Extension Disconnect after 30s

Hello once again, so my inbound or outbound calls disconnect within 30s with this RTP Notice pasted below, any help?

– SIP/701-00000069 is ringing
> 0x7fe42c01c3c0 – Strict RTP learning after remote address set to: 192.168.1.143:8000
– SIP/701-00000069 answered SIP/705-00000068
– Channel SIP/701-00000069 joined ‘simple_bridge’ basic-bridge <402022e9-9536-40e2-9e4b-0313c63a6039>
– Channel SIP/705-00000068 joined ‘simple_bridge’ basic-bridge <402022e9-9536-40e2-9e4b-0313c63a6039>
[2022-01-21 18:19:46] NOTICE[155460]: chan_sip.c:29971 check_rtp_timeout: Disconnecting call ‘SIP/705-00000068’ for lack of RTP activity in 31 seconds
[2022-01-21 18:19:46] NOTICE[155460]: chan_sip.c:29971 check_rtp_timeout: Disconnecting call ‘SIP/701-00000069’ for lack of RTP activity in 31 seconds
– Channel SIP/705-00000068 left ‘simple_bridge’ basic-bridge <402022e9-9536-40e2-9e4b-0313c63a6039>
– Channel SIP/701-00000069 left ‘simple_bridge’ basic-bridge <402022e9-9536-40e2-9e4b-0313c63a6039>
== Spawn extension (from-internal, 701, 3) exited non-zero on ‘SIP/705-00000068’
– Executing [h@from-internal:1] Macro(“SIP/705-00000068”, “hangupcall”) in new stack
– Executing [s@macro-hangupcall:1] GotoIf(“SIP/705-00000068”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,3)
– Executing [s@macro-hangupcall:3] ExecIf(“SIP/705-00000068”, “0?Set(CDR(recordingfile)=)”) in new stack
– Executing [s@macro-hangupcall:4] NoOp(“SIP/705-00000068”, "SIP/701-00000069 montior file= ") in new stack
– Executing [s@macro-hangupcall:5] GotoIf(“SIP/705-00000068”, “1?skipagi”) in new stack
– Goto (macro-hangupcall,s,7)
– Executing [s@macro-hangupcall:7] Hangup(“SIP/705-00000068”, “”) in new stack
== Spawn extension (macro-hangupcall, s, 7) exited non-zero on ‘SIP/705-00000068’ in macro ‘hangupcall’
== Spawn extension (from-internal, h, 1) exited non-zero on ‘SIP/705-00000068’

You need to look at the “sip set debug on” logging to see where the SDP is telling the other party to send the RTP (c= line), and to which port (m= line) and confirm that your router is forwarding that port.

However note that chan_sip is scheduled for removal in the 2023 version of Asterisk, and has no active maintainer.

@david55 Thanks for your quick response and heads up on chan_sip,
so after turning on sip debug this is what i have:
Audio is at 14854
Adding codec ulaw to SDP
Adding codec alaw to SDP
Adding codec gsm to SDP
Adding codec g726 to SDP
Adding codec g722 to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (NAT) to 192.168.1.143:53297:
INVITE sip:[email protected]:32520;rinstance=12c89eeeff844ec5;transport=tcp SIP/2.0
Via: SIP/2.0/TCP 192.168.1.240:5160;branch=z9hG4bK1f57cdaf;rport
Max-Forwards: 70
From: “John Doe” sip:[email protected]:5160;tag=as0628aade
To: sip:[email protected]:32520;rinstance=12c89eeeff844ec5;transport=tcp
Contact: sip:[email protected]:5160;transport=tcp
Call-ID: [email protected]:5160
CSeq: 102 INVITE
User-Agent: FPBX-15.0.17.67(16.20.0)
Date: Fri, 21 Jan 2022 15:37:40 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
P-Asserted-Identity: “John Doe” sip:[email protected]
Content-Type: application/sdp
Content-Length: 354

v=0
o=root 839575431 839575431 IN IP4 192.168.1.240
s=Asterisk PBX 16.20.0
c=IN IP4 192.168.1.240
t=0 0
m=audio 14854 RTP/AVP 0 8 3 111 9 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:111 G726-32/8000
a=rtpmap:9 G722/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

There is no good reason on the Asterisk side for not receiving RTP. Are you sure nothing is blocking port 14854/UDP?

We have a firewall running and it could be blocking, I will have to talk to our networks guy next week, a quick question though, is port 14854 set to be used all the time or is it random? I am asking this because i noticed while setting up soft phones, i thought they would be always be using 5060/5061 but when i do sip show peers i see they are using some random ports, so to solve this if i ask the network admin to allow port 14854 will it be the one used all the time?

There is a range that can be configured. I believe FreePBX defaults to 10000 to 20000.

Thanks I will use that.

https://wiki.freepbx.org/display/PPS/Ports+used+on+your+PBX

@david55 & @comtech So the networks guy allowed the 10-20000 ports range, but still my calls disconnect after 30s with the same “lack of RTP activity in 31 seconds”.

@david55 I get the same even with pjsip extensions as you can see below:
– Called PJSIP/202/sip:[email protected]:57465;transport=TCP;rinstance=1388e0496bc9efcb
== Using SIP RTP Audio TOS bits 184
== Using SIP RTP Audio TOS bits 184 in TCLASS field.
== Using SIP RTP Audio CoS mark 5
– PJSIP/202-00000003 is ringing
> 0x7f416402f010 – Strict RTP learning after remote address set to: 192.168.1.143:8000
– PJSIP/202-00000003 answered PJSIP/201-00000002
> 0x7f4164040d00 – Strict RTP learning after remote address set to: 192.168.1.149:8000
– Channel PJSIP/202-00000003 joined ‘simple_bridge’ basic-bridge
– Channel PJSIP/201-00000002 joined ‘simple_bridge’ basic-bridge
[2022-01-24 18:04:39] WARNING[83699]: res_pjsip_pubsub.c:3353 pubsub_on_rx_publish_request: No registered publish handler for event presence from 202
[2022-01-24 18:04:39] WARNING[83699]: res_pjsip_pubsub.c:787 subscription_get_handler_from_rdata: No registered subscribe handler for event presence.winfo from 202
[2022-01-24 18:04:39] WARNING[83699]: res_pjsip_pubsub.c:3353 pubsub_on_rx_publish_request: No registered publish handler for event presence from 201
[2022-01-24 18:04:39] WARNING[83699]: res_pjsip_pubsub.c:787 subscription_get_handler_from_rdata: No registered subscribe handler for event presence.winfo from 201
[2022-01-24 18:04:39] WARNING[83699]: res_pjsip_pubsub.c:3353 pubsub_on_rx_publish_request: No registered publish handler for event presence from 202
[2022-01-24 18:04:39] WARNING[83699]: res_pjsip_pubsub.c:787 subscription_get_handler_from_rdata: No registered subscribe handler for event presence.winfo from 202
[2022-01-24 18:05:03] WARNING[83699]: res_pjsip_pubsub.c:3353 pubsub_on_rx_publish_request: No registered publish handler for event presence from 202
[2022-01-24 18:05:03] WARNING[83699]: res_pjsip_pubsub.c:787 subscription_get_handler_from_rdata: No registered subscribe handler for event presence.winfo from 202
[2022-01-24 18:05:09] NOTICE[62031]: res_pjsip_sdp_rtp.c:149 rtp_check_timeout: Disconnecting channel ‘PJSIP/202-00000003’ for lack of audio RTP activity in 39 seco nds
– Channel PJSIP/202-00000003 left ‘simple_bridge’ basic-bridge
– Channel PJSIP/201-00000002 left ‘simple_bridge’ basic-bridge
== Spawn extension (macro-dial-one, s, 56) exited non-zero on ‘PJSIP/201-00000002’ in macro ‘dial-one’
== Spawn extension (macro-exten-vm, s, 30) exited non-zero on ‘PJSIP/201-00000002’ in macro ‘exten-vm’
== Spawn extension (ext-local, 202, 3) exited non-zero on ‘PJSIP/201-00000002’
– Executing [h@ext-local:1] Macro(“PJSIP/201-00000002”, “hangupcall,”) in new stack
– Executing [s@macro-hangupcall:1] GotoIf(“PJSIP/201-00000002”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,3)
– Executing [s@macro-hangupcall:3] ExecIf(“PJSIP/201-00000002”, “0?Set(CDR(recordingfile)=)”) in new stack
– Executing [s@macro-hangupcall:4] NoOp(“PJSIP/201-00000002”, "PJSIP/202-00000003 montior file= ") in new stack
[2022-01-24 18:05:09] NOTICE[62031]: res_pjsip_sdp_rtp.c:149 rtp_check_timeout: Disconnecting channel ‘PJSIP/201-00000002’ for lack of audio RTP activity in 39 seco nds
– Executing [s@macro-hangupcall:5] GotoIf(“PJSIP/201-00000002”, “1?skipagi”) in new stack
– Goto (macro-hangupcall,s,7)
– Executing [s@macro-hangupcall:7] Hangup(“PJSIP/201-00000002”, “”) in new stack
== Spawn extension (macro-hangupcall, s, 7) exited non-zero on ‘PJSIP/201-00000002’ in macro ‘hangupcall’
== Spawn extension (ext-local, h, 1) exited non-zero on ‘PJSIP/201-00000002’
[2022-01-24 18:05:09] WARNING[83699]: res_pjsip_pubsub.c:787 subscription_get_handler_from_rdata: No registered subscribe handler for event presence.winfo from 202
[2022-01-24 18:05:09] WARNING[83699]: res_pjsip_pubsub.c:3353 pubsub_on_rx_publish_request: No registered publish handler for event presence from 202
[2022-01-24 18:05:09] WARNING[83699]: res_pjsip_pubsub.c:3353 pubsub_on_rx_publish_request: No registered publish handler for event presence from 201
[2022-01-24 18:05:09] WARNING[83699]: res_pjsip_pubsub.c:787 subscription_get_handler_from_rdata: No registered subscribe handler for event presence.winfo from 201

did you check your firewall for UDP timeout setting?

I notice that you are using TCP for a transport, not a problem but not the default, but further you have

0x7f4164040d00 – Strict RTP learning after remote address set to: 192.168.1.149:8000

which would seem that somehow you are forcing the media port to 8000 which is not covered by your forwarding rules, perhaps a typo or conflation with your rtp codec mapping somewhere ?

Maybe start with a bog-standard UDP extension . . .

The problem description seems strange. Please confirm that calls lasting less than 30 seconds have normal audio in both directions and there is no apparent trouble. If not, what is the first thing that goes wrong, e.g. “no incoming audio” or “no audio in either direction”.

Also, what is the simplest failing case? Are calls between extensions ok? Calls to *43 (echo test)?

@dicko when i change transport to UDP in my softphone it fails to register at all, so that’s why i am using TCP. @ashcortech I believe the 30s timeout its using is in SIP Settings RTP Timeout.
@Stewart1 there is no audio at all.

Happy to report that it worked, @david55 and the rest who suggested blocking of the port by firewall were right, apparently UDP packets were being blocked, now I am able to register my extensions using UDP as transport and my calls are not dropping after 30s. Thanks everyone who help on this.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.