[RESOLVED] One way issue on web client side

Hello to all,
I’m having a one-way audio issue when I make a call. In a few words who listens to the other side (with windows client as Zoiper) hears everything, but instead the listener through a web client can only talk but not hear anything.
The exchange of RTP packets through debugging seems to work properly through ICE support.
The network is said to be an asteroid problem, can you help me? is really a bug?

P.S. The web client is built with JsSIP.

Check first if everything is ok. Use a proper sip client to make a test call. If you can hear then it is the JsSIP softphone that has the problem.

Yes, i think everything is ok. With zoiper client, i can hear all. Do you think that is JsSIP problem? Can you suggest me a solution?

Well you need to debug the application, do you have the sources? If not I don’t think anyone beyond the one that made the application can help you.

You can’t compare a SIP Client with a WebSocket One there are too many differences. You will need to debug from both sides(Server & Client) and match those debugs. For the server use SIP SET DEBUG ON(assuming you are using chan_sip) for the client ctrl+shift+J when you attempt the call.

Usually is a NAT+ICE issue the one way audio or using videocapabilities when the websocket client is not configured for that.

Hi navaismo, thank you.

My network is very simple. I have ADSL at home with router, I installed on a PC the asterisk server and from another I try to make the connection. I must set the NAT configuration?

Cheers

You should configure it in order to let the server know “where is outside and where is inside”. I still recommend to look at the traces from Browser specially when the SDP negotiation begin.

All the SIP-websockets stacks has this workaround to set the ICE as null when you are in your own network to avoid this audio issue. Try it

And finally be sure that: if your call is an audio call only you don´t set the peer with video settings, there is a bug affecting that.

Hello navaismo,
I really need you to help me to understand the problem. Below two logs, one of registration to server, the other of attempt to call.

Registration --> http://pastebin.com/zNtTaaw2
Call --> http://pastebin.com/pGynsqAp

I state that I’m testing everything in my home personal network, where the PC 192.168.0.105 is JsSIP client while the PC 192.168.0.106 is the asterisk server.

It is possible that when the server must send back the RTP packet it send him back to my public IP and then wrong delivery? Can read it from the logs mentioned above?

Please, I ask you, you who are expert help me.

P.S. I try to set null ICE server, but when i press “call button” the client send immediately a BYE message :frowning:

Please share and format the logs here. I cannot open pastebin site and it is better if you plaste here to have all the info together.

+1 (I can open them, but it is generally more trouble than it is worth)

Sorry…

`  == WebSocket connection from '192.168.0.105:53643' for protocol 'sip' accepted using version '13'
<--- Received SIP request (568 bytes) from WS:192.168.0.105:53643 --->
REGISTER sip:192.168.0.106 SIP/2.0
Via: SIP/2.0/WS k5v7qdhee21i.invalid;branch=z9hG4bK211693
Max-Forwards: 69
To: <sip:6001@192.168.0.106>
From: "User WebRTC 6001" <sip:6001@192.168.0.106>;tag=88kogfq6mh
Call-ID: ro5f0ohad43lkhevfara26
CSeq: 1 REGISTER
Contact: <sip:k2not68h@k5v7qdhee21i.invalid;transport=ws>;+sip.ice;reg-id=1;+sip.instance="<urn:uuid:a384eef3-4ff1-4e4d-b5bb-14aa5620b252>";expires=600
Expires: 600
Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO
Supported: path,gruu,outbound
User-Agent: JsSIP 2.0.2
Content-Length: 0


<--- Transmitting SIP response (484 bytes) to WS:192.168.0.105:53643 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/WS k5v7qdhee21i.invalid;rport=53643;received=192.168.0.105;branch=z9hG4bK211693
Call-ID: ro5f0ohad43lkhevfara26
From: "User WebRTC 6001" <sip:6001@192.168.0.106>;tag=88kogfq6mh
To: <sip:6001@192.168.0.106>;tag=z9hG4bK211693
CSeq: 1 REGISTER
WWW-Authenticate: Digest  realm="asterisk",nonce="1469177118/e77523413fd8316816034a71dd26332f",opaque="07e9ed120ad79990",algorithm=md5,qop="auth"
Server: Asterisk PBX 13.10.0
Content-Length:  0


<--- Received SIP request (835 bytes) from WS:192.168.0.105:53643 --->
REGISTER sip:192.168.0.106 SIP/2.0
Via: SIP/2.0/WS k5v7qdhee21i.invalid;branch=z9hG4bK52092
Max-Forwards: 69
To: <sip:6001@192.168.0.106>
From: "User WebRTC 6001" <sip:6001@192.168.0.106>;tag=88kogfq6mh
Call-ID: ro5f0ohad43lkhevfara26
CSeq: 2 REGISTER
Authorization: Digest algorithm=MD5, username="6001", realm="asterisk", nonce="1469177118/e77523413fd8316816034a71dd26332f", uri="sip:192.168.0.106", response="a11e368c3688910978e00a3638352dd9", opaque="07e9ed120ad79990", qop=auth, cnonce="nl0vurqeqp95", nc=00000001
Contact: <sip:k2not68h@k5v7qdhee21i.invalid;transport=ws>;+sip.ice;reg-id=1;+sip.instance="<urn:uuid:a384eef3-4ff1-4e4d-b5bb-14aa5620b252>";expires=600
Expires: 600
Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO
Supported: path,gruu,outbound
User-Agent: JsSIP 2.0.2
Content-Length: 0


    -- Added contact 'sip:k2not68h@192.168.0.105:53643;transport=ws' to AOR '6001' with expiration of 600 seconds
<--- Transmitting SIP response (446 bytes) to WS:192.168.0.105:53643 --->
SIP/2.0 200 OK
Via: SIP/2.0/WS k5v7qdhee21i.invalid;rport=53643;received=192.168.0.105;branch=z9hG4bK52092
Call-ID: ro5f0ohad43lkhevfara26
From: "User WebRTC 6001" <sip:6001@192.168.0.106>;tag=88kogfq6mh
To: <sip:6001@192.168.0.106>;tag=z9hG4bK52092
CSeq: 2 REGISTER
Date: Fri, 22 Jul 2016 08:45:18 GMT
Contact: <sip:k2not68h@192.168.0.105:53643;transport=ws>;expires=599
Expires: 600
Server: Asterisk PBX 13.10.0
Content-Length:  0


  == Contact 6001/sip:k2not68h@192.168.0.105:53643;transport=ws has been created
  == Contact 6001/sip:mng9kdua@192.168.0.105:53622;transport=ws has been deleted
    -- Contact 6001/sip:k2not68h@192.168.0.105:53643;transport=ws is now Unknown.  RTT: 0.000 msec`

and call

<--- Received SIP request (2960 bytes) from WS:192.168.0.105:53667 --->
INVITE sip:100@192.168.0.106 SIP/2.0
Via: SIP/2.0/WS 6lq47gcdulkv.invalid;branch=z9hG4bK2648978
Max-Forwards: 69
To: <sip:100@192.168.0.106>
From: "User WebRTC 6001" <sip:6001@192.168.0.106>;tag=pasq8pp8jc
Call-ID: 3qjc78fivmg5ms96qecq
CSeq: 3453 INVITE
Contact: <sip:uj79f7vh@6lq47gcdulkv.invalid;transport=ws;ob>
Content-Type: application/sdp
Session-Expires: 90
Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO
Supported: timer,ice,replaces,outbound
User-Agent: JsSIP 2.0.2
Content-Length: 2432

v=0
o=- 5622713761591645631 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE audio
a=msid-semantic: WMS vzSSSZIQQ35hs80I0CqssQs5janLZzT3AHnU
m=audio 57535 UDP/TLS/RTP/SAVPF 111 103 104 9 0 8 106 105 13 126
c=IN IP4 192.168.10.1
a=rtcp:57538 IN IP4 192.168.10.1
a=candidate:2430253621 1 udp 2122260223 192.168.10.1 57535 typ host generation 0 network-id 2
a=candidate:1337008544 1 udp 2122194687 192.168.247.1 57536 typ host generation 0 network-id 1
a=candidate:1221703924 1 udp 2122129151 192.168.0.105 57537 typ host generation 0 network-id 3
a=candidate:2430253621 2 udp 2122260222 192.168.10.1 57538 typ host generation 0 network-id 2
a=candidate:1337008544 2 udp 2122194686 192.168.247.1 57539 typ host generation 0 network-id 1
a=candidate:1221703924 2 udp 2122129150 192.168.0.105 57540 typ host generation 0 network-id 3
a=candidate:3730392773 1 tcp 1518280447 192.168.10.1 9 typ host tcptype active generation 0 network-id 2
a=candidate:20110672 1 tcp 1518214911 192.168.247.1 9 typ host tcptype active generation 0 network-id 1
a=candidate:106054660 1 tcp 1518149375 192.168.0.105 9 typ host tcptype active generation 0 network-id 3
a=candidate:3730392773 2 tcp 1518280446 192.168.10.1 9 typ host tcptype active generation 0 network-id 2
a=candidate:20110672 2 tcp 1518214910 192.168.247.1 9 typ host tcptype active generation 0 network-id 1
a=candidate:106054660 2 tcp 1518149374 192.168.0.105 9 typ host tcptype active generation 0 network-id 3
a=ice-ufrag:lzrDGY2gqi3O4sIm
a=ice-pwd:J+F8f/e4iV+61MdJnqb0MW2R
a=fingerprint:sha-256 30:CE:6C:0A:9D:90:B2:C2:1E:15:E6:77:E4:72:F3:54:D9:27:9B:76:EA:46:62:BF:A2:16:60:AF:36:1B:AE:B1
a=setup:actpass
a=mid:audio
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
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:126 telephone-event/8000
a=maxptime:60
a=ssrc:3210603941 cname:5ZVmRo6XmeKHeNkF
a=ssrc:3210603941 msid:vzSSSZIQQ35hs80I0CqssQs5janLZzT3AHnU 006e5593-743b-4d11-9471-8caa3aa13e7e
a=ssrc:3210603941 mslabel:vzSSSZIQQ35hs80I0CqssQs5janLZzT3AHnU
a=ssrc:3210603941 label:006e5593-743b-4d11-9471-8caa3aa13e7e

<--- Transmitting SIP response (484 bytes) to WS:192.168.0.105:53667 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/WS 6lq47gcdulkv.invalid;rport=53667;received=192.168.0.105;branch=z9hG4bK2648978
Call-ID: 3qjc78fivmg5ms96qecq
From: "User WebRTC 6001" <sip:6001@192.168.0.106>;tag=pasq8pp8jc
To: <sip:100@192.168.0.106>;tag=z9hG4bK2648978
CSeq: 3453 INVITE
WWW-Authenticate: Digest  realm="asterisk",nonce="1469177205/acc762ddf0f322deb736ff8747c0451f",opaque="385e7d033b31ca5c",algorithm=md5,qop="auth"
Server: Asterisk PBX 13.10.0
Content-Length:  0


<--- Received SIP request (277 bytes) from WS:192.168.0.105:53667 --->
ACK sip:100@192.168.0.106 SIP/2.0
Via: SIP/2.0/WS 6lq47gcdulkv.invalid;branch=z9hG4bK2648978
To: <sip:100@192.168.0.106>;tag=z9hG4bK2648978
From: "User WebRTC 6001" <sip:6001@192.168.0.106>;tag=pasq8pp8jc
Call-ID: 3qjc78fivmg5ms96qecq
CSeq: 3453 ACK
Content-Length: 0


<--- Received SIP request (3232 bytes) from WS:192.168.0.105:53667 --->
INVITE sip:100@192.168.0.106 SIP/2.0
Via: SIP/2.0/WS 6lq47gcdulkv.invalid;branch=z9hG4bK1537306
Max-Forwards: 69
To: <sip:100@192.168.0.106>
From: "User WebRTC 6001" <sip:6001@192.168.0.106>;tag=pasq8pp8jc
Call-ID: 3qjc78fivmg5ms96qecq
CSeq: 3454 INVITE
Authorization: Digest algorithm=MD5, username="6001", realm="asterisk", nonce="1469177205/acc762ddf0f322deb736ff8747c0451f", uri="sip:100@192.168.0.106", response="104e3c510184be73c018ec0a73591976", opaque="385e7d033b31ca5c", qop=auth, cnonce="2dqd44h0vnr5", nc=00000001
Contact: <sip:uj79f7vh@6lq47gcdulkv.invalid;transport=ws;ob>
Content-Type: application/sdp
Session-Expires: 90
Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO
Supported: timer,ice,replaces,outbound
User-Agent: JsSIP 2.0.2
Content-Length: 2432

v=0
o=- 5622713761591645631 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE audio
a=msid-semantic: WMS vzSSSZIQQ35hs80I0CqssQs5janLZzT3AHnU
m=audio 57535 UDP/TLS/RTP/SAVPF 111 103 104 9 0 8 106 105 13 126
c=IN IP4 192.168.10.1
a=rtcp:57538 IN IP4 192.168.10.1
a=candidate:2430253621 1 udp 2122260223 192.168.10.1 57535 typ host generation 0 network-id 2
a=candidate:1337008544 1 udp 2122194687 192.168.247.1 57536 typ host generation 0 network-id 1
a=candidate:1221703924 1 udp 2122129151 192.168.0.105 57537 typ host generation 0 network-id 3
a=candidate:2430253621 2 udp 2122260222 192.168.10.1 57538 typ host generation 0 network-id 2
a=candidate:1337008544 2 udp 2122194686 192.168.247.1 57539 typ host generation 0 network-id 1
a=candidate:1221703924 2 udp 2122129150 192.168.0.105 57540 typ host generation 0 network-id 3
a=candidate:3730392773 1 tcp 1518280447 192.168.10.1 9 typ host tcptype active generation 0 network-id 2
a=candidate:20110672 1 tcp 1518214911 192.168.247.1 9 typ host tcptype active generation 0 network-id 1
a=candidate:106054660 1 tcp 1518149375 192.168.0.105 9 typ host tcptype active generation 0 network-id 3
a=candidate:3730392773 2 tcp 1518280446 192.168.10.1 9 typ host tcptype active generation 0 network-id 2
a=candidate:20110672 2 tcp 1518214910 192.168.247.1 9 typ host tcptype active generation 0 network-id 1
a=candidate:106054660 2 tcp 1518149374 192.168.0.105 9 typ host tcptype active generation 0 network-id 3
a=ice-ufrag:lzrDGY2gqi3O4sIm
a=ice-pwd:J+F8f/e4iV+61MdJnqb0MW2R
a=fingerprint:sha-256 30:CE:6C:0A:9D:90:B2:C2:1E:15:E6:77:E4:72:F3:54:D9:27:9B:76:EA:46:62:BF:A2:16:60:AF:36:1B:AE:B1
a=setup:actpass
a=mid:audio
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
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:126 telephone-event/8000
a=maxptime:60
a=ssrc:3210603941 cname:5ZVmRo6XmeKHeNkF
a=ssrc:3210603941 msid:vzSSSZIQQ35hs80I0CqssQs5janLZzT3AHnU 006e5593-743b-4d11-9471-8caa3aa13e7e
a=ssrc:3210603941 mslabel:vzSSSZIQQ35hs80I0CqssQs5janLZzT3AHnU
a=ssrc:3210603941 label:006e5593-743b-4d11-9471-8caa3aa13e7e

<--- Transmitting SIP response (312 bytes) to WS:192.168.0.105:53667 --->
SIP/2.0 100 Trying
Via: SIP/2.0/WS 6lq47gcdulkv.invalid;rport=53667;received=192.168.0.105;branch=z9hG4bK1537306
Call-ID: 3qjc78fivmg5ms96qecq
From: "User WebRTC 6001" <sip:6001@192.168.0.106>;tag=pasq8pp8jc
To: <sip:100@192.168.0.106>
CSeq: 3454 INVITE
Server: Asterisk PBX 13.10.0
Content-Length:  0


    -- Executing [100@from-internal:1] Goto("PJSIP/6001-00000002", "conf,1") in new stack
    -- Goto (from-internal,conf,1)
    -- Executing [conf@from-internal:1] Set("PJSIP/6001-00000002", "MEETME_RECORDINGFILE=/home/enzo/Scrivania/rec-") in new stack
    -- Executing [conf@from-internal:2] MeetMe("PJSIP/6001-00000002", "1234,Mr,0000") in new stack
<--- Transmitting SIP response (1604 bytes) to WS:192.168.0.105:53667 --->
SIP/2.0 200 OK
Via: SIP/2.0/WS 6lq47gcdulkv.invalid;rport=53667;received=192.168.0.105;branch=z9hG4bK1537306
Call-ID: 3qjc78fivmg5ms96qecq
From: "User WebRTC 6001" <sip:6001@192.168.0.106>;tag=pasq8pp8jc
To: <sip:100@192.168.0.106>;tag=3b14cfe0-ea6d-44a5-9968-c137481597d5
CSeq: 3454 INVITE
Server: Asterisk PBX 13.10.0
Contact: <sip:192.168.0.105:53667;transport=WS>
Allow: OPTIONS, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REGISTER, REFER, MESSAGE
Supported: 100rel, timer, replaces, norefersub
Session-Expires: 90;refresher=uac
Require: timer
Content-Type: application/sdp
Content-Length:   962

v=0
o=- 828298687 4 IN IP4 192.168.0.106
s=Asterisk
c=IN IP4 192.168.0.106
t=0 0
m=audio 15992 UDP/TLS/RTP/SAVPF 0 126
a=connection:new
a=setup:active
a=fingerprint:SHA-256 2D:C1:C5:B1:71:70:7F:B6:E9:4F:38:BD:1E:88:A3:5E:5D:83:32:3B:50:D9:3C:71:1A:A5:51:FF:E6:34:2F:49
a=ice-ufrag:6479530c0f51b2577455a99e67564fab
a=ice-pwd:181f28751ff4366d4ec92e4971714710
a=candidate:Hc0a8006a 1 UDP 2130706431 192.168.0.106 15992 typ host
a=candidate:Hc0a87a01 1 UDP 2130706431 192.168.122.1 15992 typ host
a=candidate:S523699b3 1 UDP 1694498815 82.54.153.179 59751 typ srflx raddr 192.168.0.106 rport 15992
a=candidate:Hc0a8006a 2 UDP 2130706430 192.168.0.106 15993 typ host
a=candidate:Hc0a87a01 2 UDP 2130706430 192.168.122.1 15993 typ host
a=candidate:S523699b3 2 UDP 1694498814 82.54.153.179 62647 typ srflx raddr 192.168.0.106 rport 15993
a=rtpmap:0 PCMU/8000
a=rtpmap:126 telephone-event/8000
a=fmtp:126 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

<--- Received SIP request (442 bytes) from WS:192.168.0.105:53667 --->
ACK sip:192.168.0.105:53667;transport=ws SIP/2.0
Via: SIP/2.0/WS 6lq47gcdulkv.invalid;branch=z9hG4bK8722118
Max-Forwards: 69
To: <sip:100@192.168.0.106>;tag=3b14cfe0-ea6d-44a5-9968-c137481597d5
From: "User WebRTC 6001" <sip:6001@192.168.0.106>;tag=pasq8pp8jc
Call-ID: 3qjc78fivmg5ms96qecq
CSeq: 3454 ACK
Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO
Supported: outbound
User-Agent: JsSIP 2.0.2
Content-Length: 0


    -- Stopped music on hold on PJSIP/6001-00000001

Where is the SIP.js DEBUG? And also share the RTP DEBUG please.

hi, jssip debug i dont know where i can enable it :frowning: rtp debug is:

[…] Sent RTP packet to 192.168.0.105:64920 (via ICE) (type 00, seq
059190, ts 022240, len 000170) Got RTP packet from 192.168.0.105:64920
(type 00, seq 022130, ts 4065699781, len 000160) Sent RTP packet to
192.168.0.105:64920 (via ICE) (type 00, seq 059191, ts 022400, len 000170)
Got RTP packet from 192.168.0.105:64920 (type 00, seq 022131, ts
4065699941, len 000160) Sent RTP packet to 192.168.0.105:64920 (via ICE)
(type 00, seq 059192, ts 022560, len 000170) Got RTP packet from
192.168.0.105:64920 (type 00, seq 022132, ts 4065700101, len 000160) Sent
RTP packet to 192.168.0.105:64920 (via ICE) (type 00, seq 059193, ts
022720, len 000170) Got RTP packet from 192.168.0.105:64920 (type 00, seq
022133, ts 4065700261, len 000160) Sent RTP packet to 192.168.0.105:64920
(via ICE) (type 00, seq 059194, ts 022880, len 000170) Got RTP packet from
192.168.0.105:64920 (type 00, seq 022134, ts 4065700421, len 000160) Got
RTP packet from 192.168.0.105:64920 (type 00, seq 022135, ts 4065700581,
len 000160) Sent RTP packet to 192.168.0.105:64920 (via ICE) (type 00, seq
059195, ts 023040, len 000170) Got RTP packet from 192.168.0.105:64920
(type 00, seq 022136, ts 4065700741, len 000160) Sent RTP packet to
192.168.0.105:64920 (via ICE) (type 00, seq 059196, ts 023200, len 000170)
Got RTP packet from 192.168.0.105:64920 (type 00, seq 022137, ts
4065700901, len 000160) Sent RTP packet to 192.168.0.105:64920 (via ICE)
(type 00, seq 059197, ts 023360, len 000170) Got RTP packet from
192.168.0.105:64920 (type 00, seq 022138, ts 4065701061, len 000160) Sent
RTP packet to 192.168.0.105:64920 (via ICE) (type 00, seq 059198, ts
023520, len 000170) Got RTP packet from 192.168.0.105:64920 (type 00, seq
022139, ts 4065701221, len 000160) […]

RTP show the correct address of your PC, To get the JS debug press CTRL+SHIFT+J and copy the output. Are you you sure that your JS peer is only for audio??

Hello, sorry if I answer now but I had a problem with the connection. Can you tell me if my html page also includes settings for the video that can give me error? Below the html code

<!DOCTYPE html>

<html xmlns:th="http://www.thymeleaf.org">

<head>
	<script type="text/javascript" src="jquery.js"></script>
	<script type="text/javascript" src="jssip-2.0.2.js"></script>
</head>
<body>
   <script type="text/javascript">
	/*<![CDATA[*/
	    var ua = null;
	    var session = null;
	    var myMultimedia = $("#audio_local");
	    var theirMultimedia = $("#audio_remote");
	    var local_stream = null;
	    var remote_stream = null;
		var ipAsterisk = "192.168.0.106";
		
	    function registerUA() {
	        var configuration = {
	            uri: 'sip:6001@' + ipAsterisk,
	            password: '6001',
	            ws_servers: 'ws://' + ipAsterisk + ':8088/ws',
	            display_name: "User WebRTC 6001",
	            no_answer_timeout: null,
	            trace_sip: true,
	            stun_servers: ['stun:null'],
				//stun_servers: ['stun:null']
	            turn_servers: null,
	            use_preloaded_route: null,
	            connection_recovery_min_interval: null,
	            connection_recovery_max_interval: null,
	            hack_ip_in_contact: false
	        };
	        ua = new JsSIP.UA(configuration);
	        ua.start();
	    }
	
	    function callAsterisk() {
	        var numTel = "100";
	        var eventH = {
	            'progress': function (e) { },
	            'failed': function (e) { },
	            'ended': function (e) { },
	            'confirmed': function (e) {
	                local_stream = session.connection.getLocalStreams()[0]; 
	     			console.log(local_stream); //If i print this variable I do get a media stream
	                myMultimedia.src = JsSIP.rtcninja.attachMediaStream(myMultimedia, local_stream); 
	            },
	            'addstream': function (e) {
	                remote_stream = e.stream; 
	    			console.log(remote_stream); //If i print this variable I do get a media stream
	    	 		theirMultimedia.src = JsSIP.rtcninja.attachMediaStream(theirMultimedia, remote_stream); 
	            }
				/**'confirmed':  function(e){
					// Attach local stream to selfView
					myMultimedia.src = window.URL.createObjectURL(session.connection.getLocalStreams()[0]);
				},
				'addstream':  function(e) {
					var stream = e.stream;
					// Attach remote stream to remoteView
					theirMultimedia.src = window.URL.createObjectURL(stream);
				}*/
	        };
	        var options = {
	            'eventHandlers': eventH,
	            'mediaConstraints': {
	                'audio': true,
	                'video': false
	            }
	        };
	        session = ua.call('sip:' + numTel + '@' + ipAsterisk, options);
	    }

	    $(document).ready(function () {
			registerUA();
			$("#btnSubmit").click(function(){
				callAsterisk();
			}); 
	    });
       /*]]>*/
    </script>
	<audio id="audio_local" autoplay=""></audio>
	<audio id="audio_remote" autoplay=""></audio>
	<input type="button" id="btnSubmit" value="Call" text="Call" name="btnSubmit" />
  </body>
</html>

and below is my peer in pjsip.conf

[6001]
type=aor
max_contacts=1
mailboxes=6001@asterisk.com
remove_existing=yes
 
[6001]
type=auth
auth_type=userpass
username=6001
password=6001
 
[6001]
type=endpoint
disallow=all
allow=ulaw
context=from-internal
auth=6001
aors=6001
media_encryption=dtls
dtls_verify=fingerprint
dtls_cert_file=/etc/asterisk/keys/asterisk.pem
dtls_ca_file=/etc/asterisk/keys/ca.crt
dtls_setup=actpass
use_avpf=yes
ice_support=yes
media_use_received_transport=yes

Can you help me? For js debug, my app doesn’t write anything and i don’t know how i can enable debug :frowning:

Cheers,

The debug can be grabbed from the console of chrome/firefox by pressing CRTL+SHIFT+J.

This is weird you are using WS and it is deprecated you should use WSS, now I’m wondering how are you able to connect to the asterisk server.

And no I don´t see video settings, but I´m not an expert using JSSIP, also are you sure you are using the correct java ID for the local and remote streams??

Aww, ive had this similar problem before, if only i had come across this forum before :’( would’ve been able to do it 2x quicker with all this awesome info. All fixed now though, but still what a waste of my time when i could’ve just looked it up online… LOL!

you think is better to use the wss? however, you can suggest an alternative
to jssip? perhaps with some examples?

@Edward_Woolsworth
If you can share your fix with @enzodd.

WSS It is not better, it is required by the browsers. JSSIP is a great API just I’m not familiar with it. I used SIPML5 and there are a lot of examples including the live demo at https://www.doubango.org/sipml5/call.htm?svn=250

Old example from me: https://github.com/navaismo/Elastix-Agent_Console_WebRTC/blob/master/modules/themes/default/js/ml5.js

But before that Share the JS log please.

Hi navaismo,

I have configured WSS protocol, and my JS log is below:

JsSIP:UA call() +8s
jssip-2.0.2.js:22521 JsSIP:RTCSession new +3ms
jssip-2.0.2.js:22521 JsSIP:RTCSession connect() +4ms
jssip-2.0.2.js:22521 JsSIP:RTCSession newRTCSession +45ms
jssip-2.0.2.js:22521 JsSIP:RTCSession session connecting +14ms
jssip-2.0.2.js:22521 JsSIP:RTCSession createLocalDescription() +0ms
jssip-2.0.2.js:22521 JsSIP:Transport send() +165ms
jssip-2.0.2.js:22521 JsSIP:Transport sending message:

INVITE sip:100@192.168.0.106 SIP/2.0
Via: SIP/2.0/WSS nun0frjrrps6.invalid;branch=z9hG4bK4979569
Max-Forwards: 69
To: <sip:100@192.168.0.106>
From: "User WebRTC 6001" <sip:6001@192.168.0.106>;tag=6tp1q63rq7
Call-ID: jkgivnj0nilbqg706fpn
CSeq: 866 INVITE
Contact: <sip:fn4qa5gb@nun0frjrrps6.invalid;transport=ws;ob>
Content-Type: application/sdp
Session-Expires: 90
Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO
Supported: timer,ice,replaces,outbound
User-Agent: JsSIP 2.0.2
Content-Length: 2434

v=0
o=- 3362957600567996038 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE audio
a=msid-semantic: WMS oaPfARRR29Suqk6uTXrJ6MZEJqLQ3Rytvm1s
m=audio 50123 UDP/TLS/RTP/SAVPF 111 103 104 9 0 8 106 105 13 126
c=IN IP4 192.168.10.1
a=rtcp:50126 IN IP4 192.168.10.1
a=candidate:2430253621 1 udp 2122260223 192.168.10.1 50123 typ host generation 0 network-id 2
a=candidate:1337008544 1 udp 2122194687 192.168.247.1 50124 typ host generation 0 network-id 1
a=candidate:4033732497 1 udp 2122129151 192.168.0.105 50125 typ host generation 0 network-id 3
a=candidate:2430253621 2 udp 2122260222 192.168.10.1 50126 typ host generation 0 network-id 2
a=candidate:1337008544 2 udp 2122194686 192.168.247.1 50127 typ host generation 0 network-id 1
a=candidate:4033732497 2 udp 2122129150 192.168.0.105 50128 typ host generation 0 network-id 3
a=candidate:3730392773 1 tcp 1518280447 192.168.10.1 9 typ host tcptype active generation 0 network-id 2
a=candidate:20110672 1 tcp 1518214911 192.168.247.1 9 typ host tcptype active generation 0 network-id 1
a=candidate:3203277665 1 tcp 1518149375 192.168.0.105 9 typ host tcptype active generation 0 network-id 3
a=candidate:3730392773 2 tcp 1518280446 192.168.10.1 9 typ host tcptype active generation 0 network-id 2
a=candidate:20110672 2 tcp 1518214910 192.168.247.1 9 typ host tcptype active generation 0 network-id 1
a=candidate:3203277665 2 tcp 1518149374 192.168.0.105 9 typ host tcptype active generation 0 network-id 3
a=ice-ufrag:bBR6bITQ74ScYr4g
a=ice-pwd:uh/UX1XgkGZkA4SQg7PX9kya
a=fingerprint:sha-256 EB:7B:A4:A4:D8:4D:F5:80:A1:6C:B0:51:79:B1:56:1F:12:9C:02:F9:D3:35:92:27:95:B6:92:CC:E0:CF:AD:1D
a=setup:actpass
a=mid:audio
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
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:126 telephone-event/8000
a=maxptime:60
a=ssrc:3041404117 cname:rjYApttjrKqjy/VR
a=ssrc:3041404117 msid:oaPfARRR29Suqk6uTXrJ6MZEJqLQ3Rytvm1s 6c33e283-c766-479d-8cdf-0155cd0cdf69
a=ssrc:3041404117 mslabel:oaPfARRR29Suqk6uTXrJ6MZEJqLQ3Rytvm1s
a=ssrc:3041404117 label:6c33e283-c766-479d-8cdf-0155cd0cdf69

 +6ms
jssip-2.0.2.js:22521 JsSIP:WebSocketInterface send() +2ms
jssip-2.0.2.js:22521 JsSIP:WebSocketInterface received WebSocket message +10ms
jssip-2.0.2.js:22521 JsSIP:Transport received text message:

SIP/2.0 401 Unauthorized
Via: SIP/2.0/WSS nun0frjrrps6.invalid;rport=52032;received=192.168.0.105;branch=z9hG4bK4979569
Call-ID: jkgivnj0nilbqg706fpn
From: "User WebRTC 6001" <sip:6001@192.168.0.106>;tag=6tp1q63rq7
To: <sip:100@192.168.0.106>;tag=z9hG4bK4979569
CSeq: 866 INVITE
WWW-Authenticate: Digest  realm="asterisk",nonce="1469994295/a2d95f69fd634c12cea3b0df2bb688ca",opaque="06c9b182487a990f",algorithm=md5,qop="auth"
Server: Asterisk PBX 13.10.0
Content-Length:  0


 +3ms
jssip-2.0.2.js:22521 JsSIP:Transport send() +32ms
jssip-2.0.2.js:22521 JsSIP:Transport sending message:

ACK sip:100@192.168.0.106 SIP/2.0
Via: SIP/2.0/WSS nun0frjrrps6.invalid;branch=z9hG4bK4979569
To: <sip:100@192.168.0.106>;tag=z9hG4bK4979569
From: "User WebRTC 6001" <sip:6001@192.168.0.106>;tag=6tp1q63rq7
Call-ID: jkgivnj0nilbqg706fpn
CSeq: 866 ACK
Content-Length: 0


 +0ms
jssip-2.0.2.js:22521 JsSIP:WebSocketInterface send() +1ms
jssip-2.0.2.js:22521 JsSIP:DigestAuthentication authenticate() | response generated +2ms
jssip-2.0.2.js:22521 JsSIP:Transport send() +3ms
jssip-2.0.2.js:22521 JsSIP:Transport sending message:

INVITE sip:100@192.168.0.106 SIP/2.0
Via: SIP/2.0/WSS nun0frjrrps6.invalid;branch=z9hG4bK1614579
Max-Forwards: 69
To: <sip:100@192.168.0.106>
From: "User WebRTC 6001" <sip:6001@192.168.0.106>;tag=6tp1q63rq7
Call-ID: jkgivnj0nilbqg706fpn
CSeq: 867 INVITE
Authorization: Digest algorithm=MD5, username="6001", realm="asterisk", nonce="1469994295/a2d95f69fd634c12cea3b0df2bb688ca", uri="sip:100@192.168.0.106", response="485ad659a10e207472e69f53e111fdaa", opaque="06c9b182487a990f", qop=auth, cnonce="0glgsmil0a70", nc=00000001
Contact: <sip:fn4qa5gb@nun0frjrrps6.invalid;transport=ws;ob>
Content-Type: application/sdp
Session-Expires: 90
Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO
Supported: timer,ice,replaces,outbound
User-Agent: JsSIP 2.0.2
Content-Length: 2434

v=0
o=- 3362957600567996038 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE audio
a=msid-semantic: WMS oaPfARRR29Suqk6uTXrJ6MZEJqLQ3Rytvm1s
m=audio 50123 UDP/TLS/RTP/SAVPF 111 103 104 9 0 8 106 105 13 126
c=IN IP4 192.168.10.1
a=rtcp:50126 IN IP4 192.168.10.1
a=candidate:2430253621 1 udp 2122260223 192.168.10.1 50123 typ host generation 0 network-id 2
a=candidate:1337008544 1 udp 2122194687 192.168.247.1 50124 typ host generation 0 network-id 1
a=candidate:4033732497 1 udp 2122129151 192.168.0.105 50125 typ host generation 0 network-id 3
a=candidate:2430253621 2 udp 2122260222 192.168.10.1 50126 typ host generation 0 network-id 2
a=candidate:1337008544 2 udp 2122194686 192.168.247.1 50127 typ host generation 0 network-id 1
a=candidate:4033732497 2 udp 2122129150 192.168.0.105 50128 typ host generation 0 network-id 3
a=candidate:3730392773 1 tcp 1518280447 192.168.10.1 9 typ host tcptype active generation 0 network-id 2
a=candidate:20110672 1 tcp 1518214911 192.168.247.1 9 typ host tcptype active generation 0 network-id 1
a=candidate:3203277665 1 tcp 1518149375 192.168.0.105 9 typ host tcptype active generation 0 network-id 3
a=candidate:3730392773 2 tcp 1518280446 192.168.10.1 9 typ host tcptype active generation 0 network-id 2
a=candidate:20110672 2 tcp 1518214910 192.168.247.1 9 typ host tcptype active generation 0 network-id 1
a=candidate:3203277665 2 tcp 1518149374 192.168.0.105 9 typ host tcptype active generation 0 network-id 3
a=ice-ufrag:bBR6bITQ74ScYr4g
a=ice-pwd:uh/UX1XgkGZkA4SQg7PX9kya
a=fingerprint:sha-256 EB:7B:A4:A4:D8:4D:F5:80:A1:6C:B0:51:79:B1:56:1F:12:9C:02:F9:D3:35:92:27:95:B6:92:CC:E0:CF:AD:1D
a=setup:actpass
a=mid:audio
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
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:126 telephone-event/8000
a=maxptime:60
a=ssrc:3041404117 cname:rjYApttjrKqjy/VR
a=ssrc:3041404117 msid:oaPfARRR29Suqk6uTXrJ6MZEJqLQ3Rytvm1s 6c33e283-c766-479d-8cdf-0155cd0cdf69
a=ssrc:3041404117 mslabel:oaPfARRR29Suqk6uTXrJ6MZEJqLQ3Rytvm1s
a=ssrc:3041404117 label:6c33e283-c766-479d-8cdf-0155cd0cdf69

 +1ms
jssip-2.0.2.js:22521 JsSIP:WebSocketInterface send() +2ms
jssip-2.0.2.js:22521 JsSIP:InviteClientTransaction Timer D expired for transaction z9hG4bK4979569 +1ms
jssip-2.0.2.js:22521 JsSIP:WebSocketInterface received WebSocket message +122ms
jssip-2.0.2.js:22521 JsSIP:Transport received text message:

SIP/2.0 100 Trying
Via: SIP/2.0/WSS nun0frjrrps6.invalid;rport=52032;received=192.168.0.105;branch=z9hG4bK1614579
Call-ID: jkgivnj0nilbqg706fpn
From: "User WebRTC 6001" <sip:6001@192.168.0.106>;tag=6tp1q63rq7
To: <sip:100@192.168.0.106>
CSeq: 867 INVITE
Server: Asterisk PBX 13.10.0
Content-Length:  0


 +1ms
jssip-2.0.2.js:22521 JsSIP:RTCSession receiveInviteResponse() +2ms
jssip-2.0.2.js:22521 JsSIP:WebSocketInterface received WebSocket message +9ms
jssip-2.0.2.js:22521 JsSIP:Transport received text message:

SIP/2.0 200 OK
Via: SIP/2.0/WSS nun0frjrrps6.invalid;rport=52032;received=192.168.0.105;branch=z9hG4bK1614579
Call-ID: jkgivnj0nilbqg706fpn
From: "User WebRTC 6001" <sip:6001@192.168.0.106>;tag=6tp1q63rq7
To: <sip:100@192.168.0.106>;tag=591ba68b-a443-4132-a67e-9dda16e79cc6
CSeq: 867 INVITE
Server: Asterisk PBX 13.10.0
Contact: <sip:192.168.0.105:52032;transport=WSS>
Allow: OPTIONS, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REGISTER, REFER, MESSAGE
Supported: 100rel, timer, replaces, norefersub
Session-Expires: 90;refresher=uac
Require: timer
Content-Type: application/sdp
Content-Length:   961

v=0
o=- 3096325766 4 IN IP4 192.168.0.106
s=Asterisk
c=IN IP4 192.168.0.106
t=0 0
m=audio 19454 UDP/TLS/RTP/SAVPF 0 126
a=connection:new
a=setup:active
a=fingerprint:SHA-256 D7:61:94:8C:DD:B5:80:7E:65:F2:02:9C:70:20:6C:14:7A:EF:36:D6:0E:57:4A:81:47:C9:DE:C0:76:58:72:B1
a=ice-ufrag:7556072e14e71c49344e2e4161a5ffef
a=ice-pwd:3a69c5f37739deae7471a41d49a01145
a=candidate:Hc0a8006a 1 UDP 2130706431 192.168.0.106 19454 typ host
a=candidate:Hc0a87a01 1 UDP 2130706431 192.168.122.1 19454 typ host
a=candidate:S570e0fc6 1 UDP 1694498815 87.14.15.198 53389 typ srflx raddr 192.168.0.106 rport 19454
a=candidate:Hc0a8006a 2 UDP 2130706430 192.168.0.106 19455 typ host
a=candidate:Hc0a87a01 2 UDP 2130706430 192.168.122.1 19455 typ host
a=candidate:S570e0fc6 2 UDP 1694498814 87.14.15.198 61628 typ srflx raddr 192.168.0.106 rport 19455
a=rtpmap:0 PCMU/8000
a=rtpmap:126 telephone-event/8000
a=fmtp:126 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

 +1ms
jssip-2.0.2.js:22521 JsSIP:RTCSession receiveInviteResponse() +7ms
jssip-2.0.2.js:22521 JsSIP:Dialog new UAC dialog created with status CONFIRMED +1ms
jssip-2.0.2.js:22521 JsSIP:RTCSession session accepted +4ms
jssip-2.0.2.js:22521 JsSIP:RTCSession sendRequest() +0ms
jssip-2.0.2.js:22521 JsSIP:RTCSession:Request new | ACK +1ms
jssip-2.0.2.js:22521 JsSIP:Transport send() +5ms
jssip-2.0.2.js:22521 JsSIP:Transport sending message:

ACK sip:192.168.0.105:52032;transport=wss SIP/2.0
Via: SIP/2.0/WSS nun0frjrrps6.invalid;branch=z9hG4bK6202021
Max-Forwards: 69
To: <sip:100@192.168.0.106>;tag=591ba68b-a443-4132-a67e-9dda16e79cc6
From: "User WebRTC 6001" <sip:6001@192.168.0.106>;tag=6tp1q63rq7
Call-ID: jkgivnj0nilbqg706fpn
CSeq: 867 ACK
Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO
Supported: outbound
User-Agent: JsSIP 2.0.2
Content-Length: 0


 +2ms
jssip-2.0.2.js:22521 JsSIP:WebSocketInterface send() +1ms
jssip-2.0.2.js:22521 JsSIP:RTCSession session confirmed +3ms
jssip-2.0.2.js:22521 JsSIP:InviteClientTransaction Timer B expired for transaction z9hG4bK1614579 +32s
jssip-2.0.2.js:22521 JsSIP:InviteClientTransaction Timer M expired for transaction z9hG4bK1614579 +145ms
jssip-2.0.2.js:22521 JsSIP:RTCSession runSessionTimer() | sending session refresh request +13s
jssip-2.0.2.js:22521 JsSIP:RTCSession sendUpdate() +17ms
jssip-2.0.2.js:22521 JsSIP:RTCSession:Request new | UPDATE +1ms
jssip-2.0.2.js:22521 JsSIP:Transport send() +3ms
jssip-2.0.2.js:22521 JsSIP:Transport sending message:

UPDATE sip:192.168.0.105:52032;transport=wss SIP/2.0
Via: SIP/2.0/WSS nun0frjrrps6.invalid;branch=z9hG4bK1093762
Max-Forwards: 69
To: <sip:100@192.168.0.106>;tag=591ba68b-a443-4132-a67e-9dda16e79cc6
From: "User WebRTC 6001" <sip:6001@192.168.0.106>;tag=6tp1q63rq7
Call-ID: jkgivnj0nilbqg706fpn
CSeq: 868 UPDATE
Contact: <sip:fn4qa5gb@nun0frjrrps6.invalid;transport=ws;ob>
Session-Expires: 90;refresher=uac
Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO
Supported: timer,ice,outbound
User-Agent: JsSIP 2.0.2
Content-Length: 0


 +0ms
jssip-2.0.2.js:22521 JsSIP:WebSocketInterface send() +1ms
jssip-2.0.2.js:22521 JsSIP:WebSocketInterface received WebSocket message +21ms
jssip-2.0.2.js:22521 JsSIP:Transport received text message:

SIP/2.0 200 OK
Via: SIP/2.0/WSS nun0frjrrps6.invalid;rport=52032;received=192.168.0.105;branch=z9hG4bK1093762
Call-ID: jkgivnj0nilbqg706fpn
From: "User WebRTC 6001" <sip:6001@192.168.0.106>;tag=6tp1q63rq7
To: <sip:100@192.168.0.106>;tag=591ba68b-a443-4132-a67e-9dda16e79cc6
CSeq: 868 UPDATE
Session-Expires: 90;refresher=uac
Require: timer
Contact: <sip:192.168.0.105:52032;transport=WSS>
Allow: OPTIONS, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REGISTER, REFER, MESSAGE
Supported: 100rel, timer, replaces, norefersub
Server: Asterisk PBX 13.10.0
Content-Length:  0


 +0ms
jssip-2.0.2.js:22521 JsSIP:RTCSession:Request onSuccessResponse +5ms

just to inform you:

  • 192.168.0.106 is asterisk ip
  • 192.168.0.105 is client jssip ip
  • 87.14.15.198 is my public ip

Cheers,