summaryrefslogtreecommitdiff
path: root/configs
diff options
context:
space:
mode:
authorGeorge Joseph <george.joseph@fairview5.com>2016-02-07 16:34:20 -0700
committerGeorge Joseph <george.joseph@fairview5.com>2016-02-18 16:30:18 -0600
commit6b921f706d493f926c3bceb44775aa71bdc5e225 (patch)
tree3ea44b98f0b0e81a0f69076dda19b3f7f596695b /configs
parent37c273f0de946282e69c0a6166b955eb3b4f8c2e (diff)
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
Diffstat (limited to 'configs')
-rw-r--r--configs/samples/pjproject.conf.sample28
1 files changed, 28 insertions, 0 deletions
diff --git a/configs/samples/pjproject.conf.sample b/configs/samples/pjproject.conf.sample
new file mode 100644
index 000000000..97af7345f
--- /dev/null
+++ b/configs/samples/pjproject.conf.sample
@@ -0,0 +1,28 @@
+; Common pjproject options
+;
+
+;========================LOG_MAPPINGS SECTION OPTIONS===============================
+;[log_mappings]
+; SYNOPSIS: Provides pjproject to Asterisk log level mappings.
+; NOTES: The name of this section in the pjproject.conf configuration file must
+; remain log_mappings or the configuration will not be applied.
+; The defaults mentioned below only apply if this file or the 'log_mappings'
+; object can'tbe found. If the object is found, there are no defaults. If
+; you don't specify an entry, nothing will be logged for that level.
+;
+;asterisk_error = ; A comma separated list of pjproject log levels to map to
+ ; Asterisk errors.
+ ; (default: "0,1")
+;asterisk_warning = ; A comma separated list of pjproject log levels to map to
+ ; Asterisk warnings.
+ ; (default: "2")
+;asterisk_notice = ; A comma separated list of pjproject log levels to map to
+ ; Asterisk notices.
+ ; (default: "")
+;asterisk_verbose = ; A comma separated list of pjproject log levels to map to
+ ; Asterisk verbose.
+ ; (default: "")
+;asterisk_debug = ; A comma separated list of pjproject log levels to map to
+ ; Asterisk debug
+ ; (default: "3,4,5")
+;type= ; Must be of type log_mappings (default: "")