[asterisk-dev] Asterisk GUI

Jonathan Rose jrose at digium.com
Wed Aug 29 09:15:48 CDT 2012


Giuseppe Longo <giuseppelng at gmail.com> wrote:
 
> Could you explain better please?

Um, sure, I suppose I can try.
We'll start with sip_debug since I actually use that once in a while...

First you would want to have a global variable (your flag) indicating that debug should
be sent as manager events.  Something like

static int sip_debug_send_events = 0;
And that goes somewhere near the top, possibly near the declaration of sipdebug and sipdebug_text.

You then figure out specifically which debug messages you want
replicated to Manager. I'd be guessing you want the verbose
output for sends which goes <--- Transmitting %s to %s --->
then spits out the SIP message and SDP and you'd probably also
want the verbose message for reads: <--- SIP read from %s --->

Instead of immediately verbose logging those messages, you'd
put them in a string instead, then you would verbose the string
and from there you would check if your sip_debug_send_events is
equal to 1 and if it is, you'd send a manager event which has
that string as one of the fields.

You'd also need to figure out a way to raise and lower the
sip_debug_send_events flag of course, but that's fairly trivial.

--
Jonathan R. Rose
Digium, Inc. | Software Engineer
445 Jan Davis Drive NW - Huntsville, AL 35806 - US
direct +1 256 428 6139 

Check us out at: http://digium.com & http://asterisk.org



More information about the asterisk-dev mailing list