[asterisk-users] Subexpression usage in Asterisk Dialplan Regular Expressions

Mike Fedyk mike at reachme.com
Mon Mar 17 20:14:23 CDT 2008


Hi,

I currently have these two lines in my dialplan to extract different parts
out of a variable and I'd like to do it in one line instead.  Does anyone
know how to use regular expression subexpressions in the dialplan?
Outputting a comma separated list that can be sent to ARRAY() would be nice
too (tried that, didn't work -- only got the first subexpression).

;extract dialed number
exten => s,n,Set(dialed_num=$[ "${ARG1}" =~ "(.*)\\*" ])

;extract user specified callerid
exten => s,n,Set(callerid_num_custom=$[ "${ARG1}" =~ "\\*(.*)" ])

Mike





More information about the asterisk-users mailing list