We have multiple phone numbers coming into our * system. Currently the calls do come through, but are all grouped together. We need to identify which number the user dialed in order for us to handle the call correctly.

We have checked with our providers and they say they are sending the DNIS information. However, when I watch the asterisk box receive a call, I see the following bit of code:

[Kasterisk1*CLI> -- dialparties.agi: dnid = unknown

I can provide configuration files if that would be helpful, or anything else.

IMPORTANT NOTE: I’m very new to Asterisk, so be gentle . . .

Thanks in advance for all the help.


if they’re sending DNIS, then you need to check the following:

i’m going to assume you’re directly connected to your telco via a T1/E1 interface card. if so, you’ll need to check the context in zapata.conf. let’s assume it’s called ‘incoming’, like so:



so, in your main extensions.conf (or wherever you want to put it, provided it’s included in extensions.conf) you’ll need a context called incoming, so that those calls have a place to be sent. then you’ll want to pattern match on the DNIS to determine which call is from which number:

exten => _0001,1,Goto(company1_ivr)
exten => _0301,1,Goto(company2_ivr)
exten => _0501,1,Goto(company3_ivr)

that’s it - you just need to set up the individual IVR’s for each company and you should be good to go.

thanks for the pointers!

i’ll work some more on this tomorrow. and yes, you’re correct about the T1.

just so i’m clear: i need to check zapata.conf to make sure i have an incoming context with the following code:


and then i also need check in extensions.conf and make sure i have a section labeled incoming. i checked that today and noted that there was no context labeled incoming.

and so i’ll have to create one, and when you’re saying i’ll pattern match on the DNIS, i presume that because i have very specific routes (i.e. direct lines for a few key employees) to setup, that i’ll actually do something like:

exten => 555-555-5555,1,Goto(1234)

where 555-555-5555 is the number as it’s supposed to be coming in from the PSTN and 1234 is the extension i want to send it to, right?