Review Board 1.7.16


res_pjsip: Forward PJSIP logging to Asterisk logging

Review Request #2830 - Created Sept. 6, 2013 and submitted

David Lee
/team/dlee/ASTERISK-22360-pjsip-logging
ASTERISK-22360
Reviewers
asterisk-dev
jcolp, mmichelson
Asterisk
This patch uses PJSIP's pj_log_set_log_func() to forward PJSIP's log
messages to Asterisk's logger. This is done in a new module:
res_pjsip_log_forwarder.so.

This patch sets defaultenabled on the existing res_pjsip_logger.so to
no, since logging every SIP packet seems a bit odd to do by default, and
is (hopefully) less necessary with regular PJSIP logging.

It also removes res_rtp_asterisk's disabling of PJSIP logging.

From the \file comment:

 * PJSIP logging doesn't exactly match Asterisk logging, but mapping the two is
 * not too bad. PJSIP log levels are identified by a single int. Limits are
 * not specified by PJSIP, but their implementation used 1 through 6.
 *
 * The mapping is as follows:
 *  - 0: LOG_ERROR
 *  - 1: LOG_ERROR
 *  - 2: LOG_WARNING
 *  - 3 and above: equivalent to ast_debug(level, ...) for res_pjsip.so
Configured res_pjsip, set the debug level, started up a phone, watched
the logs roll in.
Review request changed
Updated (Sept. 13, 2013, 10:18 a.m.)
  • changed from pending to submitted
Committed in revision 399089

https://reviewboard.asterisk.org/ runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to asteriskteam@digium.com.