[Asterisk-cvs] asterisk/channels chan_sip.c,1.663,1.664

markster at lists.digium.com markster at lists.digium.com
Thu Feb 24 07:56:11 CST 2005


Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv18759/channels

Modified Files:
	chan_sip.c 
Log Message:
Fix "tohost" logic errors (bug #3654)


Index: chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.663
retrieving revision 1.664
diff -u -d -r1.663 -r1.664
--- chan_sip.c	19 Feb 2005 17:34:06 -0000	1.663
+++ chan_sip.c	24 Feb 2005 13:54:26 -0000	1.664
@@ -4416,7 +4416,7 @@
 			snprintf(to, sizeof(to), "<sip:%s@%s>", r->username, p->tohost);
 	}
 	
-	snprintf(addr, sizeof(addr), "sip:%s", r->hostname);
+	snprintf(addr, sizeof(addr), "sip:%s", p->tohost);
 	strncpy(p->uri, addr, sizeof(p->uri) - 1);
 
 	p->branch ^= rand();
@@ -8766,7 +8766,7 @@
 		strncpy (p->fullcontact, peer->fullcontact, sizeof(p->fullcontact));
 	}
 
-	if (!ast_strlen_zero(p->tohost))
+	if (!ast_strlen_zero(peer->tohost))
 		strncpy(p->tohost, peer->tohost, sizeof(p->tohost) - 1);
 	else
 		ast_inet_ntoa(p->tohost, sizeof(p->tohost), peer->addr.sin_addr);




More information about the svn-commits mailing list