Incoming calls with multiple external numbers

I don’t understand completely how to handle incoming calls. Hopefully someone here can help me grasp that concept.

At home I have a very simple setup. Just 1 external number, that people can use to call me. In extensions.conf, it’s handled like this:

exten => s,1,Answer()
exten => s,n,GotoIfTime(09:00-22:30,*,*,*?downstairs)
exten => s,n,GotoIfTime(22:30-09:00,*,*,*?downstairs:allphones)

exten => s,n(downstairs),Dial(Local/2400@myhome&Local/2402@myhome,30,kKtT)
exten => s,n,Hangup()

exten => s,n(allphones),Dial(Local/2400@myhome&Local/2401@myhome&Local/2402@myhome,30,kKtT)
exten => s,n,Hangup()

As you can see it’s even slightly more complex than average, because it only dials the phone in the bedroom during the night. Otherwise it would wake the baby, taking a nap during the day :wink:

So, only one external number and every incoming call is handled the same.

But what if there is a block of 100 external numbers? And every external number should call directly to a different phone? How do I handle that? I’ve been fiddling around with that on my home-setup. But it keeps complaining there is no s-extension.

Any help would be most welcome.


Some of the digits from the number should be passed though as the extension, rather than “s”. That requires a technology like SIP or ISDN, that supports DID. You cannot it do it for analogue lines.

If you are using a technology that supports DID, do a detailed trace and see what the provider is actually sending, to see if, and where, they are sending the DID digits.

I see. Unfortunately, I have no idea how to do this. Perhaps you can point to some sort of more detailed explanation, or a tutorial?

If it helps, My setup is 100% VoIP (SIP). No analogue phones, what-so-ever.

sip set debug on

then look for the invite. Asterisk is expecting the digits to be in the INVITE line. If they are anywhere else, you may need to use SIP_HEADER to retrieve them. If they are not there, then you need to talk to your ITSP.

Ah, that makes sense. I’ll get into this asap.

Thank you for your help, so far :smiley: