Use tohost, not the name of the peer
authorMark Spencer <markster@digium.com>
Tue, 13 Jul 2004 02:44:11 +0000 (02:44 +0000)
committerMark Spencer <markster@digium.com>
Tue, 13 Jul 2004 02:44:11 +0000 (02:44 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3423 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 3d5b823..bd74300 100755 (executable)
@@ -3968,8 +3968,8 @@ static int transmit_register(struct sip_registry *r, char *cmd, char *auth, char
                snprintf(from, sizeof(from), "<sip:%s>;tag=as%08x", r->username, p->tag);
                snprintf(to, sizeof(to),     "<sip:%s>", r->username);
        } else {
-               snprintf(from, sizeof(from), "<sip:%s@%s>;tag=as%08x", r->username, r->hostname, p->tag);
-               snprintf(to, sizeof(to),     "<sip:%s@%s>", r->username, r->hostname);
+               snprintf(from, sizeof(from), "<sip:%s@%s>;tag=as%08x", r->username, p->tohost, p->tag);
+               snprintf(to, sizeof(to),     "<sip:%s@%s>", r->username, p->tohost);
        }
        
        snprintf(addr, sizeof(addr), "sip:%s", r->hostname);