summaryrefslogtreecommitdiff
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
authorPaul Belanger <paul.belanger@polybeacon.com>2010-05-05 18:43:03 +0000
committerPaul Belanger <paul.belanger@polybeacon.com>2010-05-05 18:43:03 +0000
commit35eeb71ead595c78f6c855abdc67a7eac0a4a74e (patch)
tree61b5ad335894d3f1285a349a594036ea293e7155 /channels/chan_sip.c
parenta6ea125e7c1937154148c972cbe1c42f498a77df (diff)
Merged revisions 261274 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r261274 | pabelanger | 2010-05-05 12:42:22 -0400 (Wed, 05 May 2010) | 12 lines Registration fix for SIP realtime. Make sure realtime fields are not empty. (closes issue #17266) Reported by: Nick_Lewis Patches: chan_sip.c-realtime.patch uploaded by Nick Lewis (license 657) Tested by: Nick_Lewis, sberney Review: https://reviewboard.asterisk.org/r/643/ ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@261314 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r--channels/chan_sip.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index a7b57438a..876ca3691 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -24997,19 +24997,23 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, str
}
}
} else if (!strcasecmp(v->name, "defaultip")) {
- if (ast_get_ip(&peer->defaddr, v->value)) {
+ if (!ast_strlen_zero(v->value) && ast_get_ip(&peer->defaddr, v->value)) {
unref_peer(peer, "unref_peer: from build_peer defaultip");
return NULL;
}
} else if (!strcasecmp(v->name, "permit") || !strcasecmp(v->name, "deny")) {
int ha_error = 0;
- peer->ha = ast_append_ha(v->name, v->value, peer->ha, &ha_error);
+ if (!ast_strlen_zero(v->value)) {
+ peer->ha = ast_append_ha(v->name, v->value, peer->ha, &ha_error);
+ }
if (ha_error) {
ast_log(LOG_ERROR, "Bad ACL entry in configuration line %d : %s\n", v->lineno, v->value);
}
} else if (!strcasecmp(v->name, "contactpermit") || !strcasecmp(v->name, "contactdeny")) {
int ha_error = 0;
- peer->contactha = ast_append_ha(v->name + 7, v->value, peer->contactha, &ha_error);
+ if (!ast_strlen_zero(v->value)) {
+ peer->contactha = ast_append_ha(v->name + 7, v->value, peer->contactha, &ha_error);
+ }
if (ha_error) {
ast_log(LOG_ERROR, "Bad ACL entry in configuration line %d : %s\n", v->lineno, v->value);
}