VoIP Mailing List Archives
Mailing list archives for the VoIP community |
|
View previous topic :: View next topic |
Author |
Message |
grcamauer at gmail.com Guest
|
Posted: Mon Apr 26, 2021 5:50 pm Post subject: [Freeswitch-users] JSON channel variable from Dialplan |
|
|
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 |
|
Back to top |
|
|
s.safarov at gmail.com Guest
|
|
Back to top |
|
|
grcamauer at gmail.com Guest
|
Posted: Tue Apr 27, 2021 3:20 pm Post subject: [Freeswitch-users] JSON channel variable from Dialplan |
|
|
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@gmail.com (s.safarov@gmail.com)> wrote:
--
Guillermo Ruiz Camauer |
|
Back to top |
|
|
dujinfang at gmail.com Guest
|
|
Back to top |
|
|
grcamauer at gmail.com Guest
|
Posted: Wed May 05, 2021 11:10 am Post subject: [Freeswitch-users] JSON channel variable from Dialplan |
|
|
Yes, CDATA should work and also you can use " for double quotes and & for single quotes.
Guillermo
On Tue, May 4, 2021 at 10:18 PM Seven Du <dujinfang@gmail.com (dujinfang@gmail.com)> wrote:
--
Guillermo Ruiz Camauer |
|
Back to top |
|
|
covici at ccs.covici.com Guest
|
|
Back to top |
|
|
grcamauer at gmail.com Guest
|
Posted: Wed May 05, 2021 4:17 pm Post subject: [Freeswitch-users] JSON channel variable from Dialplan |
|
|
Very much correct. Single quote is '
Guillermo
On Wed, May 5, 2021 at 3:44 PM John Covici <covici@ccs.covici.com (covici@ccs.covici.com)> wrote:
--
Guillermo Ruiz Camauer |
|
Back to top |
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|