[Freeswitch-users] Can API commands return something other than CSV?

Erik M. Devane - Comms Guy emdevane at gmail.com
Wed Dec 18 23:57:58 MSK 2013


Fraser

Does "api show calls as xml" work for you? From the command line, "show
calls as xml" gives me - http://pastebin.com/8ucMS4WL.

Erik


On Wed, Dec 18, 2013 at 2:30 PM, Fraser Redmond <fraserredmond at gmail.com>wrote:

> I'm connecting to FS from PHP over a socket, and parsing results using the
> php function str_getcsv()
>
> In my dialplan I have:
>     <action application="playback"
> data="tone_stream://%(250,250,600,120)"/>
>
> When I run "api show channels" if a channel is currently playing that
> tone, then within the returned results I get these 3 headers and values:
> <snip>,application,application_data,dialplan,<snip>
> <snip>,playback,tone_stream://%(250,250,600,120);loops=3,XML,<snip>
>
> So the data-separator is the comma, but the data also contains commas
> without being escaped in any way.
>
> Is there any way to change the results to be returned in json? Or change
> the delimiter?
>
> I've made a regex replace to get around this particular case by matching
> parentheses... But I can see this happening again with some other value
> that has a comma outside of parentheses, and would rather get the results
> in a better format if possible.
>
> (In the wiki, I can see that CDRs and events can be sent in json, and the
> serialize command for events, but none of those would help this particular
> case.)
>
> Cheers,
> Fraser
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> 
> 
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.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
> http://www.freeswitch.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20131218/b3af19c8/attachment.html 


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