<p>George Joseph has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/16281">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_pjproject: Allow mapping to Asterisk TRACE level<br><br>Allow mapping pjproject log messages to the Asterisk TRACE<br>log level.  The defaults were also changes to log pjproject<br>levels 3,4 to DEBUG and 5,6 to TRACE.  Previously 3,4,5,6<br>all went to DEBUG.<br><br>ASTERISK-29582<br><br>Change-Id: I859a37a8dec263ed68099709cfbd3e665324c72d<br>---<br>M configs/samples/pjproject.conf.sample<br>M res/res_pjproject.c<br>2 files changed, 21 insertions(+), 6 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/81/16281/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/configs/samples/pjproject.conf.sample b/configs/samples/pjproject.conf.sample</span><br><span>index 03149c4..273384b 100644</span><br><span>--- a/configs/samples/pjproject.conf.sample</span><br><span>+++ b/configs/samples/pjproject.conf.sample</span><br><span>@@ -52,5 +52,8 @@</span><br><span>                      ; (default: "")</span><br><span> ;asterisk_debug =    ; A comma separated list of pjproject log levels to map to</span><br><span>                      ; Asterisk debug</span><br><span style="color: hsl(0, 100%, 40%);">-                     ; (default: "3,4,5,6")</span><br><span style="color: hsl(120, 100%, 40%);">+                     ; (default: "3,4")</span><br><span style="color: hsl(120, 100%, 40%);">+;asterisk_trace =    ; A comma separated list of pjproject log levels to map to</span><br><span style="color: hsl(120, 100%, 40%);">+                     ; Asterisk trace</span><br><span style="color: hsl(120, 100%, 40%);">+                     ; (default: "5,6")</span><br><span> ;type=               ; Must be of type log_mappings (default: "")</span><br><span>diff --git a/res/res_pjproject.c b/res/res_pjproject.c</span><br><span>index f6dce4c..4047aca 100644</span><br><span>--- a/res/res_pjproject.c</span><br><span>+++ b/res/res_pjproject.c</span><br><span>@@ -29,7 +29,10 @@</span><br><span>  *  - 0: LOG_ERROR</span><br><span>  *  - 1: LOG_ERROR</span><br><span>  *  - 2: LOG_WARNING</span><br><span style="color: hsl(0, 100%, 40%);">- *  - 3 and above: equivalent to ast_debug(level, ...) for res_pjproject.so</span><br><span style="color: hsl(120, 100%, 40%);">+ *  - 3: equivalent to ast_debug(level, ...) for res_pjproject.so</span><br><span style="color: hsl(120, 100%, 40%);">+ *  - 4: equivalent to ast_debug(level, ...) for res_pjproject.so</span><br><span style="color: hsl(120, 100%, 40%);">+ *  - 5: equivalent to ast_trace(level, ...) for res_pjproject.so</span><br><span style="color: hsl(120, 100%, 40%);">+ *  - 6: equivalent to ast_trace(level, ...) for res_pjproject.so</span><br><span>  */</span><br><span> </span><br><span> /*** MODULEINFO</span><br><span>@@ -86,12 +89,15 @@</span><br><span>                                <configOption name="asterisk_notice" default=""></span><br><span>                                   <synopsis>A comma separated list of pjproject log levels to map to Asterisk LOG_NOTICE.</synopsis></span><br><span>                               </configOption></span><br><span style="color: hsl(0, 100%, 40%);">-                           <configOption name="asterisk_debug" default="3,4,5,6"></span><br><span style="color: hsl(0, 100%, 40%);">-                                        <synopsis>A comma separated list of pjproject log levels to map to Asterisk LOG_DEBUG.</synopsis></span><br><span style="color: hsl(0, 100%, 40%);">-                           </configOption></span><br><span>                                <configOption name="asterisk_verbose" default=""></span><br><span>                                  <synopsis>A comma separated list of pjproject log levels to map to Asterisk LOG_VERBOSE.</synopsis></span><br><span>                              </configOption></span><br><span style="color: hsl(120, 100%, 40%);">+                         <configOption name="asterisk_debug" default="3,4"></span><br><span style="color: hsl(120, 100%, 40%);">+                                  <synopsis>A comma separated list of pjproject log levels to map to Asterisk LOG_DEBUG.</synopsis></span><br><span style="color: hsl(120, 100%, 40%);">+                         </configOption></span><br><span style="color: hsl(120, 100%, 40%);">+                         <configOption name="asterisk_trace" default="5,6"></span><br><span style="color: hsl(120, 100%, 40%);">+                                  <synopsis>A comma separated list of pjproject log levels to map to Asterisk LOG_TRACE.</synopsis></span><br><span style="color: hsl(120, 100%, 40%);">+                         </configOption></span><br><span>                        </configObject></span><br><span>                </configFile></span><br><span>  </configInfo></span><br><span>@@ -148,6 +154,8 @@</span><br><span>            AST_STRING_FIELD(asterisk_verbose);</span><br><span>          /*! pjproject log levels mapped to Asterisk DEBUG */</span><br><span>                 AST_STRING_FIELD(asterisk_debug);</span><br><span style="color: hsl(120, 100%, 40%);">+             /*! pjproject log levels mapped to Asterisk TRACE */</span><br><span style="color: hsl(120, 100%, 40%);">+          AST_STRING_FIELD(asterisk_trace);</span><br><span>    );</span><br><span> };</span><br><span> </span><br><span>@@ -190,6 +198,8 @@</span><br><span>           mapped_level = __LOG_VERBOSE;</span><br><span>        } else if (strchr(mappings->asterisk_debug, l)) {</span><br><span>                 mapped_level = __LOG_DEBUG;</span><br><span style="color: hsl(120, 100%, 40%);">+   } else if (strchr(mappings->asterisk_trace, l)) {</span><br><span style="color: hsl(120, 100%, 40%);">+          mapped_level = __LOG_TRACE;</span><br><span>  } else {</span><br><span>             mapped_level = __LOG_SUPPRESS;</span><br><span>       }</span><br><span>@@ -675,6 +685,7 @@</span><br><span>      ast_sorcery_object_field_register(pjproject_sorcery, "log_mappings", "asterisk_warning", "",  OPT_STRINGFIELD_T, 0, STRFLDSET(struct log_mappings, asterisk_warning));</span><br><span>         ast_sorcery_object_field_register(pjproject_sorcery, "log_mappings", "asterisk_notice", "",  OPT_STRINGFIELD_T, 0, STRFLDSET(struct log_mappings, asterisk_notice));</span><br><span>   ast_sorcery_object_field_register(pjproject_sorcery, "log_mappings", "asterisk_verbose", "",  OPT_STRINGFIELD_T, 0, STRFLDSET(struct log_mappings, asterisk_verbose));</span><br><span style="color: hsl(120, 100%, 40%);">+  ast_sorcery_object_field_register(pjproject_sorcery, "log_mappings", "asterisk_trace", "",  OPT_STRINGFIELD_T, 0, STRFLDSET(struct log_mappings, asterisk_trace));</span><br><span> </span><br><span>         default_log_mappings = ast_sorcery_alloc(pjproject_sorcery, "log_mappings", "log_mappings");</span><br><span>     if (!default_log_mappings) {</span><br><span>@@ -683,7 +694,8 @@</span><br><span>   }</span><br><span>    ast_string_field_set(default_log_mappings, asterisk_error, "0,1");</span><br><span>         ast_string_field_set(default_log_mappings, asterisk_warning, "2");</span><br><span style="color: hsl(0, 100%, 40%);">-    ast_string_field_set(default_log_mappings, asterisk_debug, "3,4,5,6");</span><br><span style="color: hsl(120, 100%, 40%);">+      ast_string_field_set(default_log_mappings, asterisk_debug, "3,4");</span><br><span style="color: hsl(120, 100%, 40%);">+  ast_string_field_set(default_log_mappings, asterisk_trace, "5,6");</span><br><span> </span><br><span>     ast_sorcery_load(pjproject_sorcery);</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/16281">change 16281</a>. To unsubscribe, or for help writing mail filters, 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/c/asterisk/+/16281"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 19 </div>
<div style="display:none"> Gerrit-Change-Id: I859a37a8dec263ed68099709cfbd3e665324c72d </div>
<div style="display:none"> Gerrit-Change-Number: 16281 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>