[asterisk-commits] oej: branch oej/darjeeling-prack-1.8 r369464 - /team/oej/darjeeling-prack-1.8...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jun 28 08:19:01 CDT 2012


Author: oej
Date: Thu Jun 28 08:18:56 2012
New Revision: 369464

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=369464
Log:
Don't add required headers to 100 trying. Believe me, it would be wrong.

Modified:
    team/oej/darjeeling-prack-1.8/channels/chan_sip.c

Modified: team/oej/darjeeling-prack-1.8/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/darjeeling-prack-1.8/channels/chan_sip.c?view=diff&rev=369464&r1=369463&r2=369464
==============================================================================
--- team/oej/darjeeling-prack-1.8/channels/chan_sip.c (original)
+++ team/oej/darjeeling-prack-1.8/channels/chan_sip.c Thu Jun 28 08:18:56 2012
@@ -10579,8 +10579,10 @@
 			add_header(&resp, "X-Asterisk-HangupCauseCode", buf);
 		}
 	}
-	add_prack_respheader(p, &resp, reliable);
-	add_required_respheader(&resp);
+	if (!strncmp(msg, "100", 3)) {
+		add_prack_respheader(p, &resp, reliable);
+		add_required_respheader(&resp);
+	}
 	return send_response(p, &resp, reliable, seqno);
 }
 
@@ -12258,8 +12260,12 @@
 /*! 
  * \brief transmit SIP PRACK as a response to a provisional response with a Rseq and Require: 100rel header 
  */
-static int transmit_prack(struct sip_pvt *p)
-{
+static int transmit_prack(struct sip_pvt *p, int their_rseq)
+{
+	if (their_rseq == p->irseq) {
+		ast_debug(3, "!?!?!?!?!? This is a retransmit of the previous response. %d \n", their_rseq);
+	}
+	p->irseq = their_rseq;
 	return transmit_invite(p, SIP_PRACK, 0, 1, NULL);
 }
 
@@ -21203,12 +21209,13 @@
 		int activeextensions = parse_required_sip_options(required);
 		if (activeextensions & SIP_OPT_100REL) {
 			const char *rseq = get_header(req, "RSeq");
+			int their_rseq;
 			ast_debug(3, "!=!=!=!=!=! Response relies on PRACK! Rseq %s\n", rseq);
 			/* DO Something here !!! */
 			/* XXX If the response relies on PRACK, we need to start a PRACK transaction
 			 */
-			sscanf(get_header(req, "RSeq"), "%30u ", &p->irseq);
-			transmit_prack(p);
+			sscanf(get_header(req, "RSeq"), "%30u ", &their_rseq);
+			transmit_prack(p, their_rseq);
 		}
 		if (activeextensions & SIP_OPT_TIMER) {
 			ast_debug(3, "!=!=!=!=!=! The other side activated Session timers! \n");




More information about the asterisk-commits mailing list