Steve,<br><br>Thanks for doing this! <br><br>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.<br><br>-MC<br><br><div class="gmail_quote">
On Wed, Mar 28, 2012 at 8:41 AM, Steve Underwood <span dir="ltr"><<a href="mailto:steveu@coppice.org">steveu@coppice.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
I have commited changes to spandsp which introduces an additional opaque<br>
pointer argument to the spandsp logging routines. I have also changed<br>
mod_spandsp so it basically handles this parameter. However, right now<br>
NULL is always being passed. Someone is welcome to now start using this<br>
feature in a more meaningful way.<br>
<span class="HOEnZb"><font color="#888888"><br>
Steve<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
On 03/28/2012 02:20 AM, Steve Underwood wrote:<br>
> I can add an additional user controlled opaque pointer to each instance<br>
> of spandsp's logging, and extend the callbacks to pass that pointer to<br>
> the application. Most other things in spandsp pass opaque pointers in<br>
> callbacks, so it would kind of complete the set.<br>
><br>
> Steve<br>
><br>
><br>
> On 03/28/2012 01:18 AM, Anthony Minessale wrote:<br>
>> I think you would need to change spandsp itself to allow a private<br>
>> pointer to pass to the logging callback or you're out of luck.<br>
>><br>
>><br>
>><br>
>> On Tue, Mar 27, 2012 at 10:56 AM, Michael Collins<<a href="mailto:msc@freeswitch.org">msc@freeswitch.org</a>> wrote:<br>
>>> *SIGH* evidently there's a magic keystroke that means "send" in GMail and I<br>
>>> accidentally pressed it.<br>
>>><br>
>>> As I was saying, it looks like this function is only called 6 times:<br>
>>><br>
>>> <139>:grep -n spanfax_log_message mod_spandsp_fax.c<br>
>>> 262:void spanfax_log_message(int level, const char *msg)<br>
>>> 716: span_log_set_message_handler(&fax->logging,<br>
>>> spanfax_log_message);<br>
>>> 717: span_log_set_message_handler(&t30->logging,<br>
>>> spanfax_log_message);<br>
>>> 772: span_log_set_message_handler(&t38->logging,<br>
>>> spanfax_log_message);<br>
>>> 773: span_log_set_message_handler(&t30->logging,<br>
>>> spanfax_log_message);<br>
>>> 827: span_log_set_message_handler(&pvt->t38_gateway_state->logging,<br>
>>> spanfax_log_message);<br>
>>> 828: span_log_set_message_handler(&pvt->t38_core->logging,<br>
>>> spanfax_log_message);<br>
>>><br>
>>> I'd wager that each of those calls to the logging function would have<br>
>>> knowledge of the sesssion. I'd recommend adding a 3rd argument to the<br>
>>> logging function. In this case, I'd just add a const char *uuid and then<br>
>>> change each call to that function to supply the UUID as the 3rd argument. If<br>
>>> there is no knowledge of the session or uuid then just put an empty string<br>
>>> as the argument.<br>
>>><br>
>>> In any case, happy coding! :)<br>
>>><br>
>>> -MC<br>
>>><br>
>>><br>
>>> On Tue, Mar 27, 2012 at 1:15 AM, Anita Hall<<a href="mailto:anita.hall@simmortel.com">anita.hall@simmortel.com</a>><br>
>>> wrote:<br>
>>>> Yes Mitch, I did that but the Fax internal messages are printed by this<br>
>>>> line which has no knowledge of the session.<br>
>>>> switch_log_printf(SWITCH_CHANNEL_LOG, fs_log_level, "%s", msg);<br>
>>>><br>
>>>> I do not think, it can print the uuid without knowing the session ?<br>
>>>><br>
>>>> Here is a log snippet to show uuid prefixed at other places except line<br>
>>>> 286 of mod_spandsp_fax.c shown above<br>
>>>><br>
>>>> 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 1...<br>
>>>> ....= Extension indicator: Set<br>
>>>> 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 ....<br>
>>>> ..0.= Compressed/uncompressed mode: Compressed<br>
>>>> 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 ....<br>
>>>> .1..= Error correction mode (ECM): ECM<br>
>>>> 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 ....<br>
>>>> 0...= Frame size: 256 octets<br>
>>>> 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 .1..<br>
>>>> ....= T.6 coding: Set<br>
>>>> 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30 0...<br>
>>>> ....= Extension indicator: Not set<br>
>>>> 2012-03-27 13:40:38.604877 [DEBUG] mod_spandsp_fax.c:286 FLOW T.30<br>
>>>> Selected compression T.6 (3)<br>
>>>> 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG]<br>
>>>> mod_spandsp_fax.c:327 === Negotiation Result<br>
>>>> =======================================================<br>
>>>> 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG]<br>
>>>> mod_spandsp_fax.c:328 Remote station id:<br>
>>>> 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG]<br>
>>>> mod_spandsp_fax.c:329 Local station id: Sangoma Fax Ident<br>
>>>> 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG]<br>
>>>> mod_spandsp_fax.c:330 Transfer Rate: 4800<br>
>>>> 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG]<br>
>>>> mod_spandsp_fax.c:332 ECM status on<br>
>>>> 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG]<br>
>>>> mod_spandsp_fax.c:333 remote country:<br>
>>>> 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG]<br>
>>>> mod_spandsp_fax.c:334 remote vendor:<br>
>>>> 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG]<br>
>>>> mod_spandsp_fax.c:335 remote model:<br>
>>>> 46736448-77e4-11e1-855c-b3286880c45b 2012-03-27 13:40:38.604877 [DEBUG]<br>
>>>> mod_spandsp_fax.c:337<br>
>>>> =========================================================================<br>
>>>><br>
>>>><br>
>>>> regards,<br>
>>>> Anita<br>
<br>
<br>
_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-dev mailing list<br>
<a href="mailto:FreeSWITCH-dev@lists.freeswitch.org">FreeSWITCH-dev@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
</div></div></blockquote></div><br>