[Freeswitch-users] JSON channel variable from Dialplan

Guillermo Ruiz Camauer grcamauer at gmail.com
Wed May 5 15:38:48 UTC 2021


Yes, CDATA should work and also you can use " for double quotes and
&amp for single quotes.

Guillermo

On Tue, May 4, 2021 at 10:18 PM Seven Du <dujinfang at gmail.com> wrote:

> You can do that with standard xml CDATA syntax, find examples in the
> source tree
> https://github.com/signalwire/freeswitch/blob/master/conf/sbc/dialplan/default.xml
>
> On Wed, Apr 28, 2021 at 4:16 AM Guillermo Ruiz Camauer <
> grcamauer at gmail.com> wrote:
>
>> Thanks for the response, but actually all I needed to do was URL encode
>> the JSON.
>>
>> So the working version of
>>        <action application="set" data="MY_VAR=[\"Ford\", \"Chevy\"]"/>
>> is
>>
>> <action application="set" data="MY_VAR=
>> %5B%5C%22Ford%5C%22%2C%20%5C%22Chevy%5C%22%5D"/>
>>
>>
>> Guillermo
>>
>> On Tue, Apr 27, 2021 at 2:45 AM Sergey Safarov <s.safarov at gmail.com>
>> wrote:
>>
>>> you create FreeSwitch mod using asr_set_json_text_params as example.
>>>
>>> https://github.com/signalwire/freeswitch/blob/master/src/switch_ivr_async.c#L5306-L5331
>>>
>>> On Tue, Apr 27, 2021 at 1:36 AM Guillermo Ruiz Camauer <
>>> grcamauer at gmail.com> wrote:
>>>
>>>>
>>>>
>>>> Hi all,
>>>>
>>>>
>>>> Is it possible to set the value of a channel variable to a JSON
>>>> formatted string?
>>>>
>>>> I need to do something like this:
>>>>
>>>> <action application="set" data="MY_VAR=[\"Ford\", \"Chevy\"]"/>
>>>>
>>>> The problem seems to be that FS is not accepting the escape sequence
>>>> and MY_VAR gets set to [\
>>>>
>>>> How do I go about escaping double quotes in the dialplan?
>>>>
>>>> --
>>>> Guillermo Ruiz Camauer
>>>>
>>>> _________________________________________________________________________
>>>>
>>>> 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
>>
>>
>>
>> --
>> Guillermo Ruiz Camauer
>> _________________________________________________________________________
>>
>> 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
>
>
>
> --
> About: http://about.me/dujinfang
> Blog: http://www.dujinfang.com
> Proj:  http://www.freeswitch.org.cn
> _________________________________________________________________________
>
> 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



-- 
Guillermo Ruiz Camauer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20210505/bf0b4366/attachment.html>


More information about the FreeSWITCH-users mailing list