Asterisk Selective Outbound Routing
I had a customer of mine that a single user inside their office needed an 800 number routed to them…not a big deal. What we did was to order an additional DID from their SIP provider Vitelity. The number was provisioned and I forwarded it from the incoming trunk to the users phone. I made a test call and low and behold, it worked just fine. That was a boring story… Every good story has to have an antagonist, right? Well, when you picked up the phone to dial out, it was screened on caller ID as a number from the old DID block.
After futzing with that for a while I put in a support ticket. Support told me to put in a subaccount.
A subaccount creates a new set of trunk credentials for one to use. You also associate a caller ID with the new subaccount, which will, supposedly, screen the number properly.
Since we have a new set of trunk credentials, we have to create a new trunk in our asterisk server. My box is a trixbox ce server.
I basically used my existing trunk settings, but with the new username/password.
Now I associate my specific user inside with this new outside route…wait…what? In Cisco callmanager, you have partitions. Partitions are logical groupings of extensions. You can put route patterns in specific partitions…which would fix this situation. What does one do in Asterisk? One uses contexts. Contexts are the same construct as partitions. They basically allow you to segregate phones into different groups. When it comes down to it, I’m a GUI guy. I am a GUI guy, because I want other people to be able to use the systems I configure without breaking them. If I change something in config files, I’ll be the only guy from now until forever who can work on those systems. Having said all of that, I’ve found a great little plugin for trixbox/freepbx called custom context. What it allows you to do is EASILY create contexts, add outbound routes to said context and then apply them to users. I’m not going to walk you through that because someone already has in the video below:
Once everything is verified working, you only need to point your 800 number towards your new DID…yeah!