[Freeswitch-users] Regex capturing in nested conditions

Ken Rice krice at freeswitch.org
Tue Jan 24 21:34:41 MSK 2017


$1 comes from the LAST regex ran. In this case last regex is looking for true w/ no () so there is nothing in $1

 

From: freeswitch-users-bounces at lists.freeswitch.org [mailto:freeswitch-users-bounces at lists.freeswitch.org] On Behalf Of Rick Jarvis
Sent: Tuesday, January 24, 2017 12:14 PM
To: FreeSWITCH Users Help <freeswitch-users at lists.freeswitch.org>
Subject: [Freeswitch-users] Regex capturing in nested conditions

 

Is there a way of referencing captured regex in the first condition of nested conditions?

 

EG If I have:

 

    <extension name="8 prefix" continue="true">

      <condition field="destination_number" expression="^8(0\d{9,15})"/>

      <condition field="${db(exists/${sip_from_user}/cli8}" expression="true">

        <action application="set" data="destination_number=$1" inline="true"/>

      </condition>

    </extension>

 

At the moment this doesn’t capture the number, and just gives me an actual ‘$1’. I guess I could rearrange the conditions, but I don’t want to break all my logic really…

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20170124/0ffc4a00/attachment-0001.html 


Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list