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

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


Author: oej
Date: Thu Jun 28 05:37:56 2012
New Revision: 369459

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=369459
Log:
Add Rseq and Required headers

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

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=369459&r1=369458&r2=369459
==============================================================================
--- team/oej/darjeeling-prack-1.8/channels/chan_sip.c (original)
+++ team/oej/darjeeling-prack-1.8/channels/chan_sip.c Thu Jun 28 05:37:56 2012
@@ -4163,9 +4163,29 @@
 
 	if (p->initreq.method == SIP_INVITE && ast_test_flag(&p->flags[2], SIP_PAGE3_PRACK)) {
 		if (reliable == XMIT_PRACK) {
-			ast_debug(2, "=!=!=!=!=!=!=!= PRACK WILL BE USED HERE. Exactly HERE\n");
+			char buf[SIPBUFSIZE/2];
+			if (p->rseq == 0) {
+				p->rseq = 41; /* Starting level. Hi Douglas */
+			}
+			snprintf(buf, sizeof(buf), "%d", ++(p->rseq));
+			add_header(req, "Rseq", buf);
+			req->reqsipoptions &= SIP_OPT_100REL;
+			ast_debug(2, "=!=!=!=!=!=!=!= PRACK USED HERE. Rseq %d\n", p->rseq);
 		} else {
 			ast_debug(2, "=!=!=!=!=!=!=!= PRACK COULD BE USED HERE. Exactly HERE\n");
+		}
+	}
+
+	if (req->reqsipoptions) {
+		char buf[SIPBUFSIZE];
+		int i;
+
+		for (i = 0; i < ARRAY_LEN(sip_options); i++) {
+			if (req->reqsipoptions & sip_options[i].id) {
+				strncat(buf, ", ", sizeof(buf));
+				strncat(buf, sip_options[i].text, sizeof(buf));
+				ast_debug(3, "Found required response SIP option: %s\n", sip_options[i].text);
+			}
 		}
 	}
 
@@ -10297,6 +10317,7 @@
 		snprintf(se_hdr, sizeof(se_hdr), "%d;refresher=%s", p->stimer->st_interval,
 			strefresher2str(p->stimer->st_ref));
 		add_header(resp, "Session-Expires", se_hdr);
+		resp->reqsipoptions &= SIP_OPT_TIMER;
 	}
 
 	if (msg[0] == '2' && (p->method == SIP_SUBSCRIBE || p->method == SIP_REGISTER)) {

Modified: team/oej/darjeeling-prack-1.8/channels/sip/include/sip.h
URL: http://svnview.digium.com/svn/asterisk/team/oej/darjeeling-prack-1.8/channels/sip/include/sip.h?view=diff&rev=369459&r1=369458&r2=369459
==============================================================================
--- team/oej/darjeeling-prack-1.8/channels/sip/include/sip.h (original)
+++ team/oej/darjeeling-prack-1.8/channels/sip/include/sip.h Thu Jun 28 05:37:56 2012
@@ -753,6 +753,7 @@
 	int headers;            /*!< # of SIP Headers */
 	int method;             /*!< Method of this request */
 	int lines;              /*!< Body Content */
+	unsigned int reqsipoptions;  /*!< Required SIP options for this answer */
 	unsigned int sdp_start; /*!< the line number where the SDP begins */
 	unsigned int sdp_count; /*!< the number of lines of SDP */
 	char debug;             /*!< print extra debugging if non zero */
@@ -989,8 +990,8 @@
 	uint32_t ocseq;                         /*!< Current outgoing seqno */
 	uint32_t icseq;                         /*!< Current incoming seqno */
 	uint32_t init_icseq;                    /*!< Initial incoming seqno from first request */
-	uint32_t rseq;                          /*!< Current outgoing PRACK rseq */
-	uint32_t irseq;                         /*!< Current incoming PRACK rseq */
+	uint32_t rseq;                          /*!< Current PRACK rseq on our side*/
+	uint32_t irseq;                         /*!< Current PRACK rseq on their side*/
 	ast_group_t callgroup;                  /*!< Call group */
 	ast_group_t pickupgroup;                /*!< Pickup group */
 	uint32_t lastinvite;                    /*!< Last seqno of invite */




More information about the asterisk-commits mailing list