aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2010-07-27 15:15:22 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2010-07-27 15:15:22 +0000
commit83a3b22b9365082261031b6987501cf82cec00df (patch)
treea29a82ba636c22060372442271bd2afa78b2e069 /channels/chan_sip.c
parent3b62338056e321874db4ea750535798d981ae8b2 (diff)
Merged revisions 279784 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ........ r279784 | mmichelson | 2010-07-27 10:13:24 -0500 (Tue, 27 Jul 2010) | 14 lines 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.8@279785 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r--channels/chan_sip.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 1829bc375..4dd27f8a0 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -25596,14 +25596,6 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, str
unref_peer(peer, "removing register expire ref"));
peer->host_dynamic = FALSE;
srvlookup = v->value;
- if (global_dynamic_exclude_static) {
- int err = 0;
- sip_cfg.contact_ha = ast_append_ha("deny", ast_sockaddr_stringify(&peer->addr),
- sip_cfg.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)) {
@@ -25950,6 +25942,15 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, str
ast_string_field_set(peer, tohost, peer->dnsmgr ? srvlookup :
ast_sockaddr_stringify_host(&peer->addr));
+
+ if (global_dynamic_exclude_static) {
+ int err = 0;
+ sip_cfg.contact_ha = ast_append_ha("deny", ast_sockaddr_stringify_addr(&peer->addr),
+ sip_cfg.contact_ha, &err);
+ if (err) {
+ ast_log(LOG_ERROR, "Bad ACL entry in configuration line %d : %s\n", v->lineno, v->value);
+ }
+ }
}
if (port && !realtime && peer->host_dynamic) {