[Freeswitch-users] Freeswitch - Regular Expression in Condition
Ximo Peral
ximop_22 at hotmail.com
Thu Oct 15 20:54:17 MSD 2015
I have this condition on a dialplan: <condition field="${curl_response_data}" expression="^(\+)?(\d{6})?(\d{4,15}|anonymous),(\d{6})?(\d{4,17}),(\d{3,5}),(\d{3,5}),(NP\d{3}|RG\d{4,8}|OP\d{6}|CUB\d{6}|CF\d{1}|ANF\d{3}|TLSIOS),?(NP\d{3}|OP\d{6}|CUB\d{6}|CF\d{1}|ANF\d{3})?,?(NP\d{3}|OP\d{6}|CUB\d{6}|CF\d{1}|ANF\d{3})?,?(NP\d{3}|OP\d{6}|CUB\d{6}|CF\d{1}|ANF\d{3})?,?(NP\d{3}|OP\d{6}|CUB\d{6}|CF\d{1}|ANF\d{3})?$" break="on-true">
<action application="set" inline="true" data="auto_hunt=true"/>
<action application="transfer" data="${num_dest} XML routing.Saliente"/>And this curl response:+34987654321,971234567,000,00001,CUB281281,CUB301993,OP024000But I do not get the transfer, the regular expression is not working.I tried this and if it works:<condition field="${curl_response_data}" expression="^(\+)?(\d{6})?(\d{4,15}|anonymous),(\d{6})?(\d{9}),(\d{3,5}),(\d{3,5})(,(\w*))*$" break="on-true">
<action application="set" inline="true" data="auto_hunt=true"/>
<action application="transfer" data="${num_dest} XML routing.Saliente"/>The problem is from the fourth comma
Desperate, I tried it with this conditions and does not work!
<condition field="${curl_response_data}" expression="^(\+)?(\d{6})?(\d{4,15}|anonymous),(\d{6})?(\d{9}),(\d{3,5}),(\d{3,5}),CUB281281,CUB301993,OP024000$" break="on-true">
and
<condition field="${curl_response_data}" expression="^(\+)?(\d{6})?(\d{4,15}|anonymous),(\d{6})?(\d{9}),(\d{3,5}),(\d{3,5}),(CUB281281),(CUB301993),(OP024000)$" break="on-true">
Any ideas??
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20151015/a120ac3a/attachment.html
Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users
mailing list