[asterisk-users] Selecting outbound trunk

Devraj Mukherjee devraj at gmail.com
Mon Aug 28 21:18:32 MST 2006


Hi Everyone,

I am trying to implement a process where by people can select their
outbound trunk for calls since VoIP is not always the best option to
place the call with.

The simplest way I can think of solving this is using prefixes, so
someone appends a 0 or 1 and the dialplan puts the call through the
selected trunk, where 0 being voip and 1 being PSTN.

I have figured out how to use a Substring like function to extract the
number out of the dialed extension. My question is how do I make a
decision in the dialplan to dynamically select a trunk for the call?
Is there a SetIf function or an If function by itself?

Or is there a better way of doing this? Thank you for your input.

[outbound-statewide]
exten => _XXXXXXXXX,1,Set(CARRIER=IAX2/nehos)
exten => _XXXXXXXXX,2,SetCDRUserField(${CARRIER})
exten => _XXXXXXXXX,3,Dial(${CARRIER}/${EXTEN:2:8})



More information about the asterisk-users mailing list