Validate Caller ID

Hello,
I`m looking for extension rule to validate only 9 digits in caller id.

I`m trying multiple varriants of
same => 5,GotoIf($["${CALLERID(num)}" != “[0-9]{9}”]?rejected)
But with no result… can anyone help?

Use the standard sub-string syntax for variables or actually use a regular expression operator (and a regexp style regular expression). You may also be able to use “ex-girlfriend logic”.

The problem is more complicated becouse i can not use extension XXX/XXX at the begining.
CallerID is important in the middle of extension, so i need to validate to have only numbers.

You can have more specific matches in the middle of the extension, just remember to use “same” on the next line to provide a catchall in case it doesn’t match.