Bug in mod_commands.c with show calls command
I am using the xml_rpc interface like so: http://192.168.1.1:8080/webapi/show?calls I get a response in a table, which is a little bit undesirable because I want to parse the result in a program and don't want to parse a bunch of HTML (just seems inelegant and wasteful), so I instead tried the following request: http://192.168.1.1:8080/txtapi/show?calls That works better, but then another wrinkle appears. Caller ID (and Callee ID) names sometimes have commas, which messes up the CSV. This appears to be a bug in mod_commands.c (or I suppose you could call it an artifact of somebody coding up something quickly and not worrying about the absolute correctness of something that is not critical to the core). There is also another bug with show calls via webapi in that the generated HTML has spurious <td> tags. I think the spurious <td> tag bug arises due to lines 3145-6 in mod/applications/mod_commands/mod_commands.c. Finally, another bug (or maybe just unimplemented feature) is that xmlapl isn't really different from webapi. These problems occur in the latest source tree (20100301). I am wondering if (a) one of the developers can fix these or (b) if I fix the bugs, how can I submit patches [and if I submit patches, will they be accepted into the main tree]? The fixes are pretty trivial and I'd be happy to code them up if somebody will tell me how I can submit the patches (haven't done it before).
Just off the top of my head have you tried /xmlapi/? or read the wiki page on this? http://wiki.freeswitch.org/wiki/Mod_xml_rpc and "show calls as xml"? /b On Mar 1, 2010, at 3:31 PM, Wellie Chao wrote:
I am using the xml_rpc interface like so:
http://192.168.1.1:8080/webapi/show?calls
I get a response in a table, which is a little bit undesirable because I want to parse the result in a program and don't want to parse a bunch of HTML (just seems inelegant and wasteful), so I instead tried the following request:
http://192.168.1.1:8080/txtapi/show?calls
That works better, but then another wrinkle appears. Caller ID (and Callee ID) names sometimes have commas, which messes up the CSV.
This appears to be a bug in mod_commands.c (or I suppose you could call it an artifact of somebody coding up something quickly and not worrying about the absolute correctness of something that is not critical to the core). There is also another bug with show calls via webapi in that the generated HTML has spurious <td> tags. I think the spurious <td> tag bug arises due to lines 3145-6 in mod/applications/mod_commands/mod_commands.c. Finally, another bug (or maybe just unimplemented feature) is that xmlapl isn't really different from webapi.
These problems occur in the latest source tree (20100301).
I am wondering if (a) one of the developers can fix these or (b) if I fix the bugs, how can I submit patches [and if I submit patches, will they be accepted into the main tree]?
The fixes are pretty trivial and I'd be happy to code them up if somebody will tell me how I can submit the patches (haven't done it before).
On Mon, Mar 1, 2010 at 1:31 PM, Wellie Chao <wchao@yahoo.com> wrote:
I am using the xml_rpc interface like so:
http://192.168.1.1:8080/webapi/show?calls
I get a response in a table, which is a little bit undesirable because I want to parse the result in a program and don't want to parse a bunch of HTML (just seems inelegant and wasteful), so I instead tried the following request:
http://192.168.1.1:8080/txtapi/show?calls
That works better, but then another wrinkle appears. Caller ID (and Callee ID) names sometimes have commas, which messes up the CSV.
This appears to be a bug in mod_commands.c (or I suppose you could call it an artifact of somebody coding up something quickly and not worrying about the absolute correctness of something that is not critical to the core). There is also another bug with show calls via webapi in that the generated HTML has spurious <td> tags. I think the spurious <td> tag bug arises due to lines 3145-6 in mod/applications/mod_commands/mod_commands.c. Finally, another bug (or maybe just unimplemented feature) is that xmlapl isn't really different from webapi.
These problems occur in the latest source tree (20100301).
I am wondering if (a) one of the developers can fix these or (b) if I fix the bugs, how can I submit patches [and if I submit patches, will they be accepted into the main tree]?
The fixes are pretty trivial and I'd be happy to code them up if somebody will tell me how I can submit the patches (haven't done it before).
Go to jira.freeswitch.org and sign up for an account. You can open an issue, assign it to yourself, and then submit a patch. Be sure to upload .txt files and not tar, gz, or bz2! Also, check out the bug reporting tips on this page: http://wiki.freeswitch.org/wiki/Reporting_Bugs It gives some more details on reporting bugs and the things that you should be doing. -MC
He should be doing "show channels as xml" via XML API if he wants to parse them. .. or better yet doing it via real XMLRPC. ;) /b On Mar 1, 2010, at 3:52 PM, Michael Collins wrote:
Go to jira.freeswitch.org and sign up for an account. You can open an issue, assign it to yourself, and then submit a patch. Be sure to upload .txt files and not tar, gz, or bz2! Also, check out the bug reporting tips on this page: http://wiki.freeswitch.org/wiki/Reporting_Bugs
It gives some more details on reporting bugs and the things that you should be doing. -MC
Perhaps you may be reading up on something quickly and not worrying about the absolute correctness of something that is not critical to our time to explain. The proper syntax for the command is "show calls as xml" and you are not really using XMLRPC you are hitting it via direct url. so you will then need. http://192.168.1.1:8080/txtapi/show?calls%20as%20xml<http://192.168.1.1:8080/txtapi/show?calls> anything in the show command can be replied to with "as xml" also, for fun, try show calls as csv ::: On Mon, Mar 1, 2010 at 3:31 PM, Wellie Chao <wchao@yahoo.com> wrote:
I am using the xml_rpc interface like so:
http://192.168.1.1:8080/webapi/show?calls
I get a response in a table, which is a little bit undesirable because I want to parse the result in a program and don't want to parse a bunch of HTML (just seems inelegant and wasteful), so I instead tried the following request:
http://192.168.1.1:8080/txtapi/show?calls
That works better, but then another wrinkle appears. Caller ID (and Callee ID) names sometimes have commas, which messes up the CSV.
This appears to be a bug in mod_commands.c (or I suppose you could call it an artifact of somebody coding up something quickly and not worrying about the absolute correctness of something that is not critical to the core). There is also another bug with show calls via webapi in that the generated HTML has spurious <td> tags. I think the spurious <td> tag bug arises due to lines 3145-6 in mod/applications/mod_commands/mod_commands.c. Finally, another bug (or maybe just unimplemented feature) is that xmlapl isn't really different from webapi.
These problems occur in the latest source tree (20100301).
I am wondering if (a) one of the developers can fix these or (b) if I fix the bugs, how can I submit patches [and if I submit patches, will they be accepted into the main tree]?
The fixes are pretty trivial and I'd be happy to code them up if somebody will tell me how I can submit the patches (haven't done it before).
_______________________________________________ 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
-- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire AIM: anthm MSN:anthony_minessale@hotmail.com <MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:888@conference.freeswitch.org <sip%3A888@conference.freeswitch.org> iax:guest@conference.freeswitch.org/888 googletalk:conf+888@conference.freeswitch.org<googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:+19193869900
Terrific. "show calls as xml" works great and just what I needed. P.S. "show calls as csv" still has the comma bug. Not a big deal since I can get it as XML. CSV needs quotes around field values that contain a comma. Pretty easy to fix. Few lines of C (strchr for "," and if found, put quotes around field value). Date: Mon, 1 Mar 2010 17:24:16 -0600 From: Anthony Minessale <anthony.minessale@gmail.com> Reply-To: freeswitch-users@lists.freeswitch.org To: freeswitch-users@lists.freeswitch.org Subject: Re: [Freeswitch-users] Bug in mod_commands.c with show calls command Perhaps you may be reading up on something quickly and not worrying about the absolute correctness of something that is not critical to our time to explain. The proper syntax for the command is "show calls as xml" and you are not really using XMLRPC you are hitting it via direct url. so you will then need. http://192.168.1.1:8080/txtapi/show?calls%20as%20xml anything in the show command can be replied to with "as xml" also, for fun, try show calls as csv ::: On Mon, Mar 1, 2010 at 3:31 PM, Wellie Chao <wchao@yahoo.com> wrote: I am using the xml_rpc interface like so: http://192.168.1.1:8080/webapi/show?calls I get a response in a table, which is a little bit undesirable because I want to parse the result in a program and don't want to parse a bunch of HTML (just seems inelegant and wasteful), so I instead tried the following request: http://192.168.1.1:8080/txtapi/show?calls That works better, but then another wrinkle appears. Caller ID (and Callee ID) names sometimes have commas, which messes up the CSV. This appears to be a bug in mod_commands.c (or I suppose you could call it an artifact of somebody coding up something quickly and not worrying about the absolute correctness of something that is not critical to the core). There is also another bug with show calls via webapi in that the generated HTML has spurious <td> tags. I think the spurious <td> tag bug arises due to lines 3145-6 in mod/applications/mod_commands/mod_commands.c. Finally, another bug (or maybe just unimplemented feature) is that xmlapl isn't really different from webapi. These problems occur in the latest source tree (20100301). I am wondering if (a) one of the developers can fix these or (b) if I fix the bugs, how can I submit patches [and if I submit patches, will they be accepted into the main tree]? The fixes are pretty trivial and I'd be happy to code them up if somebody will tell me how I can submit the patches (haven't done it before). _______________________________________________ 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 -- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire AIM: anthm MSN:anthony_minessale@hotmail.com GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:888@conference.freeswitch.org iax:guest@conference.freeswitch.org/888 googletalk:conf+888@conference.freeswitch.org pstn:+19193869900
Could you please contribute a patch or at least report this issue to http;//jira.frreeswitch,org On Mar 1, 2010, at 10:29 PM, Wellie Chao wrote:
Terrific. "show calls as xml" works great and just what I needed.
P.S. "show calls as csv" still has the comma bug. Not a big deal since I can get it as XML. CSV needs quotes around field values that contain a comma. Pretty easy to fix. Few lines of C (strchr for "," and if found, put quotes around field value).
you can change the delimiter Like the example: "show calls as csv :::" The data will be sep by ::: instead of comma if you would like to make a patch to add "" it would be applied. On Mon, Mar 1, 2010 at 9:29 PM, Wellie Chao <wchao@yahoo.com> wrote:
Terrific. "show calls as xml" works great and just what I needed.
P.S. "show calls as csv" still has the comma bug. Not a big deal since I can get it as XML. CSV needs quotes around field values that contain a comma. Pretty easy to fix. Few lines of C (strchr for "," and if found, put quotes around field value).
Date: Mon, 1 Mar 2010 17:24:16 -0600 From: Anthony Minessale <anthony.minessale@gmail.com> Reply-To: freeswitch-users@lists.freeswitch.org To: freeswitch-users@lists.freeswitch.org Subject: Re: [Freeswitch-users] Bug in mod_commands.c with show calls command
Perhaps you may be reading up on something quickly and not worrying about the absolute correctness of something that is not critical to our time to explain.
The proper syntax for the command is "show calls as xml" and you are not really using XMLRPC you are hitting it via direct url. so you will then need.
http://192.168.1.1:8080/txtapi/show?calls%20as%20xml
anything in the show command can be replied to with "as xml"
also, for fun, try
show calls as csv :::
On Mon, Mar 1, 2010 at 3:31 PM, Wellie Chao <wchao@yahoo.com> wrote: I am using the xml_rpc interface like so:
http://192.168.1.1:8080/webapi/show?calls
I get a response in a table, which is a little bit undesirable because I want to parse the result in a program and don't want to parse a bunch of HTML (just seems inelegant and wasteful), so I instead tried the following request:
http://192.168.1.1:8080/txtapi/show?calls
That works better, but then another wrinkle appears. Caller ID (and Callee ID) names sometimes have commas, which messes up the CSV.
This appears to be a bug in mod_commands.c (or I suppose you could call it an artifact of somebody coding up something quickly and not worrying about the absolute correctness of something that is not critical to the core). There is also another bug with show calls via webapi in that the generated HTML has spurious <td> tags. I think the spurious <td> tag bug arises due to lines 3145-6 in mod/applications/mod_commands/mod_commands.c. Finally, another bug (or maybe just unimplemented feature) is that xmlapl isn't really different from webapi.
These problems occur in the latest source tree (20100301).
I am wondering if (a) one of the developers can fix these or (b) if I fix the bugs, how can I submit patches [and if I submit patches, will they be accepted into the main tree]?
The fixes are pretty trivial and I'd be happy to code them up if somebody will tell me how I can submit the patches (haven't done it before).
_______________________________________________ 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
-- Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire
AIM: anthm MSN:anthony_minessale@hotmail.com <MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference sip:888@conference.freeswitch.org <sip%3A888@conference.freeswitch.org> iax:guest@conference.freeswitch.org/888 googletalk:conf+888@conference.freeswitch.org<googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:+19193869900
_______________________________________________ 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
-- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire AIM: anthm MSN:anthony_minessale@hotmail.com <MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:888@conference.freeswitch.org <sip%3A888@conference.freeswitch.org> iax:guest@conference.freeswitch.org/888 googletalk:conf+888@conference.freeswitch.org<googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:+19193869900
participants (5)
-
Anthony Minessale
-
Brian West
-
Michael Collins
-
Michael Jerris
-
Wellie Chao