aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2010-07-27 15:13:24 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2010-07-27 15:13:24 +0000
commit3f6661022081e25388b128c442b59c70b4ea7cd7 (patch)
tree40afeaea1d75a97465e5ad26930b8fa5ca47bfae /channels
parent20b1c4fb96755b508faed281cb786ba821f57724 (diff)
Fix bad behavior of dynamic_exclude_static option in sip.conf.
We were attempting to create a contactdeny rule based on the peer's IP address before the peer's IP address had been set. By moving the processing further down in the function, we can ensure stuff works as we expect for it to. (closes issue #17717) Reported by: mmichelson Patches: 17717.patch uploaded by mmichelson (license 60) Tested by: DennisD git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@279784 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 2fed49df7..14eb0e19b 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -24004,13 +24004,6 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, str
peer->addr.sin_port = 0;
peer->host_dynamic = FALSE;
srvlookup = v->value;
- if (global_dynamic_exclude_static) {
- int err = 0;
- global_contact_ha = ast_append_ha("deny", (char *)ast_inet_ntoa(peer->addr.sin_addr), global_contact_ha, &err);
- if (err) {
- ast_log(LOG_ERROR, "Bad ACL entry in configuration line %d : %s\n", v->lineno, v->value);
- }
- }
}
} else if (!strcasecmp(v->name, "defaultip")) {
if (!ast_strlen_zero(v->value) && ast_get_ip(&peer->defaddr, v->value)) {
@@ -24316,6 +24309,13 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, str
}
ast_string_field_set(peer, tohost, srvlookup);
+ if (global_dynamic_exclude_static) {
+ int err = 0;
+ global_contact_ha = ast_append_ha("deny", (char *)ast_inet_ntoa(peer->addr.sin_addr), global_contact_ha, &err);
+ if (err) {
+ ast_log(LOG_ERROR, "Bad ACL entry in configuration line %d : %s\n", v->lineno, v->value);
+ }
+ }
}
if (!peer->addr.sin_port) {