Dumping channel information into a Lua array
Is it possible to get the equivalent of session:execute("info") but have the output go into a Lua array?
Besides the stated obvious, what are you trying to accomplish? -- Brian West brian@freeswitch.org FreeSWITCH Solutions, LLC PO BOX 2531 Brookfield, WI 53008-2531 Twitter: @FreeSWITCH , @briankwest http://www.freeswitchbook.com http://www.freeswitchcookbook.com T: +1.918.420.9001 | F: +1.918.420.9002 | M: +1.918.424.WEST iNUM: +883 5100 1420 9001 ISN: 410*543 Skype:briankwest PGP Key: http://www.bkw.org/key.txt (AB93356707C76CED) On Feb 13, 2014, at 3:31 AM, Alex Lake <alex@digitalmail.com> wrote:
Is it possible to get the equivalent of session:execute("info") but have the output go into a Lua array?
Sorry for the slow response... I was trying to get a way of dumping only "interesting" variables to the console to aid in debugging without generating reams of irrelevant variables! I've got a totally different method now that uses the api.
Besides the stated obvious, what are you trying to accomplish? -- Brian West brian@freeswitch.org FreeSWITCH Solutions, LLC PO BOX 2531 Brookfield, WI 53008-2531 Twitter: @FreeSWITCH , @briankwest http://www.freeswitchbook.com http://www.freeswitchcookbook.com
T: +1.918.420.9001 | F: +1.918.420.9002 | M: +1.918.424.WEST iNUM: +883 5100 1420 9001 ISN: 410*543 Skype:briankwest PGP Key: http://www.bkw.org/key.txt (AB93356707C76CED)
On Feb 13, 2014, at 3:31 AM, Alex Lake <alex@digitalmail.com> wrote:
Is it possible to get the equivalent of session:execute("info") but have the output go into a Lua array?
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
----- No virus found in this message. Checked by AVG - www.avg.com Version: 2014.0.4259 / Virus Database: 3697/7088 - Release Date: 02/12/14
If you found it helpful -- can you share the basics? On Thu, Mar 13, 2014 at 1:35 PM, Alex Lake <alex@digitalmail.com> wrote:
Sorry for the slow response...
I was trying to get a way of dumping only "interesting" variables to the console to aid in debugging without generating reams of irrelevant variables! I've got a totally different method now that uses the api.
Well, what I did was quite complicated... Essentially, I have a web application running on a LAMP stack which hits the freeswitch socket with "api show detailed_calls". This is parsed (not that easy!) into key-value pairs to find the dialplan context of each call. It then iterates through the list of calls and if it find one that matches the dialplan filter specified by the user, it hits the freeswitch socket again with "api uuid_dump <uuid>". It takes the results of this and attempts to parse it into an array of key-value pairs. This is then filtered to display into a frame on the web page. Knowing what I know now, I could do what I was originally after far more easily - just execute "uuid_dump" and parse the results. However, it's very nice to have a web-based session inspector.
If you found it helpful -- can you share the basics?
On Thu, Mar 13, 2014 at 1:35 PM, Alex Lake <alex@digitalmail.com <mailto:alex@digitalmail.com>> wrote:
Sorry for the slow response...
I was trying to get a way of dumping only "interesting" variables to the console to aid in debugging without generating reams of irrelevant variables! I've got a totally different method now that uses the api.
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
No virus found in this message. Checked by AVG - www.avg.com <http://www.avg.com> Version: 2014.0.4259 / Virus Database: 3722/7187 - Release Date: 03/12/14
BTW, you can do: show detailed_calls as xml show detailed_calls as json -- might have been easier/more robust to parse... -Avi On Thu, Mar 13, 2014 at 6:07 PM, Alex Lake <alex@digitalmail.com> wrote:
Well, what I did was quite complicated...
Essentially, I have a web application running on a LAMP stack which hits the freeswitch socket with "api show detailed_calls". This is parsed (not that easy!) into key-value pairs to find the dialplan context of each call. It then iterates through the list of calls and if it find one that matches the dialplan filter specified by the user, it hits the freeswitch socket again with "api uuid_dump <uuid>". It takes the results of this and attempts to parse it into an array of key-value pairs. This is then filtered to display into a frame on the web page.
Knowing what I know now, I could do what I was originally after far more easily - just execute "uuid_dump" and parse the results.
However, it's very nice to have a web-based session inspector.
If you found it helpful -- can you share the basics?
On Thu, Mar 13, 2014 at 1:35 PM, Alex Lake <alex@digitalmail.com> wrote:
Sorry for the slow response...
I was trying to get a way of dumping only "interesting" variables to the console to aid in debugging without generating reams of irrelevant variables! I've got a totally different method now that uses the api.
_________________________________________________________________________ Professional FreeSWITCH Consulting Services:consulting@freeswitch.orghttp://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Serverhttp://www.cudatel.com
Official FreeSWITCH Siteshttp://www.freeswitch.orghttp://wiki.freeswitch.orghttp://www.cluecon.com
FreeSWITCH-users mailing listFreeSWITCH-users@lists.freeswitch.orghttp://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-usershttp://www.frees...
No virus found in this message. Checked by AVG - www.avg.com Version: 2014.0.4259 / Virus Database: 3722/7187 - Release Date: 03/12/14
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Ah, that's good to know!!
BTW, you can do: show detailed_calls as xml show detailed_calls as json -- might have been easier/more robust to parse...
-Avi
On Thu, Mar 13, 2014 at 6:07 PM, Alex Lake <alex@digitalmail.com <mailto:alex@digitalmail.com>> wrote:
Well, what I did was quite complicated...
Essentially, I have a web application running on a LAMP stack which hits the freeswitch socket with "api show detailed_calls". This is parsed (not that easy!) into key-value pairs to find the dialplan context of each call. It then iterates through the list of calls and if it find one that matches the dialplan filter specified by the user, it hits the freeswitch socket again with "api uuid_dump <uuid>". It takes the results of this and attempts to parse it into an array of key-value pairs. This is then filtered to display into a frame on the web page.
Knowing what I know now, I could do what I was originally after far more easily - just execute "uuid_dump" and parse the results.
However, it's very nice to have a web-based session inspector.
If you found it helpful -- can you share the basics?
On Thu, Mar 13, 2014 at 1:35 PM, Alex Lake <alex@digitalmail.com <mailto:alex@digitalmail.com>> wrote:
Sorry for the slow response...
I was trying to get a way of dumping only "interesting" variables to the console to aid in debugging without generating reams of irrelevant variables! I've got a totally different method now that uses the api.
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org <mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org <mailto:FreeSWITCH-users@lists.freeswitch.org> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
No virus found in this message. Checked by AVG - www.avg.com <http://www.avg.com> Version: 2014.0.4259 / Virus Database: 3722/7187 - Release Date: 03/12/14
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org <mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org <mailto:FreeSWITCH-users@lists.freeswitch.org> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
No virus found in this message. Checked by AVG - www.avg.com <http://www.avg.com> Version: 2014.0.4259 / Virus Database: 3722/7187 - Release Date: 03/12/14
participants (3)
-
Alex Lake
-
Avi Marcus
-
Brian West