[libpri-commits] rmudgett: branch group/ccss r1403 - in /team/group/ccss: ./ doc/

SVN commits to the libpri project libpri-commits at lists.digium.com
Fri Jan 8 15:28:32 CST 2010


Author: rmudgett
Date: Fri Jan  8 15:28:28 2010
New Revision: 1403

URL: http://svnview.digium.com/svn/libpri?view=rev&rev=1403
Log:
An agent would not be informed of party A busy status if it was already known by libpri.

The CC_EVENT_REMOTE_USER_FREE is generated by action/request of the upper
layer.  Handling of the event cannot pass an event to the upper layer
directly.

Modified:
    team/group/ccss/doc/cc_ptmp_agent.fsm
    team/group/ccss/doc/cc_ptmp_agent_flattened.fsm
    team/group/ccss/doc/cc_ptp_agent.fsm
    team/group/ccss/doc/cc_ptp_agent_flattened.fsm
    team/group/ccss/pri_cc.c

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=1403&r1=1402&r2=1403
==============================================================================
--- team/group/ccss/doc/cc_ptmp_agent.fsm (original)
+++ team/group/ccss/doc/cc_ptmp_agent.fsm Fri Jan  8 15:28:28 2010
@@ -71,6 +71,10 @@
 	}
 /*
  * Pass_Up_A_Status passes up the current final status of A.
+ * Does nothing if status is invalid.
+ *
+ * Pass_Up_A_Status_Indirect is the same as Pass_Up_A_Status but
+ * sets a timer to expire immediately to pass up the event.
  * Does nothing if status is invalid.
  *
  * Pass_Up_Status_Rsp_A passes up the current accumulated status of A.
@@ -97,12 +101,12 @@
 				Next_State CC_STATE_B_AVAILABLE;
 			}
 			Test == Busy {
-				Action Pass_Up_A_Status;
+				Action Pass_Up_A_Status_Indirect;
 				Action Send_CCBSBFree;
 				Next_State CC_STATE_SUSPENDED;
 			}
 			Test == Free {
-				//Action Pass_Up_A_Status;
+				//Action Pass_Up_A_Status_Indirect;
 				Action Send_RemoteUserFree;
 				Next_State CC_STATE_WAIT_CALLBACK;
 			}

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=1403&r1=1402&r2=1403
==============================================================================
--- team/group/ccss/doc/cc_ptmp_agent_flattened.fsm (original)
+++ team/group/ccss/doc/cc_ptmp_agent_flattened.fsm Fri Jan  8 15:28:28 2010
@@ -73,6 +73,10 @@
 	}
 /*
  * Pass_Up_A_Status passes up the current final status of A.
+ * Does nothing if status is invalid.
+ *
+ * Pass_Up_A_Status_Indirect is the same as Pass_Up_A_Status but
+ * sets a timer to expire immediately to pass up the event.
  * Does nothing if status is invalid.
  *
  * Pass_Up_Status_Rsp_A passes up the current accumulated status of A.
@@ -102,7 +106,7 @@
 				Next_State CC_STATE_B_AVAILABLE;
 			}
 			Test == Busy {
-				Action Pass_Up_A_Status;
+				Action Pass_Up_A_Status_Indirect;
 				Action Send_CCBSBFree;
 				Test = Get_T_CCBS1_Status;
 				Test != Active {
@@ -113,7 +117,7 @@
 				Next_State CC_STATE_SUSPENDED;
 			}
 			Test == Free {
-				//Action Pass_Up_A_Status;
+				//Action Pass_Up_A_Status_Indirect;
 				Action Send_RemoteUserFree;
 				Action Stop_T_CCBS1;
 				Action Stop_Extended_T_CCBS1;

Modified: team/group/ccss/doc/cc_ptp_agent.fsm
URL: http://svnview.digium.com/svn/libpri/team/group/ccss/doc/cc_ptp_agent.fsm?view=diff&rev=1403&r1=1402&r2=1403
==============================================================================
--- team/group/ccss/doc/cc_ptp_agent.fsm (original)
+++ team/group/ccss/doc/cc_ptp_agent.fsm Fri Jan  8 15:28:28 2010
@@ -80,7 +80,7 @@
 			Action Reset_A_Status;
 		}
 		Stimulus CC_EVENT_REMOTE_USER_FREE {
-			Action Pass_Up_A_Status;
+			Action Pass_Up_A_Status_Indirect;
 			Test = Get_A_Status;
 			Test == Busy {
 				Next_State CC_STATE_SUSPENDED;

Modified: team/group/ccss/doc/cc_ptp_agent_flattened.fsm
URL: http://svnview.digium.com/svn/libpri/team/group/ccss/doc/cc_ptp_agent_flattened.fsm?view=diff&rev=1403&r1=1402&r2=1403
==============================================================================
--- team/group/ccss/doc/cc_ptp_agent_flattened.fsm (original)
+++ team/group/ccss/doc/cc_ptp_agent_flattened.fsm Fri Jan  8 15:28:28 2010
@@ -79,7 +79,7 @@
 	}
 	State CC_STATE_ACTIVATED {
 		Stimulus CC_EVENT_REMOTE_USER_FREE {
-			Action Pass_Up_A_Status;
+			Action Pass_Up_A_Status_Indirect;
 			Test = Get_A_Status;
 			Test == Busy {
 				Next_State CC_STATE_SUSPENDED;

Modified: team/group/ccss/pri_cc.c
URL: http://svnview.digium.com/svn/libpri/team/group/ccss/pri_cc.c?view=diff&rev=1403&r1=1402&r2=1403
==============================================================================
--- team/group/ccss/pri_cc.c (original)
+++ team/group/ccss/pri_cc.c Fri Jan  8 15:28:28 2010
@@ -3629,7 +3629,7 @@
 
 /*!
  * \internal
- * \brief Pass up party A status to upper layer (indirectly).
+ * \brief Pass up party A status response to upper layer (indirectly).
  *
  * \param data CC record pointer.
  *
@@ -3645,7 +3645,7 @@
 
 /*!
  * \internal
- * \brief FSM action to pass up party A status to upper layer (indirectly).
+ * \brief FSM action to pass up party A status response to upper layer (indirectly).
  *
  * \param ctrl D channel controller.
  * \param cc_record Call completion record to process event.
@@ -3672,7 +3672,7 @@
 
 /*!
  * \internal
- * \brief FSM action to pass up party A status to upper layer.
+ * \brief FSM action to pass up party A status response to upper layer.
  *
  * \param ctrl D channel controller.
  * \param cc_record Call completion record to process event.
@@ -3747,18 +3747,17 @@
 
 /*!
  * \internal
- * \brief FSM action to pass up party A status to upper layer.
- *
- * \param ctrl D channel controller.
- * \param cc_record Call completion record to process event.
- *
- * \return Nothing
- */
-static void pri_cc_act_pass_up_a_status(struct pri *ctrl, struct pri_cc_record *cc_record)
+ * \brief Fill in the party A status update event.
+ *
+ * \param ctrl D channel controller.
+ * \param call Q.931 call leg.
+ * \param cc_record Call completion record to process event.
+ *
+ * \return Nothing
+ */
+static void pri_cc_fill_status_a(struct pri *ctrl, q931_call *call, struct pri_cc_record *cc_record)
 {
 	struct pri_subcommand *subcmd;
-
-	PRI_CC_ACT_DEBUG_OUTPUT(ctrl);
 
 	if (cc_record->party_a_status == CC_PARTY_A_AVAILABILITY_INVALID) {
 		/* Party A status is invalid so don't pass it up. */
@@ -3775,6 +3774,64 @@
 	subcmd->u.cc_status.status =
 		(cc_record->party_a_status == CC_PARTY_A_AVAILABILITY_FREE)
 		? 0 /* free */ : 1 /* busy */;
+}
+
+/*!
+ * \internal
+ * \brief Pass up party A status to upper layer (indirectly).
+ *
+ * \param data CC record pointer.
+ *
+ * \return Nothing
+ */
+static void pri_cc_indirect_status_a(void *data)
+{
+	struct pri_cc_record *cc_record = data;
+
+	cc_record->t_indirect = 0;
+	q931_cc_indirect(cc_record->master, cc_record, pri_cc_fill_status_a);
+}
+
+/*!
+ * \internal
+ * \brief FSM action to pass up party A status to upper layer (indirectly).
+ *
+ * \param ctrl D channel controller.
+ * \param cc_record Call completion record to process event.
+ *
+ * \return Nothing
+ *
+ * \note
+ * Warning:  Must not use this action with pri_cc_act_set_self_destruct() in the
+ * same event.
+ */
+static void pri_cc_act_pass_up_a_status_indirect(struct pri *ctrl, struct pri_cc_record *cc_record)
+{
+	PRI_CC_ACT_DEBUG_OUTPUT(ctrl);
+	if (cc_record->party_a_status != CC_PARTY_A_AVAILABILITY_INVALID) {
+		/* Party A status is not invalid so pass it up. */
+		if (cc_record->t_indirect) {
+			pri_error(ctrl, "!! An indirect action is already active!");
+			pri_schedule_del(ctrl, cc_record->t_indirect);
+		}
+		cc_record->t_indirect = pri_schedule_event(ctrl, 0, pri_cc_indirect_status_a,
+			cc_record);
+	}
+}
+
+/*!
+ * \internal
+ * \brief FSM action to pass up party A status to upper layer.
+ *
+ * \param ctrl D channel controller.
+ * \param cc_record Call completion record to process event.
+ *
+ * \return Nothing
+ */
+static void pri_cc_act_pass_up_a_status(struct pri *ctrl, struct pri_cc_record *cc_record)
+{
+	PRI_CC_ACT_DEBUG_OUTPUT(ctrl);
+	pri_cc_fill_status_a(ctrl, cc_record->signaling, cc_record);
 }
 
 /*!
@@ -4307,7 +4364,7 @@
 			cc_record->state = CC_STATE_B_AVAILABLE;
 			break;
 		case CC_PARTY_A_AVAILABILITY_BUSY:
-			pri_cc_act_pass_up_a_status(ctrl, cc_record);
+			pri_cc_act_pass_up_a_status_indirect(ctrl, cc_record);
 			pri_cc_act_send_ccbs_b_free(ctrl, cc_record);
 			if (!pri_cc_get_t_ccbs1_status(cc_record)) {
 				pri_cc_act_reset_raw_a_status(ctrl, cc_record);
@@ -4317,7 +4374,7 @@
 			cc_record->state = CC_STATE_SUSPENDED;
 			break;
 		case CC_PARTY_A_AVAILABILITY_FREE:
-			//pri_cc_act_pass_up_a_status(ctrl, cc_record);
+			//pri_cc_act_pass_up_a_status_indirect(ctrl, cc_record);
 			pri_cc_act_send_remote_user_free(ctrl, cc_record);
 			pri_cc_act_stop_t_ccbs1(ctrl, cc_record);
 			pri_cc_act_stop_extended_t_ccbs1(ctrl, cc_record);
@@ -5115,7 +5172,7 @@
 {
 	switch (event) {
 	case CC_EVENT_REMOTE_USER_FREE:
-		pri_cc_act_pass_up_a_status(ctrl, cc_record);
+		pri_cc_act_pass_up_a_status_indirect(ctrl, cc_record);
 		if (cc_record->party_a_status == CC_PARTY_A_AVAILABILITY_BUSY) {
 			cc_record->state = CC_STATE_SUSPENDED;
 		} else {




More information about the libpri-commits mailing list