[Freeswitch-dev] uuid in mod_spandsp_fax.c
Hi This is my first post to dev mailing list and I am pretty excited :) I want the uuid prefixed for spandsp internal messages in the log. I noticed these are the ones printed by line 285 in mod_spandsp_fax.c switch_log_printf(SWITCH_CHANNEL_LOG, fs_log_level, "%s", msg); The lines which do print the uuid use the session variable switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "=== Negotiation Result =============\n"); So basically, I have to modify the function void spanfax_log_message(int level, const char *msg) so that it accepts user_data from which I can get the session. What other change do I have to do to make sure that this new function definition will be used correctly else where? And, if I am not thinking in the right direction, is there a simpler way to achieve this ? Thanks. regards, Anita
Anita have you tried in logfile.conf.xml setting: <param name="uuid" value="true" /> per http://wiki.freeswitch.org/wiki/Debugging_Freeswitch#UUID_Stamp_at_each_DEBU... It may already handle things. ~Mitch
Yes Mitch, I did that but the Fax internal messages are printed by this line which has no knowledge of the session. switch_log_printf(SWITCH_CHANNEL_LOG, fs_log_level, "%s", msg); I do not think, it can print the uuid without knowing the session ? Here is a log snippet to show uuid prefixed at other places except line 286 of mod_spandsp_fax.c shown above 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 1... ....= Extension indicator: Set 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 .... ..0.= Compressed/uncompressed mode: Compressed 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 .... .1..= Error correction mode (ECM): ECM 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 .... 0...= Frame size: 256 octets 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 .1.. ....= T.6 coding: Set 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 0... ....= Extension indicator: Not set 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 Selected compression T.6 (3) 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:327 === Negotiation Result ======================================================= 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:328 Remote station id: 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:329 Local station id: Sangoma Fax Ident 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:330 Transfer Rate: 4800 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:332 ECM status on 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:333 remote country: 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:334 remote vendor: 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:335 remote model: 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:337 ========================================================================= regards, Anita
Anita, It looks like this function is only called from On Tue, Mar 27, 2012 at 1:15 AM, Anita Hall <anita.hall@simmortel.com>wrote:
Yes Mitch, I did that but the Fax internal messages are printed by this line which has no knowledge of the session. switch_log_printf(SWITCH_CHANNEL_LOG, fs_log_level, "%s", msg);
I do not think, it can print the uuid without knowing the session ?
Here is a log snippet to show uuid prefixed at other places except line 286 of mod_spandsp_fax.c shown above
2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 1... ....= Extension indicator: Set 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 .... ..0.= Compressed/uncompressed mode: Compressed 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 .... .1..= Error correction mode (ECM): ECM 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 .... 0...= Frame size: 256 octets 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 .1.. ....= T.6 coding: Set 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 0... ....= Extension indicator: Not set 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 Selected compression T.6 (3) 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:327 === Negotiation Result ======================================================= 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:328 Remote station id: 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:329 Local station id: Sangoma Fax Ident 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:330 Transfer Rate: 4800 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:332 ECM status on 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:333 remote country: 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:334 remote vendor: 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:335 remote model: 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:337 =========================================================================
regards, Anita
_________________________________________________________________________ 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-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
Hi MC Only called from where ? regards, Anita On Tue, Mar 27, 2012 at 9:22 PM, Michael Collins <msc@freeswitch.org> wrote:
Anita,
It looks like this function is only called from
On Tue, Mar 27, 2012 at 1:15 AM, Anita Hall <anita.hall@simmortel.com>wrote:
Yes Mitch, I did that but the Fax internal messages are printed by this line which has no knowledge of the session. switch_log_printf(SWITCH_CHANNEL_LOG, fs_log_level, "%s", msg);
I do not think, it can print the uuid without knowing the session ?
Here is a log snippet to show uuid prefixed at other places except line 286 of mod_spandsp_fax.c shown above
2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 1... ....= Extension indicator: Set 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 .... ..0.= Compressed/uncompressed mode: Compressed 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 .... .1..= Error correction mode (ECM): ECM 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 .... 0...= Frame size: 256 octets 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 .1.. ....= T.6 coding: Set 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 0... ....= Extension indicator: Not set 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 Selected compression T.6 (3) 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:327 === Negotiation Result ======================================================= 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:328 Remote station id: 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:329 Local station id: Sangoma Fax Ident 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:330 Transfer Rate: 4800 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:332 ECM status on 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:333 remote country: 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:334 remote vendor: 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:335 remote model: 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:337 =========================================================================
regards, Anita
_________________________________________________________________________ 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-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev 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-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
*SIGH* evidently there's a magic keystroke that means "send" in GMail and I accidentally pressed it. As I was saying, it looks like this function is only called 6 times: <139>:grep -n spanfax_log_message mod_spandsp_fax.c 262:void spanfax_log_message(int level, const char *msg) 716: span_log_set_message_handler(&fax->logging, spanfax_log_message); 717: span_log_set_message_handler(&t30->logging, spanfax_log_message); 772: span_log_set_message_handler(&t38->logging, spanfax_log_message); 773: span_log_set_message_handler(&t30->logging, spanfax_log_message); 827: span_log_set_message_handler(&pvt->t38_gateway_state->logging, spanfax_log_message); 828: span_log_set_message_handler(&pvt->t38_core->logging, spanfax_log_message); I'd wager that each of those calls to the logging function would have knowledge of the sesssion. I'd recommend adding a 3rd argument to the logging function. In this case, I'd just add a const char *uuid and then change each call to that function to supply the UUID as the 3rd argument. If there is no knowledge of the session or uuid then just put an empty string as the argument. In any case, happy coding! :) -MC On Tue, Mar 27, 2012 at 1:15 AM, Anita Hall <anita.hall@simmortel.com>wrote:
Yes Mitch, I did that but the Fax internal messages are printed by this line which has no knowledge of the session. switch_log_printf(SWITCH_CHANNEL_LOG, fs_log_level, "%s", msg);
I do not think, it can print the uuid without knowing the session ?
Here is a log snippet to show uuid prefixed at other places except line 286 of mod_spandsp_fax.c shown above
2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 1... ....= Extension indicator: Set 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 .... ..0.= Compressed/uncompressed mode: Compressed 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 .... .1..= Error correction mode (ECM): ECM 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 .... 0...= Frame size: 256 octets 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 .1.. ....= T.6 coding: Set 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 0... ....= Extension indicator: Not set 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 Selected compression T.6 (3) 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:327 === Negotiation Result ======================================================= 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:328 Remote station id: 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:329 Local station id: Sangoma Fax Ident 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:330 Transfer Rate: 4800 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:332 ECM status on 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:333 remote country: 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:334 remote vendor: 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:335 remote model: 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:337 =========================================================================
regards, Anita
_________________________________________________________________________ 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-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
I think you would need to change spandsp itself to allow a private pointer to pass to the logging callback or you're out of luck. On Tue, Mar 27, 2012 at 10:56 AM, Michael Collins <msc@freeswitch.org> wrote:
*SIGH* evidently there's a magic keystroke that means "send" in GMail and I accidentally pressed it.
As I was saying, it looks like this function is only called 6 times:
<139>:grep -n spanfax_log_message mod_spandsp_fax.c 262:void spanfax_log_message(int level, const char *msg) 716: span_log_set_message_handler(&fax->logging, spanfax_log_message); 717: span_log_set_message_handler(&t30->logging, spanfax_log_message); 772: span_log_set_message_handler(&t38->logging, spanfax_log_message); 773: span_log_set_message_handler(&t30->logging, spanfax_log_message); 827: span_log_set_message_handler(&pvt->t38_gateway_state->logging, spanfax_log_message); 828: span_log_set_message_handler(&pvt->t38_core->logging, spanfax_log_message);
I'd wager that each of those calls to the logging function would have knowledge of the sesssion. I'd recommend adding a 3rd argument to the logging function. In this case, I'd just add a const char *uuid and then change each call to that function to supply the UUID as the 3rd argument. If there is no knowledge of the session or uuid then just put an empty string as the argument.
In any case, happy coding! :)
-MC
On Tue, Mar 27, 2012 at 1:15 AM, Anita Hall <anita.hall@simmortel.com> wrote:
Yes Mitch, I did that but the Fax internal messages are printed by this line which has no knowledge of the session. switch_log_printf(SWITCH_CHANNEL_LOG, fs_log_level, "%s", msg);
I do not think, it can print the uuid without knowing the session ?
Here is a log snippet to show uuid prefixed at other places except line 286 of mod_spandsp_fax.c shown above
2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 1... ....= Extension indicator: Set 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 .... ..0.= Compressed/uncompressed mode: Compressed 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 .... .1..= Error correction mode (ECM): ECM 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 .... 0...= Frame size: 256 octets 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 .1.. ....= T.6 coding: Set 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 0... ....= Extension indicator: Not set 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 Selected compression T.6 (3) 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:327 === Negotiation Result ======================================================= 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:328 Remote station id: 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:329 Local station id: Sangoma Fax Ident 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:330 Transfer Rate: 4800 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:332 ECM status on 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:333 remote country: 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:334 remote vendor: 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:335 remote model: 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:337 =========================================================================
regards, Anita
_________________________________________________________________________ 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-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev 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-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev 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 googletalk:conf+888@conference.freeswitch.org pstn:+19193869900
I can add an additional user controlled opaque pointer to each instance of spandsp's logging, and extend the callbacks to pass that pointer to the application. Most other things in spandsp pass opaque pointers in callbacks, so it would kind of complete the set. Steve On 03/28/2012 01:18 AM, Anthony Minessale wrote:
I think you would need to change spandsp itself to allow a private pointer to pass to the logging callback or you're out of luck.
On Tue, Mar 27, 2012 at 10:56 AM, Michael Collins<msc@freeswitch.org> wrote:
*SIGH* evidently there's a magic keystroke that means "send" in GMail and I accidentally pressed it.
As I was saying, it looks like this function is only called 6 times:
<139>:grep -n spanfax_log_message mod_spandsp_fax.c 262:void spanfax_log_message(int level, const char *msg) 716: span_log_set_message_handler(&fax->logging, spanfax_log_message); 717: span_log_set_message_handler(&t30->logging, spanfax_log_message); 772: span_log_set_message_handler(&t38->logging, spanfax_log_message); 773: span_log_set_message_handler(&t30->logging, spanfax_log_message); 827: span_log_set_message_handler(&pvt->t38_gateway_state->logging, spanfax_log_message); 828: span_log_set_message_handler(&pvt->t38_core->logging, spanfax_log_message);
I'd wager that each of those calls to the logging function would have knowledge of the sesssion. I'd recommend adding a 3rd argument to the logging function. In this case, I'd just add a const char *uuid and then change each call to that function to supply the UUID as the 3rd argument. If there is no knowledge of the session or uuid then just put an empty string as the argument.
In any case, happy coding! :)
-MC
On Tue, Mar 27, 2012 at 1:15 AM, Anita Hall<anita.hall@simmortel.com> wrote:
Yes Mitch, I did that but the Fax internal messages are printed by this line which has no knowledge of the session. switch_log_printf(SWITCH_CHANNEL_LOG, fs_log_level, "%s", msg);
I do not think, it can print the uuid without knowing the session ?
Here is a log snippet to show uuid prefixed at other places except line 286 of mod_spandsp_fax.c shown above
2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 1... ....= Extension indicator: Set 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 .... ..0.= Compressed/uncompressed mode: Compressed 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 .... .1..= Error correction mode (ECM): ECM 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 .... 0...= Frame size: 256 octets 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 .1.. ....= T.6 coding: Set 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 0... ....= Extension indicator: Not set 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 Selected compression T.6 (3) 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:327 === Negotiation Result ======================================================= 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:328 Remote station id: 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:329 Local station id: Sangoma Fax Ident 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:330 Transfer Rate: 4800 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:332 ECM status on 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:333 remote country: 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:334 remote vendor: 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:335 remote model: 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:337 =========================================================================
regards, Anita
_________________________________________________________________________ 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-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev 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-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
Hi, I have commited changes to spandsp which introduces an additional opaque pointer argument to the spandsp logging routines. I have also changed mod_spandsp so it basically handles this parameter. However, right now NULL is always being passed. Someone is welcome to now start using this feature in a more meaningful way. Steve On 03/28/2012 02:20 AM, Steve Underwood wrote:
I can add an additional user controlled opaque pointer to each instance of spandsp's logging, and extend the callbacks to pass that pointer to the application. Most other things in spandsp pass opaque pointers in callbacks, so it would kind of complete the set.
Steve
On 03/28/2012 01:18 AM, Anthony Minessale wrote:
I think you would need to change spandsp itself to allow a private pointer to pass to the logging callback or you're out of luck.
On Tue, Mar 27, 2012 at 10:56 AM, Michael Collins<msc@freeswitch.org> wrote:
*SIGH* evidently there's a magic keystroke that means "send" in GMail and I accidentally pressed it.
As I was saying, it looks like this function is only called 6 times:
<139>:grep -n spanfax_log_message mod_spandsp_fax.c 262:void spanfax_log_message(int level, const char *msg) 716: span_log_set_message_handler(&fax->logging, spanfax_log_message); 717: span_log_set_message_handler(&t30->logging, spanfax_log_message); 772: span_log_set_message_handler(&t38->logging, spanfax_log_message); 773: span_log_set_message_handler(&t30->logging, spanfax_log_message); 827: span_log_set_message_handler(&pvt->t38_gateway_state->logging, spanfax_log_message); 828: span_log_set_message_handler(&pvt->t38_core->logging, spanfax_log_message);
I'd wager that each of those calls to the logging function would have knowledge of the sesssion. I'd recommend adding a 3rd argument to the logging function. In this case, I'd just add a const char *uuid and then change each call to that function to supply the UUID as the 3rd argument. If there is no knowledge of the session or uuid then just put an empty string as the argument.
In any case, happy coding! :)
-MC
On Tue, Mar 27, 2012 at 1:15 AM, Anita Hall<anita.hall@simmortel.com> wrote:
Yes Mitch, I did that but the Fax internal messages are printed by this line which has no knowledge of the session. switch_log_printf(SWITCH_CHANNEL_LOG, fs_log_level, "%s", msg);
I do not think, it can print the uuid without knowing the session ?
Here is a log snippet to show uuid prefixed at other places except line 286 of mod_spandsp_fax.c shown above
2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 1... ....= Extension indicator: Set 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 .... ..0.= Compressed/uncompressed mode: Compressed 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 .... .1..= Error correction mode (ECM): ECM 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 .... 0...= Frame size: 256 octets 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 .1.. ....= T.6 coding: Set 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 0... ....= Extension indicator: Not set 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 Selected compression T.6 (3) 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:327 === Negotiation Result ======================================================= 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:328 Remote station id: 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:329 Local station id: Sangoma Fax Ident 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:330 Transfer Rate: 4800 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:332 ECM status on 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:333 remote country: 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:334 remote vendor: 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:335 remote model: 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:337 =========================================================================
regards, Anita
Steve, Thanks for doing this! Anita: take a look at Steve's changes and see if you can add the UUID logging. The gang here will be happy to answer any follow up questions. -MC On Wed, Mar 28, 2012 at 8:41 AM, Steve Underwood <steveu@coppice.org> wrote:
Hi,
I have commited changes to spandsp which introduces an additional opaque pointer argument to the spandsp logging routines. I have also changed mod_spandsp so it basically handles this parameter. However, right now NULL is always being passed. Someone is welcome to now start using this feature in a more meaningful way.
Steve
On 03/28/2012 02:20 AM, Steve Underwood wrote:
I can add an additional user controlled opaque pointer to each instance of spandsp's logging, and extend the callbacks to pass that pointer to the application. Most other things in spandsp pass opaque pointers in callbacks, so it would kind of complete the set.
Steve
On 03/28/2012 01:18 AM, Anthony Minessale wrote:
I think you would need to change spandsp itself to allow a private pointer to pass to the logging callback or you're out of luck.
On Tue, Mar 27, 2012 at 10:56 AM, Michael Collins<msc@freeswitch.org> wrote:
*SIGH* evidently there's a magic keystroke that means "send" in GMail and I accidentally pressed it.
As I was saying, it looks like this function is only called 6 times:
<139>:grep -n spanfax_log_message mod_spandsp_fax.c 262:void spanfax_log_message(int level, const char *msg) 716: span_log_set_message_handler(&fax->logging, spanfax_log_message); 717: span_log_set_message_handler(&t30->logging, spanfax_log_message); 772: span_log_set_message_handler(&t38->logging, spanfax_log_message); 773: span_log_set_message_handler(&t30->logging, spanfax_log_message); 827: span_log_set_message_handler(&pvt->t38_gateway_state->logging, spanfax_log_message); 828: span_log_set_message_handler(&pvt->t38_core->logging, spanfax_log_message);
I'd wager that each of those calls to the logging function would have knowledge of the sesssion. I'd recommend adding a 3rd argument to the logging function. In this case, I'd just add a const char *uuid and then change each call to that function to supply the UUID as the 3rd argument. If there is no knowledge of the session or uuid then just put an empty string as the argument.
In any case, happy coding! :)
-MC
On Tue, Mar 27, 2012 at 1:15 AM, Anita Hall<anita.hall@simmortel.com> wrote:
Yes Mitch, I did that but the Fax internal messages are printed by this line which has no knowledge of the session. switch_log_printf(SWITCH_CHANNEL_LOG, fs_log_level, "%s", msg);
I do not think, it can print the uuid without knowing the session ?
Here is a log snippet to show uuid prefixed at other places except line 286 of mod_spandsp_fax.c shown above
2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 1... ....= Extension indicator: Set 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 .... ..0.= Compressed/uncompressed mode: Compressed 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 .... .1..= Error correction mode (ECM): ECM 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 .... 0...= Frame size: 256 octets 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 .1.. ....= T.6 coding: Set 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 0... ....= Extension indicator: Not set 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 Selected compression T.6 (3) 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:327 === Negotiation Result ======================================================= 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:328 Remote station id: 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:329 Local station id: Sangoma Fax Ident 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:330 Transfer Rate: 4800 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:332 ECM status on 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:333 remote country: 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:334 remote vendor: 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:335 remote model: 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:337
=========================================================================
regards, Anita
_________________________________________________________________________ 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-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
participants (5)
-
Anita Hall
-
Anthony Minessale
-
Michael Collins
-
Mitch Capper
-
Steve Underwood