[Home]

Summary:ASTERISK-26630: Make logging PJPROJECT messages a bit easier
Reporter:Richard Mudgett (rmudgett)Labels:
Date Opened:2016-11-28 16:46:10.000-0600Date Closed:2016-12-02 05:37:24.000-0600
Priority:MajorRegression?
Status:Closed/CompleteComponents:Core/General Resources/res_pjsip/Bundling
Versions:13.13.0 14.2.0 Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:Rusty was debugging an issue where Asterisk was sending a 481 response to an incoming CANCEL. In order to help troubleshoot, [~mmichelson] suggested using PJSIP's transaction layer messages to determine when the transaction was destroyed, and see if the CANCEL arrived after that.

One problem though: the transaction level messages were not showing up in the debug. The problem was that using bundled PJProject, we set PJ_LOG_MAX_LEVEL to 3 in our config_site.h file. Changing that value to 5 and recompiling got the messages to show up as expected.

What this means is, in order to have high level PJProject messages show up in Asterisk logs, you have to:
* Set PJ_LOG_MAX_LEVEL to a high enough value before compiling PJProject
* Make sure that your pjproject.conf file associates those level messages to appropriate Asterisk log levels
* Ensure that you have set core debug to a high enough value to make Asterisk debug messages get logged
* Set up logger.conf so that debug messages are actually going to a file somewhere.

That's a lot of hoops to jump through in order to get PJSIP messages into your logs. What is suggested to do is to try to eliminate at least one of these steps. Perhaps
* Set PJ_LOG_MAX_LEVEL to a higher default value in bundled PJPROJECT, or
* Use PJProject runtime API to set the max level based on whatever core debug is set to (or something similar), or
* Eliminate the need for associating PJProject levels to Asterisk levels. Some sane default should be fine.
Comments:By: Friendly Automation (friendly-automation) 2016-12-02 05:37:25.412-0600

Change 4516 merged by Joshua Colp:
PJPROJECT logging: Made easier to get available logging levels.

[https://gerrit.asterisk.org/4516|https://gerrit.asterisk.org/4516]

By: Friendly Automation (friendly-automation) 2016-12-02 05:38:12.788-0600

Change 4517 merged by Joshua Colp:
PJPROJECT logging: Made easier to get available logging levels.

[https://gerrit.asterisk.org/4517|https://gerrit.asterisk.org/4517]

By: Friendly Automation (friendly-automation) 2016-12-02 05:38:39.315-0600

Change 4515 merged by Joshua Colp:
PJPROJECT logging: Made easier to get available logging levels.

[https://gerrit.asterisk.org/4515|https://gerrit.asterisk.org/4515]

By: Friendly Automation (friendly-automation) 2017-01-17 14:43:30.211-0600

Change 4726 merged by Joshua Colp:
PJPROJECT logging: Made easier to get available logging levels.

[https://gerrit.asterisk.org/4726|https://gerrit.asterisk.org/4726]