Hi All,

I’ve got a new install with a Sangoma card all up and running, receiving the CLI, etc. However after much searching I still can’t figure out how to match my inbound calls on that line in the dialplan.

So here’s my config from chan_dahdi;

;Sangoma AFT-200 [slot:4 bus:2 span:1]
signalling = fxs_ks
channel => 1

And here’s my entry from extensions.conf. At present I’ve just used a “match all” in order to catch the inbound call. How can I get the phone number dialled and match it against exten? Currently ${CALLERID(dnid)} always returns blank.

exten => _.,1,Answer()
same => n,Verbose(Caller ID is: ${CALLERID(num)})
same => n,Verbose(Dialled is: ${CALLERID(dnid)})
same => n,Wait(1)
same => n,Playback(zombies)
same => n,Hangup()

I’m sure it’s out there somewhere, but I can’t seem to find it. Any help would be appreciated.


I should probably add that I’m using Asterisk 11.
I’ve also tried reading the EXTEN variable and it’s always set to “s”

– Executing [s@inbound:5] Verbose(“DAHDI/1-1”, “Exten is: s”) in new stack
Exten is: s

So rather than “s” I’d like it to be the actual dialed number.


fxo-ks indicates this is an analogue device. Asterisk (and most PTTs) don’t support DID on analogue devices.

Is it possible to set the number in the config file for dahdi (or somewhere) so that I’d know that a certain telephone number relates to a specific channel?

If I had a 4 port FXO card, each plugged into a phone line how would I know/route the calls in the dialplan depending upon which number it came in on?

As it currently stands my dialplan is just doing a catch-all so that analog calls are falling through the extensions and being caught. There must be a better way?


Edit: Thinking about it more… I guess I could just specify a different context from each analogue line and route them within their own context and continue to do a catch-all. Would that be the way to go?

Hi there,

Yes, you can do this by changing the context name in each channel setting in chan_dahdi.conf

then you can play on dialplan to route the call on specific extension or ivr.

Sohaib Khan