diff options
author | pabelanger <pabelanger@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-05-05 16:42:22 +0000 |
---|---|---|
committer | pabelanger <pabelanger@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-05-05 16:42:22 +0000 |
commit | ac9ca359531dab6bb0acd35569011e071293adc7 (patch) | |
tree | f412f6446e1a37536801b09bf08c2b4e62f8dafa /channels | |
parent | 80ff76bb5d4b141747498f7f0ebbdf70b5c73e42 (diff) |
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: http://svn.digium.com/svn/asterisk/branches/1.4@261274 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_sip.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index fdb4c98e3..84209b0dd 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -18076,14 +18076,18 @@ 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)) { ASTOBJ_UNREF(peer, sip_destroy_peer); return NULL; } } else if (!strcasecmp(v->name, "permit") || !strcasecmp(v->name, "deny")) { - peer->ha = ast_append_ha(v->name, v->value, peer->ha); + if (!ast_strlen_zero(v->value)) { + peer->ha = ast_append_ha(v->name, v->value, peer->ha); + } } else if (!strcasecmp(v->name, "contactpermit") || !strcasecmp(v->name, "contactdeny")) { - peer->contactha = ast_append_ha(v->name + 7, v->value, peer->contactha); + if (!ast_strlen_zero(v->value)) { + peer->contactha = ast_append_ha(v->name + 7, v->value, peer->contactha); + } } else if (!strcasecmp(v->name, "port")) { peer->portinuri = 1; if (!realtime && ast_test_flag(&peer->flags[1], SIP_PAGE2_DYNAMIC)) |