[libpri-commits] rmudgett: branch rmudgett/t312 r2218 - in /team/rmudgett/t312: pri.c q931.c

SVN commits to the libpri project libpri-commits at lists.digium.com
Fri Feb 25 12:02:17 CST 2011


Author: rmudgett
Date: Fri Feb 25 12:02:13 2011
New Revision: 2218

URL: http://svnview.digium.com/svn/libpri?view=rev&rev=2218
Log:
Moved Q.921/Q.931 packet stats after configuration settings.

Modified:
    team/rmudgett/t312/pri.c
    team/rmudgett/t312/q931.c

Modified: team/rmudgett/t312/pri.c
URL: http://svnview.digium.com/svn/libpri/team/rmudgett/t312/pri.c?view=diff&rev=2218&r1=2217&r2=2218
==============================================================================
--- team/rmudgett/t312/pri.c (original)
+++ team/rmudgett/t312/pri.c Fri Feb 25 12:02:13 2011
@@ -1731,6 +1731,22 @@
 	used = pri_snprintf(buf, used, buf_size, "Switchtype: %s\n",
 		pri_switch2str(ctrl->switchtype));
 	used = pri_snprintf(buf, used, buf_size, "Type: %s\n", pri_node2str(ctrl->localtype));
+	used = pri_snprintf(buf, used, buf_size, "Overlap Dial: %d\n", ctrl->overlapdial);
+	used = pri_snprintf(buf, used, buf_size, "Logical Channel Mapping: %d\n",
+		ctrl->chan_mapping_logical);
+	used = pri_snprintf(buf, used, buf_size, "Timer and counter settings:\n");
+	switch_bit = PRI_BIT(ctrl->switchtype);
+	for (idx = 0; idx < ARRAY_LEN(pri_timer); ++idx) {
+		if (pri_timer[idx].used_by & switch_bit) {
+			enum PRI_TIMERS_AND_COUNTERS tmr;
+
+			tmr = pri_timer[idx].number;
+			if (0 <= ctrl->timers[tmr]) {
+				used = pri_snprintf(buf, used, buf_size, "  %s: %d\n",
+					pri_timer[idx].name, ctrl->timers[tmr]);
+			}
+		}
+	}
 	/* Remember that Q921 Counters include Q931 packets (and any retransmissions) */
 	used = pri_snprintf(buf, used, buf_size, "Q931 RX: %d\n", ctrl->q931_rxcount);
 	used = pri_snprintf(buf, used, buf_size, "Q931 TX: %d\n", ctrl->q931_txcount);
@@ -1743,22 +1759,6 @@
 		}
 		used = pri_snprintf(buf, used, buf_size, "Q921 Outstanding: %u (TEI=%d)\n",
 			q921outstanding, link->tei);
-	}
-	used = pri_snprintf(buf, used, buf_size, "Overlap Dial: %d\n", ctrl->overlapdial);
-	used = pri_snprintf(buf, used, buf_size, "Logical Channel Mapping: %d\n",
-		ctrl->chan_mapping_logical);
-	used = pri_snprintf(buf, used, buf_size, "Timer and counter settings:\n");
-	switch_bit = PRI_BIT(ctrl->switchtype);
-	for (idx = 0; idx < ARRAY_LEN(pri_timer); ++idx) {
-		if (pri_timer[idx].used_by & switch_bit) {
-			enum PRI_TIMERS_AND_COUNTERS tmr;
-
-			tmr = pri_timer[idx].number;
-			if (0 <= ctrl->timers[tmr]) {
-				used = pri_snprintf(buf, used, buf_size, "  %s: %d\n",
-					pri_timer[idx].name, ctrl->timers[tmr]);
-			}
-		}
 	}
 #define DEBUG_CALL_RECORDS
 #if defined(DEBUG_CALL_RECORDS)

Modified: team/rmudgett/t312/q931.c
URL: http://svnview.digium.com/svn/libpri/team/rmudgett/t312/q931.c?view=diff&rev=2218&r1=2217&r2=2218
==============================================================================
--- team/rmudgett/t312/q931.c (original)
+++ team/rmudgett/t312/q931.c Fri Feb 25 12:02:13 2011
@@ -6695,6 +6695,7 @@
 				pri_message(ctrl, DBGHEAD "Remaining slaves %d\n", DBGINFO, slaves);
 			}
 
+/* BUGBUG T312 active, winning subcall exists, master call state rank */
 			if (call->t303_timer) {
 				/* Abort master call. */
 				__q931_hangup(ctrl, call, cause);
@@ -7622,7 +7623,9 @@
 			if (subcall == winner) {
 				/* .. and we're it: */
 				*allow_event = 1;
-				UPDATE_OURCALLSTATE(ctrl, master, newstate);
+				if (master_rank != Q931_RANKED_CALL_STATE_ABORT) {
+					UPDATE_OURCALLSTATE(ctrl, master, newstate);
+				}
 			}
 		}
 		break;
@@ -8082,6 +8085,8 @@
 	struct q931_call *master;
 	int cause;
 
+/* BUGBUG more conditions are needed to correctly determine which cause to use. */
+/* BUGBUG T312 active, winning subcall exists, master call state rank */
 	cause = PRI_CAUSE_INVALID_CALL_REFERENCE;
 	master = call->master_call;
 	if (master != call && master->t312_timer) {
@@ -8105,6 +8110,10 @@
  * \param mh Q.931 message header.
  * \param c Q.931 call leg.
  * \param missingmand Number of missing mandatory ie's.
+ *
+ * \note
+ * When this function returns c may be destroyed so you can no
+ * longer dereference it.
  *
  * \retval 0 if no error or event.
  * \retval Q931_RES_HAVEEVENT if have an event.




More information about the libpri-commits mailing list