[Asterisk-cvs] asterisk/channels chan_sip.c,1.355,1.356

markster at lists.digium.com markster at lists.digium.com
Sun May 2 12:09:59 CDT 2004


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

Modified Files:
	chan_sip.c 
Log Message:
On incoming call, set peername to username to properly authenticate BYE (it's not used for anything else, as far as I know)


Index: chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.355
retrieving revision 1.356
diff -u -d -r1.355 -r1.356
--- chan_sip.c	2 May 2004 05:38:20 -0000	1.355
+++ chan_sip.c	2 May 2004 16:17:40 -0000	1.356
@@ -4475,9 +4475,11 @@
 					ast_rtp_setnat(p->vrtp, p->nat);
 				}
 				p->canreinvite = peer->canreinvite;
-				if (strlen(peer->username))
-					strncpy(p->username, peer->username, sizeof(p->username) - 1);
 				strncpy(p->peername, peer->name, sizeof(p->peername) - 1);
+				if (strlen(peer->username)) {
+					strncpy(p->username, peer->username, sizeof(p->username) - 1);
+					strncpy(p->peername, peer->username, sizeof(p->peername) - 1);
+				}
 				if (strlen(peer->context))
 					strncpy(p->context, peer->context, sizeof(p->context) - 1);
 				strncpy(p->peersecret, peer->secret, sizeof(p->peersecret) - 1);




More information about the svn-commits mailing list