<div dir="ltr">Fraser<div><br></div><div>Does "api show calls as xml" work for you? From the command line, "show calls as xml" gives me - <a href="http://pastebin.com/8ucMS4WL">http://pastebin.com/8ucMS4WL</a>.</div>
<div><br></div><div>Erik</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Dec 18, 2013 at 2:30 PM, Fraser Redmond <span dir="ltr"><<a href="mailto:fraserredmond@gmail.com" target="_blank">fraserredmond@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><span style="font-family:arial,sans-serif;font-size:13px">I'm connecting to FS from PHP over a socket, and parsing results using the php function str_getcsv()</span><div style="font-family:arial,sans-serif;font-size:13px">
<br></div><div style="font-family:arial,sans-serif;font-size:13px">In my dialplan I have:</div><div style="font-family:arial,sans-serif;font-size:13px"> <action application="playback" data="tone_stream://%(250,250,600,120)"/><br>
</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">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:<br>
</div><div style="font-family:arial,sans-serif;font-size:13px"><snip>,application,application_data,dialplan,<snip></div><div style="font-family:arial,sans-serif;font-size:13px"><snip>,playback,tone_stream://%(250,250,600,120);loops=3,XML,<snip><br>
</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">So the data-separator is the comma, but the data also contains commas without being escaped in any way.</div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Is there any way to change the results to be returned in json? Or change the delimiter?</div><div style="font-family:arial,sans-serif;font-size:13px">
<br></div><div style="font-family:arial,sans-serif;font-size:13px">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.</div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">(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.)</div>
<div style="font-family:arial,sans-serif;font-size:13px"><br clear="all"><div>Cheers,<br>Fraser</div></div></div></div>
<br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br></div>