<div dir="ltr"><div><div><div><div>Hi Seven,<br><br></div>What you&#39;re suggesting makes consummate sense. I feel a move away from the existing single-string input and output for API calls (which imposes an encoding/parsing burden on clients) to JSON would slash the cost of interfacing to Freeswitch, and further broaden its appeal.<br><br></div><div>I started writing a higher-level Python interface layer, got as far as abstracting the ESL connection and implementing a wrap of the &quot;show calls&quot; function, a showCalls() method which actually returns a list of dicts rather than an amorphous blob, and thought there has to be a better way. Especially since (a) The text output format may change at any time, and (b) the same effort would need to be repeated for several different languages.<br><br></div>Is the move to json something that can be done incrementally, one function at a time, or does it really need an architectural change? What are people&#39;s thoughts on the best way of achieving this?<br><br></div>Cheers<br></div>David<br><div><div><div><br><div><div><div class="gmail_extra"><br><div class="gmail_quote">On 29 August 2015 at 11:55, Seven Du <span dir="ltr">&lt;<a href="mailto:dujinfang@gmail.com" target="_blank">dujinfang@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I&#39;d like to start the migration in the following way:<div><br></div><div>1) write a JSON version of all existing APIs</div><div>2) refactor all normal APIs to use JSON API internally and still output the same text result as before</div><div>3) It would be easy support other formats like XML and web once all APIs are internally JSON</div><div>4) Use modern way to require a desired format like use &quot;Accept&quot; header in HTTP to chose JSON/XML/Text etc.</div><div><br></div><div>I would experiment a bit if the idea sounds good.</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 27, 2015 at 11:36 PM, Michael Jerris <span dir="ltr">&lt;<a href="mailto:mike@jerris.com" target="_blank">mike@jerris.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">we have added the jsonapi interface but almost nothing uses it yet.  Migrating functions to it will be a project over time<div><div><span></span><br><br>On Wednesday, August 26, 2015, David McNab &lt;<a href="mailto:davidmcnabnz@gmail.com" target="_blank">davidmcnabnz@gmail.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div>Hi there,<br><br></div>How do you do API calls in JSON? Or, how do I get a list of all the API calls which can receive JSON parameters and return JSON return values?<br><br></div>For example, in the console, I tried &#39;show calls&#39;, and got a list of calls. I did the same call from via XML-RPC from a python script, and got a single string back, containing what would have been output to the console. But when I tried, from the console:<br><br></div><div><span style="font-family:monospace,monospace"><b>json {&quot;command&quot;:&quot;show calls&quot;, &quot;format&quot;:&quot;pretty&quot;, &quot;data&quot;:{}}</b></span><br></div><div><br>I got an invalid response.<br><br></div><div>I also tried:<br><br><b>json {&quot;command&quot;:&quot;show&quot;, &quot;format&quot;:&quot;pretty&quot;, &quot;data&quot;:&quot;calls&quot;}</b><br><br></div><div>but got similar.<br><br></div><div>Is there a general sceme for invoking all the console API commands (and receiving responses) in JSON format?<br><br></div><div>If not, I guess I need to write some parsers to process each command&#39;s output string.<br><br></div><div>Cheers<br></div><div>David<br><br></div></div>
</blockquote>
</div></div><br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" rel="noreferrer" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://confluence.freeswitch.org" rel="noreferrer" target="_blank">http://confluence.freeswitch.org</a><br>
<a href="http://www.cluecon.com" rel="noreferrer" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><span><font color="#888888"><br></font></span></blockquote></div><span><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div>About: <a href="http://about.me/dujinfang" target="_blank">http://about.me/dujinfang</a><br>Blog: <a href="http://www.dujinfang.com" target="_blank">http://www.dujinfang.com</a><br>Proj:  <a href="http://www.freeswitch.org.cn" target="_blank">http://www.freeswitch.org.cn</a></div>
</font></span></div>
<br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" rel="noreferrer" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://confluence.freeswitch.org" rel="noreferrer" target="_blank">http://confluence.freeswitch.org</a><br>
<a href="http://www.cluecon.com" rel="noreferrer" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br></blockquote></div><br></div></div></div></div></div></div></div>