Call drops after 20 seconds

I have had this problem before, and I did a reinstall of system. I checked that the firewall was opened up and I checked that the externip and the localnet in the sip config files.

I get this in the logs:
[2009-12-17 22:13:24] VERBOSE[3727] logger.c: – SIP/702-093eaa48 is circuit-busy
[2009-12-17 22:13:24] VERBOSE[3727] logger.c: – SIP/701-093e6ad0 is ringing
[2009-12-17 22:13:26] VERBOSE[3727] logger.c: – SIP/701-093e6ad0 answered SIP/5725926e1-b7760bc0
[2009-12-17 22:13:26] VERBOSE[3727] logger.c: – Executing [s@macro-auto-blkvm:1] Set(“SIP/701-093e6ad0”, “__MACRO_RESULT=”) in new stack
[2009-12-17 22:13:26] DEBUG[3727] app_macro.c: Executed application: Set
[2009-12-17 22:13:26] VERBOSE[3727] logger.c: – Executing [s@macro-auto-blkvm:2] DBdel(“SIP/701-093e6ad0”, “BLKVM/700/SIP/5725926e1-b7760bc0”) in new stack
[2009-12-17 22:13:26] VERBOSE[3727] logger.c: – DBdel: family=BLKVM, key=700/SIP/5725926e1-b7760bc0
[2009-12-17 22:13:26] DEBUG[3727] app_macro.c: Executed application: dbDel
[2009-12-17 22:13:26] DEBUG[3727] app_dial.c: Macro exited with status 0
[2009-12-17 22:13:46] WARNING[3120] chan_sip.c: Maximum retries exceeded on transmission [email protected] for seqno 103 (Critical Response)
[2009-12-17 22:13:46] WARNING[3120] chan_sip.c: Hanging up call [email protected] - no reply to our critical packet.
[2009-12-17 22:13:46] VERBOSE[3727] logger.c: == Spawn extension (macro-dial, s, 7) exited non-zero on ‘SIP/5725926e1-b7760bc0’ in macro ‘dial’
[2009-12-17 22:13:46] VERBOSE[3727] logger.c: == Spawn extension (macro-dial, s, 7) exited non-zero on ‘SIP/5725926e1-b7760bc0’
[2009-12-17 22:13:46] VERBOSE[3727] logger.c: – Executing [h@macro-dial:1] Macro(“SIP/5725926e1-b7760bc0”, “hangupcall”) in new stack
[2009-12-17 22:13:46] VERBOSE[3727] logger.c: – Executing [s@macro-hangupcall:1] ResetCDR(“SIP/5725926e1-b7760bc0”, “vw”) in new stack
[2009-12-17 22:13:46] DEBUG[3727] app_macro.c: Executed application: ResetCDR
[2009-12-17 22:13:46] VERBOSE[3727] logger.c: – Executing [s@macro-hangupcall:2] NoCDR(“SIP/5725926e1-b7760bc0”, “”) in new stack
[2009-12-17 22:13:46] DEBUG[3727] app_macro.c: Executed application: NoCDR
[2009-12-17 22:13:46] VERBOSE[3727] logger.c: – Executing [s@macro-hangupcall:3] GotoIf(“SIP/5725926e1-b7760bc0”, “1?skiprg”) in new stack
[2009-12-17 22:13:46] VERBOSE[3727] logger.c: – Goto (macro-hangupcall,s,6)
[2009-12-17 22:13:46] DEBUG[3727] app_macro.c: Executed application: GotoIf
[2009-12-17 22:13:46] VERBOSE[3727] logger.c: – Executing [s@macro-hangupcall:6] GotoIf(“SIP/5725926e1-b7760bc0”, “0?skipblkvm”) in new stack
[2009-12-17 22:13:46] DEBUG[3727] app_macro.c: Executed application: GotoIf
[2009-12-17 22:13:46] VERBOSE[3727] logger.c: – Executing [s@macro-hangupcall:7] NoOp(“SIP/5725926e1-b7760bc0”, “Cleaning Up Block VM Flag: BLKVM/700/SIP/5725926e1-b7760bc0”) in new stack
[2009-12-17 22:13:46] DEBUG[3727] app_macro.c: Executed application: Noop
[2009-12-17 22:13:46] VERBOSE[3727] logger.c: – Executing [s@macro-hangupcall:8] DBdel(“SIP/5725926e1-b7760bc0”, “BLKVM/700/SIP/5725926e1-b7760bc0”) in new stack
[2009-12-17 22:13:46] VERBOSE[3727] logger.c: – DBdel: family=BLKVM, key=700/SIP/5725926e1-b7760bc0
[2009-12-17 22:13:46] VERBOSE[3727] logger.c: – DBdel: Error deleting key from database.
[2009-12-17 22:13:46] DEBUG[3727] app_macro.c: Executed application: DBDel
[2009-12-17 22:13:46] VERBOSE[3727] logger.c: – Executing [s@macro-hangupcall:9] GotoIf(“SIP/5725926e1-b7760bc0”, “1?theend”) in new stack
[2009-12-17 22:13:46] VERBOSE[3727] logger.c: – Goto (macro-hangupcall,s,11)
[2009-12-17 22:13:46] DEBUG[3727] app_macro.c: Executed application: GotoIf
[2009-12-17 22:13:46] VERBOSE[3727] logger.c: – Executing [s@macro-hangupcall:11] Hangup(“SIP/5725926e1-b7760bc0”, “”) in new stack
[2009-12-17 22:13:46] VERBOSE[3727] logger.c: == Spawn extension (macro-hangupcall, s, 11) exited non-zero on ‘SIP/5725926e1-b7760bc0’ in macro ‘hangupcall’
[2009-12-17 22:13:46] VERBOSE[3727] logger.c: == Spawn extension (macro-hangupcall, s, 11) exited non-zero on ‘SIP/5725926e1-b7760bc0’

Does anyone have any idea???

Thanks!

The setting in externip is wrong. Check that externip matches your real public IP-address.

This is what is in my sip_custom.conf:

;externip=70.191.226.29
;localnet=68.157.253.0/255.255.255.0
canreinvite=no
NAT=Yes
Qualify=yes
promiscredir=yes

I checked the ip via whatismyipaddress.com like 18 times. I know the 68 internal isn’t normal, but i had it before with this and it worked fine, so i’m not sure whats up with it.

You have NAT=yes but have remarked out both externip and localnet. That can’t be right.

Okay, I’m sorry, commented out doesn’t help.

Josh

I had similar situation in the past – SIP Invite is sent from my Asterisk server to the SIP provider, the response comes back fine, they start sending each other RTP packets, but they are dropped by my NAT translator, and eventually (in ~20-30 seconds) cause the call to die. This is because of unconventional way SIP assigns ports to RTP traffic – they don’t match the ports used during SIP call setup stage. NAT device does not recognize RTP packets as belonging to the SIP call, hence does not know to which internal IP to send the RTP to. A solution is to install SIP-aware NAT device, or hard-code internal and external IPs into the NAT device (instead of expecting the NAT dynamically learn it), so it knows - anything that comes to your external IP to be forwarded to your internal IP. Another solution is to use IAX instead of SIP, but this is another topic.
Dropped RTP by your NAT device may or may not be the issue you are facing. Try enabling SIP debug to see what happens with your SIP packets (Asterisk command “SIP debug”).
PS. Using someone else’s public IP for your private network is a bad practice. Are you sure you can reach your SIP provider from your Asterisk server behind NAT? Ignore this question if you 100% sure it works.

I did that command and it gave me this:
SIP Debugging re-enabled

It seems to kill the calls randomly, and it hasn’t done it for a few days, I’m thinking it may have been a problem with the commenting out and with sipgate, Iam sure I can reach those ips accurately.

Josh

The logs you provided in the beginning of this post do not contain SIP debug messages, so SIP debug was disabled when you collected them. Collect another set of logs when the problem happens, this time with SIP debug enabled. I am sure you will see why your calls are dropped then.

You are using public IP’s on the inside of your network? Are those even your IP’s? If not the traffic will not route back to you.

I took a look and 68.157.253.0/24 has a gateway of 65.83.239.161 (BTW no reverse DNS is setup for this subnet)

The externip you have us is a cox cable address.

Why don’t you tell us more about your network and post the output of ifconfig.

Thanks.

Yes, 68.157.251.0 is an external ip address, that I am using internally. It is property of another company that worked for, and was/is used internally there. I do use it internally. and it works alright for everything else, as long as someone else isn’t running anythin on the ip address that i’m using it shouldn’t interfere.

ifconfig output:
root@pbx:~ $ ifconfig
eth0 Link encap:Ethernet HWaddr 00:19:DB:5D:13:54
inet addr:68.157.251.194 Bcast:68.157.251.255 Mask:255.255.255.0
inet6 addr: fe80::219:dbff:fe5d:1354/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:37389 errors:0 dropped:0 overruns:0 frame:0
TX packets:33215 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:5901250 (5.6 MiB) TX bytes:11220210 (10.7 MiB)
Interrupt:193 Base address:0x8000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:31520 errors:0 dropped:0 overruns:0 frame:0
TX packets:31520 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:6427263 (6.1 MiB) TX bytes:6427263 (6.1 MiB)

Thanks, sorry I know its wrong to use it, but it usually works fine, and i’ve got cameras setup on the network with that ip internally. it would be a huge pain to change.

josh

Hi there,
I have configuration on Freepbx to make a call between 2 external extensions registered FreePBX.
My configuration::
In module Asterisk Sip Setting on FreePBX:
externip= my_ip_public
localnet=192.168.8.0/255.255.255.0
qualify=yes
canreinvite=no
nat=yes

At my modem, I forward port :
my_ip_public:5080->192.168.8.209:5060
my_ip_public:30000-40000->192.168.8.209

I changed rtp port default into:
rtpstart:30000
rtpend:40000

When I make call, called extension ring and pick call but no sound and called extesion is droped after 20s, while callee exteions still connected. I mean the hangup of 2 extension is not synchronous.

Please tell me what is problem and how can I fix it.
Thanks and best Regards,
Ngan Nguyen

You can’t remap the external SIP port with a PAT translate, that won’t work.

I registered external extension to asterisk server. But when I make call, called extension is dropped after 20s while callee extensions have status of connecting!
I check my asterisk again. That is rtp.conf
rtpstart=30000
rtpend=40000

BUT when I use “reload” on Asterisk CLI, I saw :
ubuntu-server*CLI>
== Parsing ‘/etc/asterisk/extconfig.conf’: == Found
== Parsing ‘/etc/asterisk/manager.conf’: == Found
== Parsing ‘/etc/asterisk/manager_additional.conf’: == Found
== Parsing ‘/etc/asterisk/manager_custom.conf’: == Found
== Parsing ‘/etc/asterisk/rtp.conf’: == Found
== RTP Allocating from port range 5000 -> 31000
== Parsing ‘/etc/asterisk/logger.conf’: == Found

Note at the line : RTP Allocating from port range 5000 -> 31000
So why? I changed default RTP port in rtp.conf, how can’t it update range port 30000-40000?

I have this problem for a month! But I can fix it until now? Please help me!
Thanks a lot!
Ngan Nguyen