[Asterisk-cvs] asterisk/channels chan_sip.c,1.249,1.250

markster at lists.digium.com markster at lists.digium.com
Mon Nov 24 12:47:12 CST 2003


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

Modified Files:
	chan_sip.c 
Log Message:
Increment session version each time we send a new SDP


Index: chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.249
retrieving revision 1.250
diff -u -d -r1.249 -r1.250
--- chan_sip.c	24 Nov 2003 01:49:43 -0000	1.249
+++ chan_sip.c	24 Nov 2003 19:13:32 -0000	1.250
@@ -202,6 +202,8 @@
 	int progress;						/* Have sent 183 message progress */
 	int tag;							/* Another random number */
 	int nat;							/* Whether to try to support NAT */
+	int sessionid;						/* SDP Session ID */
+	int sessionversion;					/* SDP Session Version */
 	struct sockaddr_in sa;				/* Our peer */
 	struct sockaddr_in redirip;			/* Where our RTP should be going if not to us */
 	struct sockaddr_in vredirip;		/* Where our Video RTP should be going if not to us */
@@ -2446,6 +2448,11 @@
 		ast_log(LOG_WARNING, "No way to add SDP without an RTP structure\n");
 		return -1;
 	}
+	if (!p->sessionid) {
+		p->sessionid = getpid();
+		p->sessionversion = p->sessionid;
+	} else
+		p->sessionversion++;
 	ast_rtp_get_us(p->rtp, &sin);
 	if (p->vrtp)
 		ast_rtp_get_us(p->vrtp, &vsin);
@@ -2477,7 +2484,7 @@
 	if (sipdebug && p->vrtp)
 		ast_verbose("Video is at %s port %d\n", inet_ntoa(p->ourip), ntohs(vsin.sin_port));	
 	snprintf(v, sizeof(v), "v=0\r\n");
-	snprintf(o, sizeof(o), "o=root %d %d IN IP4 %s\r\n", getpid(), getpid(), inet_ntoa(dest.sin_addr));
+	snprintf(o, sizeof(o), "o=root %d %d IN IP4 %s\r\n", p->sessionid, p->sessionversion, inet_ntoa(dest.sin_addr));
 	snprintf(s, sizeof(s), "s=session\r\n");
 	snprintf(c, sizeof(c), "c=IN IP4 %s\r\n", inet_ntoa(dest.sin_addr));
 	snprintf(t, sizeof(t), "t=0 0\r\n");




More information about the svn-commits mailing list