Index: channels/sig_pri.h =================================================================== --- channels/sig_pri.h (revision 299623) +++ channels/sig_pri.h (working copy) @@ -35,24 +35,12 @@ #if defined(HAVE_PRI_CCSS) /*! PRI debug message flags when normal PRI debugging is turned on at the command line. */ #define SIG_PRI_DEBUG_NORMAL \ - (PRI_DEBUG_APDU | PRI_DEBUG_Q931_DUMP | PRI_DEBUG_Q931_STATE | PRI_DEBUG_Q921_STATE \ - | PRI_DEBUG_CC) - -/*! PRI debug message flags when intense PRI debugging is turned on at the command line. */ -#define SIG_PRI_DEBUG_INTENSE \ - (PRI_DEBUG_APDU | PRI_DEBUG_Q931_DUMP | PRI_DEBUG_Q931_STATE | PRI_DEBUG_Q921_STATE \ - | PRI_DEBUG_CC | PRI_DEBUG_Q921_RAW | PRI_DEBUG_Q921_DUMP) - + (PRI_DEBUG_APDU | PRI_DEBUG_Q931_STATE | PRI_DEBUG_Q921_STATE | PRI_DEBUG_CC) #else /*! PRI debug message flags when normal PRI debugging is turned on at the command line. */ #define SIG_PRI_DEBUG_NORMAL \ - (PRI_DEBUG_APDU | PRI_DEBUG_Q931_DUMP | PRI_DEBUG_Q931_STATE | PRI_DEBUG_Q921_STATE) - -/*! PRI debug message flags when intense PRI debugging is turned on at the command line. */ -#define SIG_PRI_DEBUG_INTENSE \ - (PRI_DEBUG_APDU | PRI_DEBUG_Q931_DUMP | PRI_DEBUG_Q931_STATE | PRI_DEBUG_Q921_STATE \ - | PRI_DEBUG_Q921_RAW | PRI_DEBUG_Q921_DUMP) + (PRI_DEBUG_APDU | PRI_DEBUG_Q931_STATE | PRI_DEBUG_Q921_STATE) #endif /* !defined(HAVE_PRI_CCSS) */ #if 0 Index: channels/chan_dahdi.c =================================================================== --- channels/chan_dahdi.c (revision 299623) +++ channels/chan_dahdi.c (working copy) @@ -13880,13 +13880,19 @@ { int span; int x; + int debugmask = 0; int level = 0; switch (cmd) { case CLI_INIT: - e->command = "pri set debug {on|off|0|1|2} span"; + e->command = "pri set debug {on|off|0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15} span"; e->usage = "Usage: pri set debug {|on|off} span \n" - " Enables debugging on a given PRI span\n"; + " Enables debugging on a given PRI span\n" + " Level is a bitmap of the following values:\n" + " 1 General debugging incl. state changes\n" + " 2 Decoded Q.931 messages\n" + " 4 Decoded Q.921 messages\n" + " 8 Raw hex dumps of Q.921 frames\n"; return NULL; case CLI_GENERATE: return complete_span_4(a->line, a->word, a->pos, a->n); @@ -13912,20 +13918,15 @@ return CLI_SUCCESS; } + if (level & 1) debugmask = SIG_PRI_DEBUG_NORMAL; + if (level & 2) debugmask = debugmask | PRI_DEBUG_Q931_DUMP; + if (level & 4) debugmask = debugmask | PRI_DEBUG_Q921_DUMP; + if (level & 8) debugmask = debugmask | PRI_DEBUG_Q921_RAW; + /* Set debug level in libpri */ for (x = 0; x < SIG_PRI_NUM_DCHANS; x++) { if (pris[span - 1].pri.dchans[x]) { - switch (level) { - case 0: - pri_set_debug(pris[span - 1].pri.dchans[x], 0); - break; - case 1: - pri_set_debug(pris[span - 1].pri.dchans[x], SIG_PRI_DEBUG_NORMAL); - break; - default: - pri_set_debug(pris[span - 1].pri.dchans[x], SIG_PRI_DEBUG_INTENSE); - break; - } + pri_set_debug(pris[span - 1].pri.dchans[x], debugmask); } } if (level == 0) {