[Freeswitch-users] Escape variable content when used as a field in a condition

David Villasmil david.villasmil.work at gmail.com
Wed Sep 15 11:54:57 UTC 2021


Thanks Ken, I tried that but it was just escaping the $ from ${variable}

I ended up using a cond function.

Thanks again

David

On Wed, 15 Sep 2021 at 02:08, Ken Rice <krice at freeswitch.org> wrote:

> put a slash right after the ^ In the expression or you have to feed it a
> proper regex in that chanvar.
>
>
>
> Sent from my iPhone
>
> On Sep 14, 2021, at 14:33, David Villasmil <david.villasmil.work at gmail.com>
> wrote:
>
> 
>
> Hello all,
>
> I'm trying to compare 2 variables in a condition, something like
>
> <condition field="${sip_from_user}"
> expression="^${some_other_phone_number}$" inline="true">
>
> But it looks like FS expands the variable, and does the comparison. The
> problem with this is, those 2 phone numbers are in e.164, i.e.:
>
> sip_from_user = +18885551212
> some_other_phone_number = +18005551212
>
> and so the condition ends up being:
>
> <condition field="+18885551212" expression="^+18005551212$" inline="true">
>
> which of course won't work....
>
> Is there any way of escaping the variables automatically when comparing?
> I haven't found a way.
>
> Thanks!
>
> David Villasmil
> email: david.villasmil.work at gmail.com
> phone: +34669448337
>
> _________________________________________________________________________
>
> The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
> Enhance your FreeSWITCH install with disruptive priced SMS and PSTN
> services.
> Build your next product on our scalable cloud platform.
>
> Join our online community to chat in real time
> https://signalwire.community
>
> Professional FreeSWITCH Services
> sales at freeswitch.com
> https://freeswitch.com
>
> Official FreeSWITCH Sites
> https://freeswitch.com/oss
> https://freeswitch.org/confluence
> https://cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> https://freeswitch.com
>
> _________________________________________________________________________
>
> The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
> Enhance your FreeSWITCH install with disruptive priced SMS and PSTN
> services.
> Build your next product on our scalable cloud platform.
>
> Join our online community to chat in real time
> https://signalwire.community
>
> Professional FreeSWITCH Services
> sales at freeswitch.com
> https://freeswitch.com
>
> Official FreeSWITCH Sites
> https://freeswitch.com/oss
> https://freeswitch.org/confluence
> https://cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> https://freeswitch.com

-- 
Regards,

David Villasmil
email: david.villasmil.work at gmail.com
phone: +34669448337
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20210915/059dbe44/attachment.html>


More information about the FreeSWITCH-users mailing list