A video call between two webrtc peers fails

Hi,

A web client registers to Asterisk via websocket (thepatient), and immediately enters a queue (901).

Another web client then registers to Asterisk with a “webphone” (thedoctor), and it rings as expected because it is a member of the queue (agent).
If “thedoctor” accepts the audio call, everything works fine.
However, if “thedoctor” accepts the video call, it immediately hangs up.

This is what I see in the Asterisk console:

  == WebSocket connection from '192.168.211.139:35676' for protocol 'sip' accepted using version '13'
    -- Added contact 'sip:2keisrv5@192.168.211.139:35676;transport=ws' to AOR 'thepatient' with expiration of 600 seconds
  == Endpoint thepatient is now Reachable
  == Setting global variable 'SIPDOMAIN' to 'sip.mydomain.org'
    -- Executing [901@default:1] Answer("PJSIP/thepatient-0000000f", "") in new stack
       > 0x7f056c059b90 -- Strict RTP learning after remote address set to: 192.168.211.139:42933
       > 0x7f056c00bb40 -- Strict RTP learning after remote address set to: 192.168.211.139:42933
       > 0x7f056c059b90 -- Strict RTP learning after remote address set to: 192.168.211.139:42933
       > 0x7f056c00bb40 -- Strict RTP learning after ICE completion
       > 0x7f056c00bb40 -- Strict RTP switching to RTP target address 192.168.211.139:42933 as source
    -- Executing [901@default:2] Queue("PJSIP/thepatient-0000000f", "901,t,,") in new stack
    -- Started music on hold, class 'default', on channel 'PJSIP/thepatient-0000000f'
       > 0x7f056c059b90 -- Strict RTP switching to RTP target address 192.168.211.139:42933 as source
       > 0x7f056c059b90 -- Strict RTP learning complete - Locking on source address 192.168.211.139:42933
       > 0x7f056c00bb40 -- Strict RTP learning complete - Locking on source address 192.168.211.139:42933
  == WebSocket connection from '10.215.144.48:49935' for protocol 'sip' accepted using version '13'
    -- Added contact 'sip:slrkc04l@10.215.144.48:49935;transport=ws' to AOR 'thedoctor' with expiration of 300 seconds
  == Endpoint thedoctor is now Reachable
    -- Executing [thedoctor@default:1] Answer("Local/thedoctor@default-00000000;2", "") in new stack
    -- Called Local/thedoctor@default
    -- Local/thedoctor@default-00000000;1 answered PJSIP/thepatient-0000000f
    -- Stopped music on hold on PJSIP/thepatient-0000000f
    -- Channel Local/thedoctor@default-00000000;1 joined 'simple_bridge' basic-bridge <ddf939a8-d894-412d-b6fc-e014b93ae764>
    -- Channel PJSIP/thepatient-0000000f joined 'simple_bridge' basic-bridge <ddf939a8-d894-412d-b6fc-e014b93ae764>
    -- Executing [thedoctor@default:2] Dial("Local/thedoctor@default-00000000;2", "PJSIP/thedoctor") in new stack
    -- Called PJSIP/thedoctor
    -- Local/thedoctor@default-00000000;2 requested media update control 26, passing it to PJSIP/thedoctor-00000010
    -- PJSIP/thedoctor-00000010 is ringing
    -- PJSIP/thedoctor-00000010 is ringing
    -- No one is available to answer at this time (1:0/0/0)
    -- Executing [thedoctor@default:3] Hangup("Local/thedoctor@default-00000000;2", "") in new stack
  == Spawn extension (default, thedoctor, 3) exited non-zero on 'Local/thedoctor@default-00000000;2'
    -- Channel Local/thedoctor@default-00000000;1 left 'simple_bridge' basic-bridge <ddf939a8-d894-412d-b6fc-e014b93ae764>
    -- Channel PJSIP/thepatient-0000000f left 'simple_bridge' basic-bridge <ddf939a8-d894-412d-b6fc-e014b93ae764>
  == Spawn extension (default, 901, 2) exited non-zero on 'PJSIP/thepatient-0000000f'

My Asterisk queue:

[901]
joinempty = yes
leavewhenempty = no
member => Local/thedoctor@default,0,Doctor,PJSIP/thedoctor,yes

Both “thepatient” and “thedoctor” have the same pjsip.conf settings:

[thedoctor]
type=aor
max_contacts=5
remove_existing=yes

[thedoctor]
type=auth
auth_type=userpass
username=thedoctor
password=whatever

[thedoctor]
type=endpoint
aors=thedoctor
auth=thedoctor
dtls_auto_generate_cert=yes
webrtc=yes
context=default
disallow=all
allow=alaw,ulaw,opus,gsm,vp8,h264
rtp_symmetric=yes
force_rport=yes

The message “No one is available to answer at this time” seems to show up as soon as “doctor” answers the video call.

Increasing debug level and verbosity (in general and for pjsip) doesn’t really tell me much.

What can I try?

Vieri

You need to state the actual version of Asterisk in use, as well as provide a packet trace (pjsip set logger on). In general though I doubt anyone has tested Queue itself with video calling like such.

Same behavior if “thepatient” calls “thedoctor” directly (no queue).

Asterisk 16.10.0.

The pjsip log is here:
https://pastebin.com/u7L2Vc9T

There is no SIP response from the called endpoint stating that it has answered. You’d need to investigate the browser there or the Javascript. Looking at the Javascript console can sometimes yield information.

MediaStreamError
​
constraint: ""
​
message: "Failed to allocate videosource"
​
name: "NotReadableError"
​

I presume this means the web browser via js does not detect the input webcam? So that’s why the video call fails?
For a SIP video call to succeed, is it mandatory that both ends have video input? Can there just be one peer with video input and the other simply streams it?

I don’t speak Javascript WebRTC browser that much, so it is entirely possible that is the cause.

Yes, it’s possible to do a unidirectional stream but you would need to figure out how to do so with the Javascript API.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.