Pre-Submission Checklist

Type Of Change

Checklist:

Description

Add new preprocessor keywords trydefenv and trydefenvs that work like defenv and defenvs respectively, with the difference that if the environmental variable is not defined, then the value in Kamailio will not be defined.

For example:

#!KAMAILIO

loadmodule "xlog"
loadmodule "pv"

#!trydefenv EXTRALOG

request_route {
    #!ifdef EXTRALOG
       xlog("L_I", "Some Extra Logging here\n");
    #!endif
    forward ();
}

If the environmental variable $EXTRALOG is defined, the log line will be written. If the environmental variable is not set, then in Kamailio EXTRALOG will not be defined and the #!ifdef section will not be loaded.


You can view, comment on, or merge this pull request online at:

  https://github.com/kamailio/kamailio/pull/2969

Commit Summary

File Changes

(2 files)

Patch Links:


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.