Inbound Routes based on CallerID not working

I have created a new PBX at our office. I have 1 number that when it calls in I want to route to a specific destination.
This used to work fine by making an inbound route and then adding the CallerID that is presented in the console when they rang in and making a destination for the route.

System details are: PBX Firmware:6.12.65-22

I logged into the CLI and got customer to call in and got the below.

(DID route number is replaced with 987654321 and CID of incoming call is replaced with 123456789)

== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– Executing [[email protected]:1] Set(“SIP/2-MNF-987654321-000002b0”, “GROUP()=OUT_2”) in new stack
– Executing [[email protected]:2] Goto(“SIP/2-MNF-987654321-000002b0”, “from-trunk,987654321,1”) in new stack
– Goto (from-trunk,987654321,1)
– Executing [[email protected]:1] Set(“SIP/2-MNF-987654321-000002b0”, “__FROM_DID=987654321”) in new stack
– Executing [[email protected]:2] Gosub(“SIP/2-MNF-987654321-000002b0”, “sub-record-check,s,1(in,987654321,dontcare)”) in new stack
– Executing [[email protected]:1] GotoIf(“SIP/2-MNF-987654321-000002b0”, “0?initialized”) in new stack
– Executing [[email protected]:2] Set(“SIP/2-MNF-987654321-000002b0”, “__REC_STATUS=INITIALIZED”) in new stack
– Executing [[email protected]:3] Set(“SIP/2-MNF-987654321-000002b0”, “NOW=1417862314”) in new stack
– Executing [[email protected]:4] Set(“SIP/2-MNF-987654321-000002b0”, “__DAY=06”) in new stack
– Executing [[email protected]:5] Set(“SIP/2-MNF-987654321-000002b0”, “__MONTH=12”) in new stack
– Executing [[email protected]:6] Set(“SIP/2-MNF-987654321-000002b0”, “__YEAR=2014”) in new stack
– Executing [[email protected]:7] Set(“SIP/2-MNF-987654321-000002b0”, “__TIMESTR=20141206-183834”) in new stack
– Executing [[email protected]:8] Set(“SIP/2-MNF-987654321-000002b0”, “__FROMEXTEN=unknown”) in new stack
– Executing [[email protected]:9] Set(“SIP/2-MNF-987654321-000002b0”, “__MON_FMT=wav”) in new stack
– Executing [[email protected]:10] NoOp(“SIP/2-MNF-987654321-000002b0”, “Recordings initialized”) in new stack
– Executing [[email protected]:11] ExecIf(“SIP/2-MNF-987654321-000002b0”, “0?Set(ARG3=dontcare)”) in new stack
– Executing [[email protected]:12] Set(“SIP/2-MNF-987654321-000002b0”, “REC_POLICY_MODE_SAVE=”) in new stack
– Executing [[email protected]:13] GotoIf(“SIP/2-MNF-987654321-000002b0”, “2?checkaction”) in new stack
– Goto (sub-record-check,s,16)
– Executing [[email protected]:16] GotoIf(“SIP/2-MNF-987654321-000002b0”, “1?sub-record-check,in,1”) in new stack
– Goto (sub-record-check,in,1)
– Executing [[email protected]:1] NoOp(“SIP/2-MNF-987654321-000002b0”, “Inbound Recording Check to 987654321”) in new stack
– Executing [[email protected]:2] Set(“SIP/2-MNF-987654321-000002b0”, “FROMEXTEN=unknown”) in new stack
– Executing [[email protected]:3] ExecIf(“SIP/2-MNF-987654321-000002b0”, “10?Set(FROMEXTEN=123456789)”) in new stack
– Executing [[email protected]:4] Gosub(“SIP/2-MNF-987654321-000002b0”, “recordcheck,1(dontcare,in,987654321)”) in new stack
– Executing [[email protected]:1] NoOp(“SIP/2-MNF-987654321-000002b0”, “Starting recording check against dontcare”) in new stack
– Executing [[email protected]:2] Goto(“SIP/2-MNF-987654321-000002b0”, “dontcare”) in new stack
– Goto (sub-record-check,recordcheck,3)
– Executing [[email protected]:3] Return(“SIP/2-MNF-987654321-000002b0”, “”) in new stack
– Executing [[email protected]:5] Return(“SIP/2-MNF-987654321-000002b0”, “”) in new stack
– Executing [[email protected]:3] Gosub(“SIP/2-MNF-987654321-000002b0”, “app-blacklist-check,s,1()”) in new stack
– Executing [[email protected]:1] GotoIf(“SIP/2-MNF-987654321-000002b0”, “0?blacklisted”) in new stack
– Executing [[email protected]:2] Set(“SIP/2-MNF-987654321-000002b0”, “CALLED_BLACKLIST=1”) in new stack
– Executing [[email protected]:3] Return(“SIP/2-MNF-987654321-000002b0”, “”) in new stack
– Executing [[email protected]:4] Set(“SIP/2-MNF-987654321-000002b0”, “CDR(did)=987654321”) in new stack

Relevant Line is below (missing CALLERID(number)= line)

– Executing [[email protected]:5] ExecIf(“SIP/2-MNF-987654321-000002b0”, “0 ?Set(CALLERID(name)=123456789)”) in new stack

Then:

-- Executing [[email protected]:6] Set("SIP/2-MNF-987654321-000002b0", "CHANNEL(musicclass)=default") in new stack
-- Executing [[email protected]:7] Set("SIP/2-MNF-987654321-000002b0", "__MOHCLASS=default") in new stack

[2014-12-06 18:38:34] WARNING[22023][C-000002c4]: func_channel.c:538 func_channel_read: Unknown or unavailable item requested: ‘reversecharge’
– Executing [[email protected]:8] GotoIf(“SIP/2-MNF-987654321-000002b0”, “0?macro-hangupcall”) in new stack
– Executing [[email protected]:9] Set(“SIP/2-MNF-987654321-000002b0”, “__CALLINGPRES_SV=allowed_not_screened”) in new stack
– Executing [[email protected]:10] Set(“SIP/2-MNF-987654321-000002b0”, “CALLERPRES()=allowed_not_screened”) in new stack
– Executing [[email protected]:11] Goto(“SIP/2-MNF-987654321-000002b0”, “app-daynight,0,1”) in new stack
– Goto (app-daynight,0,1)
– Executing [[email protected]:1] GotoIf(“SIP/2-MNF-987654321-000002b0”, “0?ivr-4,s,1:timeconditions,1,1”) in new stack
– Goto (timeconditions,1,1)
– Executing [[email protected]:1] Set(“SIP/2-MNF-987654321-000002b0”, “DB(TC/1/INUSESTATE)=INUSE”) in new stack
– Executing [[email protected]:2] Set(“SIP/2-MNF-987654321-000002b0”, “DB(TC/1/NOT_INUSESTATE)=NOT_INUSE”) in new stack
– Executing [[email protected]:3] GotoIfTime(“SIP/2-MNF-987654321-000002b0”, “09:00-17:30,mon-fri,,?truestate”) in new stack
– Executing [[email protected]:4] GotoIf(“SIP/2-MNF-987654321-000002b0”, “0?truegoto”) in new stack
– Executing [[email protected]:5] ExecIf(“SIP/2-MNF-987654321-000002b0”, “0?Set(DB(TC/1)=)”) in new stack
– Executing [[email protected]:6] Set(“SIP/2-MNF-987654321-000002b0”, “DEVICE_STATE(Custom:TC1)=INUSE”) in new stack
– Executing [[email protected]:7] ExecIf(“SIP/2-MNF-987654321-000002b0”, “0?Set(NOT_INUSE)”) in new stack
– Executing [[email protected]:8] GotoIf(“SIP/2-MNF-987654321-000002b0”, “1?ivr-3,s,1”) in new stack
– Goto (ivr-3,s,1)
– Executing [[email protected]:1] Set(“SIP/2-MNF-987654321-000002b0”, “TIMEOUT_LOOPCOUNT=0”) in new stack
– Executing [[email protected]:2] Set(“SIP/2-MNF-987654321-000002b0”, “INVALID_LOOPCOUNT=0”) in new stack
– Executing [[email protected]:3] Set(“SIP/2-MNF-987654321-000002b0”, “_IVR_CONTEXT_ivr-3=”) in new stack
– Executing [[email protected]:4] Set(“SIP/2-MNF-987654321-000002b0”, “_IVR_CONTEXT=ivr-3”) in new stack
– Executing [[email protected]:5] Set(“SIP/2-MNF-987654321-000002b0”, “__IVR_RETVM=”) in new stack
– Executing [[email protected]:6] GotoIf(“SIP/2-MNF-987654321-000002b0”, “0?skip”) in new stack
– Executing [[email protected]:7] Answer(“SIP/2-MNF-987654321-000002b0”, “”) in new stack
– Executing [[email protected]:8] Wait(“SIP/2-MNF-987654321-000002b0”, “1”) in new stack
– Executing [[email protected]:9] Set(“SIP/2-MNF-987654321-000002b0”, “IVR_MSG=custom/IVR-NIGHT”) in new stack
– Executing [[email protected]:10] Set(“SIP/2-MNF-987654321-000002b0”, “TIMEOUT(digit)=3”) in new stack
– Digit timeout set to 3.000
– Executing [[email protected]:11] ExecIf(“SIP/2-MNF-987654321-000002b0”, “1?Background(custom/IVR-NIGHT)”) in new stack
– <SIP/2-MNF-987654321-000002b0> Playing ‘custom/IVR-NIGHT.slin’ (language ‘en’)
== Spawn extension (ivr-3, s, 11) exited non-zero on ‘SIP/2-MNF-987654321-000002b0’
– Executing [[email protected]:1] Hangup(“SIP/2-MNF-987654321-000002b0”, “”) in new stack
== Spawn extension (ivr-3, h, 1) exited non-zero on ‘SIP/2-MNF-987654321-000002b0’

Calling into another PBX I get the following relevant lines in the * CLI

Other DID has been replaced with 00000000

Executing [[email protected]:29] Set(“IAX2/00000000-14951”, “CALLERID(number)=0123456789”) in new stack
Executing [[email protected]:30] Set(“IAX2/00000000-14951”, “CALLERID(name)=0123456789”) in new stack

It appears the CALLERID(number)=XXXXXXXXXX is not getting sent
This means I cannot appply any inbound rotues based on Caller ID.

Any suggestions on why this is not here?

I forgot to mention I am using Asterisk 11 if that helps.

So I just ran asterisk-version-switch on CLI thinking that maybe it was a bug with 11 and went to 12.
Same problem
Only getting

CALLERID(name)=xxxxxxxxxx

no

CALLERID(number)=xxxxxxxxxx

in asterisk CLI.

Do you have a DID specified in the route? If not, have you checked off the CID Priority Route option?

No DID specified and CID priority route is not ticked. I took screenshot from old pbx for this and have setup exactly the same.
In the CLI you can see no reference at all to CALLERID(number)= … only CALLERID(name)= … whereas in other pbx the number string is directly before the name string.

OK, for others having this problem maybe??? @AdHominem was correct …
I ticked the box for CID Priority Route and now all is working.