Author: jrose
Date: Thu Nov 20 09:46:39 2014
New Revision: 428333

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=428333
Log:
PJSIP ACLs: Fix ACLs not loading on startup and apply/acl issues on contact

The biggest problem this patch fixes is that ACLs weren't previously being
loaded when the res_pjsip_acl module was loaded. Yikes. In addition, the
ACL options contact_permit and contact_acl were effectively interpreted as
contact_deny and this patch fixes that as well.

AST-1418 #close
Reported by: Thomas Thompson
Review: https://reviewboard.asterisk.org/r/4120/

ASTERISK-24531 #close
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/4171/

Modified:
    branches/12/res/res_pjsip_acl.c

Modified: branches/12/res/res_pjsip_acl.c
URL: 
http://svnview.digium.com/svn/asterisk/branches/12/res/res_pjsip_acl.c?view=diff&rev=428333&r1=428332&r2=428333
==============================================================================
--- branches/12/res/res_pjsip_acl.c (original)
+++ branches/12/res/res_pjsip_acl.c Thu Nov 20 09:46:39 2014
@@ -233,8 +233,9 @@
        struct ast_sip_acl *sip_acl = obj;
        int error = 0;
        int ignore;
-       if (!strncmp(var->name, "contact", 7)) {
-               ast_append_acl(var->name + 7, var->value, 
&sip_acl->contact_acl, &error, &ignore);
+
+       if (!strncmp(var->name, "contact_", 8)) {
+               ast_append_acl(var->name + 8, var->value, 
&sip_acl->contact_acl, &error, &ignore);
        } else {
                ast_append_acl(var->name, var->value, &sip_acl->acl, &error, 
&ignore);
        }
@@ -287,6 +288,8 @@
        ast_sorcery_object_field_register_custom(ast_sip_get_sorcery(), 
SIP_SORCERY_ACL_TYPE, "contact_deny", "", acl_handler, NULL, NULL, 0, 0);
        ast_sorcery_object_field_register_custom(ast_sip_get_sorcery(), 
SIP_SORCERY_ACL_TYPE, "contact_acl", "", acl_handler, NULL, NULL, 0, 0);
 
+       ast_sorcery_load_object(ast_sip_get_sorcery(), SIP_SORCERY_ACL_TYPE);
+
        ast_sip_register_service(&acl_module);
        return AST_MODULE_LOAD_SUCCESS;
 }


-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

svn-commits mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/svn-commits

Reply via email to