[Asterisk-cvs] asterisk/channels chan_sip.c,1.592,1.593

markster at lists.digium.com markster at lists.digium.com
Sat Dec 18 17:01:56 CST 2004


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

Modified Files:
	chan_sip.c 
Log Message:
Fix SIP ACK for BYE (bug #3087)


Index: chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.592
retrieving revision 1.593
diff -u -d -r1.592 -r1.593
--- chan_sip.c	18 Dec 2004 14:26:24 -0000	1.592
+++ chan_sip.c	18 Dec 2004 21:58:05 -0000	1.593
@@ -3108,6 +3108,7 @@
 	return 0;
 }
 
+/*--- reqprep: Initialize a SIP request packet ---*/
 static int reqprep(struct sip_request *req, struct sip_pvt *p, char *msg, int seqno, int newbranch)
 {
 	struct sip_request *orig = &p->initreq;
@@ -3143,9 +3144,12 @@
 			c = p->okcontacturi;
 		else
 			c = p->initreq.rlPart2;
+	} else if (!ast_strlen_zero(p->okcontacturi)) {
+		c = p->okcontacturi; /* Use for BYE or REINVITE */
 	} else if (!ast_strlen_zero(p->uri)) {
 		c = p->uri;
 	} else {
+		/* We have no URI, use To: or From:  header as URI (depending on direction) */
 		if (p->outgoing)
 			strncpy(stripped, get_header(orig, "To"), sizeof(stripped) - 1);
 		else
@@ -3577,7 +3581,7 @@
       e++;
       if( !*e ) { return -1; }  
     }
-    req->rlPart2= e;
+    req->rlPart2= e;	/* URI */
     if( ( e= strrchr( req->rlPart2, 'S' ) ) == NULL ) {
       return -1;
     }
@@ -3591,9 +3595,12 @@
   return 1;
 }
 
-/* transmit_reinvite_with_sdp: Transmit reinvite with SDP :-) ---*/
-/*   A re-invite is basically a new INVITE with the same CALL-ID and TAG as the
-     INVITE that opened the SIP dialogue */
+/*--- transmit_reinvite_with_sdp: Transmit reinvite with SDP :-) ---*/
+/* 	A re-invite is basically a new INVITE with the same CALL-ID and TAG as the
+	INVITE that opened the SIP dialogue 
+	We reinvite so that the audio stream (RTP) go directly between
+	the SIP UAs. SIP Signalling stays with * in the path.
+*/
 static int transmit_reinvite_with_sdp(struct sip_pvt *p)
 {
 	struct sip_request req;
@@ -3754,7 +3761,7 @@
 }
 
         
-/*--- transmit_invite: Build REFER/INVITE/OPTIONS message and trasmit it ---*/
+/*--- transmit_invite: Build REFER/INVITE/OPTIONS message and transmit it ---*/
 static int transmit_invite(struct sip_pvt *p, char *cmd, int sdp, char *auth, char *authheader, char *vxml_url, char *distinctive_ring, char *osptoken, int addsipheaders, int init)
 {
 	struct sip_request req;
@@ -6744,6 +6751,7 @@
 	}
 }
 
+/*--- check_pendings: Check pending actions on SIP call ---*/
 static void check_pendings(struct sip_pvt *p)
 {
 	/* Go ahead and send bye at this point */
@@ -9163,6 +9171,7 @@
 	return rtp;
 }
 
+/*--- sip_set_rtp_peer: Set the RTP peer for this call ---*/
 static int sip_set_rtp_peer(struct ast_channel *chan, struct ast_rtp *rtp, struct ast_rtp *vrtp, int codecs)
 {
 	struct sip_pvt *p;




More information about the svn-commits mailing list