[asterisk-dev] -netsec sip_destroy_hook annoyance, libmidcom proposed change

Peter Beckman beckman at purplecow.com
Sat Dec 2 13:52:09 MST 2006


I'm going to be using a Ranch Networks box in front of asterisk, which
requires -netsec and libmidcom.  I'm building and testing the asterisk
boxes without the Ranch boxes to make sure they work first.

I disabled midcom in the midcom.conf by putting "midcomnat = no" while it
was not needed; it was preventing calls from going through since no
firewall existed between it and the net.

Now I get these messages every few seconds:

     Dec  2 15:23:38 ERROR[12890]: res_netsec.c:1058 midcom__sip_destroy_hook: Midcom: Module not enabled
     Midcom: Module currently disabled

and I've reviewed the code and understand why.  (Disabled the first by
commenting out the "console=>" line in logger.conf, a hack but suppressed
'em).

I'm wondering if one of the following changes would be acceptable:

     1. Allow a config var in midcom.conf to specify "iknowitsdisabled=yes" so
        if midcom is disabled, and you know it is, and you don't need to be
        reminded all the time, you can shut off the "midcom disabled"
        messages.  Defaults to "no".

     2. Check in chan_sip.c to see if midcom is enabled, and if not, don't
        try to destroy the hook in midcom.

     3. Change the log level of the message, and set the verbosity of the
        ast_verbose call higher.

>From tags/1.2.13-netsec/channels/chan_sip.c:

     2150 #ifdef SIP_MIDCOM
     2151     if (m_cb)
     2152       m_cb->__sip_destroy_hook(p);
     2153 #endif

>From libmidcom/trunk/res_netsec.c

     602   if (!midcom_enabled) {
     603     ast_log(LOG_ERROR, "Midcom: Module not enabled\n");
     604     if (option_verbose > 1)
     605       ast_verbose("Midcom: Module currently disabled\n");
     606     return 1;
     607   }

I realize that I could set the verbosity at or below 1, but then the other
things I'm watching for won't be displayed either.

Beckman
---------------------------------------------------------------------------
Peter Beckman                                                  Internet Guy
beckman at purplecow.com                             http://www.purplecow.com/
---------------------------------------------------------------------------


More information about the asterisk-dev mailing list