I have this system:
- (1) Pjsip phone
- (2) Sipml5 phone running on windows and linux
- (3) Sipml5 phone running on android
- (4) Asterisk server
(4) is on an AWS machine. All clients are connected to (4) via vpn. All clients are registered: (1) transport udp, (2) and (3) transport ws. Instant answer is a requeriment.
The problem is when i make a call from (1) or (2) to (3) it has ~2-3 seconds sound delay, but when i make a call from (1) to (2) it seems all ok. PJSIP.conf is the same for (2) and (3).
I have checked RTP protocol, STUN and SDP trace. RTP debug shows, until ICE completition, sound go to wrong address (SDP c=IPV4 wrong address).
I have tried this recommendations
- SIP and RTP Routing - From Asterisk
- Forum post: Delay in receiving the call
- Forum post: WEBRTC 1 to 4 seconds delay
but none works for me. Any advice?
Thanks in advance. Alberto.
Update:
Android debug:
Making a call (it works)
00:00:13.205 I/ViewRootImpl@b2bea09[MainActivity]: ViewPostIme pointer 0
00:00:13.240 I/Capacitor/Console: File: http://localhost/static/js/main.aca58b93.chunk.js - Line 1 - Msg: ==stack event = m_permission_requested
00:00:13.243 I/Capacitor/Console: File: http://localhost/static/js/main.aca58b93.chunk.js - Line 1 - Msg: ===session event = connecting
00:00:13.280 I/libOpenSLES: Emulating old channel mask behavior (ignoring positional mask 0x1, using default mask 0x10 based on channel count of 1)
00:00:13.280 D/AudioRecord: createRecord_l() remove fast or raw flag of voip calls, source=7, flags=5
00:00:13.515 E/chromium: [ERROR:web_contents_delegate.cc(232)] WebContentsDelegate::CheckMediaAccessPermission: Not supported.
00:00:13.534 I/Capacitor/Console: File: http://localhost/static/js/main.aca58b93.chunk.js - Line 1 - Msg: ==stack event = m_permission_accepted
00:00:13.813 I/IMM_LC: hsifw() - flags=0, caller=android.view.inputmethod.InputMethodManager.hideSoftInputFromWindow:1846 org.chromium.content.browser.input.ImeAdapterImpl.i:174 org.chromium.content.browser.input.ImeAdapterImpl.updateState:523 android.os.MessageQueue.nativePollOnce:-2 android.os.MessageQueue.next:335
00:00:13.813 I/IMM_LC: hideSoftInputFromWindow - mService.hideSoftInput
00:00:13.883 I/Capacitor/Console: File: http://localhost/static/js/main.aca58b93.chunk.js - Line 1 - Msg: ===session event = i_ao_request
00:00:13.966 I/Capacitor/Console: File: http://localhost/static/js/main.aca58b93.chunk.js - Line 1 - Msg: ===session event = m_early_media
00:00:13.970 I/Capacitor/Console: File: http://localhost/static/js/main.aca58b93.chunk.js - Line 1 - Msg: ===session event = connected
00:00:15.916 I/ViewRootImpl@b2bea09[MainActivity]: ViewPostIme pointer 1
00:00:15.933 I/Capacitor/Console: File: http://localhost/static/js/main.aca58b93.chunk.js - Line 1 - Msg: <i>Terminating the call...</i>
00:00:15.954 I/Capacitor/Console: File: http://localhost/static/js/main.aca58b93.chunk.js - Line 1 - Msg: ===session event = terminating
00:00:16.032 I/Capacitor/Console: File: http://localhost/static/js/main.aca58b93.chunk.js - Line 1 - Msg: ===session event = terminated
Receiving a call (2-3 seconds no audio)
00:00:45.548 I/Capacitor/Console: File: http://localhost/static/js/main.aca58b93.chunk.js - Line 1 - Msg: ==stack event = m_permission_requested
00:00:45.555 I/Capacitor/Console: File: http://localhost/static/js/main.aca58b93.chunk.js - Line 1 - Msg: ==stack event = i_new_call
00:00:45.559 I/Capacitor/Console: File: http://localhost/static/js/main.aca58b93.chunk.js - Line 1 - Msg: Answer / Reject
00:00:45.564 I/Capacitor/Console: File: http://localhost/static/js/main.aca58b93.chunk.js - Line 1 - Msg: <i>Incoming call from [<b>7013</b>]</i>
00:00:45.567 I/Capacitor/Console: File: http://localhost/static/js/main.aca58b93.chunk.js - Line 1 - Msg: <i>Connecting...</i>
00:00:45.577 I/Capacitor/Console: File: http://localhost/static/js/main.aca58b93.chunk.js - Line 1 - Msg: ===session event = connected
00:00:45.581 I/Capacitor/Console: File: http://localhost/static/js/main.aca58b93.chunk.js - Line 1 - Msg: <i>In call</i>
00:00:45.592 I/Capacitor/Console: File: http://localhost/static/js/main.aca58b93.chunk.js - Line 1 - Msg: ===session event = m_stream_audio_remote_added
00:00:45.632 I/AAudio: AAudioStreamBuilder_openStream() called ----------------------------------------
00:00:45.632 I/AudioStreamBuilder: rate = 48000, channels = 2, format = 5, sharing = SH, dir = OUTPUT
00:00:45.632 I/AudioStreamBuilder: device = 0, sessionId = -1, perfMode = 12, callback: ON with frames = 192
00:00:45.632 I/AudioStreamBuilder: usage = 1, contentType = 0, inputPreset = 0, allowedCapturePolicy = 0
00:00:45.632 I/AudioStreamBuilder: privacy sensitive = false
00:00:45.632 I/AudioStreamBuilder: opPackageName = (null)
00:00:45.632 I/AudioStreamBuilder: attributionTag = (null)
00:00:45.632 D/o.ionic.ideavc: PlayerBase::PlayerBase()
00:00:45.686 D/AudioStreamInternal_Client: open() original HW burst = 96, minMicros = 2000 => SW burst = 96
00:00:45.686 D/AAudioStream: setState(s#2) from 0 to 2
00:00:45.686 I/AAudioFlowGraph: configure() source format = 0x00000005, channels = 2, sink format = 0x00000005, channels = 2
00:00:45.688 I/AAudio: AAudioStreamBuilder_openStream() returns 0 = AAUDIO_OK for s#2 ----------------
00:00:45.699 I/libOpenSLES: Emulating old channel mask behavior (ignoring positional mask 0x1, using default mask 0x10 based on channel count of 1)
00:00:45.700 D/AudioRecord: createRecord_l() remove fast or raw flag of voip calls, source=7, flags=5
00:00:45.907 D/AAudio: AAudioStream_requestStart(s#2) called --------------
00:00:45.907 D/AAudioStream: setState(s#2) from 2 to 3
00:00:45.908 E/chromium: [ERROR:web_contents_delegate.cc(232)] WebContentsDelegate::CheckMediaAccessPermission: Not supported.
00:00:45.924 I/Capacitor/Console: File: http://localhost/static/js/main.aca58b93.chunk.js - Line 1 - Msg: ==stack event = m_permission_accepted
00:00:45.961 D/AAudio: AAudioStream_requestStart(s#2) returned 0 ---------
00:00:45.966 D/AudioStreamInternalPlay_Client: callbackLoop() entering >>>>>>>>>>>>>>>
00:00:45.966 D/AudioStreamInternal_Client: onEventFromServer - got AAUDIO_SERVICE_EVENT_STARTED
00:00:45.966 D/AAudioStream: setState(s#2) from 3 to 4
00:00:52.604 W/chromium: [WARNING:sync_reader.cc(237)] ASR: No room in socket buffer.: Broken pipe (32)
00:00:52.619 I/Capacitor/Console: File: http://localhost/static/js/main.aca58b93.chunk.js - Line 1 - Msg: ===session event = terminated
00:00:52.673 D/AAudio: AAudioStream_requestStop(s#2) called
00:00:52.676 D/AudioStreamInternalPlay_Client: callbackLoop() exiting, result = 192, isActive() = 1 <<<<<<<<<<<<<<
00:00:52.676 D/AAudioStream: joinThread_l() pthread_join succeeded
00:00:52.676 D/IsochronousClockModel: stop(nanos = 212228077818778) max lateness = 630 micros
00:00:52.676 D/AAudioStream: setState(s#2) from 4 to 9
00:00:52.811 D/AudioStreamInternal_Client: onEventFromServer - got AAUDIO_SERVICE_EVENT_STOPPED
00:00:52.811 D/AAudioStream: setState(s#2) from 9 to 10
00:00:57.812 D/AAudio: AAudioStream_close(s#2) called ---------------
00:00:57.812 D/AudioStreamInternal_Client: release_l(): mServiceStreamHandle = 0x00000068
00:00:57.813 D/AAudioStream: setState(s#2) from 10 to 11
00:00:57.917 D/AAudioStream: setState(s#2) from 11 to 11
00:00:57.917 D/AAudioStream: setState(s#2) from 11 to 12
00:00:57.917 D/AudioStreamInternal_Client: ~AudioStreamInternal() 0x6f9155d960 called
00:00:57.917 D/AAudioStream: ~AudioStream(s#2) mPlayerBase strongCount = 2
00:00:57.917 D/AAudio: AAudioStream_close(s#2) returned 0 ---------
00:01:03.213 I/ViewRootImpl@b2bea09[MainActivity]: ViewPostIme pointer 0
00:01:03.270 I/ViewRootImpl@b2bea09[MainActivity]: ViewPostIme pointer 1
00:01:03.281 I/IMM_LC: hsifw() - flags=0, caller=android.view.inputmethod.InputMethodManager.hideSoftInputFromWindow:1846 org.chromium.content.browser.input.ImeAdapterImpl.i:174 org.chromium.content.browser.input.ImeAdapterImpl.updateState:523 android.os.MessageQueue.nativePollOnce:-2 android.os.MessageQueue.next:335
00:01:03.282 I/IMM_LC: hideSoftInputFromWindow - mService.hideSoftInput