Still STUN server issue JsSIP-Kamailio-Asterisk

Hello all,

I had already issue with STUN server, which is still not resolved:

So now I’m trying connect web client and non-web client through Kamailio to Asterisk and back to Kamailio and finally to client (Asterisk handling media). I have little changed topology and issue is ongoing.

I tried to go some changes:
1, nat=no/nat=yes
2, [stun:null] in JsSIP client
3, another LAN/router

I’ve got an issue:

The turn server should not necessary, regarding previous topic.

Here’s some outputs:

; sip.conf
[general]
qualify=no
context=internal
allowguest=yes
allowoverlap=no
udpbindaddr=0.0.0.0:5060
tcpenable=yes
tcpbindaddr=0.0.0.0
transport=udp,tcp,ws,wss
srvlookup=yes
disallow=all
allow=ulaw,alaw
nat=no
bindaddr=0.0.0.0


[webrtc]
type=friend
fromdomain=webrtc.sk
context=internal
host=192.168.0.107  ; kamailio's IP
port=5060
transport=udp
trustrpid=yes
deny=0.0.0.0/0.0.0.0
permit=192.168.0.0/255.255.255.0
insecure=port,invite
encryption=yes
avpf=yes
icesupport=yes
videosupport=no

[softphone]
type=friend
fromdomain=softphone.sk
context=internal
host=192.168.0.107  ; kamailio's IP
port=5060
transport=udp
trustrpid=yes
deny=0.0.0.0/0.0.0.0
permit=192.168.0.0/255.255.255.0
insecure=port,invite
encryption=no
avpf=no
icesupport=no
videosupport=no

; extensions.conf
[internal]
exten => _3XX,1,Dial(SIP/softphone/${EXTEN})
exten => _2XX,1,Dial(SIP/webrtc/${EXTEN})

SIP debug:

debian*CLI> sip set debug on
SIP Debugging enabled

<--- SIP read from UDP:192.168.0.107:5060 --->
INVITE sip:300@192.168.0.107 SIP/2.0
Record-Route: <sip:192.168.0.107;r2=on;lr=on;ftag=644hglgse5;vsf=AAAAAEVVUjJFWnJZVFRKWlMAQls3>
Record-Route: <sip:192.168.0.107:8080;transport=ws;r2=on;lr=on;ftag=644hglgse5;vsf=AAAAAEVVUjJFWnJZVFRKWlMAQls3>
Via: SIP/2.0/UDP 192.168.0.107;branch=z9hG4bK4763.d7b7ddab2a818b9041b4cd80aeaa81f7.0
Via: SIP/2.0/WS ca0ach4mukq6.invalid;rport=52134;received=192.168.0.103;branch=z9hG4bK3812052
Max-Forwards: 16
To: <sip:300@192.168.0.107>
From: <sip:webrtc@webrtc.sk>;tag=644hglgse5
Call-ID: oegkth77as391tndea94
CSeq: 2776 INVITE
Contact: <sip:444gqtht@ca0ach4mukq6.invalid;alias=192.168.0.103~52134~5;transport=ws;ob>
Allow: ACK,CANCEL,BYE,OPTIONS,INVITE
Content-Type: application/sdp
Supported: path, outbound, gruu
User-Agent: JsSIP 0.3.0
Content-Length: 2154

v=0
o=- 5057366035517514009 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE audio
a=msid-semantic: WMS vXg8XhHmFuozZimbQsDneOaxhhBIlCPmcvzh
m=audio 63523 RTP/SAVPF 111 103 104 0 8 106 105 13 126
c=IN IP4 147.175.216.240
a=rtcp:63523 IN IP4 147.175.216.240
a=candidate:1560575937 1 udp 2122260223 169.254.65.8 63522 typ host generation 0
a=candidate:1560575937 2 udp 2122260223 169.254.65.8 63522 typ host generation 0
a=candidate:1840965416 1 udp 2122194687 192.168.0.103 63523 typ host generation 0
a=candidate:1840965416 2 udp 2122194687 192.168.0.103 63523 typ host generation 0
a=candidate:3975340444 1 udp 1685987071 147.175.216.240 63523 typ srflx raddr 192.168.0.103 rport 63523 generation 0
a=candidate:3975340444 2 udp 1685987071 147.175.216.240 63523 typ srflx raddr 192.168.0.103 rport 63523 generation 0
a=candidate:327648049 1 tcp 1518280447 169.254.65.8 0 typ host generation 0
a=candidate:327648049 2 tcp 1518280447 169.254.65.8 0 typ host generation 0
a=candidate:590945240 1 tcp 1518214911 192.168.0.103 0 typ host generation 0
a=candidate:590945240 2 tcp 1518214911 192.168.0.103 0 typ host generation 0
a=ice-ufrag:gcQWKl7c64RjqQ6T
a=ice-pwd:cNluD+zpWpj+pOpfltGfn5Ev
a=ice-options:google-ice
a=fingerprint:sha-256 EB:69:64:1E:F8:7A:E6:9B:4C:A5:FA:16:F1:2D:5C:66:A4:64:E5:39:68:DD:E2:E3:FF:F0:1C:C8:31:7E:62:84
a=setup:actpass
a=mid:audio
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=sendrecv
a=rtcp-mux
a=crypto:0 AES_CM_128_HMAC_SHA1_32 inline:pF0R/LKn4bOHrJn3GhDcuhrhObjgJf/DqxV3Nevb
a=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:1U1mClNTUr72BLx3q5wWLBZXsZDaN87/O1GKB/n+
a=rtpmap:111 opus/48000/2
a=fmtp:111 minptime=10
a=rtpmap:103 ISAC/16000
a=rtpmap:104 ISAC/32000
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:1080979580 cname:fxQEAR/s7Ga8zRSi
a=ssrc:1080979580 msid:vXg8XhHmFuozZimbQsDneOaxhhBIlCPmcvzh 5dc34352-89d1-4157-99f1-48e551a29caa
a=ssrc:1080979580 mslabel:vXg8XhHmFuozZimbQsDneOaxhhBIlCPmcvzh
a=ssrc:1080979580 label:5dc34352-89d1-4157-99f1-48e551a29caa
<------------->
--- (16 headers 45 lines) ---
Sending to 192.168.0.107:5060 (no NAT)
Sending to 192.168.0.107:5060 (no NAT)
Using INVITE request as basis request - oegkth77as391tndea94
Found peer 'webrtc' for 'webrtc' from 192.168.0.107:5060
  == Using SIP RTP CoS mark 5
Found RTP audio format 111
Found RTP audio format 103
Found RTP audio format 104
Found RTP audio format 0
Found RTP audio format 8
Found RTP audio format 106
Found RTP audio format 105
Found RTP audio format 13
Found RTP audio format 126
Found audio description format opus for ID 111
Found unknown media description format ISAC for ID 103
Found unknown media description format ISAC for ID 104
Found audio description format PCMU for ID 0
Found audio description format PCMA for ID 8
Found unknown media description format CN for ID 106
Found unknown media description format CN for ID 105
Found audio description format CN for ID 13
Found audio description format telephone-event for ID 126
Capabilities: us - (ulaw|alaw), peer - audio=(ulaw|alaw|opus)/video=(nothing)/text=(nothing), combined - (ulaw|alaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x3 (telephone-event|CN|), combined - 0x1 (telephone-event|)
Peer audio RTP is at port 147.175.216.240:63523
Looking for 300 in internal (domain 192.168.0.107)
list_route: route/path hop: <sip:192.168.0.107;r2=on;lr=on;ftag=644hglgse5;vsf=AAAAAEVVUjJFWnJZVFRKWlMAQls3>
list_route: route/path hop: <sip:192.168.0.107:8080;transport=ws;r2=on;lr=on;ftag=644hglgse5;vsf=AAAAAEVVUjJFWnJZVFRKWlMAQls3>

<--- Transmitting (no NAT) to 192.168.0.107:5060 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.0.107;branch=z9hG4bK4763.d7b7ddab2a818b9041b4cd80aeaa81f7.0;received=192.168.0.107
Via: SIP/2.0/WS ca0ach4mukq6.invalid;rport=52134;received=192.168.0.103;branch=z9hG4bK3812052
Record-Route: <sip:192.168.0.107;r2=on;lr=on;ftag=644hglgse5;vsf=AAAAAEVVUjJFWnJZVFRKWlMAQls3>
Record-Route: <sip:192.168.0.107:8080;transport=ws;r2=on;lr=on;ftag=644hglgse5;vsf=AAAAAEVVUjJFWnJZVFRKWlMAQls3>
From: <sip:webrtc@webrtc.sk>;tag=644hglgse5
To: <sip:300@192.168.0.107>
Call-ID: oegkth77as391tndea94
CSeq: 2776 INVITE
Server: Asterisk PBX 12.1.0-rc3
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Contact: <sip:300@192.168.0.109:5060>
Content-Length: 0


<------------>
    -- Executing [300@internal:1] Dial("SIP/webrtc-00000008", "SIP/softphone/300") in new stack
  == Using SIP RTP CoS mark 5
Audio is at 15644
Adding codec 100003 (ulaw) to SDP
Adding codec 100004 (alaw) to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (no NAT) to 192.168.0.107:5060:
INVITE sip:300@192.168.0.107:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.0.109:5060;branch=z9hG4bK44456fbf
Max-Forwards: 70
From: <sip:webrtc@softphone.sk>;tag=as78a8de15
To: <sip:300@192.168.0.107:5060>
Contact: <sip:webrtc@192.168.0.109:5060>
Call-ID: 5603d2bf4ffd69f915d472e773b27393@softphone.sk
CSeq: 102 INVITE
User-Agent: Asterisk PBX 12.1.0-rc3
Date: Wed, 07 May 2014 22:15:06 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 306

v=0
o=root 711849534 711849534 IN IP4 192.168.0.109
s=Asterisk PBX 12.1.0-rc3
c=IN IP4 192.168.0.109
t=0 0
m=audio 15644 RTP/AVP 0 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=maxptime:150
a=sendrecv

---
    -- Called SIP/softphone/300

<--- SIP read from UDP:192.168.0.107:5060 --->
SIP/2.0 100 trying -- your call is important to us
Via: SIP/2.0/UDP 192.168.0.109:5060;branch=z9hG4bK44456fbf
From: <sip:webrtc@softphone.sk>;tag=as78a8de15
To: <sip:300@192.168.0.107:5060>
Call-ID: 5603d2bf4ffd69f915d472e773b27393@softphone.sk
CSeq: 102 INVITE
Server: kamailio (4.1.2 (x86_64/linux))
Content-Length: 0

<------------->
--- (8 headers 0 lines) ---

<--- SIP read from UDP:192.168.0.107:5060 --->
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 192.168.0.109:5060;branch=z9hG4bK44456fbf
Record-Route: <sip:192.168.0.107;lr;ftag=as78a8de15>
Call-ID: 5603d2bf4ffd69f915d472e773b27393@softphone.sk
From: <sip:webrtc@softphone.sk>;tag=as78a8de15
To: <sip:300@192.168.0.107>;tag=9b3a53cdd44941be84666800bbf0c1ee
CSeq: 102 INVITE
Server: Blink 0.8.0 (Windows)
Contact: <sip:81372409@192.168.0.103:51830>
Allow: SUBSCRIBE, NOTIFY, PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, MESSAGE, REFER
Content-Length: 0

<------------->
--- (11 headers 0 lines) ---
list_route: route/path hop: <sip:192.168.0.107;lr;ftag=as78a8de15>
    -- SIP/softphone-00000009 is ringing

<--- Transmitting (no NAT) to 192.168.0.107:5060 --->
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 192.168.0.107;branch=z9hG4bK4763.d7b7ddab2a818b9041b4cd80aeaa81f7.0;received=192.168.0.107
Via: SIP/2.0/WS ca0ach4mukq6.invalid;rport=52134;received=192.168.0.103;branch=z9hG4bK3812052
Record-Route: <sip:192.168.0.107;r2=on;lr=on;ftag=644hglgse5;vsf=AAAAAEVVUjJFWnJZVFRKWlMAQls3>
Record-Route: <sip:192.168.0.107:8080;transport=ws;r2=on;lr=on;ftag=644hglgse5;vsf=AAAAAEVVUjJFWnJZVFRKWlMAQls3>
From: <sip:webrtc@webrtc.sk>;tag=644hglgse5
To: <sip:300@192.168.0.107>;tag=as46b25851
Call-ID: oegkth77as391tndea94
CSeq: 2776 INVITE
Server: Asterisk PBX 12.1.0-rc3
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Contact: <sip:300@192.168.0.109:5060>
Content-Length: 0


<------------>
[May  8 00:15:06] ERROR[3868]: pjsip:0 <?>: 	icess0x1d055d8 ..Error sending STUN request: Invalid argument

<--- SIP read from UDP:192.168.0.107:5060 --->
SIP/2.0 603 Decline
Via: SIP/2.0/UDP 192.168.0.109:5060;branch=z9hG4bK44456fbf
Record-Route: <sip:192.168.0.107;lr;ftag=as78a8de15>
Call-ID: 5603d2bf4ffd69f915d472e773b27393@softphone.sk
From: <sip:webrtc@softphone.sk>;tag=as78a8de15
To: <sip:300@192.168.0.107>;tag=9b3a53cdd44941be84666800bbf0c1ee
CSeq: 102 INVITE
Server: Blink 0.8.0 (Windows)
Allow: SUBSCRIBE, NOTIFY, PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, MESSAGE, REFER
Content-Length: 0

<------------->
--- (10 headers 0 lines) ---
    -- Got SIP response 603 "Decline" back from 192.168.0.107:5060
set_destination: Parsing <sip:192.168.0.107;lr;ftag=as78a8de15> for address/port to send to
set_destination: set destination to 192.168.0.107:5060
Transmitting (no NAT) to 192.168.0.107:5060:
ACK sip:81372409@192.168.0.103:51830 SIP/2.0
Via: SIP/2.0/UDP 192.168.0.109:5060;branch=z9hG4bK44456fbf
Route: <sip:192.168.0.107;lr;ftag=as78a8de15>
Max-Forwards: 70
From: <sip:webrtc@softphone.sk>;tag=as78a8de15
To: <sip:300@192.168.0.107:5060>;tag=9b3a53cdd44941be84666800bbf0c1ee
Contact: <sip:webrtc@192.168.0.109:5060>
Call-ID: 5603d2bf4ffd69f915d472e773b27393@softphone.sk
CSeq: 102 ACK
User-Agent: Asterisk PBX 12.1.0-rc3
Content-Length: 0


---
    -- SIP/softphone-00000009 is busy
  == Everyone is busy/congested at this time (1:1/0/0)
    -- Auto fallthrough, channel 'SIP/webrtc-00000008' status is 'BUSY'

<--- Reliably Transmitting (no NAT) to 192.168.0.107:5060 --->
SIP/2.0 486 Busy Here
Via: SIP/2.0/UDP 192.168.0.107;branch=z9hG4bK4763.d7b7ddab2a818b9041b4cd80aeaa81f7.0;received=192.168.0.107
Via: SIP/2.0/WS ca0ach4mukq6.invalid;rport=52134;received=192.168.0.103;branch=z9hG4bK3812052
From: <sip:webrtc@webrtc.sk>;tag=644hglgse5
To: <sip:300@192.168.0.107>;tag=as46b25851
Call-ID: oegkth77as391tndea94
CSeq: 2776 INVITE
Server: Asterisk PBX 12.1.0-rc3
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
X-Asterisk-HangupCause: Call Rejected
X-Asterisk-HangupCauseCode: 21
Content-Length: 0


<------------>
Really destroying SIP dialog '5603d2bf4ffd69f915d472e773b27393@softphone.sk' Method: INVITE

<--- SIP read from UDP:192.168.0.107:5060 --->
ACK sip:300@192.168.0.107 SIP/2.0
Via: SIP/2.0/UDP 192.168.0.107;branch=z9hG4bK4763.d7b7ddab2a818b9041b4cd80aeaa81f7.0
Max-Forwards: 16
To: <sip:300@192.168.0.107>;tag=as46b25851
From: <sip:webrtc@webrtc.sk>;tag=644hglgse5
Call-ID: oegkth77as391tndea94
CSeq: 2776 ACK
Content-Length: 0

<------------->
--- (8 headers 0 lines) ---
Really destroying SIP dialog 'oegkth77as391tndea94' Method: ACK
debian*CLI> 

JsSIP client configuration:

var configuration ={
                'ws_servers': 'ws://192.168.0.107:8080',
                'uri': 'sip:200@192.168.0.107',
                'password': '200',
                'register': true,
                'authorization_user': '200',
                'trace_sip': true,
                'stun_servers': ['stun:stun.l.google.com:19302']
            };

If you find out something please let me know.

Thanks for help!

Patrik