Inbound routes pattern match not working

FreePBX v2.8.1.3 on asterisknow, asterisk version 1.6.2.17.

inbound routes pattern matching does not work

for example, a DID with 448435005555 is recognised on inbound routes and correctly routed. However 44843500XXXX is not recognised at all and we get the following-

-- Executing [[email protected]:1] Set("SIP/SIP-TRUNK-00000033", "GROUP()=OUT_2") in new stack
-- Executing [[email protected]:2] Goto("SIP/SIP-TRUNK-00000033", "from-trunk,448435001111,1") in new stack
-- Goto (from-trunk,448435001111,1)
-- Executing [[email protected]:1] Set("SIP/SIP-TRUNK-00000033", "__FROM_DID=448435001111") in new stack

– Executing [[email protected]:2] NoOp(“SIP/SIP-TRUNK-00000033”, “Received an unknown call with DID set to 448435001111”) in new stack
– Executing [[email protected]:3] Goto(“SIP/SIP-TRUNK-00000033”, “s,a2”) in new stack
– Goto (from-trunk,s,2)
– Executing [[email protected]:2] Answer(“SIP/SIP-TRUNK-00000033”, “”) in new stack
– Executing [[email protected]:3] Wait(“SIP/SIP-TRUNK-00000033”, “2”) in new stack
– Executing [[email protected]:4] Playback(“SIP/SIP-TRUNK-00000033”, “ss-noservice”) in new stack
– <SIP/SIP-TRUNK-00000033> Playing ‘ss-noservice.ulaw’ (language ‘en’)

sip_additional.conf looks like this:

exten => 448435005555,1,Set(__FROM_DID=${EXTEN})
exten => 448435005555,n,Gosub(app-blacklist-check,s,1)
exten => 448435005555,n,ExecIf($[ “${CALLERID(name)}” = “” ] ?Set(CALLERID(name)=${CALLERID(num)}))
exten => 448435005555,n,Set(__CALLINGPRES_SV=${CALLERPRES()})
exten => 448435005555,n,Set(CALLERPRES()=allowed_not_screened)
exten => 448435005555,n(dest-ext),Goto(from-did-direct,200,1)
exten => 44843500XXXX,1,Set(__FROM_DID=${EXTEN})
exten => 44843500XXXX,n,Gosub(app-blacklist-check,s,1)
exten => 44843500XXXX,n,ExecIf($[ “${CALLERID(name)}” = “” ] ?Set(CALLERID(name)=${CALLERID(num)}))
exten => 44843500XXXX,n,Set(__CALLINGPRES_SV=${CALLERPRES()})
exten => 44843500XXXX,n,Set(CALLERPRES()=allowed_not_screened)
exten => 44843500XXXX,n(dest-ext),Goto(app-announcement-1,s,1)

That worked thanks!

Didnt Freepbx used to put the underscore in automatically?
Ive never had to do that on previous freepbx versions!

nope, I don’t believe it ever has.

I’ve been debating doing it if all characters are valid pattern characters since it’s unlikely that it would collide with the fairly rare case of a non-numeric DID.

try putting _44843500XXXX

inbound route’s doesn’t automatically add that yet since it’s possible to have non-numeric inbound ‘DIDs’ that are not patterns…

Just wanted to post a note that although FreePBX now allows pattern matches in DIDs, it does not allow pattern matches in Caller IDs. However, I tried adding the underscore, and found that it works. Yay!