Queue Failover Destination Based on CID Prefix

Hello all,

To accomplish we did the Following,

Inbound Route > Queue 501 > Failover to Misc Destinations which dials 58056565141 (Randomized Number) Which reaches the script below in extensions_custom.conf, if no Prefix it goes to IVR-1 which adds Prefix "AA: " if it does have the Prefix, it sends it to Voicemail of Extension 200.

So you can basically have one queue and Failover can be sent to different destinations based on the callers CID (In this case a Prefix)

Here’s the script:

[from-internal]
exten => 58056565141,1,Set(check="${CALLERID(name):0:4}")
exten => 58056565141,n,GotoIf($[${check} != “AA:”]?4:3)
exten => 58056565141,3,Goto(ext-local,vmu200,1)
exten => 58056565141,4,Goto(ivr-1,s,1)