Passing on the dialled number ID in Asterisk

February 23, 2012 Chilling_Silence How-To's / Guides / Tech info

So I had a problem recently where the phone number that I was dialling wasn’t being passed on to the destination. In otherwords:
I call 0800 83 83 83 (Pretend here, I don’t really work for Pizza Hut).

My asterisk box picks up and says “Oh hai, you want Pizza Hut on 0800 83 83 83, I’ll pass you on to that user”.

Asterisk sends me off to the Pizza Hut server.

Then on the Pizza Hut box we receive something that looks like this:

-- Executing [s@from-trunk:1] Set("SIP/VoIP_Provider-0000014f", "__FROM_DID=s") in new stack

The “__FROM_DID=s” basically means it’s not getting the information it needs from the remote side, so then the Pizza Hut server will say:

“Hi this is the Pizza Hut asterisk server, who do you want?! You haven’t told me? Meh, I’ll hang up on you, try again later”

Not good 🙁

Thankfully it’s not too hard to get it to forward on the correct details.

In some places this is known as DNIS, or Dialled Number Identification Service.

I was searching for “Dialled CID” or “Called Number” and a variety of other things.

Thankfully it didn’t require much, just a quick change of dial-plan. Mine was previously:

exten=>0800838383,1,Dial(SIP/pizzahut,30)

Now it looks like this:

exten=>0800838383,1,Dial(SIP/pizzahut/${EXTEN},30)

All solved!!

Asterisk, called number, calling id, dialplan, dnis,


Leave a Reply

Powered by WordPress. Designed by elogi.