Incoming VoIP calls drop after 20 seconds - Asterisk

VOIP setup and troubleshooting
Post Reply
maestro
Posts: 85
Joined: Sat Jan 24, 2009 5:40 pm
Location: In front of my PC

Incoming VoIP calls drop after 20 seconds - Asterisk

Post by maestro » Tue Sep 14, 2010 9:07 pm

I have been using Exetel VoIP with Asterisk for over 12 months, but just recently all incoming calls have been dropping after 20 seconds(errors listed at bottom of post).

This started happening after a recent blackout, although I cannot pick anything that would have changed. I have double-checked the ports Asterisk is configured for SIP and RTP and they are appropriately port-forwarded in the modem.

Internal calls work fine. Calls out through Exetel work fine, only incoming calls from Exetel are giving this problem.

A packet capture shows RTP packets in both directions with the occasional SIP and RTCP packet, then after a while my end rejects incoming RTP packets with "ICMP - Port unreachable", then Exetel continues to send RTP packets for a while while I send nothing back.

I have noticed that one of the SIP packets from Exetel includes "sip:1.2.3.4:1024" (where 1.2.3.4 is my IP address). According to Wireshark this is referring to port 1024, which is not forwarded on my modem (and was never forwarded, even for the long period that VoIP worked). Is this a problem? If so, how do I make it use the configured ports in sip.conf and rtp.conf?

--- Errors from Asterisk console.

[Sep 14 20:30:58] WARNING[4909]: chan_sip.c:2794 retrans_pkt: Maximum retries exceeded on transmission call-F1AEC1FF-69A2-2D10-020F-9EB27@58.96.1.1 for seqno 1 (Critical Response) -- See doc/sip-retransmit.txt.
[Sep 14 20:30:58] WARNING[4909]: chan_sip.c:2821 retrans_pkt: Hanging up call call-F1AEC1FF-69A2-2D10-020F-9EB27@58.96.1.1 - no reply to our critical packet (see doc/sip-retransmit.txt).

pasanm

Re: Incoming VoIP calls drop after 20 seconds - Asterisk

Post by pasanm » Fri Sep 17, 2010 2:30 pm

maestro wrote:I have been using Exetel VoIP with Asterisk for over 12 months, but just recently all incoming calls have been dropping after 20 seconds(errors listed at bottom of post).

This started happening after a recent blackout, although I cannot pick anything that would have changed. I have double-checked the ports Asterisk is configured for SIP and RTP and they are appropriately port-forwarded in the modem.

Internal calls work fine. Calls out through Exetel work fine, only incoming calls from Exetel are giving this problem.

A packet capture shows RTP packets in both directions with the occasional SIP and RTCP packet, then after a while my end rejects incoming RTP packets with "ICMP - Port unreachable", then Exetel continues to send RTP packets for a while while I send nothing back.

I have noticed that one of the SIP packets from Exetel includes "sip:1.2.3.4:1024" (where 1.2.3.4 is my IP address). According to Wireshark this is referring to port 1024, which is not forwarded on my modem (and was never forwarded, even for the long period that VoIP worked). Is this a problem? If so, how do I make it use the configured ports in sip.conf and rtp.conf?

--- Errors from Asterisk console.

[Sep 14 20:30:58] WARNING[4909]: chan_sip.c:2794 retrans_pkt: Maximum retries exceeded on transmission call-F1AEC1FF-69A2-2D10-020F-9EB27@58.96.1.1 for seqno 1 (Critical Response) -- See doc/sip-retransmit.txt.
[Sep 14 20:30:58] WARNING[4909]: chan_sip.c:2821 retrans_pkt: Hanging up call call-F1AEC1FF-69A2-2D10-020F-9EB27@58.96.1.1 - no reply to our critical packet (see doc/sip-retransmit.txt).

HI maestro

what port range have you define in rtp.conf ?
Is it 10000-20000 ?
this is default value define in rtp.conf

You also have to allow incoming UDP trafffic define in this range on your router/modem firewall.
normally OUT going traffic allowed by default in any firewall unless you specifically block.

asterisk pickups RTP ports on fly on the given range. It won't use the same port for all calls, It will be going in a incremental manner therefore you have to allow a PORT range in your firewall device.

maestro
Posts: 85
Joined: Sat Jan 24, 2009 5:40 pm
Location: In front of my PC

Re: Incoming VoIP calls drop after 20 seconds - Asterisk

Post by maestro » Sun Sep 19, 2010 7:46 pm

Thank you for your response, the answers to your questions are below.
pasanm wrote: what port range have you define in rtp.conf ?
Is it 10000-20000 ?
this is default value define in rtp.conf
From my rtp.conf...
rtpstart=16384
rtpend=16482

From my sip.conf
bindport=5060
pasanm wrote: You also have to allow incoming UDP trafffic define in this range on your router/modem firewall.
normally OUT going traffic allowed by default in any firewall unless you specifically block.
From my modem's "port forwarding" setup page...
Protocol Port Start Port End Port Map
TCP,UDP 5060 5061 5060
TCP,UDP 16384 16482 16384
pasanm wrote: asterisk pickups RTP ports on fly on the given range. It won't use the same port for all calls, It will be going in a incremental manner therefore you have to allow a PORT range in your firewall device.
OK, I have the SIP and RTP ports forwarded, is there anything I missed? (is there another config file that it could be getting this port 1024 from?)

pasanm

Re: Incoming VoIP calls drop after 20 seconds - Asterisk

Post by pasanm » Mon Sep 20, 2010 2:02 pm

maestro wrote:Thank you for your response, the answers to your questions are below.
pasanm wrote: what port range have you define in rtp.conf ?
Is it 10000-20000 ?
this is default value define in rtp.conf
From my rtp.conf...
rtpstart=16384
rtpend=16482

From my sip.conf
bindport=5060
pasanm wrote: You also have to allow incoming UDP trafffic define in this range on your router/modem firewall.
normally OUT going traffic allowed by default in any firewall unless you specifically block.
From my modem's "port forwarding" setup page...
Protocol Port Start Port End Port Map
TCP,UDP 5060 5061 5060
TCP,UDP 16384 16482 16384
pasanm wrote: asterisk pickups RTP ports on fly on the given range. It won't use the same port for all calls, It will be going in a incremental manner therefore you have to allow a PORT range in your firewall device.
OK, I have the SIP and RTP ports forwarded, is there anything I missed? (is there another config file that it could be getting this port 1024 from?)
Hey maestro,

I'm not sure what this 1024 port came from it could be your end point port ( IP Phone) that attached to asterisk . I can't clearly state that as I'm not fully aware of your setup . Just for testing allow the whole UDP range from the firewall and see whether it resolve the problem. If you have set canreinvite=yes or directrtpsetup=yes (in sip.conf) asterisk will try to direct RTP streams directly between our switch and your end IP Phone.


You might need to do some logging and later on allow the specific UDP range from firewall.

maestro
Posts: 85
Joined: Sat Jan 24, 2009 5:40 pm
Location: In front of my PC

Re: Incoming VoIP calls drop after 20 seconds - Asterisk

Post by maestro » Tue Sep 21, 2010 8:04 pm

pasanm wrote:If you have set canreinvite=yes or directrtpsetup=yes (in sip.conf) asterisk will try to direct RTP streams directly between our switch and your end IP Phone.
OK, I didn't have "canreinvite" set at all for the Exetel connection in sip.conf. I have now added "canreinvite=no" and have made a successful call.

I have checked my backed up config files and none of them had specified "canreinvite=no" so I am absolutely stumped as to why it suddenly stopped working after going for so long without issue.

Thank you for your help. I sure hope that I won't need to ask anything else about this.


Thanks again.

Post Reply