summaryrefslogtreecommitdiff
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2007-04-12 19:32:00 +0000
committerJoshua Colp <jcolp@digium.com>2007-04-12 19:32:00 +0000
commitc4c2def7166543bdde49987be9e3737d2ee6527e (patch)
treeb9cee098d2f0bda220d0d7f79a54ad6bdf27840c /channels/chan_sip.c
parentcc2aa89fa9a8420d96fadab09e3ba4b705403256 (diff)
Don't treat a host lookup as failed if sipregs is not in use when doing a realtime lookup. (issue #9255 reported by sergee)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@61618 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r--channels/chan_sip.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 99b156ed1..0741715f4 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -2657,14 +2657,16 @@ static struct sip_peer *realtime_peer(const char *newpeername, struct sockaddr_i
} else if (sin) { /* Then check on IP address for dynamic peers */
ast_copy_string(ipaddr, ast_inet_ntoa(sin->sin_addr), sizeof(ipaddr));
var = ast_load_realtime("sippeers", "host", ipaddr, NULL); /* First check for fixed IP hosts */
- if (var && realtimeregs) {
- tmp = var;
- while (tmp) {
- if (!newpeername && !strcasecmp(tmp->name, "name"))
- newpeername = tmp->value;
- tmp = tmp->next;
+ if (var) {
+ if (realtimeregs) {
+ tmp = var;
+ while (tmp) {
+ if (!newpeername && !strcasecmp(tmp->name, "name"))
+ newpeername = tmp->value;
+ tmp = tmp->next;
+ }
+ varregs = ast_load_realtime("sipregs", "name", newpeername, NULL);
}
- varregs = ast_load_realtime("sipregs", "name", newpeername, NULL);
} else {
if (realtimeregs)
varregs = ast_load_realtime("sipregs", "ipaddr", ipaddr, NULL); /* Then check for registered hosts */