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
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
For handling outbound calls, your easiest approach is to have each business' phones default to different contexts, so you might have the dialplan arranged as follows: [in-pstn] exten => number,1,dosomething exten => number,1,dosomething exten => number,1,dosomething etc. [business1] ; internal calls within business1 exten => _2XX,1,Dial(SIP/business2-${EXTEN}) <handle outbound calls from business 1> [business2] ; internal calls within business2 exten => _2XX,1,Dial(SIP/business2-${EXTEN}) <handle outbound calls from business 2> [business3] ; internal calls within business2 exten => _2XX,1,Dial(SIP/business3-${EXTEN}) <handle outbound calls from business 3> Then of course in the appropriate sip/zap/iax.conf files where you've got the various business' phones defined, set context=business1/2/3 as required. To handle incoming calls from PSTN numbers I'd define 3 queues containing the users from each business, then set each of the incoming numbers in [in-pstn] to go to the appropriate queue. You'd probably also want to include in-pstn in each business' context for outbound calls so that calls made between them to each other don't go all the way out onto the PSTN and back again. Regards, Chris -- C.M. Bagnall, Director, Minotaur I.T. Limited This email is made from 100% recycled electrons