Setup Sip extensions as Line Keys

hi all, I was hoping someone could shine some light on this subject. I am trying to setup specific SIP extensions to use specific trunks to ensure the correct CLID is is used. For example 1 asterisk server running multiple businesses or departments, requiring each to have thier own CLID on outbound calls, or to use specific trunks for billing purposes.

I am aware that there are ways like prefixing with a 9 or an 8 when dialing to route manually to a specific trunk, I have also heard of people using the dialplan on the handset to prefix all numbers dialed with a 9 or 99 to allow a specific trunks to be used. they all seem to be problematic or have limitations or a certain amount of user intervention required.

this process needs to be automated, ie; a specific extension = a specific trunk.

for those who are familiar i need it to act like a line key on a standard digital / TDM phone system.

I am sure that asterisk is capable of this I obviously just need to know how.

thanks in advance,

Assuming you have something like Polycom phones, just set up the phones where each button is a specific Asterisk extension like this:
b1 - 100
b2 - 200
b3 - 300

Then set up “Ex-Girlfriend” logic in your dialplan like this
exten => 5551212/100,1,Dial(DAHDI/1/5551212)
extension 100 can dial 5551212
exten => 5551212/200,1,Playback(cantcallnumber)
extension 200 can’t call, plays message


[ul]- use different contexts, and have the context select the trunk;

  • set a channel variable, that specifies the trunk, against the sip.conf entry for the number.[/ul]

I ended up downloading the freepbx custom context module and all is working great. thanks