<p>Joshua Colp <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/8451">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Richard Mudgett: Looks good to me, but someone else must approve
Joshua Colp: Looks good to me, approved; Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">Replace direct checks of option_debug with DEBUG_ATLEAST macro.<br><br>Checking option_debug directly is incorrect as it ignores file/module<br>specific debug settings. This system-wide change replaces nearly all<br>direct checks for option_debug with the DEBUG_ATLEAST macro.<br><br>Change-Id: Ic342d4799a945dbc40ac085ac142681094a4ebf0<br>---<br>M addons/chan_ooh323.c<br>M apps/app_directory.c<br>M apps/app_minivm.c<br>M apps/app_voicemail.c<br>M cdr/cdr_pgsql.c<br>M cel/cel_pgsql.c<br>M channels/chan_dahdi.c<br>M channels/chan_sip.c<br>M main/callerid.c<br>M main/config.c<br>M main/netsock2.c<br>M main/pbx.c<br>M main/sched.c<br>M res/res_config_ldap.c<br>M res/res_config_pgsql.c<br>M res/res_rtp_asterisk.c<br>16 files changed, 88 insertions(+), 89 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/addons/chan_ooh323.c b/addons/chan_ooh323.c<br>index 5d5f5fe..91f6e8f 100644<br>--- a/addons/chan_ooh323.c<br>+++ b/addons/chan_ooh323.c<br>@@ -1174,8 +1174,7 @@<br> p->alertsent = 1;<br> }<br> ast_setstate(ast, AST_STATE_UP);<br>- if (option_debug)<br>- ast_debug(1, "ooh323_answer(%s)\n", ast_channel_name(ast));<br>+ ast_debug(1, "ooh323_answer(%s)\n", ast_channel_name(ast));<br> ast_channel_unlock(ast);<br> ooAnswerCall(p->callToken);<br> }<br>diff --git a/apps/app_directory.c b/apps/app_directory.c<br>index f644d9c..d2f479c 100644<br>--- a/apps/app_directory.c<br>+++ b/apps/app_directory.c<br>@@ -817,10 +817,10 @@<br> /* Sort items */<br> sort_items(sorted, count);<br> <br>- if (option_debug) {<br>- ast_debug(2, "Listing matching entries:\n");<br>+ if (DEBUG_ATLEAST(2)) {<br>+ ast_log(LOG_DEBUG, "Listing matching entries:\n");<br> for (ptr = sorted, i = 0; i < count; i++, ptr++) {<br>- ast_debug(2, "%s: %s\n", ptr[0]->exten, ptr[0]->name);<br>+ ast_log(LOG_DEBUG, "%s: %s\n", ptr[0]->exten, ptr[0]->name);<br> }<br> }<br> <br>diff --git a/apps/app_minivm.c b/apps/app_minivm.c<br>index 2c57e04..a3dcef8 100644<br>--- a/apps/app_minivm.c<br>+++ b/apps/app_minivm.c<br>@@ -1440,7 +1440,7 @@<br> ast_debug(1, "Using default subject for this email \n");<br> }<br> <br>- if (option_debug > 2)<br>+ if (DEBUG_ATLEAST(3))<br> fprintf(p, "X-Asterisk-debug: template %s user account %s@%s\n", template->name, vmu->username, vmu->domain);<br> fprintf(p, "MIME-Version: 1.0\n");<br> <br>diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c<br>index db6b757..089e7d2 100644<br>--- a/apps/app_voicemail.c<br>+++ b/apps/app_voicemail.c<br>@@ -3640,7 +3640,7 @@<br> char buf[1024] = "";<br> <br> if (!(user = get_user_by_mailbox(mailbox, buf, sizeof(buf))) || !(vms = get_vm_state_by_imapuser(user, 0))) {<br>- if (user && option_debug > 2)<br>+ if (user && DEBUG_ATLEAST(3))<br> ast_log(AST_LOG_WARNING, "User %s mailbox not found for update.\n", user);<br> return;<br> }<br>diff --git a/cdr/cdr_pgsql.c b/cdr/cdr_pgsql.c<br>index 4430e51..064ffb3 100644<br>--- a/cdr/cdr_pgsql.c<br>+++ b/cdr/cdr_pgsql.c<br>@@ -649,20 +649,20 @@<br> return -1;<br> }<br> <br>- if (option_debug) {<br>+ if (DEBUG_ATLEAST(1)) {<br> if (ast_strlen_zero(pghostname)) {<br>- ast_debug(1, "using default unix socket\n");<br>+ ast_log(LOG_DEBUG, "using default unix socket\n");<br> } else {<br>- ast_debug(1, "got hostname of %s\n", pghostname);<br>+ ast_log(LOG_DEBUG, "got hostname of %s\n", pghostname);<br> }<br>- ast_debug(1, "got port of %s\n", pgdbport);<br>- ast_debug(1, "got user of %s\n", pgdbuser);<br>- ast_debug(1, "got dbname of %s\n", pgdbname);<br>- ast_debug(1, "got password of %s\n", pgpassword);<br>- ast_debug(1, "got application name of %s\n", pgappname);<br>- ast_debug(1, "got sql table name of %s\n", table);<br>- ast_debug(1, "got encoding of %s\n", encoding);<br>- ast_debug(1, "got timezone of %s\n", tz);<br>+ ast_log(LOG_DEBUG, "got port of %s\n", pgdbport);<br>+ ast_log(LOG_DEBUG, "got user of %s\n", pgdbuser);<br>+ ast_log(LOG_DEBUG, "got dbname of %s\n", pgdbname);<br>+ ast_log(LOG_DEBUG, "got password of %s\n", pgpassword);<br>+ ast_log(LOG_DEBUG, "got application name of %s\n", pgappname);<br>+ ast_log(LOG_DEBUG, "got sql table name of %s\n", table);<br>+ ast_log(LOG_DEBUG, "got encoding of %s\n", encoding);<br>+ ast_log(LOG_DEBUG, "got timezone of %s\n", tz);<br> }<br> <br> pgsql_reconnect();<br>diff --git a/cel/cel_pgsql.c b/cel/cel_pgsql.c<br>index a79bfab..3f257ae 100644<br>--- a/cel/cel_pgsql.c<br>+++ b/cel/cel_pgsql.c<br>@@ -534,18 +534,18 @@<br> if ((tmp = ast_variable_retrieve(cfg, "global", "show_user_defined"))) {<br> cel_show_user_def = ast_true(tmp) ? 1 : 0;<br> }<br>- if (option_debug) {<br>+ if (DEBUG_ATLEAST(3)) {<br> if (ast_strlen_zero(pghostname)) {<br>- ast_debug(3, "cel_pgsql: using default unix socket\n");<br>+ ast_log(LOG_DEBUG, "cel_pgsql: using default unix socket\n");<br> } else {<br>- ast_debug(3, "cel_pgsql: got hostname of %s\n", pghostname);<br>+ ast_log(LOG_DEBUG, "cel_pgsql: got hostname of %s\n", pghostname);<br> }<br>- ast_debug(3, "cel_pgsql: got port of %s\n", pgdbport);<br>- ast_debug(3, "cel_pgsql: got user of %s\n", pgdbuser);<br>- ast_debug(3, "cel_pgsql: got dbname of %s\n", pgdbname);<br>- ast_debug(3, "cel_pgsql: got password of %s\n", pgpassword);<br>- ast_debug(3, "cel_pgsql: got sql table name of %s\n", table);<br>- ast_debug(3, "cel_pgsql: got show_user_defined of %s\n",<br>+ ast_log(LOG_DEBUG, "cel_pgsql: got port of %s\n", pgdbport);<br>+ ast_log(LOG_DEBUG, "cel_pgsql: got user of %s\n", pgdbuser);<br>+ ast_log(LOG_DEBUG, "cel_pgsql: got dbname of %s\n", pgdbname);<br>+ ast_log(LOG_DEBUG, "cel_pgsql: got password of %s\n", pgpassword);<br>+ ast_log(LOG_DEBUG, "cel_pgsql: got sql table name of %s\n", table);<br>+ ast_log(LOG_DEBUG, "cel_pgsql: got show_user_defined of %s\n",<br> cel_show_user_def ? "Yes" : "No");<br> }<br> <br>diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c<br>index d5e79ff..8669267 100644<br>--- a/channels/chan_dahdi.c<br>+++ b/channels/chan_dahdi.c<br>@@ -15167,14 +15167,14 @@<br> ast_mutex_lock(&p->lock);<br> if (p->owner && !p->restartpending) {<br> if (ast_channel_trylock(p->owner)) {<br>- if (option_debug > 2)<br>+ if (DEBUG_ATLEAST(3))<br> ast_verbose("Avoiding deadlock\n");<br> /* Avoid deadlock since you're not supposed to lock iflock or pvt before a channel */<br> ast_mutex_unlock(&p->lock);<br> ast_mutex_unlock(&iflock);<br> goto retry;<br> }<br>- if (option_debug > 2)<br>+ if (DEBUG_ATLEAST(3))<br> ast_verbose("Softhanging up on %s\n", ast_channel_name(p->owner));<br> ast_softhangup_nolock(p->owner, AST_SOFTHANGUP_EXPLICIT);<br> p->restartpending = 1;<br>diff --git a/channels/chan_sip.c b/channels/chan_sip.c<br>index 0a5caec..1ec4496 100644<br>--- a/channels/chan_sip.c<br>+++ b/channels/chan_sip.c<br>@@ -22332,7 +22332,7 @@<br> return;<br> }<br> <br>- if (!option_debug && !sipdebug) {<br>+ if (!sipdebug && !DEBUG_ATLEAST(1)) {<br> if (!errmsg) {<br> ast_log(LOG_NOTICE, "You must have debugging enabled (SIP or Asterisk) in order to dump SIP history.\n");<br> errmsg = 1;<br>@@ -22340,20 +22340,20 @@<br> return;<br> }<br> <br>- ast_debug(1, "\n---------- SIP HISTORY for '%s' \n", dialog->callid);<br>+ ast_log(LOG_DEBUG, "\n---------- SIP HISTORY for '%s' \n", dialog->callid);<br> if (dialog->subscribed) {<br>- ast_debug(1, " * Subscription\n");<br>+ ast_log(LOG_DEBUG, " * Subscription\n");<br> } else {<br>- ast_debug(1, " * SIP Call\n");<br>+ ast_log(LOG_DEBUG, " * SIP Call\n");<br> }<br> if (dialog->history) {<br> AST_LIST_TRAVERSE(dialog->history, hist, list)<br>- ast_debug(1, " %-3.3d. %s\n", ++x, hist->event);<br>+ ast_log(LOG_DEBUG, " %-3.3d. %s\n", ++x, hist->event);<br> }<br> if (!x) {<br>- ast_debug(1, "Call '%s' has no history\n", dialog->callid);<br>+ ast_log(LOG_DEBUG, "Call '%s' has no history\n", dialog->callid);<br> }<br>- ast_debug(1, "\n---------- END SIP HISTORY for '%s' \n", dialog->callid);<br>+ ast_log(LOG_DEBUG, "\n---------- END SIP HISTORY for '%s' \n", dialog->callid);<br> }<br> <br> <br>diff --git a/main/callerid.c b/main/callerid.c<br>index a9864da..a411bd3 100644<br>--- a/main/callerid.c<br>+++ b/main/callerid.c<br>@@ -503,7 +503,7 @@<br> case 0x06: /* short dial number */<br> case 0x07: /* reserved */<br> default: /* reserved */<br>- if (option_debug > 1)<br>+ if (DEBUG_ATLEAST(2))<br> ast_log(LOG_NOTICE, "did info:#1=%X\n", (unsigned)cid->rawdata[x]);<br> break ;<br> }<br>diff --git a/main/config.c b/main/config.c<br>index eec6c02..6bc1eda 100644<br>--- a/main/config.c<br>+++ b/main/config.c<br>@@ -2787,9 +2787,7 @@<br> }<br> cat = cat->next;<br> }<br>- if (!option_debug) {<br>- ast_verb(2, "Saving '%s': saved\n", fn);<br>- }<br>+ ast_verb(2, "Saving '%s': saved\n", fn);<br> } else {<br> ast_debug(1, "Unable to open for writing: %s\n", fn);<br> ast_verb(2, "Unable to write '%s' (%s)\n", fn, strerror(errno));<br>diff --git a/main/netsock2.c b/main/netsock2.c<br>index 5f94a75..90835c3 100644<br>--- a/main/netsock2.c<br>+++ b/main/netsock2.c<br>@@ -445,7 +445,7 @@<br> && addr->ss.ss_family == AF_INET6) {<br> return ntohs(((struct sockaddr_in6 *)&addr->ss)->sin6_port);<br> }<br>- if (option_debug >= 1) {<br>+ if (DEBUG_ATLEAST(1)) {<br> ast_log(__LOG_DEBUG, file, line, func, "Not an IPv4 nor IPv6 address, cannot get port.\n");<br> }<br> return 0;<br>@@ -463,7 +463,7 @@<br> } else if (addr->len == sizeof(struct sockaddr_in6)<br> && addr->ss.ss_family == AF_INET6) {<br> ((struct sockaddr_in6 *)&addr->ss)->sin6_port = htons(port);<br>- } else if (option_debug >= 1) {<br>+ } else if (DEBUG_ATLEAST(1)) {<br> ast_log(__LOG_DEBUG, file, line, func,<br> "Not an IPv4 nor IPv6 address, cannot set port.\n");<br> }<br>@@ -659,7 +659,7 @@<br> return 0;<br> }<br> <br>- if (addr->ss.ss_family != AF_INET && option_debug >= 1) {<br>+ if (addr->ss.ss_family != AF_INET && DEBUG_ATLEAST(1)) {<br> ast_log(__LOG_DEBUG, file, line, func, "Address family is not AF_INET\n");<br> }<br> <br>@@ -672,7 +672,7 @@<br> {<br> memcpy(&addr->ss, sin, sizeof(*sin));<br> <br>- if (addr->ss.ss_family != AF_INET && option_debug >= 1) {<br>+ if (addr->ss.ss_family != AF_INET && DEBUG_ATLEAST(1)) {<br> ast_log(__LOG_DEBUG, file, line, func, "Address family is not AF_INET\n");<br> }<br> <br>diff --git a/main/pbx.c b/main/pbx.c<br>index 8e58819..b4599de 100644<br>--- a/main/pbx.c<br>+++ b/main/pbx.c<br>@@ -7424,13 +7424,13 @@<br> ast_add_hint(tmp);<br> }<br> }<br>- if (option_debug) {<br>+ if (DEBUG_ATLEAST(1)) {<br> if (tmp->matchcid == AST_EXT_MATCHCID_ON) {<br>- ast_debug(1, "Added extension '%s' priority %d (CID match '%s') to %s (%p)\n",<br>- tmp->name, tmp->priority, tmp->cidmatch_display, con->name, con);<br>+ ast_log(LOG_DEBUG, "Added extension '%s' priority %d (CID match '%s') to %s (%p)\n",<br>+ tmp->name, tmp->priority, tmp->cidmatch_display, con->name, con);<br> } else {<br>- ast_debug(1, "Added extension '%s' priority %d to %s (%p)\n",<br>- tmp->name, tmp->priority, con->name, con);<br>+ ast_log(LOG_DEBUG, "Added extension '%s' priority %d to %s (%p)\n",<br>+ tmp->name, tmp->priority, con->name, con);<br> }<br> }<br> <br>diff --git a/main/sched.c b/main/sched.c<br>index 222c691..9729ccb 100644<br>--- a/main/sched.c<br>+++ b/main/sched.c<br>@@ -33,10 +33,7 @@<br> ASTERISK_FILE_VERSION(__FILE__, "$Revision$")<br> <br> #ifdef DEBUG_SCHEDULER<br>-#define DEBUG(a) do { \<br>- if (option_debug) \<br>- DEBUG_M(a) \<br>- } while (0)<br>+#define DEBUG(a) a<br> #else<br> #define DEBUG(a)<br> #endif<br>@@ -550,8 +547,7 @@<br> }<br> #ifdef DUMP_SCHEDULER<br> /* Dump contents of the context while we have the lock so nothing gets screwed up by accident. */<br>- if (option_debug)<br>- ast_sched_dump(con);<br>+ ast_sched_dump(con);<br> #endif<br> if (con->sched_thread) {<br> ast_cond_signal(&con->sched_thread->cond);<br>@@ -651,8 +647,7 @@<br> <br> #ifdef DUMP_SCHEDULER<br> /* Dump contents of the context while we have the lock so nothing gets screwed up by accident. */<br>- if (option_debug)<br>- ast_sched_dump(con);<br>+ ast_sched_dump(con);<br> #endif<br> if (con->sched_thread) {<br> ast_cond_signal(&con->sched_thread->cond);<br>@@ -713,25 +708,33 @@<br> void ast_sched_dump(struct ast_sched_context *con)<br> {<br> struct sched *q;<br>- struct timeval when = ast_tvnow();<br>+ struct timeval when;<br> int x;<br> size_t heap_size;<br>+<br>+ if (!DEBUG_ATLEAST(1)) {<br>+ return;<br>+ }<br>+<br>+ when = ast_tvnow();<br> #ifdef SCHED_MAX_CACHE<br>- ast_debug(1, "Asterisk Schedule Dump (%zu in Q, %u Total, %u Cache, %u high-water)\n", ast_heap_size(con->sched_heap), con->eventcnt - 1, con->schedccnt, con->highwater);<br>+ ast_log(LOG_DEBUG, "Asterisk Schedule Dump (%zu in Q, %u Total, %u Cache, %u high-water)\n",<br>+ ast_heap_size(con->sched_heap), con->eventcnt - 1, con->schedccnt, con->highwater);<br> #else<br>- ast_debug(1, "Asterisk Schedule Dump (%zu in Q, %u Total, %u high-water)\n", ast_heap_size(con->sched_heap), con->eventcnt - 1, con->highwater);<br>+ ast_log(LOG_DEBUG, "Asterisk Schedule Dump (%zu in Q, %u Total, %u high-water)\n",<br>+ ast_heap_size(con->sched_heap), con->eventcnt - 1, con->highwater);<br> #endif<br> <br>- ast_debug(1, "=============================================================\n");<br>- ast_debug(1, "|ID Callback Data Time (sec:ms) |\n");<br>- ast_debug(1, "+-----+-----------------+-----------------+-----------------+\n");<br>+ ast_log(LOG_DEBUG, "=============================================================\n");<br>+ ast_log(LOG_DEBUG, "|ID Callback Data Time (sec:ms) |\n");<br>+ ast_log(LOG_DEBUG, "+-----+-----------------+-----------------+-----------------+\n");<br> ast_mutex_lock(&con->lock);<br> heap_size = ast_heap_size(con->sched_heap);<br> for (x = 1; x <= heap_size; x++) {<br> struct timeval delta;<br> q = ast_heap_peek(con->sched_heap, x);<br> delta = ast_tvsub(q->when, when);<br>- ast_debug(1, "|%.4d | %-15p | %-15p | %.6ld : %.6ld |\n",<br>+ ast_log(LOG_DEBUG, "|%.4d | %-15p | %-15p | %.6ld : %.6ld |\n",<br> q->sched_id->id,<br> q->callback,<br> q->data,<br>@@ -739,7 +742,7 @@<br> (long int)delta.tv_usec);<br> }<br> ast_mutex_unlock(&con->lock);<br>- ast_debug(1, "=============================================================\n");<br>+ ast_log(LOG_DEBUG, "=============================================================\n");<br> }<br> <br> /*! \brief<br>diff --git a/res/res_config_ldap.c b/res/res_config_ldap.c<br>index 78f1fa8..e3935e0 100644<br>--- a/res/res_config_ldap.c<br>+++ b/res/res_config_ldap.c<br>@@ -550,11 +550,11 @@<br> } /*!< while (ldap_attribute_name) */<br> ber_free(ber, 0);<br> if (static_table_config == table_config) {<br>- if (option_debug > 2) {<br>+ if (DEBUG_ATLEAST(3)) {<br> const struct ast_variable *tmpdebug = variable_named(var, "variable_name");<br> const struct ast_variable *tmpdebug2 = variable_named(var, "variable_value");<br> if (tmpdebug && tmpdebug2) {<br>- ast_debug(3, "Added to vars - %s = %s\n", tmpdebug->value, tmpdebug2->value);<br>+ ast_log(LOG_DEBUG, "Added to vars - %s = %s\n", tmpdebug->value, tmpdebug2->value);<br> }<br> }<br> vars[entry_index++] = var;<br>@@ -1620,14 +1620,14 @@<br> <br> /* Ready to update */<br> ast_debug(3, "Modifying %zu matched entries\n", entry_count);<br>- if (option_debug > 2) {<br>+ if (DEBUG_ATLEAST(3)) {<br> size_t i;<br> for (i = 0; modifications[i]; i++) {<br> if (modifications[i]->mod_op != LDAP_MOD_DELETE) {<br>- ast_debug(3, "%s => %s\n", modifications[i]->mod_type,<br>- modifications[i]->mod_values[0]);<br>+ ast_log(LOG_DEBUG, "%s => %s\n", modifications[i]->mod_type,<br>+ modifications[i]->mod_values[0]);<br> } else {<br>- ast_debug(3, "deleting %s\n", modifications[i]->mod_type);<br>+ ast_log(LOG_DEBUG, "deleting %s\n", modifications[i]->mod_type);<br> }<br> }<br> }<br>diff --git a/res/res_config_pgsql.c b/res/res_config_pgsql.c<br>index b4f5aa2..d06b2b0 100644<br>--- a/res/res_config_pgsql.c<br>+++ b/res/res_config_pgsql.c<br>@@ -1560,16 +1560,16 @@<br> <br> ast_config_destroy(config);<br> <br>- if (option_debug) {<br>+ if (DEBUG_ATLEAST(1)) {<br> if (!ast_strlen_zero(dbhost)) {<br>- ast_debug(1, "PostgreSQL RealTime Host: %s\n", dbhost);<br>- ast_debug(1, "PostgreSQL RealTime Port: %i\n", dbport);<br>+ ast_log(LOG_DEBUG, "PostgreSQL RealTime Host: %s\n", dbhost);<br>+ ast_log(LOG_DEBUG, "PostgreSQL RealTime Port: %i\n", dbport);<br> } else {<br>- ast_debug(1, "PostgreSQL RealTime Socket: %s\n", dbsock);<br>+ ast_log(LOG_DEBUG, "PostgreSQL RealTime Socket: %s\n", dbsock);<br> }<br>- ast_debug(1, "PostgreSQL RealTime User: %s\n", dbuser);<br>- ast_debug(1, "PostgreSQL RealTime Password: %s\n", dbpass);<br>- ast_debug(1, "PostgreSQL RealTime DBName: %s\n", dbname);<br>+ ast_log(LOG_DEBUG, "PostgreSQL RealTime User: %s\n", dbuser);<br>+ ast_log(LOG_DEBUG, "PostgreSQL RealTime Password: %s\n", dbpass);<br>+ ast_log(LOG_DEBUG, "PostgreSQL RealTime DBName: %s\n", dbname);<br> }<br> <br> if (!pgsql_reconnect(NULL)) {<br>diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c<br>index 1dcae3b..04e9fa5 100644<br>--- a/res/res_rtp_asterisk.c<br>+++ b/res/res_rtp_asterisk.c<br>@@ -4164,11 +4164,9 @@<br> format = frame->subclass.format;<br> if (ast_format_cmp(rtp->lasttxformat, format) == AST_FORMAT_CMP_NOT_EQUAL) {<br> /* Oh dear, if the format changed we will have to set up a new smoother */<br>- if (option_debug > 0) {<br>- ast_debug(1, "Ooh, format changed from %s to %s\n",<br>- ast_format_get_name(rtp->lasttxformat),<br>- ast_format_get_name(frame->subclass.format));<br>- }<br>+ ast_debug(1, "Ooh, format changed from %s to %s\n",<br>+ ast_format_get_name(rtp->lasttxformat),<br>+ ast_format_get_name(frame->subclass.format));<br> ao2_replace(rtp->lasttxformat, format);<br> if (rtp->smoother) {<br> ast_smoother_free(rtp->smoother);<br>@@ -5251,7 +5249,7 @@<br> ast_sockaddr_stringify(&remote_address),<br> strerror(errno));<br> } else if (((ast_test_flag(bridged, FLAG_NAT_ACTIVE) == FLAG_NAT_INACTIVE) || rtpdebug) && !ast_test_flag(bridged, FLAG_NAT_INACTIVE_NOWARN)) {<br>- if (option_debug || rtpdebug) {<br>+ if (rtpdebug || DEBUG_ATLEAST(1)) {<br> ast_log(LOG_WARNING,<br> "RTP NAT: Can't write RTP to private "<br> "address %s, waiting for other end to "<br>@@ -5585,13 +5583,14 @@<br> if (ext) {<br> hdrlen += (ntohl(rtpheader[hdrlen/4]) & 0xffff) << 2;<br> hdrlen += 4;<br>- if (option_debug) {<br>+ if (DEBUG_ATLEAST(1)) {<br> unsigned int profile;<br> profile = (ntohl(rtpheader[3]) & 0xffff0000) >> 16;<br>- if (profile == 0x505a)<br>- ast_debug(1, "Found Zfone extension in RTP stream - zrtp - not supported.\n");<br>- else<br>- ast_debug(1, "Found unknown RTP Extensions %x\n", profile);<br>+ if (profile == 0x505a) {<br>+ ast_log(LOG_DEBUG, "Found Zfone extension in RTP stream - zrtp - not supported.\n");<br>+ } else {<br>+ ast_log(LOG_DEBUG, "Found unknown RTP Extensions %x\n", profile);<br>+ }<br> }<br> }<br> <br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/8451">change 8451</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/8451"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: Ic342d4799a945dbc40ac085ac142681094a4ebf0 </div>
<div style="display:none"> Gerrit-Change-Number: 8451 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>