[Asterisk-Users] Incoming/Outgoing call question

Conrad Wood asterisk-users at conradwood.net
Thu Feb 23 18:19:38 MST 2006


On Thu, 2006-02-23 at 17:53 -0500, Kevin Smith wrote:
> Hey everyone,
> 
> I have a more of an opinion question then a technical question. The 
> asterisk server I am setting up is going to host 3 different businesses. 
> Each business is in the same building, and on the same network. My 
> question is regarding calls coming in and going out. We are a small ISP 
> and have a lot of numbers that are forwarded to our phone system. The 
> other companies have about 3 to 5 numbers going into their offices. My 
> question is if there is a good way to test for which number and where to 
> send it to.
> 
> Right now my though process was something like this (keep in mind I 
> haven't wrote it):
> 
> [default]
> include => Our-Numbers
> include => Business1
> include => Business2
> 
> [Out-Numbers]
> exten => s,1,gotoif,$[${EXTEN}=Number1 | 
> ${EXTEN}=Number2......${EXTEN}=NumberN]?Match:1|:
> 
> Is that the best way to test for the number that is being dialed? Or can 
> you recommend a better way. If anyone has done something similar could 
> you share how you did this type of a setup? I know I could manually put 
> in each one, but I think there probably is a better way. If I have to go 
> that route, then I probably will write a script to generate the file.
> 
> Thanks,
> Kevin
> 

For incoming calls I'd do something like (simplified):
[incoming-calls]
exten => BUSINESS1,1,Dial(SIP/business1)
exten => BUSINESS2,1,Dial(SIP/business2)
...

assuming you got channels that give you that information, e.g. ISDN or
so. Analogue pots won't provide the information which number was
dialled.
Asterisk will match the number that was dialled in the dialplan as the
extension. You might want to put a pattern in in case the number dialled
isn't specifically listed. (e.g. your numbers?)


Conrad









More information about the asterisk-users mailing list