Commit Graph

5 Commits

Author SHA1 Message Date
George Joseph f8767a8804 res_pjproject: Add ability to map pjproject log levels to Asterisk log levels
Warnings and errors in the pjproject libraries are generally handled by
Asterisk.  In many cases, Asterisk wouldn't even consider them to be warnings
or errors so the messages emitted by pjproject directly are either superfluous
or misleading.  A good exampe of this are the level-0 errors pjproject emits
when it can't open a TCP/TLS socket to a client to send an OPTIONS.  We don't
consider a failure to qualify a UDP client an "ERROR", why should a TCP/TLS
client be treated any differently?

A config file for res_pjproject has bene added (pjproject.conf) and a new
log_mappings object allows mapping pjproject levels to Asterisk levels
(or nothing).  The defaults if no pjproject.conf file is found are the same
as those that were hard-coded into res_pjproject initially: 0,1 = LOG_ERROR,
2 = LOG_WARNING, 3,4,5 = LOG_DEBUG<level>

Change-Id: Iba7bb349c70397586889b8f45b8c3d6c6c8c3898
2016-02-18 16:30:29 -06:00
George Joseph 40da6434c1 build_system: Fix some warnings highlighted by clang
Fix some warnings found with clang.

Change-Id: I5195b6189b148c2ee3ed4a19d015a6d4ef3e77bd
2016-02-01 19:22:40 -06:00
Richard Mudgett 5615db3714 res_pjsip: Add CLI "pjsip dump endpt [details]"
Dump the res_pjsip endpt internals.

In non-developer mode we will not document or make easily accessible the
"details" option even though it is still available.  The user has to know
it exists to use it.  Presumably they would also be aware of the potential
crash warning below.

Warning: PJPROJECT documents that the function used by this CLI command
may cause a crash when asking for details because it tries to access all
active memory pools.

Change-Id: If2d98a3641c9873364d1daaad971376311aef3cb
2016-01-21 12:47:12 -06:00
George Joseph dd5c063934 res_pjproject: Add module providing pjproject logging and utils
res_pjsip_log_forwarder has been renamed to res_pjproject
and enhanced as follows:

As a follow-on to the recent 'Add CLI "pjsip show buildopts"' patch,
a new ast_pjproject_get_buildopt function has been added.  It
allows the caller to get the value of one of the buildopts.

The initial use case is retrieving the runtime value of
PJ_MAX_HOSTNAME to insure we don't send a hostname greater
than pjproject can handle.  Since it can differ between
the version of pjproject that Asterisk was compiled against
and the version of pjproject that Asterisk is running against,
we can't use the PJ_MAX_HOSTNAME macro directly in Asterisk
source code.

Change-Id: Iab6e82fec3d7cf00c1cf6185c42be3e7569dee1e
2016-01-20 09:56:13 -07:00
George Joseph 130aa1427e pjsip_loging_refactor: Rename res_pjsip_log_forwarder to res_pjproject
Change-Id: I5387821f29e5caa0cba0b7d62b0fc0d341e7e20b
2016-01-18 18:01:36 -07:00