Incoming call problem after 1.0.11 -> 1.2.10 upgrade

I’ve had asterisk 1.0.x running for about two years now. Very simple setup that registers to my SIP provider, and distributes calls to a few extensions and voicemail. One extension is a Sipura SPA-2000, and the other is X-lite. Both are behind NAT, and my asterisk server is on a public IP.

Everything has been working great for the last two years – no problems whatsoever.

Recently, I tried upgrading to 1.2.10. I cleared out /usr/lib/asterisk/modules and /etc/asterisk, installed 1.2.10 from source, and then copied over my existing sip.conf, extensions.conf and voicemail.conf. At first I thought the upgrade had gone very smoothly – the extensions still registered fine, asterisk registers to my SIP provider fine, and outbound calls from the extensions also working fine. However, when an inbound call comes in from my SIP provider and asterisk tries to ring the extensions, it fails somehow. Call goes straight to voicemail. Here’s what I see in the log:

-- Executing Dial("SIP/1095-09f8e878","SIP/meehan-home&SIP|30") in new stack
-- Called meehan-home

Jul 28 13:32:19 WARNING[18564]: chan_sip.c:1217 retrans_pkt: Maximum retries exceeded on transmission 677205ea6fb09dfb5d82f91d03ca0ec1@69.59.xx.xx for seqno 102 (Critical Request)
Jul 28 13:32:19 WARNING[18564]: chan_sip.c:1234 retrans_pkt: Hanging up call 677205ea6fb09dfb5d82f91d03ca0ec1@69.59.xx.xx - no reply to our critical packet.
== Everyone is busy/congested at this time (2:0/0/2)

If I turn on SIP debug, I see the INVITE and retries going out to the extension, but the extension never replies. Here’s the relevant section from my sip.conf:

[meehan-home]
type=friend
username=meehan-home
secret=xxxxxxx
context=meehan-out
callerid=Meehan <2001>
mailbox=3001, 3002
host=dynamic
nat=yes
qualify=yes
canreinvite=yes
dtmfmode=inband
incominglimit=2
allow=all

If I revert back to Asterisk 1.0.11, everything works fine again. Any ideas on what might be going on here?

Jim Meehan
Oakland, CA

that Dial command looks weird:

Dial(“SIP/1095-09f8e878”,“SIP/meehan-home[color=red]&SIP[/color]|30”)

What’s up with that extra &SIP? Or is it just a typo?

Can you try setting up an IAX2 extension just to test? If that works it would point to a networking/NAT problem.

Oops – I edited my log a little to simplify the explanation. Here’s unedited version:

    -- Executing Dial("SIP/1095-09f8e878", "SIP/meehan-home&SIP/mobile|30") in new stack                                                                        
    -- Called meehan-home
Jul 28 13:32:15 NOTICE[18576]: app_dial.c:1049 dial_exec_full: Unable to create channel of type 'SIP' (cause 3 - No route to destination)                       
Jul 28 13:32:19 WARNING[18564]: chan_sip.c:1217 retrans_pkt: Maximum retries exceeded on transmission 677205ea6fb09dfb5d82f91d03ca0ec1@69.59.xx.xx for seqno 102 (Critical Request)                                                            
Jul 28 13:32:19 WARNING[18564]: chan_sip.c:1234 retrans_pkt: Hanging up call 677205ea6fb09dfb5d82f91d03ca0ec1@69.59.xx.xx - no reply to our critical packet.   
  == Everyone is busy/congested at this time (2:0/0/2)

The X-lite extension wasn’t running/registered when I grabbed this log. I was thinking it could be a NAT problem as well, but why would it show up under 1.2.10 and not under 1.0.11?

I will try setting up an IAX2 extension and see what happens.

Seems to work okay with the Idefisk IAX2 soft phone client…

Now I’m tempted to just ditch the Sipura ATA and get one that supports IAX2.

Still no luck in figuring this out. Running asterisk 1.0.11, everything works fine. Switch to asterisk 1.2.10, I get the “no reply to our critical packet” message in the log file.

Any other ideas?

have you checked /var/log/asterisk/full? does that give any clues?

what does ‘sip show peers’ display?

So I finally figured this one out after looking at packet traces of inbound calls with Asterisk 1.0.11 compared to 1.2.10. It turns out this was not a NAT problem.

Here’s the start of my context for inbound calls from my provider:

[code]; ‘s’ extension – default for inbound calls

; race.com doesn’t send me CallerID name info,
; so launch an AGI perl script to look it up in
; Google Phonebook. Script sets variable $googlename
; when it exits, and we use that variable to set the
; CallerID name.

exten => s,1,AGI(callerid.agi|${CALLERIDNUM})
exten => s,2,SetCallerId,"${googlename} <${CALLERIDNUM}>"

; Dial my two SIP phones, set in global variable $PHONES
; If one of them is answered, call gets passed to it.

exten => s,3,Dial(${PHONES},30)[/code]

It seems the quotes in the SetCallerId command are handled differently by the two Asterisk versions. In 1.0.11, the “From:” line in the SIP INVITE header looks like this:

From: "@CA SNFC CNTRL" <sip:415269xxxx@69.59.178.92>;tag=as217929ad SIP Display info: "@CA SNFC CNTRL" SIP from address: sip:415269xxxx@69.59.178.92 SIP tag: as217929ad

However, under 1.2.10, there’s an extra leading quote on the CID string:

From: ""@CA SNFC CNTRL" <sip:415269xxxx@69.59.178.92>;tag=as52854432 SIP Display info: ""@CA SNFC CNTRL" SIP from address: sip:415269xxxx@69.59.178.92 SIP tag: as52854432

Apparently that extra quote in the SIP “From” header totally messes up both X-Lite and my Sipura ATA, and causes them to completely ignore the INVITE requests without even sending an error.

So I removed the quotes from the SetCallerId line in my extensions.conf, like so:

And now everything is working fine under 1.2.10. I’m not sure if this is a bug in 1.2.10, or just my fault for including quotes where they shouldn’t have been. It’s very confusing though that an earlier version does the right thing (as far as the SIP header is concerned) and a later version does not.

the format should be inside of parenthesis

[quote]SetCallerID( ) Sets the Caller ID for the channel
SetCallerID(clid[,a])
Sets the Caller ID on the channel to a specified value. If the a argument is passed, ANI is
also set to the specified value.
Always returns 0.
; set both the Caller ID and ANI
exten => 123,1,SetCallerID(“John Q. Public <8885551212>”,a)[/quote]