Route based on dial pattern

Alright, I have a few systems where I want to hide the outbound CID on all calls except 911. I’m testing on my lab system with 7 and 11 digits dialed to route with CID exposed, and 10 digits dialed using a different route (but the same carriers) and hiding the CID. I don’t want to tie up 911’s resources. I figure the patterns would trigger the correct route. What I’m getting is 7 and 11 digit calls route fine, but 10 digits get a message of can’t complete as dialed. The trace suggests it’s a bad number. If I put the same 10 digit pattern back in with my existing main route, calls process normally.

The patterns I’m using are:
1NXXNXXXXXX
NXXNXXXXXX
NXXXXXX

Pretty simple, I would think. Anyone got a clue? I don’t.

Sounds like your carrier blocks the call because of the caller ID based on your comment of you block the caller ID with using 10 digit numbers.

Here’s a trace:

[[email protected] ~]# tail -f /var/log/asterisk/full
[2018-10-08 09:11:37] VERBOSE[13570][C-0000006d] pbx.c: Executing [[email protected]: 1] Goto(“SIP/104-000000f4”, “11,1”) in new stack
[2018-10-08 09:11:37] VERBOSE[13570][C-0000006d] pbx_builtins.c: Goto (bad-numbe r,11,1)
[2018-10-08 09:11:37] VERBOSE[13570][C-0000006d] pbx.c: Executing [[email protected] :1] ResetCDR(“SIP/104-000000f4”, “”) in new stack
[2018-10-08 09:11:37] VERBOSE[13570][C-0000006d] pbx.c: Executing [[email protected] :2] NoCDR(“SIP/104-000000f4”, “”) in new stack
[2018-10-08 09:11:37] VERBOSE[13570][C-0000006d] pbx.c: Executing [[email protected] :3] Progress(“SIP/104-000000f4”, “”) in new stack
[2018-10-08 09:11:37] VERBOSE[13570][C-0000006d] pbx.c: Executing [[email protected] :4] Wait(“SIP/104-000000f4”, “1”) in new stack
[2018-10-08 09:11:38] VERBOSE[13570][C-0000006d] pbx.c: Executing [[email protected] :5] Playback(“SIP/104-000000f4”, “silence/1&cannot-complete-as-dialed&check-numb er-dial-again,noanswer”) in new stack
[2018-10-08 09:11:38] VERBOSE[13570][C-0000006d] file.c: <SIP/104-000000f4> Play ing ‘silence/1.ulaw’ (language ‘en’)
[2018-10-08 09:11:39] VERBOSE[13570][C-0000006d] file.c: <SIP/104-000000f4> Play ing ‘cannot-complete-as-dialed.ulaw’ (language ‘en’)
[2018-10-08 09:11:39] VERBOSE[13570][C-0000006d] file.c: <SIP/104-000000f4> Play ing ‘check-number-dial-again.ulaw’ (language ‘en’)
[2018-10-08 09:12:25] VERBOSE[3256][C-0000006e] netsock2.c: Using SIP RTP TOS bits 184
[2018-10-08 09:12:25] VERBOSE[3256][C-0000006e] netsock2.c: Using SIP RTP CoS mark 5
[2018-10-08 09:12:25] VERBOSE[13861][C-0000006e] pbx.c: Executing [[email protected]:1] Macro(“SIP/104-000000f5”, “user-callerid,LIMIT”) in new stack
[2018-10-08 09:12:25] VERBOSE[13861][C-0000006e] pbx.c: Executing [[email protected]:1] Set(“SIP/104-000000f5”, “TOUCH_MONITOR=1539015145.285”) in new stack
[2018-10-08 09:12:25] VERBOSE[13861][C-0000006e] pbx.c: Executing [[email protected]:2] Set(“SIP/104-000000f5”, “AMPUSER=104”) in new stack
[2018-10-08 09:12:25] VERBOSE[13861][C-0000006e] pbx.c: Executing [[email protected]:3] GotoIf(“SIP/104-000000f5”, “0?report”) in new stack
[2018-10-08 09:12:25] VERBOSE[13861][C-0000006e] pbx.c: Executing [[email protected]:4] ExecIf(“SIP/104-000000f5”, “1?Set(REALCALLERIDNUM=104)”) in new stack
[2018-10-08 09:12:25] VERBOSE[13861][C-0000006e] pbx.c: Executing [[email protected]user-callerid:5] Set(“SIP/104-000000f5”, “AMPUSER=104”) in new stack
[2018-10-08 09:12:25] VERBOSE[13861][C-0000006e] pbx.c: Executing [[email protected]:6] GotoIf(“SIP/104-000000f5”, “0?limit”) in new stack
[2018-10-08 09:12:25] VERBOSE[13861][C-0000006e] pbx.c: Executing [[email protected]:7] Set(“SIP/104-000000f5”, “AMPUSERCIDNAME=Len 450”) in new stack
[2018-10-08 09:12:25] VERBOSE[13861][C-0000006e] pbx.c: Executing [[email protected]:8] ExecIf(“SIP/104-000000f5”, “0?Set(__CIDMASQUERADING=TRUE)”) in new stack
[2018-10-08 09:12:25] VERBOSE[13861][C-0000006e] pbx.c: Executing [[email protected]:9] GotoIf(“SIP/104-000000f5”, “0?report”) in new stack
[2018-10-08 09:12:25] VERBOSE[13861][C-0000006e] pbx.c: Executing [[email protected]:10] Set(“SIP/104-000000f5”, “AMPUSERCID=104”) in new stack
[2018-10-08 09:12:25] VERBOSE[13861][C-0000006e] pbx.c: Executing [[email protected]:11] Set(“SIP/104-000000f5”, “__DIAL_OPTIONS=HhTtr”) in new stack
[2018-10-08 09:12:25] VERBOSE[13861][C-0000006e] pbx.c: Executing [[email protected]:12] Set(“SIP/104-000000f5”, “CALLERID(all)=“Len 450” <104>”) in new stack
[2018-10-08 09:12:25] VERBOSE[13861][C-0000006e] pbx.c: Executing [[email protected]:13] GotoIf(“SIP/104-000000f5”, “0?limit”) in new stack
[2018-10-08 09:12:25] VERBOSE[13861][C-0000006e] pbx.c: Executing [[email protected]:14] ExecIf(“SIP/104-000000f5”, “1?Set(GROUP(concurrency_limit)=104)”) in new stack
[2018-10-08 09:12:25] VERBOSE[13861][C-0000006e] pbx.c: Executing [[email protected]:15] ExecIf(“SIP/104-000000f5”, “0?Set(CHANNEL(language)=)”) in new stack
[2018-10-08 09:12:25] VERBOSE[13861][C-0000006e] pbx.c: Executing [[email protected]:16] NoOp(“SIP/104-000000f5”, “Macro Depth is 1”) in new stack
[2018-10-08 09:12:25] VERBOSE[13861][C-0000006e] pbx.c: Executing [[email protected]:17] GotoIf(“SIP/104-000000f5”, “1?report2:macroerror”) in new stack
[2018-10-08 09:12:25] VERBOSE[13861][C-0000006e] pbx_builtins.c: Goto (macro-user-callerid,s,18)
[2018-10-08 09:12:25] VERBOSE[13861][C-0000006e] pbx.c: Executing [[email protected]:18] GotoIf(“SIP/104-000000f5”, “1?continue”) in new stack
[2018-10-08 09:12:25] VERBOSE[13861][C-0000006e] pbx_builtins.c: Goto (macro-user-callerid,s,37)
[2018-10-08 09:12:25] VERBOSE[13861][C-0000006e] pbx.c: Executing [[email protected]:37] Set(“SIP/104-000000f5”, “CALLERID(number)=104”) in new stack
[2018-10-08 09:12:25] VERBOSE[13861][C-0000006e] pbx.c: Executing [[email protected]:38] Set(“SIP/104-000000f5”, “CALLERID(name)=Len 450”) in new stack
[2018-10-08 09:12:25] VERBOSE[13861][C-0000006e] pbx.c: Executing [[email protected]:39] GotoIf(“SIP/104-000000f5”, “0?cnum”) in new stack
[2018-10-08 09:12:25] VERBOSE[13861][C-0000006e] pbx.c: Executing [[email protected]:40] Set(“SIP/104-000000f5”, “CDR(cnam)=Len 450”) in new stack
[2018-10-08 09:12:25] VERBOSE[13861][C-0000006e] pbx.c: Executing [[email protected]:41] Set(“SIP/104-000000f5”, “CDR(cnum)=104”) in new stack
[2018-10-08 09:12:25] VERBOSE[13861][C-0000006e] pbx.c: Executing [[email protected]:42] Set(“SIP/104-000000f5”, “CHANNEL(language)=en”) in new stack
[2018-10-08 09:12:25] VERBOSE[13861][C-0000006e] pbx.c: Executing [[10 digits]@from-internal:2] Set(“SIP/104-000000f5”, “ROUTEUSER=104”) in new stack
[2018-10-08 09:12:25] VERBOSE[13861][C-0000006e] pbx.c: Executing [[10 digits]@from-internal:3] Set(“SIP/104-000000f5”, “ROUTEUSER=104”) in new stack
[2018-10-08 09:12:25] VERBOSE[13861][C-0000006e] pbx.c: Executing [[10 digits]@from-internal:4] GotoIf(“SIP/104-000000f5”, “1?notblind”) in new stack
[2018-10-08 09:12:25] VERBOSE[13861][C-0000006e] pbx_builtins.c: Goto (from-internal,[10 digits],7)
[2018-10-08 09:12:25] VERBOSE[13861][C-0000006e] pbx.c: Executing [[10 digits]@from-internal:7] GotoIf(“SIP/104-000000f5”, “1?restrictedroute-c4ca4238a0b923820dcc509a6f75849b,[10 digits],2:outbound-allroutes,[10 digits],2”) in new stack
[2018-10-08 09:12:25] VERBOSE[13861][C-0000006e] pbx_builtins.c: Goto (restrictedroute-c4ca4238a0b923820dcc509a6f75849b,[10 digits],2)
[2018-10-08 09:12:25] VERBOSE[13861][C-0000006e] pbx.c: Channel ‘SIP/104-000000f5’ sent to invalid extension: context,exten,priority=restrictedroute-c4ca4238a0b923820dcc509a6f75849b,[10 digits],2
[2018-10-08 09:12:25] VERBOSE[13861][C-0000006e] pbx.c: Executing [[email protected]:1] Goto(“SIP/104-000000f5”, “bad-number,s,1”) in new stack
[2018-10-08 09:12:25] VERBOSE[13861][C-0000006e] pbx_builtins.c: Goto (bad-number,s,1)
[2018-10-08 09:12:25] VERBOSE[13861][C-0000006e] pbx.c: Executing [[email protected]:1] Goto(“SIP/104-000000f5”, “11,1”) in new stack
[2018-10-08 09:12:25] VERBOSE[13861][C-0000006e] pbx_builtins.c: Goto (bad-number,11,1)
[2018-10-08 09:12:25] VERBOSE[13861][C-0000006e] pbx.c: Executing [[email protected]:1] ResetCDR(“SIP/104-000000f5”, “”) in new stack
[2018-10-08 09:12:25] VERBOSE[13861][C-0000006e] pbx.c: Executing [[email protected]:2] NoCDR(“SIP/104-000000f5”, “”) in new stack
[2018-10-08 09:12:25] VERBOSE[13861][C-0000006e] pbx.c: Executing [[email protected]:3] Progress(“SIP/104-000000f5”, “”) in new stack
[2018-10-08 09:12:25] VERBOSE[13861][C-0000006e] pbx.c: Executing [[email protected]:4] Wait(“SIP/104-000000f5”, “1”) in new stack
[2018-10-08 09:12:26] VERBOSE[13861][C-0000006e] pbx.c: Executing [[email protected]:5] Playback(“SIP/104-000000f5”, “silence/1&cannot-complete-as-dialed&check-number-dial-again,noanswer”) in new stack
[2018-10-08 09:12:26] VERBOSE[13861][C-0000006e] file.c: <SIP/104-000000f5> Playing ‘silence/1.ulaw’ (language ‘en’)
[2018-10-08 09:12:27] VERBOSE[13861][C-0000006e] file.c: <SIP/104-000000f5> Playing ‘cannot-complete-as-dialed.ulaw’ (language ‘en’)
[2018-10-08 09:12:29] VERBOSE[13861][C-0000006e] file.c: <SIP/104-000000f5> Playing ‘check-number-dial-again.ulaw’ (language ‘en’)

I just did a test on my successful route where I changed the Route CID to hidden. Calls routed fine and CID came up as “unavailable”.

If I set the route containing 10 digits to first, it still fails, no matter the carrier selection. Something suggests NXXNXXXXXX is no good if it’s in a route all by itself. Should there be other entries in the dial pattern?

From bash

rasterisk -x 'dialplan show [email protected]'

any outrt-N would indicate an acceptable path, it perhaps is intercepted before it gets to one.

So if I do not see an outrt-N, I have no route?

You seem to be running afoul of ‘restricted routes’ (extension routing, class of service, custom contexts, outbound route permissions, etc.) Check what you have configured to block.

1 Like

Ah! There it is! Seems when I created the second test route, the extension routing didn’t include any extensions. Let me do some more testing and check to see what my client systems look like (they were mostly programmed by someone else).

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.