<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>