[svn-commits] oej: branch oej/codename-pineapple r47460 - in /team/oej/codename-pineapple/c...

svn-commits at lists.digium.com svn-commits at lists.digium.com
Fri Nov 10 12:40:19 MST 2006


Author: oej
Date: Fri Nov 10 13:40:18 2006
New Revision: 47460

URL: http://svn.digium.com/view/asterisk?view=rev&rev=47460
Log:
Updates

Modified:
    team/oej/codename-pineapple/channels/chan_sip3.c
    team/oej/codename-pineapple/channels/sip3/sip3.h
    team/oej/codename-pineapple/channels/sip3/sip3_network.c

Modified: team/oej/codename-pineapple/channels/chan_sip3.c
URL: http://svn.digium.com/view/asterisk/team/oej/codename-pineapple/channels/chan_sip3.c?view=diff&rev=47460&r1=47459&r2=47460
==============================================================================
--- team/oej/codename-pineapple/channels/chan_sip3.c (original)
+++ team/oej/codename-pineapple/channels/chan_sip3.c Fri Nov 10 13:40:18 2006
@@ -2319,9 +2319,9 @@
 	add_header(&req, "Allow", ALLOWED_METHODS);
 	add_header(&req, "Supported", SUPPORTED_EXTENSIONS);
 	if (sipdebug)
-		add_header(&req, "X-asterisk-Info", t38type ? "SIP re-invite for T38 fax" : "SIP re-invite (External RTP bridge)");
+		add_header(&req, "X-asterisk-Info",(t38type ? "SIP re-invite for T38 fax" : "SIP re-invite (External RTP bridge)"));
 	if (!ast_test_flag(&p->flags[0], SIP_NO_HISTORY))
-		append_history(p, "ReInv", t38type ? "Re-invite sent for T38" : "Re-invite sent for external RTP media");
+		append_history(p, "ReInv", "%s", (t38type ? "Re-invite sent for T38" : "Re-invite sent for external RTP media"));
 	if (t38type)
 		add_t38_sdp(&req, p);
 	else

Modified: team/oej/codename-pineapple/channels/sip3/sip3.h
URL: http://svn.digium.com/view/asterisk/team/oej/codename-pineapple/channels/sip3/sip3.h?view=diff&rev=47460&r1=47459&r2=47460
==============================================================================
--- team/oej/codename-pineapple/channels/sip3/sip3.h (original)
+++ team/oej/codename-pineapple/channels/sip3/sip3.h Fri Nov 10 13:40:18 2006
@@ -399,7 +399,7 @@
 	struct sip_request *next;	/*!< For linked list of packets, use this */
 	int retrans;			/*!< Retransmission number */
 	int seqno;			/*!< Sequence number */
-	struct sip_dialog *owner;	/*!< Owner SIP dialog */
+	struct sip_dialog *dialog;	/*!< Owner SIP dialog */
 	int retransid;			/*!< Retransmission ID */
 	int timer_a;			/*!< SIP timer A, retransmission timer */
 	int timer_t1;			/*!< SIP Timer T1, estimated RTT or 500 ms */

Modified: team/oej/codename-pineapple/channels/sip3/sip3_network.c
URL: http://svn.digium.com/view/asterisk/team/oej/codename-pineapple/channels/sip3/sip3_network.c?view=diff&rev=47460&r1=47459&r2=47460
==============================================================================
--- team/oej/codename-pineapple/channels/sip3/sip3_network.c (original)
+++ team/oej/codename-pineapple/channels/sip3/sip3_network.c Fri Nov 10 13:40:18 2006
@@ -306,7 +306,7 @@
 	int reschedule = DEFAULT_RETRANS;
 
 	/* Lock channel PVT */
-	dialog_lock(pkt->owner, TRUE);
+	dialog_lock(pkt->dialog, TRUE);
 
 	if (pkt->retrans < MAX_RETRANS) {
 		pkt->retrans++;
@@ -334,53 +334,53 @@
  				ast_log(LOG_DEBUG, "** SIP timers: Rescheduling retransmission %d to %d ms (t1 %d ms (Retrans id #%d)) \n", pkt->retrans +1, siptimer_a, pkt->timer_t1, pkt->retransid);
  		} 
 
-		if (sip_debug_test_pvt(pkt->owner)) {
-			const struct sockaddr_in *dst = sip_real_dst(pkt->owner);
+		if (sip_debug_test_pvt(pkt->dialog)) {
+			const struct sockaddr_in *dst = sip_real_dst(pkt->dialog);
 			ast_verbose("Retransmitting #%d (%s) to %s:%d:\n%s\n---\n",
-				pkt->retrans, sip_nat_mode(pkt->owner),
+				pkt->retrans, sip_nat_mode(pkt->dialog),
 				ast_inet_ntoa(dst->sin_addr),
 				ntohs(dst->sin_port), pkt->data);
 		}
 
-		append_history(pkt->owner, "ReTx", "%d %s", reschedule, pkt->data);
-		__sip_xmit(pkt->owner, pkt);
-		dialog_lock(pkt->owner, FALSE);
+		append_history(pkt->dialog, "ReTx", "%d %s", reschedule, pkt->data);
+		__sip_xmit(pkt->dialog, pkt);
+		dialog_lock(pkt->dialog, FALSE);
 		return  reschedule;
 	} 
 	/* Too many retries */
-	if (pkt->owner && pkt->method != SIP_OPTIONS) {
+	if (pkt->dialog && pkt->method != SIP_OPTIONS) {
 		if (ast_test_flag(pkt, SIP_PKT_FATAL) || sipdebug)	/* Tell us if it's critical or if we're debugging */
-			ast_log(LOG_WARNING, "Maximum retries exceeded on transmission %s for seqno %d (%s %s)\n", pkt->owner->callid, pkt->seqno, (ast_test_flag(pkt, SIP_PKT_FATAL)) ? "Critical" : "Non-critical", (ast_test_flag(pkt, SIP_PKT_RESPONSE)) ? "Response" : "Request");
+			ast_log(LOG_WARNING, "Maximum retries exceeded on transmission %s for seqno %d (%s %s)\n", pkt->dialog->callid, pkt->seqno, (ast_test_flag(pkt, SIP_PKT_FATAL)) ? "Critical" : "Non-critical", (ast_test_flag(pkt, SIP_PKT_RESPONSE)) ? "Response" : "Request");
 	} else {
 		if ((pkt->method == SIP_OPTIONS) && sipdebug)
-			ast_log(LOG_WARNING, "Cancelling retransmit of OPTIONs (call id %s) \n", pkt->owner->callid);
-	}
-	append_history(pkt->owner, "MaxRetries", "%s", (ast_test_flag(pkt, SIP_PKT_FATAL)) ? "(Critical)" : "(Non-critical)");
+			ast_log(LOG_WARNING, "Cancelling retransmit of OPTIONs (call id %s) \n", pkt->dialog->callid);
+	}
+	append_history(pkt->dialog, "MaxRetries", "%s", (ast_test_flag(pkt, SIP_PKT_FATAL)) ? "(Critical)" : "(Non-critical)");
  		
 	pkt->retransid = -1;
 
 	if (ast_test_flag(pkt, SIP_PKT_FATAL)) {
-		while(pkt->owner->owner && ast_channel_trylock(pkt->owner->owner)) {
-			dialog_lock(pkt->owner, FALSE);
+		while(pkt->dialog->owner && ast_channel_trylock(pkt->dialog->owner)) {
+			dialog_lock(pkt->dialog, FALSE);
 			usleep(1);
-			dialog_lock(pkt->owner, TRUE);
-		}
-		if (pkt->owner->owner) {
-			ast_set_flag(&pkt->owner->flags[0], SIP_ALREADYGONE);
-			ast_log(LOG_WARNING, "Hanging up call %s - no reply to our critical packet.\n", pkt->owner->callid);
-			ast_queue_hangup(pkt->owner->owner);
-			ast_channel_unlock(pkt->owner->owner);
+			dialog_lock(pkt->dialog, TRUE);
+		}
+		if (pkt->dialog->owner) {
+			ast_set_flag(&pkt->dialog->flags[0], SIP_ALREADYGONE);
+			ast_log(LOG_WARNING, "Hanging up call %s - no reply to our critical packet.\n", pkt->dialog->callid);
+			ast_queue_hangup(pkt->dialog->owner);
+			ast_channel_unlock(pkt->dialog->owner);
 		} else {
 			/* If no channel owner, destroy now 
 				...unless it's a SIP options packet, where
 				we want the peerpoke expiry routine handle this.
 			*/
 			if (pkt->method != SIP_OPTIONS)
-				ast_set_flag(&pkt->owner->flags[0], SIP_NEEDDESTROY);	
+				ast_set_flag(&pkt->dialog->flags[0], SIP_NEEDDESTROY);	
 		}
 	}
 	/* In any case, go ahead and remove the packet */
-	for (prev = NULL, cur = pkt->owner->packets; cur; prev = cur, cur = cur->next) {
+	for (prev = NULL, cur = pkt->dialog->packets; cur; prev = cur, cur = cur->next) {
 		if (cur == pkt)
 			break;
 	}
@@ -388,14 +388,14 @@
 		if (prev)
 			prev->next = cur->next;
 		else
-			pkt->owner->packets = cur->next;
-		dialog_lock(pkt->owner, FALSE);
+			pkt->dialog->packets = cur->next;
+		dialog_lock(pkt->dialog, FALSE);
 		free(cur);
 		pkt = NULL;
 	} else
-		ast_log(LOG_WARNING, "Weird, couldn't find packet owner!\n");
+		ast_log(LOG_WARNING, "Weird, couldn't find packet dialog!\n");
 	if (pkt)
-		dialog_lock(pkt->owner, FALSE);
+		dialog_lock(pkt->dialog, FALSE);
 	return 0;
 }
 
@@ -411,7 +411,7 @@
 
 	ast_set_flag(req, SIP_PKT_CONNECTED);	/* Stop sipsock_read from free'ing this request */
 	req->next = dialog->packets;
-	req->owner = dialog;
+	req->dialog = dialog;
 	req->seqno = seqno;
 	if (resp)
 		ast_set_flag(req, SIP_PKT_RESPONSE);
@@ -433,7 +433,7 @@
 	dialog->packets = req;
 
 	/* Send packet */
-	if (!__sip_xmit(req->owner, req))
+	if (!__sip_xmit(req->dialog, req))
 		res = AST_FAILURE;
 	else
 		res = AST_SUCCESS;



More information about the svn-commits mailing list