Webrtc with asterisk behind NAT

Hi
I’m using webrtc to register extension on asterisk 14 running behind NAT, external_ip localnet and other need settings are done. But call drops after few hours with hangupcause code 44. I checked settings on asterisk, I also run stun and turn server behind NAT. Anyone can help?

You’d need to provide the console output and “pjsip set logger on” output to show exactly who and what is hanging up the call.

Now it’s change to cause 16, this is the output, i’m not using pjsip but chan_sip for webrtc client.

<------------>
[2017-11-08 17:39:03] VERBOSE[29072] chan_sip.c: Scheduling destruction of SIP dialog ‘e06kojq6u9qa10bv66uj2o’ in 32000 ms (Method: REGISTER)
[2017-11-08 17:39:19] VERBOSE[24738] chan_sip.c: Really destroying SIP dialog ‘3mv3uh5lkgoibj0uhsul7h’ Method: REGISTER
[2017-11-08 17:39:19] VERBOSE[24198] chan_sip.c:
<— SIP read from WS:114.236.90.213:54774 —>
BYE sip:6019@218.4.144.4:0;transport=ws SIP/2.0
Via: SIP/2.0/WSS s5pa2pn3ni79.invalid;branch=z9hG4bK5106063
Max-Forwards: 69
To: sip:6019@218.4.144.4:0;tag=as5bc78167
From: “6001” sip:08133b3e@s5pa2pn3ni79.invalid;transport=ws;tag=csd7vtn0qi
Call-ID: 6c6d7b9a00a5e99e14c3a2ba4fccc21a@218.4.144.4:0
CSeq: 1494 BYE
Reason: SIP ;cause=408; text="RTP Timeout"
Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO
Supported: outbound
User-Agent: JsSIP 3.0.15
Content-Length: 0

<------------->
[2017-11-08 17:39:19] VERBOSE[24198] chan_sip.c: — (12 headers 0 lines) —
[2017-11-08 17:39:19] VERBOSE[24198][C-0000005c] chan_sip.c: Scheduling destruction of SIP dialog ‘6c6d7b9a00a5e99e14c3a2ba4fccc21a@218.4.144.4:0’ in 32000 ms (Method: BYE)
[2017-11-08 17:39:19] VERBOSE[24198][C-0000005c] chan_sip.c:
<— Transmitting (no NAT) to 114.236.90.213:5060 —>
SIP/2.0 200 OK
Via: SIP/2.0/WSS s5pa2pn3ni79.invalid;branch=z9hG4bK5106063;received=114.236.90.213
From: “6001” sip:08133b3e@s5pa2pn3ni79.invalid;transport=ws;tag=csd7vtn0qi
To: sip:6019@218.4.144.4:0;tag=as5bc78167
Call-ID: 6c6d7b9a00a5e99e14c3a2ba4fccc21a@218.4.144.4:0
CSeq: 1494 BYE
Server: FPBX-14.0.1.1(14.5.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0

<------------>
[2017-11-08 17:39:19] VERBOSE[24295][C-0000005c] bridge_channel.c: Channel SIP/6001-000000ab left ‘simple_bridge’ basic-bridge
[2017-11-08 17:39:19] VERBOSE[24294][C-0000005c] bridge_channel.c: Channel SIP/6019-000000aa left ‘simple_bridge’ basic-bridge
[2017-11-08 17:39:19] VERBOSE[24294][C-0000005c] app_macro.c: Spawn extension (macro-dial-one, s, 53) exited non-zero on ‘SIP/6019-000000aa’ in macro ‘dial-one’
[2017-11-08 17:39:19] VERBOSE[24294][C-0000005c] app_macro.c: Spawn extension (macro-exten-vm, s, 20) exited non-zero on ‘SIP/6019-000000aa’ in macro ‘exten-vm’
[2017-11-08 17:39:19] VERBOSE[24294][C-0000005c] pbx.c: Spawn extension (from-internal, 6001, 2) exited non-zero on ‘SIP/6019-000000aa’
[2017-11-08 17:39:19] VERBOSE[24294][C-0000005c] pbx.c: Executing [h@from-internal:1] Macro(“SIP/6019-000000aa”, “hangupcall”) in new stack
[2017-11-08 17:39:19] VERBOSE[24294][C-0000005c] pbx.c: Executing [s@macro-hangupcall:1] GotoIf(“SIP/6019-000000aa”, “1?theend”) in new stack
[2017-11-08 17:39:19] VERBOSE[24294][C-0000005c] pbx_builtins.c: Goto (macro-hangupcall,s,3)
[2017-11-08 17:39:19] VERBOSE[24294][C-0000005c] pbx.c: Executing [s@macro-hangupcall:3] ExecIf(“SIP/6019-000000aa”, “0?Set(CDR(recordingfile)=)”) in new stack
[2017-11-08 17:39:19] VERBOSE[24294][C-0000005c] pbx.c: Executing [s@macro-hangupcall:4] Hangup(“SIP/6019-000000aa”, “”) in new stack
[2017-11-08 17:39:19] VERBOSE[24294][C-0000005c] app_macro.c: Spawn extension (macro-hangupcall, s, 4) exited non-zero on ‘SIP/6019-000000aa’ in macro ‘hangupcall’
[2017-11-08 17:39:19] VERBOSE[24294][C-0000005c] pbx.c: Spawn extension (from-internal, h, 1) exited non-zero on ‘SIP/6019-000000aa’
[2017-11-08 17:39:19] VERBOSE[24294][C-0000005c] chan_sip.c: Scheduling destruction of SIP dialog ‘733blf5lngrbj3sgvv43’ in 32000 ms (Method: ACK)
[2017-11-08 17:39:19] VERBOSE[24294][C-0000005c] chan_sip.c: Reliably Transmitting (NAT) to 192.9.200.158:33870:
BYE sip:c1psti7o@ijiju8opt50n.invalid;transport=ws;ob SIP/2.0
Via: SIP/2.0/WS 192.168.60.128:5160;branch=z9hG4bK54bd01fa;rport
Max-Forwards: 70
From: sip:6001@192.168.60.128;tag=as4b606b0e
To: “6019” sip:6019@192.168.60.128;tag=lbohf3vbeb
Call-ID: 733blf5lngrbj3sgvv43
CSeq: 102 BYE
User-Agent: FPBX-14.0.1.1(14.5.0)
X-Asterisk-HangupCause: Normal Clearing
X-Asterisk-HangupCauseCode: 16
Content-Length: 0


[2017-11-08 17:39:19] VERBOSE[29072] chan_sip.c:
<— SIP read from WS:192.9.200.158:33870 —>
SIP/2.0 200 OK
Via: SIP/2.0/WS 192.168.60.128:5160;branch=z9hG4bK54bd01fa;rport
To: “6019” sip:6019@192.168.60.128;tag=lbohf3vbeb
From: sip:6001@192.168.60.128;tag=as4b606b0e
Call-ID: 733blf5lngrbj3sgvv43
CSeq: 102 BYE
Supported: outbound
Content-Length: 0

<------------->
[2017-11-08 17:39:19] VERBOSE[29072] chan_sip.c: — (8 headers 0 lines) —
[2017-11-08 17:39:19] VERBOSE[29072][C-0000005c] chan_sip.c: SIP Response message for INCOMING dialog BYE arrived
[2017-11-08 17:39:20] VERBOSE[24738] chan_sip.c: Really destroying SIP dialog ‘733blf5lngrbj3sgvv43’ Method: ACK
[2017-11-08 17:39:27] VERBOSE[2063] chan_sip.c:
<— SIP read from WS:192.9.200.224:61292 —>
REGISTER sip:192.168.60.128 SIP/2.0
Via: SIP/2.0/WSS j2o2c8176qjs.invalid;branch=z9hG4bK1049798
Max-Forwards: 69
To: sip:6014@192.168.60.128
From: “6014” sip:6014@192.168.60.128;tag=hufpb2pebk
Call-ID: lgfk3tfcoh01k49runor8s
CSeq: 633 REGISTER
Contact: sip:gcv73i18@j2o2c8176qjs.invalid;transport=ws;+sip.ice;reg-id=1;+sip.instance=“urn:uuid:127b6fed-2075-4dfe-855b-21418330a3aa”;expires=600
Expires: 600
Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO
Supported: path,gruu,outbound
User-Agent: JsSIP 3.0.15
Content-Length: 0

<------------->
[2017-11-08 17:39:27] VERBOSE[2063] chan_sip.c: — (13 headers 0 lines) —
[2017-11-08 17:39:27] VERBOSE[2063] chan_sip.c:
<— Transmitting (no NAT) to 192.9.200.224:5060 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/WSS j2o2c8176qjs.invalid;branch=z9hG4bK1049798;received=192.9.200.224
From: “6014” sip:6014@192.168.60.128;tag=hufpb2pebk
To: sip:6014@192.168.60.128;tag=as65d5cd62
Call-ID: lgfk3tfcoh01k49runor8s
CSeq: 633 REGISTER
Server: FPBX-14.0.1.1(14.5.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm=“asterisk”, nonce="78c1d46b"
Content-Length: 0