[asterisk-users] a little regex help needed

sean darcy seandarcy2 at gmail.com
Mon Oct 20 13:10:02 CDT 2008


I'm trying to set the callerid(name) to Office for all calls from the 
main office.

exten =>s,n,Set(CALLERID(name)=${IF($[0${CALLERID(num)} = 
0${REGEX("21245711*")} ] ? "Office":${CALLERID(name)} )})

The main office callerid's are all 212 457 11xx. But this statement 
seems to match everything, including callerid(num)=""

What I'd expect is a callerid(num) of 2124571123 to generate an if test 
of  [02124571123 == 021245711*] or TRUE.

But I've messed up the regex statement somehow.

Thanks for any help.

sean




More information about the asterisk-users mailing list