Summary:ASTERISK-04874: enabling sip debugging, and using 'sip reload' from cmd disables debug
Reporter:timecop (timecop)Labels:
Date Opened:2005-08-22 19:19:19Date Closed:2008-01-15 15:45:15.000-0600
Versions:Frequency of
Environment:Attachments:( 0) debug.diff
Description:say you want to debug a sip registration issue.
you type 'sip debug' in cli.
you type 'sip reload'.
sip reload disables debugging, so you can't debug.


culprit is in reload_config() in chan_sip.c line 11058.
sipdebug = 0;
Comments:By: timecop (timecop) 2005-08-22 19:24:31

the patch.

By: Kevin P. Fleming (kpfleming) 2005-08-23 13:57:36

Committed to CVS HEAD, thanks!

By: Olle Johansson (oej) 2005-08-24 01:16:10

If you want that to happen, you need to turn on sipdebug=yes in sip.conf. That is why that setting is there.

This patch actually breaks the situation if someone removes the line sipdebug=yes from sip.conf, we don't reset to default behaviour as we do with other settings.

I think this should be reverted.

By: timecop (timecop) 2005-08-24 01:24:01

no it doesn't.
it still loads sipdebug=yes or no from the config file if you changed it after.

               } else if (!strcasecmp(v->name, "sipdebug")) {
                       sipdebug = ast_true(v->value);

line 11282 or so @ chan_sip.c
now, if you ahd sipdebug=no in sip.conf AND sip reloaded after doing 'sip debug' in cli, it would still get disabled, which is I think broken also, but thats another story.

By: Olle Johansson (oej) 2005-08-24 02:13:06

It does. Add a comment in front of sipdebug in sip.conf, like


If you now reload, it will *not* go back to the default state as we do with other parameters, it will keep the old state from before the reload. Parameters in sip.conf has to work the same way in this regard.

To get debug output from start, you add sipdebug=yes in sip.conf and reload.

By: Kevin P. Fleming (kpfleming) 2005-08-24 22:29:20

I have fixed this problem so that it works as expected in both cases now.

By: Digium Subversion (svnbot) 2008-01-15 15:45:15.000-0600

Repository: asterisk
Revision: 6389

U   trunk/channels/chan_sip.c

r6389 | kpfleming | 2008-01-15 15:45:14 -0600 (Tue, 15 Jan 2008) | 2 lines

don't reset sipdebug to zero during reload (issue ASTERISK-4874)