SIP-to-PSTN calls completed approx. 25% of the time

Hi all,

I’ve been trying to figure this one out for several days now.

My setup currently includes an analog phone connected to a Linksys SPA3102. I have things configured such that incoming calls from the world can be routed to whatever Asterisk extension I defined. Outgoing calls (Asterisk-to-PSTN) only connect around 25% of the time- I get a “We’re sorry, your call cannot be completed as dialed. Please check the number and dial again.” dialogue.

I’m wondering if this is something I’m causing on my end, or if it’s some sort of strange incompatibility with Asterisk and my phone line provider (AT&T). The fact that I get the default “We’re sorry” message makes me think it’s some incompatibility, but I’ve been at a total loss as to how to even begin troubleshooting the problem as incoming calls work perfectly.

I’m using Asterisk 1.6.2.6. Any insight greatly appreciated, TIA.

The extension in sip.conf is:

[line1] type=friend host=[ip.address] username=line1 secret=1111 dtmfmode=rfc2833 context=outbound-local insecure=port,invite disallow=all allow=ulaw nat=yes port=5061

The relevant context in extensions.conf

[code][outbound-local]

exten => _9XXXXXXX,1,Dial(SIP/${EXTEN:1}@line1,25)
[/code]

Verbose CLI output from a failed call (which unfortunately is the same as for a successful call, further leading me to think it’s not an Asterisk problem):

  == Using SIP RTP CoS mark 5
    -- Executing [97826005@phones:1] Dial("SIP/1000-0000007e", "SIP/7826005@line1,25") in new stack
  == Using SIP RTP CoS mark 5
    -- Called 7826005@line1
    -- SIP/line1-0000007f is ringing
    -- SIP/line1-0000007f answered SIP/1000-0000007e
    -- Native bridging SIP/1000-0000007e and SIP/line1-0000007f
  == Spawn extension (phones, 97826005, 1) exited non-zero on 'SIP/1000-0000007e'

Hi sr.
Look, you are wrong because you are trying to make outgoing calls to PSTN using SIP technology :S
To get this to work, please update your context [outgoing-local] to:
exten => _9XXXXXXX,1,Dial(Zap/1/w${EXTEN:1}@line1,25)

In that case you will dial using the ZAP channel #1 and the number 9 will be ignored because i wrote : Dial(Zap/1/w${EXTEN:1}

I hope this help you to solve your problems.

Manuel as GNU

Does this apply even though I’m not using a Digium card (or even have Zaptel/DAHDI installed to begin with)? The Linksys should take care of the conversion from analog to digital and vice versa. If it doesn’t , I’m not sure why calling “in” to Asterisk from the PSTN works without issue.

In addition, how would switching from SIP to ZAP explain that sometimes the current setup connects to PSTN?

[quote=“gnu”]Hi sr.
Look, you are wrong because you are trying to make outgoing calls to PSTN using SIP technology :S
To get this to work, please update your context [outgoing-local] to:
exten => _9XXXXXXX,1,Dial(Zap/1/w${EXTEN:1}@line1,25)

In that case you will dial using the ZAP channel #1 and the number 9 will be ignored because i wrote : Dial(Zap/1/w${EXTEN:1}

I hope this help you to solve your problems.

Manuel as GNU[/quote]

(24-hour bump)

Maybe this can help

forowifi.com/forum/showthread.php?t=149, please use google translate

Thanks, but that site is more concerned with the initial setup of an inbound/outbound connection to a PSTN through a Linksys 3102, which I already have. I’m more looking for an explanation or possible reasons why a VoIP-to-PSTN connection would work “sometimes” when a PSTN-to-VoIP connection works 100% of the time (so far).

[quote=“navaismo”]Maybe this can help

forowifi.com/forum/showthread.php?t=149, please use google translate[/quote]

I see, your configurations are the same because nobody inform about this issue?

Sorry, I’m not quite sure what you’re asking? (Thanks for trying to help, though!)

Hi mket,

I would tend to agree with you that if your CLI output is the same for the failed calls and the good calls that I wouldn’t think of it as a problem from the Asterisk end.

What is the complete message for the we are sorry message? Every phone company starts with Were sorry, but what are they sorry for ? :>

I would guess that it might be some sort of timing issue with the SPA3102 and the Phone company. It may be possible to but in a little longer delay to the dialing or before picking up a line.

Do you know which version of the firmware your unit has? The last release that I saw was from Jan 2009 at version 5.1.10.

[quote=“mazzic”]
What is the complete message for the we are sorry message? Every phone company starts with Were sorry, but what are they sorry for ? :> [/quote]

“We’re sorry, your call cannot be completed as dialed. Please check the number and dial again.”

Hmm, I hadn’t thought of that. I’ll try messing around with the delays in the Linksys config.

It’s 5.1.10.

[quote=“mazzic”]
I would guess that it might be some sort of timing issue with the SPA3102 and the Phone company. It may be possible to but in a little longer delay to the dialing or before picking up a line. [/quote]

Well I spent a little time fiddling with the Linksys control panel and found that doubling the value of “PSTN Dialing Delay” from 1 (second) to 2 solves the problem (or at least seems to have solved the problem). The setting can be found under

…for future reference.

I don’t know what kind of “handshaking” goes on behind the scenes when one tries to connect a PSTN call, but based on the terminology I’d guess that previously Asterisk didn’t wait long enough to make the proper connection to the PSTN, perhaps truncating or otherwise corrupting the number in the process and leading to the “We’re sorry” message. Does that seem reasonable (or does anyone happen to know the “right” answer) ?

Anyway, thanks for pointing me in the right direction mazzic.