Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a Trixbox server (Asterisk and FreePBX) that has multiple tenants on it. I need these tenants calls to go out via different outbound routes in order to split the bills at the SIP trunk provider end. Essentially the extensions need to be grouped and each group needs to have it's own outbound SIP trunk.

This used to be achievable using custom contexts in FreePBX but that functionality no longer exists. How can this be done now? I'd be happy to change to a different VoIP distribution which provides this functionality however I need it to be Asterisk and FreePBX based as that's what the customer knows.

share|improve this question
    
How often will the number of tenants be changing? If you're willing to, it's fairly simple to do this in the extensions_custom.conf file. –  dkwiebe Nov 29 '11 at 21:42
    
@dkwiebe very rarely. –  SimonJGreen Jan 7 '12 at 12:53
add comment

1 Answer 1

up vote 1 down vote accepted

We usually do this by adding contexts in the extensions_custom.conf file. These custom contexts include the default contexts but listen for your outbound calls such as NXXNXXXXXX, 1NXXNXXXXXX and add your dialing codes such as 7777 to the beginning of the call. Then you simply setup your outbound routes so the specific routes are listening for the relevant codes and stripping them off before pushing the call to the carrier.

Phones belonging to client1 would be set in "custom-client1" context while client2 phones would be in "custom-client2".

[custom-client1]
exten => _NXXNXXXXXX,1,Dial(Local/888${EXTEN}@from-internal)
exten => _1NXXNXXXXXX,1,Dial(Local/888${EXTEN}@from-internal)
exten => _NXXXXXX,1,Dial(Local/888${EXTEN}@from-internal)
include => from-internal

[custom-client2] 
exten => _NXXNXXXXXX,1,Dial(Local/889${EXTEN}@from-internal)
exten => _1NXXNXXXXXX,1,Dial(Local/889${EXTEN}@from-internal)
exten => _NXXXXXX,1,Dial(Local/889${EXTEN}@from-internal)
include => from-internal
share|improve this answer
    
OK I think I follow that. So the outbound route will be controlled by prefixing the numbers dialed, and these prefixes will be added by matching against extensions? Do you have an example of this? –  SimonJGreen Jan 7 '12 at 12:55
    
@SimonJGreen I just added the samples you were looking for. –  dkwiebe Jan 9 '12 at 21:19
    
Thanks, we'll try this and let you know how it goes. –  SimonJGreen Jan 12 '12 at 11:40
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.