? Extension 5007 use Trunk XYZ to make call's

Hi all,

I’ve done some searching on the forum, but till now I did not find a way to do this.

I have 5 trunks on my Asterisk server that are all working great.
I can use any of the trunks by using the pre-set outbound route.

Now I would like one of my extensions (lets say 5007) to always use a pre-set trunks to call out.
The way I’m doing this now is by using a rule in the outbound routes. (I need to add a 9 in front of the phone number)

Is there a way to make extension 5007 to automaticaly use the trunk that I normally use with the 9 in front?

Thank you for any info on this.

You can put 5007 in dedicated context where all outbound calls will be routed by any trunk You want.
(sip.conf)
[5007]
context=trunkNoutbound

(extensions.conf)
[everyone]
exten => _9X.,dial(SIP/trunkN/${EXTEN:1})

[trunkNoutbound]
exten => _X.,dial(SIP/trunkN/${EXTEN})

Great!

I’m going to give it a test run later today!
I’ll report back.

Thank you for the info.

[quote=“fdragowski”]You can put 5007 in dedicated context where all outbound calls will be routed by any trunk You want.
(sip.conf)
[5007]
context=trunkNoutbound[/quote]
Isn’t the context on sip.conf used for incoming and not outgoing calls?

[quote=“mazilo”][quote=“fdragowski”]You can put 5007 in dedicated context where all outbound calls will be routed by any trunk You want.
(sip.conf)
[5007]
context=trunkNoutbound[/quote]
Isn’t the context on sip.conf used for incoming and not outgoing calls?[/quote]
Not sure, but whatever I try I can not get it to work :frowning:
I’ve changed “context=from-internal” to “context=trunkNoutbound” for 5007 in sip_additional.conf, and added “[trunkNoutbound] exten => _X.,dial(SIP/trunkN/${EXTEN})” to extenstions_custom.conf.
After a restart, the 5007 does register fine, but can not dial out anymore. I can also not call other extensions with 5007.
The softphone is showing me a 404 :confused:

Some background:

Only one line in context trunkNoutbound:
exten => _X.,dial(SIP/trunkN/${EXTEN})
will do no good. Do You hane trunk confgured as trunkN ? There should by trunk You normally use with prefix 9.
Finally inlude there dialplan with local dialplan.
For example:
include => my_local_dialplan

Thank you for your reply.

I’m going to give it an other go.
Will report back again.