“WebRTC Error” on incoming jssip call with video

908 views
Skip to first unread message

Sergey Tamkovich

unread,
Oct 2, 2021, 12:01:12 PM10/2/21
to JsSIP

Hello everybody,

I’m not sure whether my question is more related to jssip or to webrtc, but i’m desperate so i’ll try here.

I have a door bell, which can initiate sip video calls with ulaw/h264. I’ve installed asterisk and configured it to accept sip endpoints through udp and websocket. Using examples from the internet i’ve built react-native app for android to receive calls using react-native-webrtc and react-native-jssip. It even works if i place an audio call from asterisk to my RN app. I can answer it, audio travels both directions - everything is perfect.

However, if i enable h264 codec on asterisk for RN endpoint - i got an error from webrtc, when i'm trying to answer the call. I googled and tried everything before writing this question, maybe someone can guide me - most likely i’m doing something wrong or missing some important bit.

I would really appreciate any advice,

thank you in advance!


UA init:

let socket = new JsSIP.WebSocketInterface('wss://domofon.fqdn:8089/ws');
let configuration = {
sockets: [socket],
uri: 'sip:webrtc...@domofon.fqdn',
password: 'webrtc_client',
session_timers: false,
};
let ua = new JsSIP.UA(configuration);


Call answer:

const options = {
eventHandlers: eventHandlers,
mediaConstraints: {audio: true, video: true},
pcConfig: {
rtcpMuxPolicy: 'require',
iceServers: [],
},
rtcOfferConstraints: {
offerToReceiveAudio: 1,
offerToReceiveVideo: 1,
},
};
call.answer(options);

Debug output:

INVITE sip:dd6e...@home.ip:40581;transport=ws SIP/2.0

Via: SIP/2.0/WSS asterisk.ip:8089;rport;branch=z9hG4bKPj2f2a463d-2719-44f7-ad7a-4e01e2fbd221;alias

From: <sip:014@domofon-test>;tag=a889e457-1ab9-4f5b-9e7b-4b65977a1062

To: <sip:dd6e...@home.ip>

Contact: <sip:asterisk@domofon-test:5060;transport=ws>

Call-ID: e9402b69-bb8c-4367-adea-7f88a42df219

CSeq: 24000 INVITE

Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER

Supported: 100rel, timer, replaces, norefersub, histinfo

Session-Expires: 1800

Min-SE: 90

Max-Forwards: 70

User-Agent: Asterisk PBX 18.4.0

Content-Type: application/sdp

Content-Length:  1549


v=0

o=- 247016796 247016796 IN IP4 asterisk.ip

s=Asterisk

c=IN IP4 asterisk.ip

t=0 0

a=msid-semantic:WMS *

a=group:BUNDLE audio-0 video-1

m=audio 16692 UDP/TLS/RTP/SAVPF 0 8 101

a=connection:new

a=setup:actpass

a=fingerprint:SHA-256 52:93:08:22:BD:B0:26:92:86:40:04:A1:BC:79:9F:4C:40:02:D0:EB:85:E8:B8:B3:DF:14:CD:C4:84:BA:3A:CB

a=ice-ufrag:45a51fda68f5269042081a4a3f128834

a=ice-pwd:7ec90f4b39d7070253c507b26cf09df0

a=candidate:Hb00c610e 1 UDP 2130706431 asterisk.ip 16692 typ host

a=rtpmap:0 PCMU/8000

a=rtpmap:8 PCMA/8000

a=rtpmap:101 telephone-event/8000

a=fmtp:101 0-16

a=ptime:20

a=maxptime:150

a=sendrecv

a=rtcp-mux

a=ssrc:2114533563 cname:2ec6da81-7aec-4dea-b6a4-1e310b5c3feb

a=msid:52024678-70c5-4442-adbd-7140de561366 361ae9ca-8b75-4822-98aa-b0ec635a11b6

a=rtcp-fb:* transport-cc

a=mid:audio-0

m=video 16692 UDP/TLS/RTP/SAVPF 99

a=connection:new

a=setup:actpass

a=fingerprint:SHA-256 52:93:08:22:BD:B0:26:92:86:40:04:A1:BC:79:9F:4C:40:02:D0:EB:85:E8:B8:B3:DF:14:CD:C4:84:BA:3A:CB

a=ice-ufrag:45a51fda68f5269042081a4a3f128834

a=ice-pwd:7ec90f4b39d7070253c507b26cf09df0

a=rtpmap:99 H264/90000

a=fmtp:99 packetization-mode=1;profile-level-id=428016

a=sendrecv

a=rtcp-mux

a=ssrc:370757493 cname:dbc942ca-ccb3-4b9c-afb6-9b7b47d578fc

a=msid:96f48882-751e-445b-a50d-f0ffbb46d66f 5b4355a0-f43d-4398-91e2-0dd7be184de2

a=rtcp-fb:* transport-cc

a=rtcp-fb:* ccm fir

a=rtcp-fb:* goog-remb

a=rtcp-fb:* nack

a=extmap:1 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01

a=mid:video-1


 +10s

 DEBUG  JsSIP:Transport send() +44ms

 DEBUG  JsSIP:Transport sending message:


SIP/2.0 100 Trying

Via: SIP/2.0/WSS asterisk.ip:8089;rport;branch=z9hG4bKPj2f2a463d-2719-44f7-ad7a-4e01e2fbd221;alias

To: <sip:dd6e...@home.ip>

From: <sip:014@domofon-test>;tag=a889e457-1ab9-4f5b-9e7b-4b65977a1062

Call-ID: e9402b69-bb8c-4367-adea-7f88a42df219

CSeq: 24000 INVITE

Supported: ice,replaces,outbound

Content-Length: 0



 +2ms

 DEBUG  JsSIP:WebSocketInterface send() +47ms

 DEBUG  JsSIP:RTCSession new +0ms

 DEBUG  JsSIP:RTCSession init_incoming() +3ms

 DEBUG  JsSIP:Dialog new UAS dialog created with status EARLY +0ms

 DEBUG  JsSIP:RTCSession newRTCSession() +9ms

 LOG  event newRTCSession fired

 LOG  incoming call

 DEBUG  JsSIP:WebSocketInterface new() [url:"wss://domofon.fqdn:8089/ws"] +35ms

 DEBUG  JsSIP:UA new() [configuration:'{"password": "webrtc_client", "session_timers": false, "sockets": [{"_sip_uri": "sip:domofon.fqdn:8089;transport=ws", "_url": "wss://domofon.fqdn:8089/ws", "_via_transport": "WSS", "_ws": null}], "uri": "sip:webrtc...@domofon.fqdn"}'] +11s

 DEBUG  JsSIP:Transport new() +72ms

 WARN  JsSIP:ERROR:Transport cannot use TextDecoder: ReferenceError: Can't find variable: TextDecoder +11s

App@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.d2&modulesOnly=false&runModule=true:107708:41

RCTView

View

RCTView

View

AppContainer@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.d2&modulesOnly=false&runModule=true:74995:36

d2(RootComponent)@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.d2&modulesOnly=false&runModule=true:81851:28

 DEBUG  JsSIP:UA configuration parameters after validation: +65ms

 DEBUG  JsSIP:UA - authorization_user: "webrtc_client" +1ms

 DEBUG  JsSIP:UA - password: NOT SHOWN +0ms

 DEBUG  JsSIP:UA - realm: null +1ms

 DEBUG  JsSIP:UA - ha1: NOT SHOWN +0ms

 DEBUG  JsSIP:UA - authorization_jwt: NOT SHOWN +0ms

 DEBUG  JsSIP:UA - display_name: null +0ms

 DEBUG  JsSIP:UA - uri: sip:webrtc...@domofon.fqdn +1ms

 DEBUG  JsSIP:UA - contact_uri: {"_parameters":{"transport":"ws"},"_headers":{},"_scheme":"sip","_user":"lbrb8gp1","_host":"ogrg28hbjfng.invalid","_port":null} +0ms

 DEBUG  JsSIP:UA - instance_id: "8762e436-330b-4297-9ce9-d2599d754e50" +0ms

 DEBUG  JsSIP:UA - use_preloaded_route: false +0ms

 DEBUG  JsSIP:UA - session_timers: false +1ms

 DEBUG  JsSIP:UA - session_timers_refresh_method: "UPDATE" +0ms

 DEBUG  JsSIP:UA - session_timers_force_refresher: false +0ms

 DEBUG  JsSIP:UA - no_answer_timeout: 60000 +0ms

 DEBUG  JsSIP:UA - register: true +0ms

 DEBUG  JsSIP:UA - register_expires: 600 +1ms

 DEBUG  JsSIP:UA - registrar_server: sip:domofon.fqdn +0ms

 DEBUG  JsSIP:UA - connection_recovery_max_interval: 30 +0ms

 DEBUG  JsSIP:UA - connection_recovery_min_interval: 2 +0ms

 DEBUG  JsSIP:UA - via_host: "ogrg28hbjfng.invalid" +0ms

 DEBUG  JsSIP:UA start() +1ms

 DEBUG  JsSIP:Transport connect() +38ms

 DEBUG  JsSIP:WebSocketInterface connect() +76ms

 DEBUG  JsSIP:WebSocketInterface connecting to WebSocket wss://domofon.fqdn:8089/ws +0ms

 DEBUG  JsSIP:WebSocketInterface new() [url:"wss://domofon.fqdn:8089/ws"] +34ms

 DEBUG  JsSIP:UA new() [configuration:'{"password": "webrtc_client", "session_timers": false, "sockets": [{"_sip_uri": "sip:domofon.fqdn:8089;transport=ws", "_url": "wss://domofon.fqdn:8089/ws", "_via_transport": "WSS", "_ws": null}], "uri": "sip:webrtc...@domofon.fqdn"}'] +40ms

 DEBUG  JsSIP:Transport new() +46ms

 WARN  JsSIP:ERROR:Transport cannot use TextDecoder: ReferenceError: Can't find variable: TextDecoder +83ms

App@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.d2&modulesOnly=false&runModule=true:107708:41

RCTView

View

RCTView

View

AppContainer@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.d2&modulesOnly=false&runModule=true:74995:36

d2(RootComponent)@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.d2&modulesOnly=false&runModule=true:81851:28

 DEBUG  JsSIP:UA configuration parameters after validation: +18ms

 DEBUG  JsSIP:UA - authorization_user: "webrtc_client" +1ms

 DEBUG  JsSIP:UA - password: NOT SHOWN +0ms

 DEBUG  JsSIP:UA - realm: null +0ms

 DEBUG  JsSIP:UA - ha1: NOT SHOWN +0ms

 DEBUG  JsSIP:UA - authorization_jwt: NOT SHOWN +0ms

 DEBUG  JsSIP:UA - display_name: null +1ms

 DEBUG  JsSIP:UA - uri: sip:webrtc...@domofon.fqdn +1ms

 DEBUG  JsSIP:UA - contact_uri: {"_parameters":{"transport":"ws"},"_headers":{},"_scheme":"sip","_user":"oin82sv2","_host":"ogrg28hbjfng.invalid","_port":null} +0ms

 DEBUG  JsSIP:UA - instance_id: "de73e18d-16d5-44b0-9243-33593c147079" +1ms

 DEBUG  JsSIP:UA - use_preloaded_route: false +0ms

 DEBUG  JsSIP:UA - session_timers: false +1ms

 DEBUG  JsSIP:UA - session_timers_refresh_method: "UPDATE" +0ms

 DEBUG  JsSIP:UA - session_timers_force_refresher: false +0ms

 DEBUG  JsSIP:UA - no_answer_timeout: 60000 +0ms

 DEBUG  JsSIP:UA - register: true +1ms

 DEBUG  JsSIP:UA - register_expires: 600 +0ms

 DEBUG  JsSIP:UA - registrar_server: sip:domofon.fqdn +0ms

 DEBUG  JsSIP:UA - connection_recovery_max_interval: 30 +0ms

 DEBUG  JsSIP:UA - connection_recovery_min_interval: 2 +2ms

 DEBUG  JsSIP:UA - via_host: "ogrg28hbjfng.invalid" +1ms

 DEBUG  JsSIP:UA start() +0ms

 DEBUG  JsSIP:Transport connect() +20ms

 DEBUG  JsSIP:WebSocketInterface connect() +31ms

 DEBUG  JsSIP:WebSocketInterface connecting to WebSocket wss://domofon.fqdn:8089/ws +1ms

 DEBUG  JsSIP:Transport send() +18ms

 DEBUG  JsSIP:Transport sending message:


SIP/2.0 180 Ringing

Via: SIP/2.0/WSS asterisk.ip:8089;rport;branch=z9hG4bKPj2f2a463d-2719-44f7-ad7a-4e01e2fbd221;alias

To: <sip:dd6e...@home.ip>;tag=00q1dm9b27

From: <sip:014@domofon-test>;tag=a889e457-1ab9-4f5b-9e7b-4b65977a1062

Call-ID: e9402b69-bb8c-4367-adea-7f88a42df219

CSeq: 24000 INVITE

Contact: <sip:dd6e...@ogrg28hbjfng.invalid;transport=ws>

Supported: ice,replaces,outbound

Content-Length: 0



 +1ms

 DEBUG  JsSIP:WebSocketInterface send() +18ms

 DEBUG  JsSIP:RTCSession session progress +168ms

 DEBUG  JsSIP:RTCSession emit "progress" +1ms

 DEBUG  JsSIP:WebSocketInterface WebSocket wss://domofon.fqdn:8089/ws connected +236ms

 


 LOG  Answering call

 DEBUG  JsSIP:RTCSession answer() +2s

 DEBUG  JsSIP:Dialog dialog e9402b69-bb8c-4367-adea-7f88a42df21900q1dm9b27a889e457-1ab9-4f5b-9e7b-4b65977a1062  changed to CONFIRMED state +3s

 DEBUG  JsSIP:RTCSession emit "peerconnection" +59ms

 LOG  event session.peerconnection fired

 DEBUG  JsSIP:RTCSession emit "sdp" +87ms

 LOG  event session.connection.negotiationneeded fired

 LOG  {"bubbles": false, "cancelable": false, "currentTarget": {"_localStreams": [[MediaStream]], "_peerConnectionId": 0, "_remoteStreams": [], "_subscriptions": [[Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object]], "connectionState": "new", "iceConnectionState": "new", "iceGatheringState": "new", "ontrack": [Function anonymous], "signalingState": "stable"}, "eventPhase": 2, "isTrusted": false, "target": {"_localStreams": [[MediaStream]], "_peerConnectionId": 0, "_remoteStreams": [], "_subscriptions": [[Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object]], "connectionState": "new", "iceConnectionState": "new", "iceGatheringState": "new", "ontrack": [Function anonymous], "signalingState": "stable"}, "timeStamp": 1633188822286, "type": "negotiationneeded"}

 LOG  event session.connection.signalingstatechange fired

 LOG  {"bubbles": false, "cancelable": false, "currentTarget": {"_localStreams": [[MediaStream]], "_peerConnectionId": 0, "_remoteStreams": [], "_subscriptions": [[Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object]], "connectionState": "new", "iceConnectionState": "new", "iceGatheringState": "new", "ontrack": [Function anonymous], "signalingState": "have-remote-offer"}, "eventPhase": 2, "isTrusted": false, "target": {"_localStreams": [[MediaStream]], "_peerConnectionId": 0, "_remoteStreams": [], "_subscriptions": [[Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object]], "connectionState": "new", "iceConnectionState": "new", "iceGatheringState": "new", "ontrack": [Function anonymous], "signalingState": "have-remote-offer"}, "timeStamp": 1633188822309, "type": "signalingstatechange"}

 DEBUG  JsSIP:Transport send() +2s

 DEBUG  JsSIP:Transport sending message:


SIP/2.0 488 Not Acceptable Here

Via: SIP/2.0/WSS asterisk.ip:8089;rport;branch=z9hG4bKPj2f2a463d-2719-44f7-ad7a-4e01e2fbd221;alias

To: <sip:dd6e...@home.ip>;tag=00q1dm9b27

From: <sip:014@domofon-test>;tag=a889e457-1ab9-4f5b-9e7b-4b65977a1062

Call-ID: e9402b69-bb8c-4367-adea-7f88a42df219

CSeq: 24000 INVITE

Supported: ice,replaces,outbound

Content-Length: 0



 +1ms

 DEBUG  JsSIP:WebSocketInterface send() +2s

 DEBUG  JsSIP:RTCSession session failed +47ms

 DEBUG  JsSIP:RTCSession emit "_failed" +2ms

 DEBUG  JsSIP:RTCSession close() +1ms

 DEBUG  JsSIP:RTCSession close() | closing local MediaStream +1ms

 DEBUG  JsSIP:Dialog dialog e9402b69-bb8c-4367-adea-7f88a42df21900q1dm9b27a889e457-1ab9-4f5b-9e7b-4b65977a1062 deleted +215ms

 DEBUG  JsSIP:RTCSession emit "failed" +23ms

 LOG  event session.failed fired

 LOG  {"cause": "WebRTC Error", "message": null, "originator": "system"}

 DEBUG  JsSIP:WebSocketInterface new() [url:"wss://domofon.fqdn:8089/ws"] +33ms

 DEBUG  JsSIP:UA new() [configuration:'{"password": "webrtc_client", "session_timers": false, "sockets": [{"_sip_uri": "sip:domofon.fqdn:8089;transport=ws", "_url": "wss://domofon.fqdn:8089/ws", "_via_transport": "WSS", "_ws": null}], "uri": "sip:webrtc...@domofon.fqdn"}'] +3s

 DEBUG  JsSIP:Transport new() +43ms

 WARN  JsSIP:ERROR:Transport cannot use TextDecoder: ReferenceError: Can't find variable: TextDecoder +3s

App@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.d2&modulesOnly=false&runModule=true:107708:41

RCTView

View

RCTView

View

AppContainer@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.d2&modulesOnly=false&runModule=true:74995:36

d2(RootComponent)@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.d2&modulesOnly=false&runModule=true:81851:28

 DEBUG  JsSIP:UA configuration parameters after validation: +20ms

 DEBUG  JsSIP:UA - authorization_user: "webrtc_client" +1ms

 DEBUG  JsSIP:UA - password: NOT SHOWN +1ms

 DEBUG  JsSIP:UA - realm: null +0ms

 DEBUG  JsSIP:UA - ha1: NOT SHOWN +1ms

 DEBUG  JsSIP:UA - authorization_jwt: NOT SHOWN +0ms

 DEBUG  JsSIP:UA - display_name: null +2ms

 DEBUG  JsSIP:UA - uri: sip:webrtc...@domofon.fqdn +0ms

 DEBUG  JsSIP:UA - contact_uri: {"_parameters":{"transport":"ws"},"_headers":{},"_scheme":"sip","_user":"45vkg9d7","_host":"ogrg28hbjfng.invalid","_port":null} +2ms

 DEBUG  JsSIP:UA - instance_id: "f0fc2e3c-9113-4b25-8a25-7149694572eb" +1ms

 DEBUG  JsSIP:UA - use_preloaded_route: false +0ms

 DEBUG  JsSIP:UA - session_timers: false +0ms

 DEBUG  JsSIP:UA - session_timers_refresh_method: "UPDATE" +1ms

 DEBUG  JsSIP:UA - session_timers_force_refresher: false +0ms

 DEBUG  JsSIP:UA - no_answer_timeout: 60000 +1ms

 DEBUG  JsSIP:UA - register: true +0ms

 DEBUG  JsSIP:UA - register_expires: 600 +1ms

 DEBUG  JsSIP:UA - registrar_server: sip:domofon.fqdn +1ms

 DEBUG  JsSIP:UA - connection_recovery_max_interval: 30 +1ms

 DEBUG  JsSIP:UA - connection_recovery_min_interval: 2 +1ms

 DEBUG  JsSIP:UA - via_host: "ogrg28hbjfng.invalid" +0ms

 DEBUG  JsSIP:UA start() +0ms

 DEBUG  JsSIP:Transport connect() +27ms

 DEBUG  JsSIP:WebSocketInterface connect() +37ms

 DEBUG  JsSIP:WebSocketInterface connecting to WebSocket wss://domofon.fqdn:8089/ws +0ms

 WARN  JsSIP:ERROR:RTCSession emit "peerconnection:setremotedescriptionfailed" [error:"Failed to set remote offer sdp: Failed to set remote video description send parameters for m-section with mid='video-1'."] +0ms

 DEBUG  JsSIP:WebSocketInterface received WebSocket message +81ms

 DEBUG  JsSIP:Transport received text message:


ACK sip:dd6e...@home.ip:40581;transport=ws SIP/2.0

Via: SIP/2.0/WSS asterisk.ip:8089;rport;branch=z9hG4bKPj2f2a463d-2719-44f7-ad7a-4e01e2fbd221;alias

From: <sip:014@domofon-test>;tag=a889e457-1ab9-4f5b-9e7b-4b65977a1062

To: <sip:dd6e...@home.ip>;tag=00q1dm9b27

Call-ID: e9402b69-bb8c-4367-adea-7f88a42df219

CSeq: 24000 ACK

Max-Forwards: 70

User-Agent: Asterisk PBX 18.4.0

Content-Length:  0



 +82ms

 LOG  event session.connection.iceconnectionstatechange fired


Roman Shpount

unread,
Oct 2, 2021, 12:28:51 PM10/2/21
to js...@googlegroups.com
The offer you are getting from Asterisk, when video is enabled, has Plan-B SDP. It never became a standard and it is no longer supported by Chrome. Please see Chrome transition guide https://docs.google.com/document/d/1-ZfikoUtoJa9k-GZG1daN0BU3IjIanQ_JSscHxQesvU/edit&ved=2ahUKEwiiv5TpkKzzAhWyF1kFHernCsgQFnoECBIQAQ&usg=AOvVaw1U5RFqKPfOzTdJKs6HVWd7 for more details. 

Roman Shpount

--
You received this message because you are subscribed to the Google Groups "JsSIP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jssip+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jssip/4a7b14a0-922f-4807-a9d9-5e133d5f8617n%40googlegroups.com.

Sergey Tamkovich

unread,
Oct 2, 2021, 3:16:14 PM10/2/21
to JsSIP
Roman, thank you very much for this insight!
Unfortunately i can't open your url, google says "document not found". 
I found sdp-interop js module, i'll try to use it with jssip on my experimental react-native app.

суббота, 2 октября 2021 г. в 19:28:51 UTC+3, Roman Shpount:

Roman Shpount

unread,
Oct 2, 2021, 3:57:37 PM10/2/21
to js...@googlegroups.com
As long as your call scenarios are simple enough sdp-interop should work. It is primarily designed for jitsi so your mileage may vary.

Here is another link to the same document https://docs.google.com/document/d/1-ZfikoUtoJa9k-GZG1daN0BU3IjIanQ_JSscHxQesvU/edit?usp=drivesdk . If it doesn't work try searching for Chrome Plan B to Plan Unified transition guide.

Roman Shpount

Reply all
Reply to author
Forward
0 new messages