Regex match caller id

Hello,

I am trying to write a dialplan to check the caller id on an outbound call and if not a valid value, force a value.

I am using

[outgoing]
exten => _X.,1,GotoIf($[${REGEX("^039909310" “${CALLERID(num)}”)}]?3)
exten => _X.,2,Set(CALLERID(num)=0354546670)
exten => _X.,3,Dial(SIP/AAPT/${EXTEN})

I know my caller id is set to 0399093104 so it should just dial out, but the regex is failing and it sets.

I have tried a NOOP on the regex and it says it is fine so i am a little confused.

Any ideas?

Matthew Enger

Whilst I think the problem is the "s, this is easier to do with ex-girlfriend logic:

exten => _X./_039909310.,1,Noop
exten => _X.,s,Set(CALLERID(num)=0354546670)
exten => _X.,n,Dial(SIP/AAPT/${EXTEN})