> On 28/11/2016, at 12:29 pm, Calum Power <[email protected]> wrote: > > <snip> > > What I have written come up with is below, but I just wanted to see if I was > going about this the right way, and that this expression would actually > work... > > exten => B,n,GotoIf($["${CALLERID(num):-2}" = "13"] & > $["${CALLERID(num):0:2}" = [5-9][5-9])?change_context) > > Any advice/suggestions/flames welcome J
Hi Calum
I think you'll need another closing square-bracket at the end of the second
conditional test in your example, ie: 5-9]])?cha
I also think you may need to wrap that second conditional up in the REGEX
function, although there are much smarter people on-list who will likely come
back with a better suggestion!
Also, checking the second character of CID is the same as the first character
(otherwise you'd match 56, 69, 97 etc).
I'm thinking something like:
$[${REGEX("[5-9]" ${CALLERID(num):0:1})}] & $[${CALLERID(num):0:1} =
${CALLERID(num):1:1}]
Hope this helps anyway :)
Pete
smime.p7s
Description: S/MIME cryptographic signature
-- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
