[svn-commits] rmudgett: branch group/ccss r1390 - in /team/group/ccss: ./ doc/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Dec 16 13:08:11 CST 2009


Author: rmudgett
Date: Wed Dec 16 13:08:09 2009
New Revision: 1390

URL: http://svnview.digium.com/svn/libpri?view=rev&rev=1390
Log:
Grouped several timers into a T_SUPERVISION collective name.

*  The following timers have been collected into a T_SUPERVISION
functional timer since they are mutually exclusive timers for the same
purpose:
PTMP - T_CCBS2/T_CCNR2,
PTP - T_CCBS5/T_CCNR5/T_CCBS6/T_CCNR6,
Q.SIG - QSIG_CCBS_T2/QSIG_CCNR_T2

*  Promoted the T_RETENTION timer to be used by all CC agents unless
another timer is defined by the standard for the purpose.  All CC agent
FSM's will use the T_RETENTION collective name timer to supervise the
resources allocated for the CC offer.

Modified:
    team/group/ccss/doc/cc_ptmp_agent.fsm
    team/group/ccss/doc/cc_ptmp_agent_flattened.fsm
    team/group/ccss/doc/cc_ptmp_monitor.fsm
    team/group/ccss/doc/cc_ptmp_monitor_flattened.fsm
    team/group/ccss/pri.c
    team/group/ccss/pri_cc.c
    team/group/ccss/pri_internal.h

Modified: team/group/ccss/doc/cc_ptmp_agent.fsm
URL: http://svnview.digium.com/svn/libpri/team/group/ccss/doc/cc_ptmp_agent.fsm?view=diff&rev=1390&r1=1389&r2=1390
==============================================================================
--- team/group/ccss/doc/cc_ptmp_agent.fsm (original)
+++ team/group/ccss/doc/cc_ptmp_agent.fsm Wed Dec 16 13:08:09 2009
@@ -310,12 +310,12 @@
 	Superstate CC_ACTIVE(CC_STATE_ACTIVATED, CC_STATE_B_AVAILABLE, CC_STATE_SUSPENDED, CC_STATE_WAIT_CALLBACK, CC_STATE_CALLBACK) {
 		Prolog {
 			/* Start T_CCBS2 or T_CCNR2 depending upon CC mode. */
-			Action Start_T_CCBS2;
-		}
-		Epilog {
-			Action Stop_T_CCBS2;
-		}
-		Stimulus CC_EVENT_TIMEOUT_T_CCBS2 {
+			Action Start_T_SUPERVISION;
+		}
+		Epilog {
+			Action Stop_T_SUPERVISION;
+		}
+		Stimulus CC_EVENT_TIMEOUT_T_SUPERVISION {
 			Action Pass_Up_CC_Cancel;
 			Action Send_CCBSErase(T_CCBS2_TIMEOUT);
 			Next_State CC_STATE_IDLE;

Modified: team/group/ccss/doc/cc_ptmp_agent_flattened.fsm
URL: http://svnview.digium.com/svn/libpri/team/group/ccss/doc/cc_ptmp_agent_flattened.fsm?view=diff&rev=1390&r1=1389&r2=1390
==============================================================================
--- team/group/ccss/doc/cc_ptmp_agent_flattened.fsm (original)
+++ team/group/ccss/doc/cc_ptmp_agent_flattened.fsm Wed Dec 16 13:08:09 2009
@@ -60,7 +60,7 @@
 			Action Send_EraseCallLinkageID;
 			Action Relese_LinkID;
 			/* Start T_CCBS2 or T_CCNR2 depending upon CC mode. */
-			Action Start_T_CCBS2;
+			Action Start_T_SUPERVISION;
 			Action Reset_A_Status;
 			Next_State CC_STATE_ACTIVATED;
 		}
@@ -159,7 +159,7 @@
 				Action Pass_Up_CC_Cancel;
 				Action Stop_T_CCBS1;
 				Action Stop_Extended_T_CCBS1;
-				Action Stop_T_CCBS2;
+				Action Stop_T_SUPERVISION;
 				Action Set_Selfdestruct;
 				Next_State CC_STATE_IDLE;
 			}
@@ -167,12 +167,12 @@
 		Stimulus CC_EVENT_TIMEOUT_EXTENDED_T_CCBS1 {
 			Action Reset_A_Status;
 		}
-		Stimulus CC_EVENT_TIMEOUT_T_CCBS2 {
+		Stimulus CC_EVENT_TIMEOUT_T_SUPERVISION {
 			Action Pass_Up_CC_Cancel;
 			Action Send_CCBSErase(T_CCBS2_TIMEOUT);
 			Action Stop_T_CCBS1;
 			Action Stop_Extended_T_CCBS1;
-			Action Stop_T_CCBS2;
+			Action Stop_T_SUPERVISION;
 			Action Set_Selfdestruct;
 			Next_State CC_STATE_IDLE;
 		}
@@ -181,15 +181,15 @@
 			Action Send_CCBSErase(Normal_Unspecified);
 			Action Stop_T_CCBS1;
 			Action Stop_Extended_T_CCBS1;
-			Action Stop_T_CCBS2;
-			Action Set_Selfdestruct;
-			Next_State CC_STATE_IDLE;
-		}
-		Stimulus CC_EVENT_CANCEL {
-			Action Send_CCBSErase(Normal_Unspecified);
-			Action Stop_T_CCBS1;
-			Action Stop_Extended_T_CCBS1;
-			Action Stop_T_CCBS2;
+			Action Stop_T_SUPERVISION;
+			Action Set_Selfdestruct;
+			Next_State CC_STATE_IDLE;
+		}
+		Stimulus CC_EVENT_CANCEL {
+			Action Send_CCBSErase(Normal_Unspecified);
+			Action Stop_T_CCBS1;
+			Action Stop_Extended_T_CCBS1;
+			Action Stop_T_SUPERVISION;
 			Action Set_Selfdestruct;
 			Next_State CC_STATE_IDLE;
 		}
@@ -237,7 +237,7 @@
 				Action Pass_Up_CC_Cancel;
 				Action Stop_T_CCBS1;
 				Action Stop_Extended_T_CCBS1;
-				Action Stop_T_CCBS2;
+				Action Stop_T_SUPERVISION;
 				Action Set_Selfdestruct;
 				Next_State CC_STATE_IDLE;
 			}
@@ -255,12 +255,12 @@
 			}
 			Next_State CC_STATE_SUSPENDED;
 		}
-		Stimulus CC_EVENT_TIMEOUT_T_CCBS2 {
+		Stimulus CC_EVENT_TIMEOUT_T_SUPERVISION {
 			Action Pass_Up_CC_Cancel;
 			Action Send_CCBSErase(T_CCBS2_TIMEOUT);
 			Action Stop_T_CCBS1;
 			Action Stop_Extended_T_CCBS1;
-			Action Stop_T_CCBS2;
+			Action Stop_T_SUPERVISION;
 			Action Set_Selfdestruct;
 			Next_State CC_STATE_IDLE;
 		}
@@ -269,15 +269,15 @@
 			Action Send_CCBSErase(Normal_Unspecified);
 			Action Stop_T_CCBS1;
 			Action Stop_Extended_T_CCBS1;
-			Action Stop_T_CCBS2;
-			Action Set_Selfdestruct;
-			Next_State CC_STATE_IDLE;
-		}
-		Stimulus CC_EVENT_CANCEL {
-			Action Send_CCBSErase(Normal_Unspecified);
-			Action Stop_T_CCBS1;
-			Action Stop_Extended_T_CCBS1;
-			Action Stop_T_CCBS2;
+			Action Stop_T_SUPERVISION;
+			Action Set_Selfdestruct;
+			Next_State CC_STATE_IDLE;
+		}
+		Stimulus CC_EVENT_CANCEL {
+			Action Send_CCBSErase(Normal_Unspecified);
+			Action Stop_T_CCBS1;
+			Action Stop_Extended_T_CCBS1;
+			Action Stop_T_SUPERVISION;
 			Action Set_Selfdestruct;
 			Next_State CC_STATE_IDLE;
 		}
@@ -323,7 +323,7 @@
 				Action Pass_Up_CC_Cancel;
 				Action Stop_T_CCBS1;
 				Action Stop_Extended_T_CCBS1;
-				Action Stop_T_CCBS2;
+				Action Stop_T_SUPERVISION;
 				Action Set_Selfdestruct;
 				Next_State CC_STATE_IDLE;
 			}
@@ -332,12 +332,12 @@
 			Action Send_CCBSStatusRequest;
 			Action Start_T_CCBS1;
 		}
-		Stimulus CC_EVENT_TIMEOUT_T_CCBS2 {
+		Stimulus CC_EVENT_TIMEOUT_T_SUPERVISION {
 			Action Pass_Up_CC_Cancel;
 			Action Send_CCBSErase(T_CCBS2_TIMEOUT);
 			Action Stop_T_CCBS1;
 			Action Stop_Extended_T_CCBS1;
-			Action Stop_T_CCBS2;
+			Action Stop_T_SUPERVISION;
 			Action Set_Selfdestruct;
 			Next_State CC_STATE_IDLE;
 		}
@@ -346,15 +346,15 @@
 			Action Send_CCBSErase(Normal_Unspecified);
 			Action Stop_T_CCBS1;
 			Action Stop_Extended_T_CCBS1;
-			Action Stop_T_CCBS2;
-			Action Set_Selfdestruct;
-			Next_State CC_STATE_IDLE;
-		}
-		Stimulus CC_EVENT_CANCEL {
-			Action Send_CCBSErase(Normal_Unspecified);
-			Action Stop_T_CCBS1;
-			Action Stop_Extended_T_CCBS1;
-			Action Stop_T_CCBS2;
+			Action Stop_T_SUPERVISION;
+			Action Set_Selfdestruct;
+			Next_State CC_STATE_IDLE;
+		}
+		Stimulus CC_EVENT_CANCEL {
+			Action Send_CCBSErase(Normal_Unspecified);
+			Action Stop_T_CCBS1;
+			Action Stop_Extended_T_CCBS1;
+			Action Stop_T_SUPERVISION;
 			Action Set_Selfdestruct;
 			Next_State CC_STATE_IDLE;
 		}
@@ -364,7 +364,7 @@
 			Action Pass_Up_CC_Cancel;
 			Action Send_CCBSErase(T_CCBS3_TIMEOUT);
 			Action Stop_T_CCBS3;
-			Action Stop_T_CCBS2;
+			Action Stop_T_SUPERVISION;
 			Action Set_Selfdestruct;
 			Next_State CC_STATE_IDLE;
 		}
@@ -396,11 +396,11 @@
 			Action Set_Raw_A_Status_Free;
 			Action Pass_Up_Status_Rsp_A_Indirect;
 		}
-		Stimulus CC_EVENT_TIMEOUT_T_CCBS2 {
+		Stimulus CC_EVENT_TIMEOUT_T_SUPERVISION {
 			Action Pass_Up_CC_Cancel;
 			Action Send_CCBSErase(T_CCBS2_TIMEOUT);
 			Action Stop_T_CCBS3;
-			Action Stop_T_CCBS2;
+			Action Stop_T_SUPERVISION;
 			Action Set_Selfdestruct;
 			Next_State CC_STATE_IDLE;
 		}
@@ -408,14 +408,14 @@
 			Action Pass_Up_CC_Cancel;
 			Action Send_CCBSErase(Normal_Unspecified);
 			Action Stop_T_CCBS3;
-			Action Stop_T_CCBS2;
-			Action Set_Selfdestruct;
-			Next_State CC_STATE_IDLE;
-		}
-		Stimulus CC_EVENT_CANCEL {
-			Action Send_CCBSErase(Normal_Unspecified);
-			Action Stop_T_CCBS3;
-			Action Stop_T_CCBS2;
+			Action Stop_T_SUPERVISION;
+			Action Set_Selfdestruct;
+			Next_State CC_STATE_IDLE;
+		}
+		Stimulus CC_EVENT_CANCEL {
+			Action Send_CCBSErase(Normal_Unspecified);
+			Action Stop_T_CCBS3;
+			Action Stop_T_SUPERVISION;
 			Action Set_Selfdestruct;
 			Next_State CC_STATE_IDLE;
 		}
@@ -429,23 +429,23 @@
 			Action Set_Raw_A_Status_Free;
 			Action Pass_Up_Status_Rsp_A_Indirect;
 		}
-		Stimulus CC_EVENT_TIMEOUT_T_CCBS2 {
+		Stimulus CC_EVENT_TIMEOUT_T_SUPERVISION {
 			Action Pass_Up_CC_Cancel;
 			Action Send_CCBSErase(T_CCBS2_TIMEOUT);
-			Action Stop_T_CCBS2;
+			Action Stop_T_SUPERVISION;
 			Action Set_Selfdestruct;
 			Next_State CC_STATE_IDLE;
 		}
 		Stimulus CC_EVENT_LINK_CANCEL {
 			Action Pass_Up_CC_Cancel;
 			Action Send_CCBSErase(Normal_Unspecified);
-			Action Stop_T_CCBS2;
-			Action Set_Selfdestruct;
-			Next_State CC_STATE_IDLE;
-		}
-		Stimulus CC_EVENT_CANCEL {
-			Action Send_CCBSErase(Normal_Unspecified);
-			Action Stop_T_CCBS2;
+			Action Stop_T_SUPERVISION;
+			Action Set_Selfdestruct;
+			Next_State CC_STATE_IDLE;
+		}
+		Stimulus CC_EVENT_CANCEL {
+			Action Send_CCBSErase(Normal_Unspecified);
+			Action Stop_T_SUPERVISION;
 			Action Set_Selfdestruct;
 			Next_State CC_STATE_IDLE;
 		}

Modified: team/group/ccss/doc/cc_ptmp_monitor.fsm
URL: http://svnview.digium.com/svn/libpri/team/group/ccss/doc/cc_ptmp_monitor.fsm?view=diff&rev=1390&r1=1389&r2=1390
==============================================================================
--- team/group/ccss/doc/cc_ptmp_monitor.fsm (original)
+++ team/group/ccss/doc/cc_ptmp_monitor.fsm Wed Dec 16 13:08:09 2009
@@ -129,10 +129,10 @@
 			 * so normally the CC records will be cleaned up by network
 			 * activity.
 			 */
-			Action Start_T_CCBS2;
+			Action Start_T_SUPERVISION;
 		}
 		Epilog {
-			Action Stop_T_CCBS2;
+			Action Stop_T_SUPERVISION;
 		}
 		Stimulus CC_EVENT_B_FREE {
 			/* Received CCBSBFree */
@@ -149,7 +149,7 @@
 			/* The original call parameters have already been set. */
 			Action Queue_SETUP_Recall;
 		}
-		Stimulus CC_EVENT_TIMEOUT_T_CCBS2 {
+		Stimulus CC_EVENT_TIMEOUT_T_SUPERVISION {
 			Action Send_CC_Deactivate_Req;
 			Action Pass_Up_CC_Cancel;
 			Next_State CC_STATE_IDLE;

Modified: team/group/ccss/doc/cc_ptmp_monitor_flattened.fsm
URL: http://svnview.digium.com/svn/libpri/team/group/ccss/doc/cc_ptmp_monitor_flattened.fsm?view=diff&rev=1390&r1=1389&r2=1390
==============================================================================
--- team/group/ccss/doc/cc_ptmp_monitor_flattened.fsm (original)
+++ team/group/ccss/doc/cc_ptmp_monitor_flattened.fsm Wed Dec 16 13:08:09 2009
@@ -71,7 +71,7 @@
 			 * so normally the CC records will be cleaned up by network
 			 * activity.
 			 */
-			Action Start_T_CCBS2;
+			Action Start_T_SUPERVISION;
 			Next_State CC_STATE_ACTIVATED;
 		}
 		Stimulus CC_EVENT_CC_REQUEST_FAIL {
@@ -155,23 +155,23 @@
 			/* The original call parameters have already been set. */
 			Action Queue_SETUP_Recall;
 		}
-		Stimulus CC_EVENT_TIMEOUT_T_CCBS2 {
+		Stimulus CC_EVENT_TIMEOUT_T_SUPERVISION {
 			Action Send_CC_Deactivate_Req;
 			Action Pass_Up_CC_Cancel;
-			Action Stop_T_CCBS2;
+			Action Stop_T_SUPERVISION;
 			Action Set_Selfdestruct;
 			Next_State CC_STATE_IDLE;
 		}
 		Stimulus CC_EVENT_LINK_CANCEL {
 			/* Received CCBSErase */
 			Action Pass_Up_CC_Cancel;
-			Action Stop_T_CCBS2;
+			Action Stop_T_SUPERVISION;
 			Action Set_Selfdestruct;
 			Next_State CC_STATE_IDLE;
 		}
 		Stimulus CC_EVENT_CANCEL {
 			Action Send_CC_Deactivate_Req;
-			Action Stop_T_CCBS2;
+			Action Stop_T_SUPERVISION;
 			Action Set_Selfdestruct;
 			Next_State CC_STATE_IDLE;
 		}

Modified: team/group/ccss/pri.c
URL: http://svnview.digium.com/svn/libpri/team/group/ccss/pri.c?view=diff&rev=1390&r1=1389&r2=1390
==============================================================================
--- team/group/ccss/pri.c (original)
+++ team/group/ccss/pri.c Wed Dec 16 13:08:09 2009
@@ -92,7 +92,7 @@
 	{ "T-ACTIVATE",     PRI_TIMER_T_ACTIVATE,       PRI_ETSI_SWITCHES },
 	{ "T-DEACTIVATE",   PRI_TIMER_T_DEACTIVATE,     PRI_ETSI_SWITCHES },
 	{ "T-INTERROGATE",  PRI_TIMER_T_INTERROGATE,    PRI_ETSI_SWITCHES },
-	{ "T-RETENTION",    PRI_TIMER_T_RETENTION,      PRI_ETSI_SWITCHES },
+	{ "T-RETENTION",    PRI_TIMER_T_RETENTION,      PRI_ETSI_SWITCHES | PRI_BIT(PRI_SWITCH_QSIG) },
 	{ "T-CCBS1",        PRI_TIMER_T_CCBS1,          PRI_ETSI_SWITCHES },
 	{ "T-CCBS2",        PRI_TIMER_T_CCBS2,          PRI_ETSI_SWITCHES },
 	{ "T-CCBS3",        PRI_TIMER_T_CCBS3,          PRI_ETSI_SWITCHES },

Modified: team/group/ccss/pri_cc.c
URL: http://svnview.digium.com/svn/libpri/team/group/ccss/pri_cc.c?view=diff&rev=1390&r1=1389&r2=1390
==============================================================================
--- team/group/ccss/pri_cc.c (original)
+++ team/group/ccss/pri_cc.c Wed Dec 16 13:08:09 2009
@@ -1621,8 +1621,8 @@
 	case CC_EVENT_TIMEOUT_EXTENDED_T_CCBS1:
 		str = "CC_EVENT_TIMEOUT_EXTENDED_T_CCBS1";
 		break;
-	case CC_EVENT_TIMEOUT_T_CCBS2:
-		str = "CC_EVENT_TIMEOUT_T_CCBS2";
+	case CC_EVENT_TIMEOUT_T_SUPERVISION:
+		str = "CC_EVENT_TIMEOUT_T_SUPERVISION";
 		break;
 	case CC_EVENT_TIMEOUT_T_CCBS3:
 		str = "CC_EVENT_TIMEOUT_T_CCBS3";
@@ -1681,8 +1681,8 @@
 static void pri_cc_act_stop_t_retention(struct pri *ctrl, struct pri_cc_record *cc_record)
 {
 	PRI_CC_ACT_DEBUG_OUTPUT(ctrl);
-	pri_schedule_del(ctrl, cc_record->fsm.ptmp.t_retention);
-	cc_record->fsm.ptmp.t_retention = 0;
+	pri_schedule_del(ctrl, cc_record->t_retention);
+	cc_record->t_retention = 0;
 }
 
 /*!
@@ -1697,7 +1697,7 @@
 {
 	struct pri_cc_record *cc_record = data;
 
-	cc_record->fsm.ptmp.t_retention = 0;
+	cc_record->t_retention = 0;
 	q931_cc_timeout(cc_record->signaling->pri, cc_record->signaling, cc_record,
 		CC_EVENT_TIMEOUT_T_RETENTION);
 }
@@ -1714,11 +1714,11 @@
 static void pri_cc_act_start_t_retention(struct pri *ctrl, struct pri_cc_record *cc_record)
 {
 	PRI_CC_ACT_DEBUG_OUTPUT(ctrl);
-	if (cc_record->fsm.ptmp.t_retention) {
+	if (cc_record->t_retention) {
 		pri_error(ctrl, "!! T_RETENTION is already running!");
-		pri_schedule_del(ctrl, cc_record->fsm.ptmp.t_retention);
-	}
-	cc_record->fsm.ptmp.t_retention = pri_schedule_event(ctrl,
+		pri_schedule_del(ctrl, cc_record->t_retention);
+	}
+	cc_record->t_retention = pri_schedule_event(ctrl,
 		ctrl->timers[PRI_TIMER_T_RETENTION], pri_cc_timeout_t_retention, cc_record);
 }
 
@@ -1779,56 +1779,83 @@
 
 /*!
  * \internal
- * \brief FSM action to stop the PTMP T_CCBS2 timer.
- *
- * \param ctrl D channel controller.
- * \param cc_record Call completion record to process event.
- *
- * \return Nothing
- */
-static void pri_cc_act_stop_t_ccbs2(struct pri *ctrl, struct pri_cc_record *cc_record)
+ * \brief FSM action to stop the T_SUPERVISION timer.
+ *
+ * \param ctrl D channel controller.
+ * \param cc_record Call completion record to process event.
+ *
+ * \return Nothing
+ */
+static void pri_cc_act_stop_t_supervision(struct pri *ctrl, struct pri_cc_record *cc_record)
 {
 	PRI_CC_ACT_DEBUG_OUTPUT(ctrl);
-	pri_schedule_del(ctrl, cc_record->fsm.ptmp.t_ccbs2);
-	cc_record->fsm.ptmp.t_ccbs2 = 0;
-}
-
-/*!
- * \internal
- * \brief T_CCBS2 timeout callback.
+	pri_schedule_del(ctrl, cc_record->t_supervision);
+	cc_record->t_supervision = 0;
+}
+
+/*!
+ * \internal
+ * \brief T_SUPERVISION timeout callback.
  *
  * \param data CC record pointer.
  *
  * \return Nothing
  */
-static void pri_cc_timeout_t_ccbs2(void *data)
+static void pri_cc_timeout_t_supervision(void *data)
 {
 	struct pri_cc_record *cc_record = data;
 
-	cc_record->fsm.ptmp.t_ccbs2 = 0;
+	cc_record->t_supervision = 0;
 	q931_cc_timeout(cc_record->signaling->pri, cc_record->signaling, cc_record,
-		CC_EVENT_TIMEOUT_T_CCBS2);
-}
-
-/*!
- * \internal
- * \brief FSM action to start the PTMP T_CCBS2 timer.
- *
- * \param ctrl D channel controller.
- * \param cc_record Call completion record to process event.
- *
- * \return Nothing
- */
-static void pri_cc_act_start_t_ccbs2(struct pri *ctrl, struct pri_cc_record *cc_record)
-{
+		CC_EVENT_TIMEOUT_T_SUPERVISION);
+}
+
+/*!
+ * \internal
+ * \brief FSM action to start the T_SUPERVISION timer.
+ *
+ * \param ctrl D channel controller.
+ * \param cc_record Call completion record to process event.
+ *
+ * \return Nothing
+ */
+static void pri_cc_act_start_t_supervision(struct pri *ctrl, struct pri_cc_record *cc_record)
+{
+	int timer_id;
+	int duration;
+
 	PRI_CC_ACT_DEBUG_OUTPUT(ctrl);
-	if (cc_record->fsm.ptmp.t_ccbs2) {
-		pri_error(ctrl, "!! T_CCBS2/T_CCNR2 is already running!");
-		pri_schedule_del(ctrl, cc_record->fsm.ptmp.t_ccbs2);
-	}
-	cc_record->fsm.ptmp.t_ccbs2 = pri_schedule_event(ctrl,
-		ctrl->timers[cc_record->is_ccnr ? PRI_TIMER_T_CCNR2 : PRI_TIMER_T_CCBS2],
-		pri_cc_timeout_t_ccbs2, cc_record);
+	if (cc_record->t_supervision) {
+		pri_error(ctrl, "!! A CC supervision timer is already running!");
+		pri_schedule_del(ctrl, cc_record->t_supervision);
+	}
+	switch (ctrl->switchtype) {
+	case PRI_SWITCH_EUROISDN_E1:
+	case PRI_SWITCH_EUROISDN_T1:
+		if (q931_is_ptmp(ctrl)) {
+			/* ETSI PTMP mode. */
+			timer_id = cc_record->is_ccnr ? PRI_TIMER_T_CCNR2 : PRI_TIMER_T_CCBS2;
+		} else if (cc_record->party_b_is_remote) {
+			/* ETSI PTP mode network A side. */
+			timer_id = cc_record->is_ccnr ? PRI_TIMER_T_CCNR6 : PRI_TIMER_T_CCBS6;
+		} else {
+			/* ETSI PTP mode network B side. */
+			timer_id = cc_record->is_ccnr ? PRI_TIMER_T_CCNR5 : PRI_TIMER_T_CCBS5;
+		}
+		duration = ctrl->timers[timer_id];
+		break;
+	case PRI_SWITCH_QSIG:
+		timer_id = cc_record->is_ccnr ? PRI_TIMER_QSIG_CCNR_T2 : PRI_TIMER_QSIG_CCBS_T2;
+		duration = ctrl->timers[timer_id];
+		break;
+	default:
+		/* Timer not defined for this switch type.  Should never happen. */
+		pri_error(ctrl, "!! A CC supervision timer is not defined!");
+		duration = 0;
+		break;
+	}
+	cc_record->t_supervision = pri_schedule_event(ctrl, duration,
+		pri_cc_timeout_t_supervision, cc_record);
 }
 
 /*!
@@ -2913,7 +2940,7 @@
 	case CC_EVENT_CC_REQUEST_ACCEPT:
 		pri_cc_act_send_erase_call_linkage_id(ctrl, cc_record);
 		pri_cc_act_release_link_id(ctrl, cc_record);
-		pri_cc_act_start_t_ccbs2(ctrl, cc_record);
+		pri_cc_act_start_t_supervision(ctrl, cc_record);
 		pri_cc_act_reset_a_status(ctrl, cc_record);
 		cc_record->state = CC_STATE_ACTIVATED;
 		break;
@@ -3014,7 +3041,7 @@
 			pri_cc_act_pass_up_cc_cancel(ctrl, cc_record);
 			pri_cc_act_stop_t_ccbs1(ctrl, cc_record);
 			pri_cc_act_stop_extended_t_ccbs1(ctrl, cc_record);
-			pri_cc_act_stop_t_ccbs2(ctrl, cc_record);
+			pri_cc_act_stop_t_supervision(ctrl, cc_record);
 			pri_cc_act_set_self_destruct(ctrl, cc_record);
 			cc_record->state = CC_STATE_IDLE;
 		}
@@ -3022,12 +3049,12 @@
 	case CC_EVENT_TIMEOUT_EXTENDED_T_CCBS1:
 		pri_cc_act_reset_a_status(ctrl, cc_record);
 		break;
-	case CC_EVENT_TIMEOUT_T_CCBS2:
+	case CC_EVENT_TIMEOUT_T_SUPERVISION:
 		pri_cc_act_pass_up_cc_cancel(ctrl, cc_record);
 		pri_cc_act_send_ccbs_erase(ctrl, cc_record, 1 /* t-CCBS2-timeout */);
 		pri_cc_act_stop_t_ccbs1(ctrl, cc_record);
 		pri_cc_act_stop_extended_t_ccbs1(ctrl, cc_record);
-		pri_cc_act_stop_t_ccbs2(ctrl, cc_record);
+		pri_cc_act_stop_t_supervision(ctrl, cc_record);
 		pri_cc_act_set_self_destruct(ctrl, cc_record);
 		cc_record->state = CC_STATE_IDLE;
 		break;
@@ -3036,7 +3063,7 @@
 		pri_cc_act_send_ccbs_erase(ctrl, cc_record, 0 /* normal-unspecified */);
 		pri_cc_act_stop_t_ccbs1(ctrl, cc_record);
 		pri_cc_act_stop_extended_t_ccbs1(ctrl, cc_record);
-		pri_cc_act_stop_t_ccbs2(ctrl, cc_record);
+		pri_cc_act_stop_t_supervision(ctrl, cc_record);
 		pri_cc_act_set_self_destruct(ctrl, cc_record);
 		cc_record->state = CC_STATE_IDLE;
 		break;
@@ -3044,7 +3071,7 @@
 		pri_cc_act_send_ccbs_erase(ctrl, cc_record, 0 /* normal-unspecified */);
 		pri_cc_act_stop_t_ccbs1(ctrl, cc_record);
 		pri_cc_act_stop_extended_t_ccbs1(ctrl, cc_record);
-		pri_cc_act_stop_t_ccbs2(ctrl, cc_record);
+		pri_cc_act_stop_t_supervision(ctrl, cc_record);
 		pri_cc_act_set_self_destruct(ctrl, cc_record);
 		cc_record->state = CC_STATE_IDLE;
 		break;
@@ -3105,7 +3132,7 @@
 			pri_cc_act_pass_up_cc_cancel(ctrl, cc_record);
 			pri_cc_act_stop_t_ccbs1(ctrl, cc_record);
 			pri_cc_act_stop_extended_t_ccbs1(ctrl, cc_record);
-			pri_cc_act_stop_t_ccbs2(ctrl, cc_record);
+			pri_cc_act_stop_t_supervision(ctrl, cc_record);
 			pri_cc_act_set_self_destruct(ctrl, cc_record);
 			cc_record->state = CC_STATE_IDLE;
 			break;
@@ -3123,12 +3150,12 @@
 		}
 		cc_record->state = CC_STATE_SUSPENDED;
 		break;
-	case CC_EVENT_TIMEOUT_T_CCBS2:
+	case CC_EVENT_TIMEOUT_T_SUPERVISION:
 		pri_cc_act_pass_up_cc_cancel(ctrl, cc_record);
 		pri_cc_act_send_ccbs_erase(ctrl, cc_record, 1 /* t-CCBS2-timeout */);
 		pri_cc_act_stop_t_ccbs1(ctrl, cc_record);
 		pri_cc_act_stop_extended_t_ccbs1(ctrl, cc_record);
-		pri_cc_act_stop_t_ccbs2(ctrl, cc_record);
+		pri_cc_act_stop_t_supervision(ctrl, cc_record);
 		pri_cc_act_set_self_destruct(ctrl, cc_record);
 		cc_record->state = CC_STATE_IDLE;
 		break;
@@ -3137,7 +3164,7 @@
 		pri_cc_act_send_ccbs_erase(ctrl, cc_record, 0 /* normal-unspecified */);
 		pri_cc_act_stop_t_ccbs1(ctrl, cc_record);
 		pri_cc_act_stop_extended_t_ccbs1(ctrl, cc_record);
-		pri_cc_act_stop_t_ccbs2(ctrl, cc_record);
+		pri_cc_act_stop_t_supervision(ctrl, cc_record);
 		pri_cc_act_set_self_destruct(ctrl, cc_record);
 		cc_record->state = CC_STATE_IDLE;
 		break;
@@ -3145,7 +3172,7 @@
 		pri_cc_act_send_ccbs_erase(ctrl, cc_record, 0 /* normal-unspecified */);
 		pri_cc_act_stop_t_ccbs1(ctrl, cc_record);
 		pri_cc_act_stop_extended_t_ccbs1(ctrl, cc_record);
-		pri_cc_act_stop_t_ccbs2(ctrl, cc_record);
+		pri_cc_act_stop_t_supervision(ctrl, cc_record);
 		pri_cc_act_set_self_destruct(ctrl, cc_record);
 		cc_record->state = CC_STATE_IDLE;
 		break;
@@ -3205,7 +3232,7 @@
 			pri_cc_act_pass_up_cc_cancel(ctrl, cc_record);
 			pri_cc_act_stop_t_ccbs1(ctrl, cc_record);
 			pri_cc_act_stop_extended_t_ccbs1(ctrl, cc_record);
-			pri_cc_act_stop_t_ccbs2(ctrl, cc_record);
+			pri_cc_act_stop_t_supervision(ctrl, cc_record);
 			pri_cc_act_set_self_destruct(ctrl, cc_record);
 			cc_record->state = CC_STATE_IDLE;
 			break;
@@ -3215,12 +3242,12 @@
 		pri_cc_act_send_ccbs_status_request(ctrl, cc_record);
 		//pri_cc_act_start_t_ccbs1(ctrl, cc_record);
 		break;
-	case CC_EVENT_TIMEOUT_T_CCBS2:
+	case CC_EVENT_TIMEOUT_T_SUPERVISION:
 		pri_cc_act_pass_up_cc_cancel(ctrl, cc_record);
 		pri_cc_act_send_ccbs_erase(ctrl, cc_record, 1 /* t-CCBS2-timeout */);
 		pri_cc_act_stop_t_ccbs1(ctrl, cc_record);
 		pri_cc_act_stop_extended_t_ccbs1(ctrl, cc_record);
-		pri_cc_act_stop_t_ccbs2(ctrl, cc_record);
+		pri_cc_act_stop_t_supervision(ctrl, cc_record);
 		pri_cc_act_set_self_destruct(ctrl, cc_record);
 		cc_record->state = CC_STATE_IDLE;
 		break;
@@ -3229,7 +3256,7 @@
 		pri_cc_act_send_ccbs_erase(ctrl, cc_record, 0 /* normal-unspecified */);
 		pri_cc_act_stop_t_ccbs1(ctrl, cc_record);
 		pri_cc_act_stop_extended_t_ccbs1(ctrl, cc_record);
-		pri_cc_act_stop_t_ccbs2(ctrl, cc_record);
+		pri_cc_act_stop_t_supervision(ctrl, cc_record);
 		pri_cc_act_set_self_destruct(ctrl, cc_record);
 		cc_record->state = CC_STATE_IDLE;
 		break;
@@ -3237,7 +3264,7 @@
 		pri_cc_act_send_ccbs_erase(ctrl, cc_record, 0 /* normal-unspecified */);
 		pri_cc_act_stop_t_ccbs1(ctrl, cc_record);
 		pri_cc_act_stop_extended_t_ccbs1(ctrl, cc_record);
-		pri_cc_act_stop_t_ccbs2(ctrl, cc_record);
+		pri_cc_act_stop_t_supervision(ctrl, cc_record);
 		pri_cc_act_set_self_destruct(ctrl, cc_record);
 		cc_record->state = CC_STATE_IDLE;
 		break;
@@ -3264,7 +3291,7 @@
 		pri_cc_act_pass_up_cc_cancel(ctrl, cc_record);
 		pri_cc_act_send_ccbs_erase(ctrl, cc_record, 2 /* t-CCBS3-timeout */);
 		pri_cc_act_stop_t_ccbs3(ctrl, cc_record);
-		pri_cc_act_stop_t_ccbs2(ctrl, cc_record);
+		pri_cc_act_stop_t_supervision(ctrl, cc_record);
 		pri_cc_act_set_self_destruct(ctrl, cc_record);
 		cc_record->state = CC_STATE_IDLE;
 		break;
@@ -3294,11 +3321,11 @@
 		pri_cc_act_set_raw_a_status_free(ctrl, cc_record);
 		pri_cc_act_pass_up_status_rsp_a_indirect(ctrl, cc_record);
 		break;
-	case CC_EVENT_TIMEOUT_T_CCBS2:
+	case CC_EVENT_TIMEOUT_T_SUPERVISION:
 		pri_cc_act_pass_up_cc_cancel(ctrl, cc_record);
 		pri_cc_act_send_ccbs_erase(ctrl, cc_record, 1 /* t-CCBS2-timeout */);
 		pri_cc_act_stop_t_ccbs3(ctrl, cc_record);
-		pri_cc_act_stop_t_ccbs2(ctrl, cc_record);
+		pri_cc_act_stop_t_supervision(ctrl, cc_record);
 		pri_cc_act_set_self_destruct(ctrl, cc_record);
 		cc_record->state = CC_STATE_IDLE;
 		break;
@@ -3306,14 +3333,14 @@
 		pri_cc_act_pass_up_cc_cancel(ctrl, cc_record);
 		pri_cc_act_send_ccbs_erase(ctrl, cc_record, 0 /* normal-unspecified */);
 		pri_cc_act_stop_t_ccbs3(ctrl, cc_record);
-		pri_cc_act_stop_t_ccbs2(ctrl, cc_record);
+		pri_cc_act_stop_t_supervision(ctrl, cc_record);
 		pri_cc_act_set_self_destruct(ctrl, cc_record);
 		cc_record->state = CC_STATE_IDLE;
 		break;
 	case CC_EVENT_CANCEL:
 		pri_cc_act_send_ccbs_erase(ctrl, cc_record, 0 /* normal-unspecified */);
 		pri_cc_act_stop_t_ccbs3(ctrl, cc_record);
-		pri_cc_act_stop_t_ccbs2(ctrl, cc_record);
+		pri_cc_act_stop_t_supervision(ctrl, cc_record);
 		pri_cc_act_set_self_destruct(ctrl, cc_record);
 		cc_record->state = CC_STATE_IDLE;
 		break;
@@ -3344,23 +3371,23 @@
 		pri_cc_act_set_raw_a_status_free(ctrl, cc_record);
 		pri_cc_act_pass_up_status_rsp_a_indirect(ctrl, cc_record);
 		break;
-	case CC_EVENT_TIMEOUT_T_CCBS2:
+	case CC_EVENT_TIMEOUT_T_SUPERVISION:
 		pri_cc_act_pass_up_cc_cancel(ctrl, cc_record);
 		pri_cc_act_send_ccbs_erase(ctrl, cc_record, 1 /* t-CCBS2-timeout */);
-		pri_cc_act_stop_t_ccbs2(ctrl, cc_record);
+		pri_cc_act_stop_t_supervision(ctrl, cc_record);
 		pri_cc_act_set_self_destruct(ctrl, cc_record);
 		cc_record->state = CC_STATE_IDLE;
 		break;
 	case CC_EVENT_LINK_CANCEL:
 		pri_cc_act_pass_up_cc_cancel(ctrl, cc_record);
 		pri_cc_act_send_ccbs_erase(ctrl, cc_record, 0 /* normal-unspecified */);
-		pri_cc_act_stop_t_ccbs2(ctrl, cc_record);
+		pri_cc_act_stop_t_supervision(ctrl, cc_record);
 		pri_cc_act_set_self_destruct(ctrl, cc_record);
 		cc_record->state = CC_STATE_IDLE;
 		break;
 	case CC_EVENT_CANCEL:
 		pri_cc_act_send_ccbs_erase(ctrl, cc_record, 0 /* normal-unspecified */);
-		pri_cc_act_stop_t_ccbs2(ctrl, cc_record);
+		pri_cc_act_stop_t_supervision(ctrl, cc_record);
 		pri_cc_act_set_self_destruct(ctrl, cc_record);
 		cc_record->state = CC_STATE_IDLE;
 		break;
@@ -3479,7 +3506,7 @@
 		 * so normally the CC records will be cleaned up by network
 		 * activity.
 		 */
-		pri_cc_act_start_t_ccbs2(ctrl, cc_record);
+		pri_cc_act_start_t_supervision(ctrl, cc_record);
 		cc_record->state = CC_STATE_ACTIVATED;
 		break;
 	case CC_EVENT_CC_REQUEST_FAIL:
@@ -3597,23 +3624,23 @@
 		/* The original call parameters have already been set. */
 		pri_cc_act_queue_setup_recall(ctrl, call, cc_record);
 		break;
-	case CC_EVENT_TIMEOUT_T_CCBS2:
+	case CC_EVENT_TIMEOUT_T_SUPERVISION:
 		pri_cc_act_send_cc_deactivate_req(ctrl, cc_record);
 		pri_cc_act_pass_up_cc_cancel(ctrl, cc_record);
-		pri_cc_act_stop_t_ccbs2(ctrl, cc_record);
+		pri_cc_act_stop_t_supervision(ctrl, cc_record);
 		pri_cc_act_set_self_destruct(ctrl, cc_record);
 		cc_record->state = CC_STATE_IDLE;
 		break;
 	case CC_EVENT_LINK_CANCEL:
 		/* Received CCBSErase */
 		pri_cc_act_pass_up_cc_cancel(ctrl, cc_record);
-		pri_cc_act_stop_t_ccbs2(ctrl, cc_record);
+		pri_cc_act_stop_t_supervision(ctrl, cc_record);
 		pri_cc_act_set_self_destruct(ctrl, cc_record);
 		cc_record->state = CC_STATE_IDLE;
 		break;
 	case CC_EVENT_CANCEL:
 		pri_cc_act_send_cc_deactivate_req(ctrl, cc_record);
-		pri_cc_act_stop_t_ccbs2(ctrl, cc_record);
+		pri_cc_act_stop_t_supervision(ctrl, cc_record);
 		pri_cc_act_set_self_destruct(ctrl, cc_record);
 		cc_record->state = CC_STATE_IDLE;
 		break;

Modified: team/group/ccss/pri_internal.h
URL: http://svnview.digium.com/svn/libpri/team/group/ccss/pri_internal.h?view=diff&rev=1390&r1=1389&r2=1390
==============================================================================
--- team/group/ccss/pri_internal.h (original)
+++ team/group/ccss/pri_internal.h Wed Dec 16 13:08:09 2009
@@ -674,7 +674,7 @@
 	CC_EVENT_LINK_CANCEL,
 	/*! Tear down CC request from upper layer. */
 	CC_EVENT_CANCEL,
-	/*! Tear down of CC signaling link completed. */
+	/*! Received message indicating tear down of CC signaling link completed. */
 	CC_EVENT_SIGNALING_GONE,
 	/*! Sent ALERTING message. */
 	CC_EVENT_MSG_ALERTING,
@@ -699,7 +699,7 @@
 	/*! Timeout for valid party A status. */
 	CC_EVENT_TIMEOUT_EXTENDED_T_CCBS1,
 	/*! Max time the CCBS/CCNR service will be active. */
-	CC_EVENT_TIMEOUT_T_CCBS2,
+	CC_EVENT_TIMEOUT_T_SUPERVISION,
 	/*! Max time to wait for user A to respond to user B availability. */
 	CC_EVENT_TIMEOUT_T_CCBS3,
 };
@@ -746,12 +746,8 @@
 	union {
 		/*! PTMP FSM parameters. */
 		struct {
-			/*! T_RETENTION timer id. */
-			int t_retention;
 			/*! Extended T_CCBS1 timer id for CCBSStatusRequest handling. */
 			int extended_t_ccbs1;
-			/*! T_CCBS2/T_CCNR2 timer id.  CC service supervision timer. */
-			int t_ccbs2;
 			/*! T_CCBS3 timer id. A response to B available timer. */
 			int t_ccbs3;
 			/*! Invoke id for the CCBSStatusRequest message to find if T_CCBS1 still running. */
@@ -763,8 +759,6 @@
 		} ptmp;
 		/*! PTP FSM parameters. */
 		struct {
-			/*! T_CCBS5/T_CCBS6/T_CCNR5/T_CCNR6 timer id.  CC service supervision timer. */
-			int t_supervision;
 		} ptp;
 	} fsm;
 	/*! Received message parameters of interest. */
@@ -777,6 +771,24 @@
 			int code;
 		} cc_req_rsp;
 	} msg;
+	/*!
+	 * \brief PTMP T_RETENTION timer id.
+	 * \note
+	 * This timer is used by all CC agents to implement
+	 * the Asterisk CC core offer timer.
+	 */
+	int t_retention;
+	/*!
+	 * \brief CC service supervision timer.
+	 *
+	 * \details
+	 * This timer is one of the following timer id's depending upon
+	 * switch type and CC mode:
+	 * PTMP - T_CCBS2/T_CCNR2,
+	 * PTP - T_CCBS5/T_CCNR5/T_CCBS6/T_CCNR6,
+	 * Q.SIG - QSIG_CCBS_T2/QSIG_CCNR_T2
+	 */
+	int t_supervision;
 	/*! Invoke id for the cc-request message to find if T_ACTIVATE/QSIG_CC_T1 still running. */
 	int t_activate_invoke_id;
 	/*! Pending response information. */




More information about the svn-commits mailing list