Outbound Routes dial plan prefix not working

what I’m trying to do is when someone dials let’s say 411 I want to strip 411 and prepend a 1-800 number that’s a free information line but it doesn’t work it’ll just dial the match pattern and it will not do prepend and prefix

but 7 digit dialing with prepend area code works fine

the numbers in the picture is only a example

The Pattern Match help option at the top would have this information in it. Your matching is wrong. It’s prefix+pattern so it’s looking for 800+800 and if there is a match it will send prepend+match. So this would end up with 18008005000800 which is not going to work.

There isn’t a strip option here, which is what you’re looking for with the result of user dials 800, it strips the 3 digits and then adds the prepend resulting in 18008005000. You’ll have to do that is custom context code for this to happen.

I’m following the instructions of Chris from crosstalk Solutions
this is the video link at 23:40 minutes

Then show a call this isn’t working on so we can see what is happening in the dialplan.

[[email protected] ~]# asterisk -rvvv
Asterisk 13.22.0, Copyright © 1999 - 2014, Digium, Inc. and others.
Created by Mark Spencer [email protected]
Asterisk comes with ABSOLUTELY NO WARRANTY; type ‘core show warranty’ for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type ‘core show license’ for details.

Connected to Asterisk 13.22.0 currently running on freepbx (pid = 2246)
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– Executing [[email protected]:1] ResetCDR(“SIP/202-00000011”, “”) in new stack
– Executing [[email protected]:2] NoCDR(“SIP/202-00000011”, “”) in new stack
– Executing [[email protected]:3] Progress(“SIP/202-00000011”, “”) in new stack
– Executing [[email protected]:4] Wait(“SIP/202-00000011”, “1”) in new stack
– Executing [[email protected]:5] Playback(“SIP/202-00000011”, “silence/1&cannot-complete-as-dialed&check-number-dial-again,noanswer”) in ne
– <SIP/202-00000011> Playing ‘silence/1.ulaw’ (language ‘en’)
– <SIP/202-00000011> Playing ‘cannot-complete-as-dialed.ulaw’ (language ‘en’)
– <SIP/202-00000011> Playing ‘check-number-dial-again.ulaw’ (language ‘en’)
– Executing [[email protected]:1] Macro(“SIP/202-00000011”, “hangupcall”) in new stack
– Executing [[email protected]:1] GotoIf(“SIP/202-00000011”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,3)
– Executing [[email protected]:3] ExecIf(“SIP/202-00000011”, “0?Set(CDR(recordingfile)=)”) in new stack
– Executing [[email protected]:4] NoOp(“SIP/202-00000011”, " montior file= ") in new stack
– Executing [[email protected]:5] GotoIf(“SIP/202-00000011”, “1?skipagi”) in new stack
– Goto (macro-hangupcall,s,7)
– Executing [[email protected]:7] Hangup(“SIP/202-00000011”, “”) in new stack
== Spawn extension (macro-hangupcall, s, 7) exited non-zero on ‘SIP/202-00000011’ in macro ‘hangupcall’
== Spawn extension (from-internal, h, 1) exited non-zero on ‘SIP/202-00000011’

Alright, so that is the result of there being zero matches found. So now try it again but dial 800800 and show the results.

it completed successfully the call the log results has personal info it’s the same like as a regular call by the way I just realized that number is an adult number I did not test this specific number before I used it as an example

This is not complicated. Suppose when 411 is dialed, you want to call 18003733411 (Free 411). Set up your Outbound Route with:
prepend: 18003733411
prefix: 411
match pattern: (leave blank)

What the Outbound Route does is look for a number matching the prefix followed by the match pattern. If it matches, the prefix is removed and the prepend is prepended. In this case, the match pattern is empty so when 411 is dialed, it matches, the prefix is removed (leaving nothing), so the prepend is what gets called.


thank you so much I guess Chris from crosstalk Solutions made a little mistake we’re all human I guess
other than that no one has better videos on FreePBX

You mean it’s almost like it’s prefix+pattern?! No way!

like this it works fine

In theory, yes. Because it’s prefix+pattern since there is no pattern it matches on the prefix only. But I’m not a 100% it works right since what is in that screenshot is a 12 digit toll free number, unless that is some special number for you to use.

I can use anything in the prepend I use my cell phone number and I dialed 411 and it redirected the call to my cell phone

I know how the outbound routes work. What I said originally was the same answer @Stewart1 gave you in a different way.

You posted a screenshot and said “like this it works fine” and while the match/prefix part was correct the prepend part had a non routable number as it was 12 digits. That’s why I said I wasn’t 100% that would actually work. The upstream wouldn’t be able to route 12 digit numbers anywhere.

1 Like

Hence the ending of my sentence. So if this was a special number/rule for you to use by your carrier (I’m not sure how having an extra 1 at the end is a rule) then you should have just replied with “Yes, that is a special route I can use with my carrier” and avoided this.

Sorry, my mistake. The number should be 18003733411. (1 800 FREE 411) Original post now edited.

1 Like

sorry you are right there is no 12 digit numbers I used an example number that I did actually not use in testing, I really appreciate your help

it still doesn’t work properly
it goes to 411 not the free one

it goes to the free one

it only works when you use a random number in prefix

My suspicion is that either there is another Outbound Route that matches 411, earlier in the list, or the device is modifying the number. Try putting it above all other routes except Emergency routes (and check that your emergency routes don’t match 411).

I looked at all the dial patterns I couldn’t see anything that matches I disabled all the trunks and 411 still works looks like you don’t need a trunk for 411