[asterisk-commits] mmichelson: branch group/pimp_my_sip r380246 - in /team/group/pimp_my_sip: ma...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Jan 28 09:43:27 CST 2013
Author: mmichelson
Date: Mon Jan 28 09:43:23 2013
New Revision: 380246
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=380246
Log:
Fix bugs in ACL handling.
When retrieving multiple sorcery objects, you have to specify the "multiple"
flag in addition to the "all" flag. The "all" flag does not automatically
imply the "multiple" flag.
Also, let's not try to respond to an ACK. That's bad.
Modified:
team/group/pimp_my_sip/main/sorcery.c
team/group/pimp_my_sip/res/res_sip_acl.c
Modified: team/group/pimp_my_sip/main/sorcery.c
URL: http://svnview.digium.com/svn/asterisk/team/group/pimp_my_sip/main/sorcery.c?view=diff&rev=380246&r1=380245&r2=380246
==============================================================================
--- team/group/pimp_my_sip/main/sorcery.c (original)
+++ team/group/pimp_my_sip/main/sorcery.c Mon Jan 28 09:43:23 2013
@@ -835,6 +835,7 @@
unsigned int cached = 0;
if (!object_type) {
+ ast_log(LOG_NOTICE, "Can't find object type '%s'\n", type);
return NULL;
}
Modified: team/group/pimp_my_sip/res/res_sip_acl.c
URL: http://svnview.digium.com/svn/asterisk/team/group/pimp_my_sip/res/res_sip_acl.c?view=diff&rev=380246&r1=380245&r2=380246
==============================================================================
--- team/group/pimp_my_sip/res/res_sip_acl.c (original)
+++ team/group/pimp_my_sip/res/res_sip_acl.c Mon Jan 28 09:43:23 2013
@@ -121,7 +121,7 @@
static pj_bool_t acl_on_rx_msg(pjsip_rx_data *rdata)
{
int forbidden;
- struct ao2_container *acls = ast_sorcery_retrieve_by_fields(ast_sip_get_sorcery(), "acl", AST_RETRIEVE_FLAG_ALL, NULL);
+ struct ao2_container *acls = ast_sorcery_retrieve_by_fields(ast_sip_get_sorcery(), "acl", AST_RETRIEVE_FLAG_MULTIPLE | AST_RETRIEVE_FLAG_ALL, NULL);
struct sip_acl *matched_acl;
if (!acls) {
ast_log(LOG_ERROR, "Unable to retrieve ACL sorcery data\n");
@@ -136,7 +136,9 @@
ao2_ref(acls, -1);
if (forbidden) {
- pjsip_endpt_respond_stateless(ast_sip_get_pjsip_endpoint(), rdata, 403, NULL, NULL, NULL);
+ if (rdata->msg_info.msg->line.req.method.id != PJSIP_ACK_METHOD) {
+ pjsip_endpt_respond_stateless(ast_sip_get_pjsip_endpoint(), rdata, 403, NULL, NULL, NULL);
+ }
return PJ_TRUE;
}
@@ -148,7 +150,6 @@
/* This should run after a logger but before anything else */
.priority = 1,
.on_rx_request = acl_on_rx_msg,
- .on_rx_response = acl_on_rx_msg,
};
static int acl_handler(const struct aco_option *opt, struct ast_variable *var, void *obj)
More information about the asterisk-commits
mailing list