onsip / SIP.js

A simple, intuitive, and powerful JavaScript signaling library
https://sipjs.com
MIT License
1.9k stars 702 forks source link

invite event not fired on incomming call #445

Closed dehghanimeh closed 7 years ago

dehghanimeh commented 7 years ago

hey guys

i have problem on incoming calls

my asterisk server located in internet and have a static ip adders

my sip users

[1060] ; This will be WebRTC client type=friend username=1060 ; The Auth user for SIP.js host=dynamic ; Allows any host to register secret=password ; The SIP Password for SIP.js encryption=yes ; Tell Asterisk to use encryption for this peer avpf=no; Tell Asterisk to use AVPF for this peer icesupport=yes ; Tell Asterisk to use ICE for this peer context=default ; Tell Asterisk which context to use when this peer is dialing directmedia=no ; Asterisk will relay media for this peer transport=udp,ws,wss ; Asterisk will allow this peer to register on UDP or WebSockets force_avp=yes ; Force Asterisk to use avp. Introduced in Asterisk 11.11 dtlssetup=actpass ; Tell Asterisk to use actpass SDP parameter when setting up DTLS

[1010] ; This will be WebRTC client type=friend username=1010 ; The Auth user for SIP.js host=dynamic ; Allows any host to register secret=password ; The SIP Password for SIP.js encryption=yes ; Tell Asterisk to use encryption for this peer avpf=no; Tell Asterisk to use AVPF for this peer icesupport=yes ; Tell Asterisk to use ICE for this peer context=default ; Tell Asterisk which context to use when this peer is dialing directmedia=no ; Asterisk will relay media for this peer transport=udp,ws,wss ; Asterisk will allow this peer to register on UDP or WebSockets force_avp=yes ; Force Asterisk to use avp. Introduced in Asterisk 11.11 dtlssetup=actpass ; Tell Asterisk to use actpass SDP parameter when setting up DTLS

and i have regular sip user like this

[1001] username=1001 nat=yes
type=friend host=dynamic secret=password context=default

when user 1010 and 1060 from web want to call user 1001 , all things work fine.

but when web user 1060 what to call web user 1010

the invite sipjs event not fired

userAgent.on('invite', function (session) {....

and in asterisk cli appear this error

`chan_sip.c:4268`` sip_reliable_xmit: Serious Network Trouble; sip_xmit returns error for pkt data

detail of asterisk cli error


Executing [1010@default:4] Dial("SIP/1060-0000001b", "SIP/1010") in new stack == DTLS ECDH initialized (automatic), faster PFS enabled == Using SIP RTP CoS mark 5 Audio is at 11158 Adding codec ulaw to SDP Adding codec alaw to SDP Adding codec gsm to SDP Adding non-codec 0x1 (telephone-event) to SDP Reliably Transmitting (NAT) to 151.233.58.206:55423: INVITE sip:q26suj9d@192.0.2.251;transport=ws SIP/2.0 Via: SIP/2.0/WS 185.8.173.206:5060;branch=z9hG4bK4c6736ac;rport Max-Forwards: 70 From: "web" sip:1060@185.8.173.206;tag=as0110259a To: sip:q26suj9d@192.0.2.251;transport=ws Contact: sip:1060@185.8.173.206:5060;transport=WS Call-ID: 3e5c57fe49a611db0470fd915fdc7c85@185.8.173.206:5060 CSeq: 102 INVITE User-Agent: Asterisk PBX 14.1.1 Date: Mon, 18 Sep 2017 16:52:32 GMT Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE Supported: replaces, timer Content-Type: application/sdp Content-Length: 804 v=0 o=root 30578188 30578188 IN IP4 185.8.173.206 s=Asterisk PBX 14.1.1 c=IN IP4 185.8.173.206 t=0 0 m=audio 11158 RTP/SAVPF 0 8 3 101 a=rtpmap:0 PCMU/8000 a=rtpmap:8 PCMA/8000 a=rtpmap:3 GSM/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-16 a=maxptime:150 a=ice-ufrag:2996824b4ff09e3e1544138235b5ebaf a=ice-pwd:50372bfe57a9d2202c6377b90e84d932 a=candidate:Hb908adce 1 UDP 2130706431 185.8.173.206 11158 typ host a=candidate:H2e1429de 1 UDP 2130706431 46.20.41.222 11158 typ host a=candidate:Hb908adce 2 UDP 2130706430 185.8.173.206 11159 typ host a=candidate:H2e1429de 2 UDP 2130706430 46.20.41.222 11159 typ host a=connection:new a=setup:actpass a=fingerprint:SHA-256 49:5E:3B:D1:D4:2A:7E:93:D5:1C:E1:90:EC:AA:74:CC:3A:93:ED:78:F7:F3:0D:59:7F:54:CF:66:E2:90:77:32 a=sendrecv

[Sep 18 12:52:32] ERROR[15861][C-000003de]: chan_sip.c:4268 sip_reliable_xmit: Serious Network Trouble; sip_xmit returns error for pkt data -- Called SIP/1010

egreenmachine commented 7 years ago

Please provide logs from SIP.js with traceSip turned on.

dehghanimeh commented 7 years ago

thanks for reply

caller sipjs(1060) user log

boot.js:4718 [Deprecation] The rtcpMuxPolicy option is being considered for removal and may be removed no earlier than M62, around October 2017. If you depend on it, please see https://www.chromestatus.com/features/5654810086866944 for more details. value @ boot.js:4718 t @ boot.js:4515 t.defaultFactory @ boot.js:4518 n @ boot.js:3042 s.invite @ boot.js:3765 (anonymous) @ boot.js:4978 boot.js:1868 Mon Sep 18 2017 23:47:12 GMT+0430 (Iran Daylight Time) | sip.invitecontext.mediahandler | acquiring local media boot.js:1868 Mon Sep 18 2017 23:47:12 GMT+0430 (Iran Daylight Time) | sip.invitecontext.mediahandler | acquired local media streams boot.js:63 session.on connecting (anonymous) @ boot.js:63 r.emit @ boot.js:170 connecting @ boot.js:2820 (anonymous) @ boot.js:4542 Promise resolved (async) value @ boot.js:4541 invite @ boot.js:3050 s.afterConnected @ boot.js:3763 s.invite @ boot.js:3766 (anonymous) @ boot.js:4978 boot.js:1868 Mon Sep 18 2017 23:47:12 GMT+0430 (Iran Daylight Time) | sip.invitecontext.mediahandler | RTCIceGatheringState changed: gathering boot.js:1868 Mon Sep 18 2017 23:47:12 GMT+0430 (Iran Daylight Time) | sip.invitecontext.mediahandler | ICE candidate received: candidate:453765593 1 udp 2122260223 192.168.41.2 63981 typ host generation 0 ufrag SpgC network-id 2 boot.js:1868 Mon Sep 18 2017 23:47:12 GMT+0430 (Iran Daylight Time) | sip.invitecontext.mediahandler | ICE candidate received: candidate:2943013415 1 udp 2122194687 192.168.2.3 63982 typ host generation 0 ufrag SpgC network-id 1 boot.js:1868 Mon Sep 18 2017 23:47:12 GMT+0430 (Iran Daylight Time) | sip.invitecontext.mediahandler | ICE candidate received: candidate:453765593 2 udp 2122260222 192.168.41.2 63983 typ host generation 0 ufrag SpgC network-id 2 boot.js:1868 Mon Sep 18 2017 23:47:12 GMT+0430 (Iran Daylight Time) | sip.invitecontext.mediahandler | ICE candidate received: candidate:2943013415 2 udp 2122194686 192.168.2.3 63984 typ host generation 0 ufrag SpgC network-id 1 boot.js:1868 Mon Sep 18 2017 23:47:12 GMT+0430 (Iran Daylight Time) | sip.invitecontext.mediahandler | ICE candidate received: candidate:1434981673 1 tcp 1518280447 192.168.41.2 9 typ host tcptype active generation 0 ufrag SpgC network-id 2 boot.js:1868 Mon Sep 18 2017 23:47:12 GMT+0430 (Iran Daylight Time) | sip.invitecontext.mediahandler | ICE candidate received: candidate:3790155479 1 tcp 1518214911 192.168.2.3 9 typ host tcptype active generation 0 ufrag SpgC network-id 1 boot.js:1868 Mon Sep 18 2017 23:47:12 GMT+0430 (Iran Daylight Time) | sip.invitecontext.mediahandler | ICE candidate received: candidate:1434981673 2 tcp 1518280446 192.168.41.2 9 typ host tcptype active generation 0 ufrag SpgC network-id 2 boot.js:1868 Mon Sep 18 2017 23:47:12 GMT+0430 (Iran Daylight Time) | sip.invitecontext.mediahandler | ICE candidate received: candidate:3790155479 2 tcp 1518214910 192.168.2.3 9 typ host tcptype active generation 0 ufrag SpgC network-id 1 boot.js:1868 Mon Sep 18 2017 23:47:12 GMT+0430 (Iran Daylight Time) | sip.invitecontext.mediahandler | ICE candidate received: candidate:104160754 1 udp 1685987071 151.233.58.206 63982 typ srflx raddr 192.168.2.3 rport 63982 generation 0 ufrag SpgC network-id 1 boot.js:1868 Mon Sep 18 2017 23:47:13 GMT+0430 (Iran Daylight Time) | sip.invitecontext.mediahandler | ICE candidate received: candidate:104160754 2 udp 1685987070 151.233.58.206 63984 typ srflx raddr 192.168.2.3 rport 63984 generation 0 ufrag SpgC network-id 1 boot.js:1868 Mon Sep 18 2017 23:47:17 GMT+0430 (Iran Daylight Time) | sip.invitecontext.mediahandler | RTCIceChecking Timeout Triggered after 5000 milliseconds boot.js:1868 Mon Sep 18 2017 23:47:17 GMT+0430 (Iran Daylight Time) | sip.transport | sending WebSocket message:

INVITE sip:1010@digihelp.ir SIP/2.0 Via: SIP/2.0/WSS fmgmpur6470o.invalid;branch=z9hG4bK6469290 Max-Forwards: 70 To: sip:1010@digihelp.ir From: "web" sip:1060@digihelp.ir;tag=au4t4tofbc Call-ID: f9n4nqr2r4rvn68ra6er CSeq: 8240 INVITE Contact: sip:b5hv17oa@fmgmpur6470o.invalid;transport=ws;ob Allow: ACK,CANCEL,INVITE,MESSAGE,BYE,OPTIONS,INFO,NOTIFY,REFER Supported: outbound User-Agent: web.digihelp.ir Content-Type: application/sdp Content-Length: 2325

v=0 o=- 7625252267076789833 2 IN IP4 127.0.0.1 s=- t=0 0 a=group:BUNDLE audio a=msid-semantic: WMS 8wYMkX0ag7aDfPjQCSvxT1TQYBwcFxkcs7Ar m=audio 63982 UDP/TLS/RTP/SAVPF 111 103 104 9 0 8 106 105 13 110 112 113 126 c=IN IP4 151.233.58.206 a=rtcp:63984 IN IP4 151.233.58.206 a=candidate:453765593 1 udp 2122260223 192.168.41.2 63981 typ host generation 0 network-id 2 a=candidate:2943013415 1 udp 2122194687 192.168.2.3 63982 typ host generation 0 network-id 1 a=candidate:453765593 2 udp 2122260222 192.168.41.2 63983 typ host generation 0 network-id 2 a=candidate:2943013415 2 udp 2122194686 192.168.2.3 63984 typ host generation 0 network-id 1 a=candidate:1434981673 1 tcp 1518280447 192.168.41.2 9 typ host tcptype active generation 0 network-id 2 a=candidate:3790155479 1 tcp 1518214911 192.168.2.3 9 typ host tcptype active generation 0 network-id 1 a=candidate:1434981673 2 tcp 1518280446 192.168.41.2 9 typ host tcptype active generation 0 network-id 2 a=candidate:3790155479 2 tcp 1518214910 192.168.2.3 9 typ host tcptype active generation 0 network-id 1 a=candidate:104160754 1 udp 1685987071 151.233.58.206 63982 typ srflx raddr 192.168.2.3 rport 63982 generation 0 network-id 1 a=candidate:104160754 2 udp 1685987070 151.233.58.206 63984 typ srflx raddr 192.168.2.3 rport 63984 generation 0 network-id 1 a=ice-ufrag:SpgC a=ice-pwd:+nyVKbq4gplt0inQZEDpJKoN a=ice-options:trickle a=fingerprint:sha-256 21:AA:1C:1F:53:06:59:6D:01:47:18:57:7E:43:8E:A5:34:13:37:90:4E:F2:9E:74:A6:4F:A0:A6:75:4E:A8:1C a=setup:actpass a=mid:audio a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level a=sendrecv a=rtcp-mux a=rtpmap:111 opus/48000/2 a=rtcp-fb:111 transport-cc a=fmtp:111 minptime=10;useinbandfec=1 a=rtpmap:103 ISAC/16000 a=rtpmap:104 ISAC/32000 a=rtpmap:9 G722/8000 a=rtpmap:0 PCMU/8000 a=rtpmap:8 PCMA/8000 a=rtpmap:106 CN/32000 a=rtpmap:105 CN/16000 a=rtpmap:13 CN/8000 a=rtpmap:110 telephone-event/48000 a=rtpmap:112 telephone-event/32000 a=rtpmap:113 telephone-event/16000 a=rtpmap:126 telephone-event/8000 a=ssrc:4052857169 cname:YjLvdxscJGxVPoWS a=ssrc:4052857169 msid:8wYMkX0ag7aDfPjQCSvxT1TQYBwcFxkcs7Ar 92e90066-cae2-4d6c-bbaa-b456f07f5a6c a=ssrc:4052857169 mslabel:8wYMkX0ag7aDfPjQCSvxT1TQYBwcFxkcs7Ar a=ssrc:4052857169 label:92e90066-cae2-4d6c-bbaa-b456f07f5a6c

boot.js:1868 Mon Sep 18 2017 23:47:17 GMT+0430 (Iran Daylight Time) | sip.transport | received WebSocket text message:

SIP/2.0 401 Unauthorized Via: SIP/2.0/WSS fmgmpur6470o.invalid;branch=z9hG4bK6469290;received=151.233.58.206 From: "web" sip:1060@digihelp.ir;tag=au4t4tofbc To: sip:1010@digihelp.ir;tag=as31451231 Call-ID: f9n4nqr2r4rvn68ra6er CSeq: 8240 INVITE Server: Asterisk PBX 14.1.1 Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE Supported: replaces, timer WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="4c4c6db5" Content-Length: 0

boot.js:1868 Mon Sep 18 2017 23:47:17 GMT+0430 (Iran Daylight Time) | sip.transport | sending WebSocket message:

ACK sip:1010@digihelp.ir SIP/2.0 Via: SIP/2.0/WSS fmgmpur6470o.invalid;branch=z9hG4bK6469290 To: sip:1010@digihelp.ir;tag=as31451231 From: "web" sip:1060@digihelp.ir;tag=au4t4tofbc Call-ID: f9n4nqr2r4rvn68ra6er Content-Length: 0 CSeq: 8240 ACK

boot.js:1868 Mon Sep 18 2017 23:47:17 GMT+0430 (Iran Daylight Time) | sip.transport | sending WebSocket message:

INVITE sip:1010@digihelp.ir SIP/2.0 Via: SIP/2.0/WSS fmgmpur6470o.invalid;branch=z9hG4bK8168330 Max-Forwards: 70 To: sip:1010@digihelp.ir From: "web" sip:1060@digihelp.ir;tag=au4t4tofbc Call-ID: f9n4nqr2r4rvn68ra6er CSeq: 8241 INVITE Authorization: Digest algorithm=MD5, username="1060", realm="asterisk", nonce="4c4c6db5", uri="sip:1010@digihelp.ir", response="9e45c71ae5530f934830de402bca7834" Contact: sip:b5hv17oa@fmgmpur6470o.invalid;transport=ws;ob Allow: ACK,CANCEL,INVITE,MESSAGE,BYE,OPTIONS,INFO,NOTIFY,REFER Supported: outbound User-Agent: web.digihelp.ir Content-Type: application/sdp Content-Length: 2325

v=0 o=- 7625252267076789833 2 IN IP4 127.0.0.1 s=- t=0 0 a=group:BUNDLE audio a=msid-semantic: WMS 8wYMkX0ag7aDfPjQCSvxT1TQYBwcFxkcs7Ar m=audio 63982 UDP/TLS/RTP/SAVPF 111 103 104 9 0 8 106 105 13 110 112 113 126 c=IN IP4 151.233.58.206 a=rtcp:63984 IN IP4 151.233.58.206 a=candidate:453765593 1 udp 2122260223 192.168.41.2 63981 typ host generation 0 network-id 2 a=candidate:2943013415 1 udp 2122194687 192.168.2.3 63982 typ host generation 0 network-id 1 a=candidate:453765593 2 udp 2122260222 192.168.41.2 63983 typ host generation 0 network-id 2 a=candidate:2943013415 2 udp 2122194686 192.168.2.3 63984 typ host generation 0 network-id 1 a=candidate:1434981673 1 tcp 1518280447 192.168.41.2 9 typ host tcptype active generation 0 network-id 2 a=candidate:3790155479 1 tcp 1518214911 192.168.2.3 9 typ host tcptype active generation 0 network-id 1 a=candidate:1434981673 2 tcp 1518280446 192.168.41.2 9 typ host tcptype active generation 0 network-id 2 a=candidate:3790155479 2 tcp 1518214910 192.168.2.3 9 typ host tcptype active generation 0 network-id 1 a=candidate:104160754 1 udp 1685987071 151.233.58.206 63982 typ srflx raddr 192.168.2.3 rport 63982 generation 0 network-id 1 a=candidate:104160754 2 udp 1685987070 151.233.58.206 63984 typ srflx raddr 192.168.2.3 rport 63984 generation 0 network-id 1 a=ice-ufrag:SpgC a=ice-pwd:+nyVKbq4gplt0inQZEDpJKoN a=ice-options:trickle a=fingerprint:sha-256 21:AA:1C:1F:53:06:59:6D:01:47:18:57:7E:43:8E:A5:34:13:37:90:4E:F2:9E:74:A6:4F:A0:A6:75:4E:A8:1C a=setup:actpass a=mid:audio a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level a=sendrecv a=rtcp-mux a=rtpmap:111 opus/48000/2 a=rtcp-fb:111 transport-cc a=fmtp:111 minptime=10;useinbandfec=1 a=rtpmap:103 ISAC/16000 a=rtpmap:104 ISAC/32000 a=rtpmap:9 G722/8000 a=rtpmap:0 PCMU/8000 a=rtpmap:8 PCMA/8000 a=rtpmap:106 CN/32000 a=rtpmap:105 CN/16000 a=rtpmap:13 CN/8000 a=rtpmap:110 telephone-event/48000 a=rtpmap:112 telephone-event/32000 a=rtpmap:113 telephone-event/16000 a=rtpmap:126 telephone-event/8000 a=ssrc:4052857169 cname:YjLvdxscJGxVPoWS a=ssrc:4052857169 msid:8wYMkX0ag7aDfPjQCSvxT1TQYBwcFxkcs7Ar 92e90066-cae2-4d6c-bbaa-b456f07f5a6c a=ssrc:4052857169 mslabel:8wYMkX0ag7aDfPjQCSvxT1TQYBwcFxkcs7Ar a=ssrc:4052857169 label:92e90066-cae2-4d6c-bbaa-b456f07f5a6c

boot.js:1868 Mon Sep 18 2017 23:47:17 GMT+0430 (Iran Daylight Time) | sip.transaction.ict | Timer D expired for INVITE client transaction z9hG4bK6469290 boot.js:1868 Mon Sep 18 2017 23:47:17 GMT+0430 (Iran Daylight Time) | sip.transport | received WebSocket text message:

SIP/2.0 100 Trying Via: SIP/2.0/WSS fmgmpur6470o.invalid;branch=z9hG4bK8168330;received=151.233.58.206 From: "web" sip:1060@digihelp.ir;tag=au4t4tofbc To: sip:1010@digihelp.ir Call-ID: f9n4nqr2r4rvn68ra6er CSeq: 8241 INVITE Server: Asterisk PBX 14.1.1 Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE Supported: replaces, timer Contact: sip:1010@185.8.173.206:5060;transport=WS Content-Length: 0

boot.js:55 session.on progress (anonymous) @ boot.js:55 r.emit @ boot.js:170 receiveInviteResponse @ boot.js:3086 receiveResponse @ boot.js:2187 s.receiveResponse @ boot.js:3446 onMessage @ boot.js:3660 ws.onmessage @ boot.js:3630 boot.js:1868 Mon Sep 18 2017 23:47:17 GMT+0430 (Iran Daylight Time) | sip.transport | received WebSocket text message:

SIP/2.0 200 OK Via: SIP/2.0/WSS fmgmpur6470o.invalid;branch=z9hG4bK8168330;received=151.233.58.206 From: "web" sip:1060@digihelp.ir;tag=au4t4tofbc To: sip:1010@digihelp.ir;tag=as04cdc760 Call-ID: f9n4nqr2r4rvn68ra6er CSeq: 8241 INVITE Server: Asterisk PBX 14.1.1 Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE Supported: replaces, timer Contact: sip:1010@185.8.173.206:5060;transport=WS Content-Type: application/sdp Content-Length: 782

v=0 o=root 278360191 278360191 IN IP4 185.8.173.206 s=Asterisk PBX 14.1.1 c=IN IP4 185.8.173.206 t=0 0 m=audio 13180 RTP/SAVPF 0 8 126 a=rtpmap:0 PCMU/8000 a=rtpmap:8 PCMA/8000 a=rtpmap:126 telephone-event/8000 a=fmtp:126 0-16 a=maxptime:150 a=ice-ufrag:7b430aef520f2b6f7b27b4e161f7ab77 a=ice-pwd:027c6fcd17a211587b2110a62bfa14c7 a=candidate:Hb908adce 1 UDP 2130706431 185.8.173.206 13180 typ host a=candidate:H2e1429de 1 UDP 2130706431 46.20.41.222 13180 typ host a=candidate:Hb908adce 2 UDP 2130706430 185.8.173.206 13181 typ host a=candidate:H2e1429de 2 UDP 2130706430 46.20.41.222 13181 typ host a=connection:new a=setup:active a=fingerprint:SHA-256 49:5E:3B:D1:D4:2A:7E:93:D5:1C:E1:90:EC:AA:74:CC:3A:93:ED:78:F7:F3:0D:59:7F:54:CF:66:E2:90:77:32 a=sendrecv

boot.js:1868 Mon Sep 18 2017 23:47:17 GMT+0430 (Iran Daylight Time) | sip.dialog | new UAC dialog created with status CONFIRMED boot.js:1868 Mon Sep 18 2017 23:47:17 GMT+0430 (Iran Daylight Time) | sip.transport | sending WebSocket message:

ACK sip:1010@185.8.173.206:5060;transport=ws SIP/2.0 Via: SIP/2.0/WSS fmgmpur6470o.invalid;branch=z9hG4bK9666675 Max-Forwards: 70 To: sip:1010@digihelp.ir;tag=as04cdc760 From: "web" sip:1060@digihelp.ir;tag=au4t4tofbc Call-ID: f9n4nqr2r4rvn68ra6er CSeq: 8241 ACK Supported: outbound User-Agent: web.digihelp.ir Content-Length: 0

boot.js:57 session.on accepted (anonymous) @ boot.js:57 r.emit @ boot.js:173 accepted @ boot.js:2814 (anonymous) @ boot.js:3145 Promise resolved (async) receiveInviteResponse @ boot.js:3143 receiveResponse @ boot.js:2187 s.receiveResponse @ boot.js:3453 onMessage @ boot.js:3660 ws.onmessage @ boot.js:3630 boot.js:1868 Mon Sep 18 2017 23:47:17 GMT+0430 (Iran Daylight Time) | sip.invitecontext.mediahandler | stream added: default boot.js:1868 Mon Sep 18 2017 23:47:18 GMT+0430 (Iran Daylight Time) | sip.invitecontext.mediahandler | RTCIceGatheringState changed: complete boot.js:1868 Mon Sep 18 2017 23:47:22 GMT+0430 (Iran Daylight Time) | sip.invitecontext.mediahandler | RTCIceChecking Timeout Triggered after 5000 milliseconds boot.js:1868 Mon Sep 18 2017 23:47:49 GMT+0430 (Iran Daylight Time) | sip.transaction.ict | Timer B expired for INVITE client transaction z9hG4bK8168330 boot.js:1868 Mon Sep 18 2017 23:47:49 GMT+0430 (Iran Daylight Time) | sip.transaction.ict | Timer M expired for INVITE client transaction z9hG4bK8168330 boot.js:1868 Mon Sep 18 2017 23:48:03 GMT+0430 (Iran Daylight Time) | sip.transport | received WebSocket text message:

BYE sip:b5hv17oa@fmgmpur6470o.invalid;transport=ws;ob SIP/2.0 Via: SIP/2.0/WS 185.8.173.206:5060;branch=z9hG4bK2e969d44 Max-Forwards: 70 From: sip:1010@digihelp.ir;tag=as04cdc760 To: "web" sip:1060@digihelp.ir;tag=au4t4tofbc Call-ID: f9n4nqr2r4rvn68ra6er CSeq: 102 BYE User-Agent: Asterisk PBX 14.1.1 Proxy-Authorization: Digest username="1060", realm="asterisk", algorithm=MD5, uri="sip:digihelp.ir", nonce="4c4c6db5", response="3581a814bba599666c5206150f2254a9" X-Asterisk-HangupCause: Normal Clearing X-Asterisk-HangupCauseCode: 16 Content-Length: 0

boot.js:1868 Mon Sep 18 2017 23:48:03 GMT+0430 (Iran Daylight Time) | sip.transport | sending WebSocket message:

SIP/2.0 200 OK Via: SIP/2.0/WS 185.8.173.206:5060;branch=z9hG4bK2e969d44 To: "web" sip:1060@digihelp.ir;tag=au4t4tofbc From: sip:1010@digihelp.ir;tag=as04cdc760 Call-ID: f9n4nqr2r4rvn68ra6er CSeq: 102 BYE Supported: outbound User-Agent: web.digihelp.ir Content-Length: 0

boot.js:73 session.on bye (anonymous) @ boot.js:73 r.emit @ boot.js:170 receiveRequest @ boot.js:2691 receiveRequest @ boot.js:3186 receiveRequest @ boot.js:600 s.receiveRequest @ boot.js:3838 onMessage @ boot.js:3657 ws.onmessage @ boot.js:3630 boot.js:1868 Mon Sep 18 2017 23:48:03 GMT+0430 (Iran Daylight Time) | sip.inviteclientcontext | closing INVITE session f9n4nqr2r4rvn68ra6ere161kjs9cf boot.js:1868 Mon Sep 18 2017 23:48:03 GMT+0430 (Iran Daylight Time) | sip.invitecontext.mediahandler | closing PeerConnection boot.js:1868 Mon Sep 18 2017 23:48:03 GMT+0430 (Iran Daylight Time) | sip.dialog | dialog f9n4nqr2r4rvn68ra6erau4t4tofbcas04cdc760 deleted boot.js:1868 Mon Sep 18 2017 23:48:03 GMT+0430 (Iran Daylight Time) | sip.transaction.nist | Timer J expired for non-INVITE server transaction z9hG4bK2e969d44

egreenmachine commented 7 years ago

Based on the logs, you are sending an invite not receiving one. The invite event is only fired on receiving an invite.

This is clearly stated in our documentation.

dehghanimeh commented 7 years ago

yes,i exactly implement the "invite" event

after the Dial(SIP/1010 ) dialplan command executed ,in the asterisk cli prompt this error will be appear

`chan_sip.c:4268`` sip_reliable_xmit: Serious Network Trouble; sip_xmit returns error for pkt data

in the destination sipjs user(1010) the "invite" event not fired and any log not displayed

egreenmachine commented 7 years ago

If you are not receiving an invite, then it must be a problem with your Asterisk set up. We support Asterisk to the extent of our guide. Please follow up with Asterisk for support with their software.

dehghanimeh commented 7 years ago

i followed this tutorial step by step exactly.

james-criscuolo commented 7 years ago

Asterisk is hanging this call up immediately, so it wouldn't surprise me if it wasn't sending the INVITE to the caller. Unfortunately, we can not offer any Asterisk support, as we are not well-versed. Beyond our guide, I recommend going directly to Asterisk for support on this.

dehghanimeh commented 7 years ago

thanks for reply

davida8450 commented 7 years ago

Is 151.233.58.206:55423 routable?

If so, get a tcpdump capture and see what ICMP response is being returned.

Also double check that the total frame size doesn’t exceed your IP MTU size.

oxygen commented 4 years ago

Got the same problem with Asterisk, has anyone found a solution?

REGISTER sip:my.domain.com SIP/2.0
Via: SIP/2.0/TCP 192.0.2.104;branch=z9hG4bK4148777;rport
To: "webrtc_user" <sip:webrtc_user@my.domain.com>
From: "webrtc_user" <sip:webrtc_user@my.domain.com>;tag=dib5pou10a
CSeq: 5674 REGISTER
Call-ID: 5oqnkfh7nu2cpi5h8f11gn
Max-Forwards: 70
Authorization: Digest algorithm=MD5, username="webrtc_user", realm="asterisk", nonce="37c978b3", uri="sip:my.domain.com", response="1895060c0a3d412a4b7c6f7e542a3070"
Contact: <sip:gksqnsah@192.0.2.104;transport=wss>;expires=600
Allow: ACK,CANCEL,INVITE,MESSAGE,BYE,OPTIONS,INFO,NOTIFY,REFER
Supported: outbound, 100rel, path, gruu
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36
Content-Length: 0

SIP/2.0 200 OK
Via: SIP/2.0/TCP 192.0.2.104;branch=z9hG4bK4148777;received=127.0.0.1;rport=60086
From: "webrtc_user" <sip:webrtc_user@my.domain.com>;tag=dib5pou10a
To: "webrtc_user" <sip:webrtc_user@my.domain.com>;tag=as29190a7c
Call-ID: 5oqnkfh7nu2cpi5h8f11gn
CSeq: 5674 REGISTER
Server: Asterisk PBX 13.18.3~dfsg-1ubuntu4
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Expires: 600
Contact: <sip:gksqnsah@192.0.2.104;transport=wss>;expires=600
Date: Sat, 04 Apr 2020 18:14:22 GMT
Content-Length: 0

Asterisk's HTTP for WebSocket sits behind a local proxy that's why received=127.0.0.1

The peer appears UNREACHABLE if qualify=yes, otherwise it appears UNMONITORED, but never with status OK. Also, right after registration Asterisk says:

    -- Remote UNIX connection
    -- Remote UNIX connection disconnected

The WebSocket appears open in the browser and keeps sending keep alive messages.

Looks like some bug in Asterisk. It keeps saying connection closed, WebSocket closed, then keep alive send success over the same port/connection.

[Apr  4 20:34:21] WARNING[14195]: chan_sip.c:30098 sip_send_keepalive: sip_send_keepalive to 127.0.0.1:60920 returned 0: Success
[Apr  4 20:34:27] ERROR[14195]: chan_sip.c:4274 __sip_reliable_xmit: Serious Network Trouble; __sip_xmit returns error for pkt data
[Apr  4 20:34:34] WARNING[14195]: chan_sip.c:30098 sip_send_keepalive: sip_send_keepalive to 127.0.0.1:60920 returned 0: Success
[Apr  4 20:34:41] ERROR[14195]: chan_sip.c:4274 __sip_reliable_xmit: Serious Network Trouble; __sip_xmit returns error for pkt data
  == WebSocket connection from '127.0.0.1:60786' closed
[Apr  4 20:34:47] WARNING[14195]: chan_sip.c:30098 sip_send_keepalive: sip_send_keepalive to 127.0.0.1:60920 returned 0: Success
[Apr  4 20:34:55] ERROR[14195]: chan_sip.c:4274 __sip_reliable_xmit: Serious Network Trouble; __sip_xmit returns error for pkt data