How to use a prefix (ex:9) to select a trunk for outbound call

Hi all !!

I have to configure something and I browse forums and google for the last 2 hours and cant get an answer (that is enought complete for my basic knowledge)

I have FreePBX setup with 7 zap trunk and 1 SIP trunk and I would like to set a prefix (Ex: 9 or 8) that will direct the call through the SIP trunk…

The point is when a call come in, we would like to be able to transfer this call to a cellphone through the SIP not the ZAP…

(I think this is a phone dial plan config but I cant figure out how to do it)

I hope this is enought clear…

Thanks to all !!

Just set up a new Outbound Route that has the 9 in the Dial Pattern and uses only your SIP Trunk. When Asterisk sees a match on the 9+xxxxxxxxxx and finds a Trunk match, it will dial out that.

Thanks Franklin

[UPDATE]

Here is my new dial plan on my phone

(*xx|[34569]11|<#9,:>[2-9]xx[2-9]xxxxxx|514[2-9]xxxxxx|450[2-9]xxxxxx|438[2-9]xxxxxx|1[2-9]xx[2-9]xxxxxx|1[01]xx|**xx.|011.|[236-9]xxxxxx|5[02-9]xxxxx|51[0-35-9]xxxx|4[01246-9]xxxxx|45[1-9]|43[0-79]xxxx|011xx.)

I have setup a SIPTrunk and an Outbound route witch have 9 as prefix.

Now when I dial out using the 9 I got “Please dial 1 before your number” or so…

Any info on that ?

did you choose local and long distance and toll free in the gui option?

are those your boobs, simin? or are you just using those to sucker poor blokes in? Are you really a 90 pound Indian or are you you?

No lololol They are not mine sincer my name is Sebastien (From Montreal not India lolol)

.

https://docs.google.com/open?id=0ByxRdyDgX8zRWkJtenBMMk1Ib3M

lololololol Slide to unlock … no need more details…

new stack
– Executing [s@macro-record-enable:24] MacroExit(“SIP/101-0000167f”, “”) in new stack
== Begin MixMonitor Recording SIP/101-0000167f
– Executing [9514586@from-internal:5] Macro(“SIP/101-0000167f”, “dialout-trunk|2|9514586|”) in new stack
– Executing [s@macro-dialout-trunk:1] Set(“SIP/101-0000167f”, “DIAL_TRUNK=2”) in new stack
– Executing [s@macro-dialout-trunk:2] GosubIf(“SIP/101-0000167f”, “0?sub-pincheck|s|1”) in new stack
– Executing [s@macro-dialout-trunk:3] GotoIf(“SIP/101-0000167f”, “0?disabletrunk|1”) in new stack
– Executing [s@macro-dialout-trunk:4] Set(“SIP/101-0000167f”, “DIAL_NUMBER=9514586”) in new stack
– Executing [s@macro-dialout-trunk:5] Set(“SIP/101-0000167f”, “DIAL_TRUNK_OPTIONS=tr”) in new stack
– Executing [s@macro-dialout-trunk:6] Set(“SIP/101-0000167f”, “OUTBOUND_GROUP=OUT_2”) in new stack
– Executing [s@macro-dialout-trunk:7] GotoIf(“SIP/101-0000167f”, “0?nomax”) in new stack
– Executing [s@macro-dialout-trunk:8] GotoIf(“SIP/101-0000167f”, “0?chanfull”) in new stack
– Executing [s@macro-dialout-trunk:9] GotoIf(“SIP/101-0000167f”, “0?skipoutcid”) in new stack
– Executing [s@macro-dialout-trunk:10] Set(“SIP/101-0000167f”, “DIAL_TRUNK_OPTIONS=”) in new stack
– Executing [s@macro-dialout-trunk:11] Macro(“SIP/101-0000167f”, “outbound-callerid|2”) in new stack
– Executing [s@macro-outbound-callerid:1] ExecIf(“SIP/101-0000167f”, “0|SetCallerPres|”) in new stack
– Executing [s@macro-outbound-callerid:2] ExecIf(“SIP/101-0000167f”, “0|Set|REALCALLERIDNUM=101”) in new stack
– Executing [s@macro-outbound-callerid:3] GotoIf(“SIP/101-0000167f”, “1?normcid”) in new stack
– Goto (macro-outbound-callerid,s,6)
– Executing [s@macro-outbound-callerid:6] Set(“SIP/101-0000167f”, “USEROUTCID=”) in new stack
– Executing [s@macro-outbound-callerid:7] Set(“SIP/101-0000167f”, “EMERGENCYCID=”) in new stack
– Executing [s@macro-outbound-callerid:8] Set(“SIP/101-0000167f”, “TRUNKOUTCID=5148569999”) in new stack
– Executing [s@macro-outbound-callerid:9] GotoIf(“SIP/101-0000167f”, “1?trunkcid”) in new stack
– Goto (macro-outbound-callerid,s,12)
– Executing [s@macro-outbound-callerid:12] ExecIf(“SIP/101-0000167f”, “1|Set|CALLERID(all)=5148569999”) in new stack
– Executing [s@macro-outbound-callerid:13] ExecIf(“SIP/101-0000167f”, “0|Set|CALLERID(all)=”) in new stack
– Executing [s@macro-outbound-callerid:14] ExecIf(“SIP/101-0000167f”, “0|Set|CALLERID(all)=”) in new stack
– Executing [s@macro-outbound-callerid:15] ExecIf(“SIP/101-0000167f”, “0|SetCallerPres|prohib_passed_screen”) in new stack
– Executing [s@macro-dialout-trunk:12] GosubIf(“SIP/101-0000167f”, “1?sub-flp-2|s|1”) in new stack
– Executing [s@sub-flp-2:1] ExecIf(“SIP/101-0000167f”, “0|Return|”) in new stack
– Executing [s@sub-flp-2:2] ExecIf(“SIP/101-0000167f”, “0|Return|”) in new stack
– Executing [s@sub-flp-2:3] Return(“SIP/101-0000167f”, “”) in new stack
– Executing [s@macro-dialout-trunk:13] Set(“SIP/101-0000167f”, “OUTNUM=9514586”) in new stack
– Executing [s@macro-dialout-trunk:14] Set(“SIP/101-0000167f”, “custom=DAHDI/1”) in new stack
– Executing [s@macro-dialout-trunk:15] ExecIf(“SIP/101-0000167f”, “0|Set|DIAL_TRUNK_OPTIONS=M(setmusic^)”) in new stack
– Executing [s@macro-dialout-trunk:16] Macro(“SIP/101-0000167f”, “dialout-trunk-predial-hook|”) in new stack
– Executing [s@macro-dialout-trunk-predial-hook:1] MacroExit(“SIP/101-0000167f”, “”) in new stack
– Executing [s@macro-dialout-trunk:17] GotoIf(“SIP/101-0000167f”, “0?bypass|1”) in new stack
– Executing [s@macro-dialout-trunk:18] GotoIf(“SIP/101-0000167f”, “0?customtrunk”) in new stack
– Executing [s@macro-dialout-trunk:19] Dial(“SIP/101-0000167f”, “DAHDI/1/9514586|300|”) in new stack