[libpri-commits] rmudgett: branch group/ccss r1396 - /team/group/ccss/doc/

SVN commits to the libpri project libpri-commits at lists.digium.com
Mon Dec 21 20:15:17 CST 2009


Author: rmudgett
Date: Mon Dec 21 20:15:15 2009
New Revision: 1396

URL: http://svnview.digium.com/svn/libpri?view=rev&rev=1396
Log:
Added CC Q.SIG agent/monitor FSM pseudo code document files in the doc directory.

Added:
    team/group/ccss/doc/cc_qsig_agent.fsm   (with props)
    team/group/ccss/doc/cc_qsig_agent_flattened.fsm   (with props)
    team/group/ccss/doc/cc_qsig_monitor.fsm   (with props)
    team/group/ccss/doc/cc_qsig_monitor_flattened.fsm   (with props)

Added: team/group/ccss/doc/cc_qsig_agent.fsm
URL: http://svnview.digium.com/svn/libpri/team/group/ccss/doc/cc_qsig_agent.fsm?view=auto&rev=1396
==============================================================================
--- team/group/ccss/doc/cc_qsig_agent.fsm (added)
+++ team/group/ccss/doc/cc_qsig_agent.fsm Mon Dec 21 20:15:15 2009
@@ -1,0 +1,149 @@
+/*
+ * FSM pseudo code used in the design/implementation of the CC Q.SIG agent.
+ */
+FSM CC_QSIG_Agent
+{
+	State CC_STATE_IDLE {
+		Init {
+		}
+		Prolog {
+			Action Set_Selfdestruct;
+		}
+		Stimulus CC_EVENT_AVAILABLE {
+			Next_State CC_STATE_AVAILABLE;
+		}
+		Stimulus CC_EVENT_CANCEL {
+			Action Set_Selfdestruct;
+		}
+	}
+	State CC_STATE_AVAILABLE {
+		/*
+		 * For Q.SIG mode the T_RETENTION timer is not defined.  However,
+		 * we will use it anyway in this state to protect our resources
+		 * from leaks caused by user A not requesting CC.  This timer
+		 * should be set much longer than the PTMP network link to
+		 * allow for variations in user A's CC offer timer.
+		 */
+		Epilog {
+			Action Stop_T_RETENTION;
+		}
+		Stimulus CC_EVENT_MSG_RELEASE {
+			Action Stop_T_RETENTION;
+			Action Start_T_RETENTION;
+		}
+		Stimulus CC_EVENT_MSG_RELEASE_COMPLETE {
+			Action Stop_T_RETENTION;
+			Action Start_T_RETENTION;
+		}
+		Stimulus CC_EVENT_CC_REQUEST {
+			Action Pass_Up_CC_Request;
+			/* Send Q931_CALL_PROCEEDING message on signaling link. */
+			Action Send_Call_Proceeding;
+			Next_State CC_STATE_REQUESTED;
+		}
+		Stimulus CC_EVENT_TIMEOUT_T_RETENTION {
+			Action Pass_Up_CC_Cancel;
+			Next_State CC_STATE_IDLE;
+		}
+		Stimulus CC_EVENT_CANCEL {
+			Next_State CC_STATE_IDLE;
+		}
+	}
+	State CC_STATE_REQUESTED {
+		Stimulus CC_EVENT_CC_REQUEST_ACCEPT {
+			Next_State CC_STATE_ACTIVATED;
+		}
+		Stimulus CC_EVENT_SIGNALING_GONE {
+			/* Signaling link cleared. */
+			Action Pass_Up_CC_Cancel;
+			Next_State CC_STATE_IDLE;
+		}
+		Stimulus CC_EVENT_CANCEL {
+			Action Hangup_Signaling_Link;
+			Next_State CC_STATE_IDLE;
+		}
+	}
+	State CC_STATE_WAIT_DESTRUCTION {
+		/*
+		 * Delayed disconnect of the signaling link to allow subcmd events
+		 * from the signaling link to be passed up.
+		 */
+		Stimulus CC_EVENT_SIGNALING_GONE {
+			/* Signaling link cleared. */
+			Next_State CC_STATE_IDLE;
+		}
+		Stimulus CC_EVENT_HANGUP_SIGNALING {
+			Action Hangup_Signaling_Link;
+			Next_State CC_STATE_IDLE;
+		}
+	}
+	State CC_STATE_ACTIVATED {
+		Stimulus CC_EVENT_REMOTE_USER_FREE {
+			/* Send ccExecPossible in FACILITY or SETUP. */
+			Action Send_RemoteUserFree;
+			Next_State CC_STATE_WAIT_CALLBACK;
+		}
+	}
+	State CC_STATE_WAIT_CALLBACK {
+		Stimulus CC_EVENT_SUSPEND {
+			/* Received ccSuspend */
+			Action Set_A_Status_Busy;
+			Action Pass_Up_A_Status;
+			Next_State CC_STATE_SUSPENDED;
+		}
+		Stimulus CC_EVENT_RECALL {
+			/* Received ccRingout */
+			Action Pass_Up_CC_Call;
+			Action Set_Original_Call_Parameters;
+		}
+	}
+	State CC_STATE_SUSPENDED {
+		Stimulus CC_EVENT_RESUME {
+			/* Received ccResume */
+			Action Set_A_Status_Free;
+			Action Pass_Up_A_Status;
+			Next_State CC_STATE_ACTIVATED;
+		}
+	}
+	Superstate CC_ACTIVE(CC_STATE_ACTIVATED, CC_STATE_WAIT_CALLBACK, CC_STATE_SUSPENDED) {
+		Prolog {
+			/* Start QSIG_CCBS_T2/QSIG_CCNR_T2 depending upon CC mode. */
+			Action Start_T_SUPERVISION;
+		}
+		Epilog {
+			Action Stop_T_SUPERVISION;
+		}
+		Stimulus CC_EVENT_TIMEOUT_T_SUPERVISION {
+			Action Pass_Up_CC_Cancel;
+			Test == Get_Signaling_Link_Active;
+			Test == TRUE {
+				Action Send_CC_Cancel(Q931_ANY_MESSAGE);
+				Action Post_HANGUP_SIGNALING;
+			}
+			Test != TRUE {
+				Action Send_CC_Cancel(Q931_SETUP);
+			}
+			Next_State CC_STATE_WAIT_DESTRUCTION;
+		}
+		Stimulus CC_EVENT_SIGNALING_GONE {
+			/* Signaling link cleared. */
+			Action Disassociate_Signaling_Link;
+		}
+		Stimulus CC_EVENT_LINK_CANCEL {
+			/* Received ccCancel */
+			Action Pass_Up_CC_Cancel;
+			Action Post_HANGUP_SIGNALING;
+			Next_State CC_STATE_WAIT_DESTRUCTION;
+		}
+		Stimulus CC_EVENT_CANCEL {
+			Test == Get_Signaling_Link_Active;
+			Test == TRUE {
+				Action Send_CC_Cancel(Q931_ANY_MESSAGE);
+				Action Hangup_Signaling_Link;
+				Next_State CC_STATE_IDLE;
+			}
+			Action Send_CC_Cancel(Q931_SETUP);
+			Next_State CC_STATE_WAIT_DESTRUCTION;
+		}
+	}
+}

Propchange: team/group/ccss/doc/cc_qsig_agent.fsm
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/group/ccss/doc/cc_qsig_agent.fsm
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/group/ccss/doc/cc_qsig_agent.fsm
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: team/group/ccss/doc/cc_qsig_agent_flattened.fsm
URL: http://svnview.digium.com/svn/libpri/team/group/ccss/doc/cc_qsig_agent_flattened.fsm?view=auto&rev=1396
==============================================================================
--- team/group/ccss/doc/cc_qsig_agent_flattened.fsm (added)
+++ team/group/ccss/doc/cc_qsig_agent_flattened.fsm Mon Dec 21 20:15:15 2009
@@ -1,0 +1,222 @@
+/*
+ * FSM pseudo code used in the design/implementation of the CC Q.SIG agent.
+ */
+FSM CC_QSIG_Agent
+{
+	State CC_STATE_IDLE {
+		Stimulus CC_EVENT_AVAILABLE {
+			Next_State CC_STATE_AVAILABLE;
+		}
+		Stimulus CC_EVENT_CANCEL {
+			Action Set_Selfdestruct;
+		}
+	}
+	State CC_STATE_AVAILABLE {
+		/*
+		 * For Q.SIG mode the T_RETENTION timer is not defined.  However,
+		 * we will use it anyway in this state to protect our resources
+		 * from leaks caused by user A not requesting CC.  This timer
+		 * should be set much longer than the PTMP network link to
+		 * allow for variations in user A's CC offer timer.
+		 */
+		Stimulus CC_EVENT_MSG_RELEASE {
+			Action Stop_T_RETENTION;
+			Action Start_T_RETENTION;
+		}
+		Stimulus CC_EVENT_MSG_RELEASE_COMPLETE {
+			Action Stop_T_RETENTION;
+			Action Start_T_RETENTION;
+		}
+		Stimulus CC_EVENT_CC_REQUEST {
+			Action Pass_Up_CC_Request;
+			/* Send Q931_CALL_PROCEEDING message on signaling link. */
+			Action Send_Call_Proceeding;
+			Action Stop_T_RETENTION;
+			Next_State CC_STATE_REQUESTED;
+		}
+		Stimulus CC_EVENT_TIMEOUT_T_RETENTION {
+			Action Pass_Up_CC_Cancel;
+			Action Stop_T_RETENTION;
+			Action Set_Selfdestruct;
+			Next_State CC_STATE_IDLE;
+		}
+		Stimulus CC_EVENT_CANCEL {
+			Action Stop_T_RETENTION;
+			Action Set_Selfdestruct;
+			Next_State CC_STATE_IDLE;
+		}
+	}
+	State CC_STATE_REQUESTED {
+		Stimulus CC_EVENT_CC_REQUEST_ACCEPT {
+			/* Start QSIG_CCBS_T2/QSIG_CCNR_T2 depending upon CC mode. */
+			Action Start_T_SUPERVISION;
+			Next_State CC_STATE_ACTIVATED;
+		}
+		Stimulus CC_EVENT_SIGNALING_GONE {
+			/* Signaling link cleared. */
+			Action Pass_Up_CC_Cancel;
+			Action Set_Selfdestruct;
+			Next_State CC_STATE_IDLE;
+		}
+		Stimulus CC_EVENT_CANCEL {
+			Action Hangup_Signaling_Link;
+			Action Set_Selfdestruct;
+			Next_State CC_STATE_IDLE;
+		}
+	}
+	State CC_STATE_WAIT_DESTRUCTION {
+		/*
+		 * Delayed disconnect of the signaling link to allow subcmd events
+		 * from the signaling link to be passed up.
+		 */
+		Stimulus CC_EVENT_SIGNALING_GONE {
+			/* Signaling link cleared. */
+			Action Set_Selfdestruct;
+			Next_State CC_STATE_IDLE;
+		}
+		Stimulus CC_EVENT_HANGUP_SIGNALING {
+			Action Hangup_Signaling_Link;
+			Action Set_Selfdestruct;
+			Next_State CC_STATE_IDLE;
+		}
+	}
+	State CC_STATE_ACTIVATED {
+		Stimulus CC_EVENT_REMOTE_USER_FREE {
+			/* Send ccExecPossible in FACILITY or SETUP. */
+			Action Send_RemoteUserFree;
+			Next_State CC_STATE_WAIT_CALLBACK;
+		}
+		Stimulus CC_EVENT_TIMEOUT_T_SUPERVISION {
+			Action Pass_Up_CC_Cancel;
+			Test == Get_Signaling_Link_Active;
+			Test == TRUE {
+				Action Send_CC_Cancel(Q931_ANY_MESSAGE);
+				Action Post_HANGUP_SIGNALING;
+			}
+			Test != TRUE {
+				Action Send_CC_Cancel(Q931_SETUP);
+			}
+			Action Stop_T_SUPERVISION;
+			Next_State CC_STATE_WAIT_DESTRUCTION;
+		}
+		Stimulus CC_EVENT_SIGNALING_GONE {
+			/* Signaling link cleared. */
+			Action Disassociate_Signaling_Link;
+		}
+		Stimulus CC_EVENT_LINK_CANCEL {
+			/* Received ccCancel */
+			Action Pass_Up_CC_Cancel;
+			Action Post_HANGUP_SIGNALING;
+			Action Stop_T_SUPERVISION;
+			Next_State CC_STATE_WAIT_DESTRUCTION;
+		}
+		Stimulus CC_EVENT_CANCEL {
+			Test == Get_Signaling_Link_Active;
+			Test == TRUE {
+				Action Send_CC_Cancel(Q931_ANY_MESSAGE);
+				Action Hangup_Signaling_Link;
+				Action Stop_T_SUPERVISION;
+				Action Set_Selfdestruct;
+				Next_State CC_STATE_IDLE;
+			}
+			Action Send_CC_Cancel(Q931_SETUP);
+			Action Stop_T_SUPERVISION;
+			Next_State CC_STATE_WAIT_DESTRUCTION;
+		}
+	}
+	State CC_STATE_WAIT_CALLBACK {
+		Stimulus CC_EVENT_SUSPEND {
+			/* Received ccSuspend */
+			Action Set_A_Status_Busy;
+			Action Pass_Up_A_Status;
+			Next_State CC_STATE_SUSPENDED;
+		}
+		Stimulus CC_EVENT_RECALL {
+			/* Received ccRingout */
+			Action Pass_Up_CC_Call;
+			Action Set_Original_Call_Parameters;
+		}
+		Stimulus CC_EVENT_TIMEOUT_T_SUPERVISION {
+			Action Pass_Up_CC_Cancel;
+			Test == Get_Signaling_Link_Active;
+			Test == TRUE {
+				Action Send_CC_Cancel(Q931_ANY_MESSAGE);
+				Action Post_HANGUP_SIGNALING;
+			}
+			Test != TRUE {
+				Action Send_CC_Cancel(Q931_SETUP);
+			}
+			Action Stop_T_SUPERVISION;
+			Next_State CC_STATE_WAIT_DESTRUCTION;
+		}
+		Stimulus CC_EVENT_SIGNALING_GONE {
+			/* Signaling link cleared. */
+			Action Disassociate_Signaling_Link;
+		}
+		Stimulus CC_EVENT_LINK_CANCEL {
+			/* Received ccCancel */
+			Action Pass_Up_CC_Cancel;
+			Action Post_HANGUP_SIGNALING;
+			Action Stop_T_SUPERVISION;
+			Next_State CC_STATE_WAIT_DESTRUCTION;
+		}
+		Stimulus CC_EVENT_CANCEL {
+			Test == Get_Signaling_Link_Active;
+			Test == TRUE {
+				Action Send_CC_Cancel(Q931_ANY_MESSAGE);
+				Action Hangup_Signaling_Link;
+				Action Stop_T_SUPERVISION;
+				Action Set_Selfdestruct;
+				Next_State CC_STATE_IDLE;
+			}
+			Action Send_CC_Cancel(Q931_SETUP);
+			Action Stop_T_SUPERVISION;
+			Next_State CC_STATE_WAIT_DESTRUCTION;
+		}
+	}
+	State CC_STATE_SUSPENDED {
+		Stimulus CC_EVENT_RESUME {
+			/* Received ccResume */
+			Action Set_A_Status_Free;
+			Action Pass_Up_A_Status;
+			Next_State CC_STATE_ACTIVATED;
+		}
+		Stimulus CC_EVENT_TIMEOUT_T_SUPERVISION {
+			Action Pass_Up_CC_Cancel;
+			Test == Get_Signaling_Link_Active;
+			Test == TRUE {
+				Action Send_CC_Cancel(Q931_ANY_MESSAGE);
+				Action Post_HANGUP_SIGNALING;
+			}
+			Test != TRUE {
+				Action Send_CC_Cancel(Q931_SETUP);
+			}
+			Action Stop_T_SUPERVISION;
+			Next_State CC_STATE_WAIT_DESTRUCTION;
+		}
+		Stimulus CC_EVENT_SIGNALING_GONE {
+			/* Signaling link cleared. */
+			Action Disassociate_Signaling_Link;
+		}
+		Stimulus CC_EVENT_LINK_CANCEL {
+			/* Received ccCancel */
+			Action Pass_Up_CC_Cancel;
+			Action Post_HANGUP_SIGNALING;
+			Action Stop_T_SUPERVISION;
+			Next_State CC_STATE_WAIT_DESTRUCTION;
+		}
+		Stimulus CC_EVENT_CANCEL {
+			Test == Get_Signaling_Link_Active;
+			Test == TRUE {
+				Action Send_CC_Cancel(Q931_ANY_MESSAGE);
+				Action Hangup_Signaling_Link;
+				Action Stop_T_SUPERVISION;
+				Action Set_Selfdestruct;
+				Next_State CC_STATE_IDLE;
+			}
+			Action Send_CC_Cancel(Q931_SETUP);
+			Action Stop_T_SUPERVISION;
+			Next_State CC_STATE_WAIT_DESTRUCTION;
+		}
+	}
+}

Propchange: team/group/ccss/doc/cc_qsig_agent_flattened.fsm
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/group/ccss/doc/cc_qsig_agent_flattened.fsm
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/group/ccss/doc/cc_qsig_agent_flattened.fsm
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: team/group/ccss/doc/cc_qsig_monitor.fsm
URL: http://svnview.digium.com/svn/libpri/team/group/ccss/doc/cc_qsig_monitor.fsm?view=auto&rev=1396
==============================================================================
--- team/group/ccss/doc/cc_qsig_monitor.fsm (added)
+++ team/group/ccss/doc/cc_qsig_monitor.fsm Mon Dec 21 20:15:15 2009
@@ -1,0 +1,268 @@
+/*
+ * FSM pseudo code used in the design/implementation of the CC Q.SIG monitor.
+ */
+FSM CC_QSIG_Monitor
+{
+	State CC_STATE_IDLE {
+		Init {
+		}
+		Prolog {
+			Action Set_Selfdestruct;
+		}
+		Stimulus CC_EVENT_AVAILABLE {
+			/*
+			 * LibPRI will determine if CC will be offered based upon
+			 * if it is even possible.
+			 * Essentially:
+			 * 1) The call must not have been redirected in this link's
+			 * setup.
+			 * 2) Received an ALERTING or received a
+			 * DISCONNECT(busy/congestion).
+			 */
+			Action Pass_Up_CC_Available;
+			Next_State CC_STATE_AVAILABLE;
+		}
+		Stimulus CC_EVENT_CANCEL {
+			Action Set_Selfdestruct;
+		}
+	}
+	State CC_STATE_AVAILABLE {
+		/*
+		 * The upper layer is responsible for canceling the CC available
+		 * offering.
+		 */
+		Stimulus CC_EVENT_CC_REQUEST {
+			/*
+			 * Before event is posted:
+			 *   cc_record->is_ccnr is set.
+			 *   The signaling connection call record is created.
+			 */
+			Action Queue_CC_Request;
+			/* Start QSIG_CC_T1. */
+			Action Start_T_ACTIVATE;
+			Next_State CC_STATE_REQUESTED;
+		}
+		Stimulus CC_EVENT_CANCEL {
+			Next_State CC_STATE_IDLE;
+		}
+	}
+	State CC_STATE_REQUESTED {
+		Stimulus CC_EVENT_CC_REQUEST_ACCEPT {
+			/*
+			 * Received ccbsRequest/ccnrRequest response
+			 * Before event is posted:
+			 *   Negotiated CC retention setting saved
+			 *   Negotiated signaling link retention setting saved
+			 */
+			Action Stop_T_ACTIVATE;
+			Test = Get_Retain_Signaling_Link;
+			Test == TRUE {
+				Test = Get_msgtype;
+				Test == Q931_RELEASE {
+					/*
+					 * The far end did not honor the
+					 * signaling link retention requirement.
+					 */
+					Action Pass_Up_CC_Req_Rsp_Timeout;
+					Action Pass_Up_CC_Cancel;
+					Action Disassociate_Signaling_Link;
+					Action Send_CC_Cancel(Q931_SETUP);
+					Next_State CC_STATE_WAIT_DESTRUCTION;
+				}
+			}
+			Action Pass_Up_CC_Req_Rsp_Success;
+			Next_State CC_STATE_ACTIVATED;
+		}
+		Stimulus CC_EVENT_CC_REQUEST_FAIL {
+			Action Stop_T_ACTIVATE;
+			Action Pass_Up_CC_Req_Rsp_Fail(error/reject, code);
+			Action Pass_Up_CC_Cancel;
+			/*
+			 * If this request fail comes in with the RELEASE message
+			 * then the post action will never get a chance to run.
+			 * It will be aborted because the CC_EVENT_SIGNALING_GONE
+			 * will be processed first.
+			 */
+			Action Post_HANGUP_SIGNALING;
+			Next_State CC_STATE_WAIT_DESTRUCTION;
+		}
+		Stimulus CC_EVENT_TIMEOUT_T_ACTIVATE {
+			Action Stop_T_ACTIVATE;
+			Action Pass_Up_CC_Req_Rsp_Timeout;
+			Action Pass_Up_CC_Cancel;
+			Action Post_HANGUP_SIGNALING;
+			Next_State CC_STATE_WAIT_DESTRUCTION;
+		}
+		Stimulus CC_EVENT_SIGNALING_GONE {
+			Action Stop_T_ACTIVATE;
+			/* Claim it was a timeout */
+			Action Pass_Up_CC_Req_Rsp_Timeout;
+			Action Pass_Up_CC_Cancel;
+			Next_State CC_STATE_IDLE;
+		}
+		Stimulus CC_EVENT_CANCEL {
+			Next_State CC_STATE_WAIT_DESTRUCTION;
+		}
+	}
+	State CC_STATE_WAIT_DESTRUCTION {
+		/*
+		 * Delayed disconnect of the signaling link to allow subcmd events
+		 * from the signaling link to be passed up.
+		 */
+		Stimulus CC_EVENT_CC_REQUEST_ACCEPT {
+			/*
+			 * Received ccbsRequest/ccnrRequest response
+			 * Before event is posted:
+			 *   Negotiated CC retention setting saved
+			 *   Negotiated signaling link retention setting saved
+			 */
+			Action Stop_T_ACTIVATE;
+			Test = Get_msgtype;
+			Test == Q931_RELEASE {
+				Action Disassociate_Signaling_Link;
+				Action Send_CC_Cancel(Q931_SETUP);
+			}
+			Test != Q931_RELEASE {
+				Action Send_CC_Cancel(Q931_ANY_MESSAGE);
+				Action Post_HANGUP_SIGNALING;
+			}
+		}
+		Stimulus CC_EVENT_CC_REQUEST_FAIL {
+			Action Stop_T_ACTIVATE;
+			/*
+			 * If this request fail comes in with the RELEASE message
+			 * then the post action will never get a chance to run.
+			 * It will be aborted because the CC_EVENT_SIGNALING_GONE
+			 * will be processed first.
+			 */
+			Action Post_HANGUP_SIGNALING;
+		}
+		Stimulus CC_EVENT_TIMEOUT_T_ACTIVATE {
+			Action Stop_T_ACTIVATE;
+			Action Hangup_Signaling_Link;
+			Next_State CC_STATE_IDLE;
+		}
+		Stimulus CC_EVENT_SIGNALING_GONE {
+			/* Signaling link cleared. */
+			Action Stop_T_ACTIVATE;
+			Next_State CC_STATE_IDLE;
+		}
+		Stimulus CC_EVENT_HANGUP_SIGNALING {
+			//Action Stop_T_ACTIVATE;
+			Action Hangup_Signaling_Link;
+			Next_State CC_STATE_IDLE;
+		}
+	}
+	State CC_STATE_ACTIVATED {
+		/*
+		 * The signaling link is not established in this state
+		 * if retain-signaling-link is false.
+		 */
+		Prolog {
+			Action Reset_A_Status;
+		}
+		Stimulus CC_EVENT_REMOTE_USER_FREE {
+			/* Received ccExecPossible */
+			Action Pass_Up_Remote_User_Free;
+			/*
+			 * ECMA-186 Section 6.5.2.1.7
+			 * Implied switch to retain-signaling-link.
+			 */
+			Action Set_Retain_Signaling_Link;
+			Test = Get_msgtype;
+			Test == Q931_SETUP {
+				/* Send Q931_CALL_PROCEEDING message on signaling link. */
+				Action Send_Call_Proceeding;
+			}
+			Test = Get_A_Status;
+			Test == Busy {
+				Next_State CC_STATE_SUSPENDED;
+			}
+			Next_State CC_STATE_WAIT_CALLBACK;
+		}
+		Stimulus CC_EVENT_SUSPEND {
+			Action Set_A_Status_Busy;
+		}
+		Stimulus CC_EVENT_RESUME {
+			Action Reset_A_Status;
+		}
+	}
+	State CC_STATE_WAIT_CALLBACK {
+		Prolog {
+			Action Start_QSIG_CC_T3;
+		}
+		Epilog {
+			Action Stop_QSIG_CC_T3;
+		}
+		Stimulus CC_EVENT_RECALL {
+			/* The original call parameters have already been set. */
+			Action Queue_SETUP_Recall;
+			Next_State CC_STATE_CALLBACK;
+		}
+		Stimulus CC_EVENT_SUSPEND {
+			Next_State CC_STATE_SUSPENDED;
+		}
+		Stimulus CC_EVENT_TIMEOUT_QSIG_CC_T3 {
+			Action Pass_Up_CC_Cancel;
+			Action Send_CC_Cancel(Q931_ANY_MESSAGE);
+			Action Post_HANGUP_SIGNALING;
+			Next_State CC_STATE_WAIT_DESTRUCTION;
+		}
+	}
+	State CC_STATE_CALLBACK {
+	}
+	State CC_STATE_SUSPENDED {
+		Prolog {
+			/*
+			 * The ccSuspend will be sent in a FACILITY or CONNECT
+			 * message depending upon the CIS call state.
+			 */
+			Action Send_CC_Suspend;
+		}
+		Stimulus CC_EVENT_RESUME {
+			Action Send_CC_Resume;
+			Next_State CC_STATE_ACTIVATED;
+		}
+	}
+	Superstate CC_ACTIVE(CC_STATE_ACTIVATED, CC_STATE_WAIT_CALLBACK, CC_STATE_CALLBACK, CC_STATE_SUSPENDED) {
+		Prolog {
+			/* Start QSIG_CCBS_T2/QSIG_CCNR_T2 depending upon CC mode. */
+			Action Start_T_SUPERVISION;
+		}
+		Epilog {
+			Action Stop_T_SUPERVISION;
+		}
+		Stimulus CC_EVENT_TIMEOUT_T_SUPERVISION {
+			Action Pass_Up_CC_Cancel;
+			Test == Get_Signaling_Link_Active;
+			Test == TRUE {
+				Action Send_CC_Cancel(Q931_ANY_MESSAGE);
+				Action Post_HANGUP_SIGNALING;
+			}
+			Test != TRUE {
+				Action Send_CC_Cancel(Q931_SETUP);
+			}
+			Next_State CC_STATE_WAIT_DESTRUCTION;
+		}
+		Stimulus CC_EVENT_SIGNALING_GONE {
+			/* Signaling link cleared. */
+			Action Disassociate_Signaling_Link;
+		}
+		Stimulus CC_EVENT_LINK_CANCEL {
+			/* Received ccCancel */
+			Action Pass_Up_CC_Cancel;
+			Action Post_HANGUP_SIGNALING;
+			Next_State CC_STATE_WAIT_DESTRUCTION;
+		}
+		Stimulus CC_EVENT_CANCEL {
+			Test == Get_Signaling_Link_Active;
+			Test == TRUE {
+				Action Send_CC_Cancel(Q931_ANY_MESSAGE);
+				Action Hangup_Signaling_Link;
+				Next_State CC_STATE_IDLE;
+			}
+			Action Send_CC_Cancel(Q931_SETUP);
+			Next_State CC_STATE_WAIT_DESTRUCTION;
+		}
+	}
+}

Propchange: team/group/ccss/doc/cc_qsig_monitor.fsm
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/group/ccss/doc/cc_qsig_monitor.fsm
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/group/ccss/doc/cc_qsig_monitor.fsm
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: team/group/ccss/doc/cc_qsig_monitor_flattened.fsm
URL: http://svnview.digium.com/svn/libpri/team/group/ccss/doc/cc_qsig_monitor_flattened.fsm?view=auto&rev=1396
==============================================================================
--- team/group/ccss/doc/cc_qsig_monitor_flattened.fsm (added)
+++ team/group/ccss/doc/cc_qsig_monitor_flattened.fsm Mon Dec 21 20:15:15 2009
@@ -1,0 +1,383 @@
+/*
+ * FSM pseudo code used in the design/implementation of the CC Q.SIG monitor.
+ */
+FSM CC_QSIG_Monitor
+{
+	State CC_STATE_IDLE {
+		Stimulus CC_EVENT_AVAILABLE {
+			/*
+			 * LibPRI will determine if CC will be offered based upon
+			 * if it is even possible.
+			 * Essentially:
+			 * 1) The call must not have been redirected in this link's
+			 * setup.
+			 * 2) Received an ALERTING or received a
+			 * DISCONNECT(busy/congestion).
+			 */
+			Action Pass_Up_CC_Available;
+			Next_State CC_STATE_AVAILABLE;
+		}
+		Stimulus CC_EVENT_CANCEL {
+			Action Set_Selfdestruct;
+		}
+	}
+	State CC_STATE_AVAILABLE {
+		/*
+		 * The upper layer is responsible for canceling the CC available
+		 * offering.
+		 */
+		Stimulus CC_EVENT_CC_REQUEST {
+			/*
+			 * Before event is posted:
+			 *   cc_record->is_ccnr is set.
+			 *   The signaling connection call record is created.
+			 */
+			Action Queue_CC_Request;
+			/* Start QSIG_CC_T1. */
+			Action Start_T_ACTIVATE;
+			Next_State CC_STATE_REQUESTED;
+		}
+		Stimulus CC_EVENT_CANCEL {
+			Action Set_Selfdestruct;
+			Next_State CC_STATE_IDLE;
+		}
+	}
+	State CC_STATE_REQUESTED {
+		Stimulus CC_EVENT_CC_REQUEST_ACCEPT {
+			/*
+			 * Received ccbsRequest/ccnrRequest response
+			 * Before event is posted:
+			 *   Negotiated CC retention setting saved
+			 *   Negotiated signaling link retention setting saved
+			 */
+			Action Stop_T_ACTIVATE;
+			Test = Get_Retain_Signaling_Link;
+			Test == TRUE {
+				Test = Get_msgtype;
+				Test == Q931_RELEASE {
+					/*
+					 * The far end did not honor the
+					 * signaling link retention requirement.
+					 */
+					Action Pass_Up_CC_Req_Rsp_Timeout;
+					Action Pass_Up_CC_Cancel;
+					Action Disassociate_Signaling_Link;
+					Action Send_CC_Cancel(Q931_SETUP);
+					Next_State CC_STATE_WAIT_DESTRUCTION;
+				}
+			}
+			Action Pass_Up_CC_Req_Rsp_Success;
+			/* Start QSIG_CCBS_T2/QSIG_CCNR_T2 depending upon CC mode. */
+			Action Start_T_SUPERVISION;
+			Action Reset_A_Status;
+			Next_State CC_STATE_ACTIVATED;
+		}
+		Stimulus CC_EVENT_CC_REQUEST_FAIL {
+			Action Stop_T_ACTIVATE;
+			Action Pass_Up_CC_Req_Rsp_Fail(error/reject, code);
+			Action Pass_Up_CC_Cancel;
+			/*
+			 * If this request fail comes in with the RELEASE message
+			 * then the post action will never get a chance to run.
+			 * It will be aborted because the CC_EVENT_SIGNALING_GONE
+			 * will be processed first.
+			 */
+			Action Post_HANGUP_SIGNALING;
+			Next_State CC_STATE_WAIT_DESTRUCTION;
+		}
+		Stimulus CC_EVENT_TIMEOUT_T_ACTIVATE {
+			Action Stop_T_ACTIVATE;
+			Action Pass_Up_CC_Req_Rsp_Timeout;
+			Action Pass_Up_CC_Cancel;
+			Action Post_HANGUP_SIGNALING;
+			Next_State CC_STATE_WAIT_DESTRUCTION;
+		}
+		Stimulus CC_EVENT_SIGNALING_GONE {
+			Action Stop_T_ACTIVATE;
+			/* Claim it was a timeout */
+			Action Pass_Up_CC_Req_Rsp_Timeout;
+			Action Pass_Up_CC_Cancel;
+			Action Set_Selfdestruct;
+			Next_State CC_STATE_IDLE;
+		}
+		Stimulus CC_EVENT_CANCEL {
+			Next_State CC_STATE_WAIT_DESTRUCTION;
+		}
+	}
+	State CC_STATE_WAIT_DESTRUCTION {
+		/*
+		 * Delayed disconnect of the signaling link to allow subcmd events
+		 * from the signaling link to be passed up.
+		 */
+		Stimulus CC_EVENT_CC_REQUEST_ACCEPT {
+			/*
+			 * Received ccbsRequest/ccnrRequest response
+			 * Before event is posted:
+			 *   Negotiated CC retention setting saved
+			 *   Negotiated signaling link retention setting saved
+			 */
+			Action Stop_T_ACTIVATE;
+			Test = Get_msgtype;
+			Test == Q931_RELEASE {
+				Action Disassociate_Signaling_Link;
+				Action Send_CC_Cancel(Q931_SETUP);
+			}
+			Test != Q931_RELEASE {
+				Action Send_CC_Cancel(Q931_ANY_MESSAGE);
+				Action Post_HANGUP_SIGNALING;
+			}
+		}
+		Stimulus CC_EVENT_CC_REQUEST_FAIL {
+			Action Stop_T_ACTIVATE;
+			/*
+			 * If this request fail comes in with the RELEASE message
+			 * then the post action will never get a chance to run.
+			 * It will be aborted because the CC_EVENT_SIGNALING_GONE
+			 * will be processed first.
+			 */
+			Action Post_HANGUP_SIGNALING;
+		}
+		Stimulus CC_EVENT_TIMEOUT_T_ACTIVATE {
+			Action Stop_T_ACTIVATE;
+			Action Hangup_Signaling_Link;
+			Action Set_Selfdestruct;
+			Next_State CC_STATE_IDLE;
+		}
+		Stimulus CC_EVENT_SIGNALING_GONE {
+			/* Signaling link cleared. */
+			Action Stop_T_ACTIVATE;
+			Action Set_Selfdestruct;
+			Next_State CC_STATE_IDLE;
+		}
+		Stimulus CC_EVENT_HANGUP_SIGNALING {
+			//Action Stop_T_ACTIVATE;
+			Action Hangup_Signaling_Link;
+			Action Set_Selfdestruct;
+			Next_State CC_STATE_IDLE;
+		}
+	}
+	State CC_STATE_ACTIVATED {
+		/*
+		 * The signaling link is not established in this state
+		 * if retain-signaling-link is false.
+		 */
+		Stimulus CC_EVENT_REMOTE_USER_FREE {
+			/* Received ccExecPossible */
+			Action Pass_Up_Remote_User_Free;
+			/*
+			 * ECMA-186 Section 6.5.2.1.7
+			 * Implied switch to retain-signaling-link.
+			 */
+			Action Set_Retain_Signaling_Link;
+			Test = Get_msgtype;
+			Test == Q931_SETUP {
+				/* Send Q931_CALL_PROCEEDING message on signaling link. */
+				Action Send_Call_Proceeding;
+			}
+			Test = Get_A_Status;
+			Test == Busy {
+				/*
+				 * The ccSuspend will be sent in a FACILITY or CONNECT
+				 * message depending upon the CIS call state.
+				 */
+				Action Send_CC_Suspend;
+				Next_State CC_STATE_SUSPENDED;
+			}
+			Action Start_QSIG_CC_T3;
+			Next_State CC_STATE_WAIT_CALLBACK;
+		}
+		Stimulus CC_EVENT_SUSPEND {
+			Action Set_A_Status_Busy;
+		}
+		Stimulus CC_EVENT_RESUME {
+			Action Reset_A_Status;
+		}
+		Stimulus CC_EVENT_TIMEOUT_T_SUPERVISION {
+			Action Pass_Up_CC_Cancel;
+			Test == Get_Signaling_Link_Active;
+			Test == TRUE {
+				Action Send_CC_Cancel(Q931_ANY_MESSAGE);
+				Action Post_HANGUP_SIGNALING;
+			}
+			Test != TRUE {
+				Action Send_CC_Cancel(Q931_SETUP);
+			}
+			Action Stop_T_SUPERVISION;
+			Next_State CC_STATE_WAIT_DESTRUCTION;
+		}
+		Stimulus CC_EVENT_SIGNALING_GONE {
+			/* Signaling link cleared. */
+			Action Disassociate_Signaling_Link;
+		}
+		Stimulus CC_EVENT_LINK_CANCEL {
+			/* Received ccCancel */
+			Action Pass_Up_CC_Cancel;
+			Action Post_HANGUP_SIGNALING;
+			Action Stop_T_SUPERVISION;
+			Next_State CC_STATE_WAIT_DESTRUCTION;
+		}
+		Stimulus CC_EVENT_CANCEL {
+			Test == Get_Signaling_Link_Active;
+			Test == TRUE {
+				Action Send_CC_Cancel(Q931_ANY_MESSAGE);
+				Action Hangup_Signaling_Link;
+				Action Stop_T_SUPERVISION;
+				Action Set_Selfdestruct;
+				Next_State CC_STATE_IDLE;
+			}
+			Action Send_CC_Cancel(Q931_SETUP);
+			Action Stop_T_SUPERVISION;
+			Next_State CC_STATE_WAIT_DESTRUCTION;
+		}
+	}
+	State CC_STATE_WAIT_CALLBACK {
+		Stimulus CC_EVENT_RECALL {
+			/* The original call parameters have already been set. */
+			Action Queue_SETUP_Recall;
+			Action Stop_QSIG_CC_T3;
+			Next_State CC_STATE_CALLBACK;
+		}
+		Stimulus CC_EVENT_SUSPEND {
+			Action Stop_QSIG_CC_T3;
+			/*
+			 * The ccSuspend will be sent in a FACILITY or CONNECT
+			 * message depending upon the CIS call state.
+			 */
+			Action Send_CC_Suspend;
+			Next_State CC_STATE_SUSPENDED;
+		}
+		Stimulus CC_EVENT_TIMEOUT_QSIG_CC_T3 {
+			Action Pass_Up_CC_Cancel;
+			Action Send_CC_Cancel(Q931_ANY_MESSAGE);
+			Action Post_HANGUP_SIGNALING;
+			Action Stop_QSIG_CC_T3;
+			Action Stop_T_SUPERVISION;
+			Next_State CC_STATE_WAIT_DESTRUCTION;
+		}
+		Stimulus CC_EVENT_TIMEOUT_T_SUPERVISION {
+			Action Pass_Up_CC_Cancel;
+			Test == Get_Signaling_Link_Active;
+			Test == TRUE {
+				Action Send_CC_Cancel(Q931_ANY_MESSAGE);
+				Action Stop_QSIG_CC_T3;
+				Action Post_HANGUP_SIGNALING;
+			}
+			Test != TRUE {
+				Action Send_CC_Cancel(Q931_SETUP);
+			}
+			Action Stop_QSIG_CC_T3;
+			Action Stop_T_SUPERVISION;
+			Next_State CC_STATE_WAIT_DESTRUCTION;
+		}
+		Stimulus CC_EVENT_SIGNALING_GONE {
+			/* Signaling link cleared. */
+			Action Disassociate_Signaling_Link;
+		}
+		Stimulus CC_EVENT_LINK_CANCEL {
+			/* Received ccCancel */
+			Action Pass_Up_CC_Cancel;
+			Action Post_HANGUP_SIGNALING;
+			Action Stop_QSIG_CC_T3;
+			Action Stop_T_SUPERVISION;
+			Next_State CC_STATE_WAIT_DESTRUCTION;
+		}
+		Stimulus CC_EVENT_CANCEL {
+			Test == Get_Signaling_Link_Active;
+			Test == TRUE {
+				Action Send_CC_Cancel(Q931_ANY_MESSAGE);
+				Action Hangup_Signaling_Link;
+				Action Stop_QSIG_CC_T3;
+				Action Stop_T_SUPERVISION;
+				Action Set_Selfdestruct;
+				Next_State CC_STATE_IDLE;
+			}
+			Action Send_CC_Cancel(Q931_SETUP);
+			Action Stop_QSIG_CC_T3;
+			Action Stop_T_SUPERVISION;
+			Next_State CC_STATE_WAIT_DESTRUCTION;
+		}
+	}
+	State CC_STATE_CALLBACK {
+		Stimulus CC_EVENT_TIMEOUT_T_SUPERVISION {
+			Action Pass_Up_CC_Cancel;
+			Test == Get_Signaling_Link_Active;
+			Test == TRUE {
+				Action Send_CC_Cancel(Q931_ANY_MESSAGE);
+				Action Post_HANGUP_SIGNALING;
+			}
+			Test != TRUE {
+				Action Send_CC_Cancel(Q931_SETUP);
+			}
+			Action Stop_T_SUPERVISION;
+			Next_State CC_STATE_WAIT_DESTRUCTION;
+		}
+		Stimulus CC_EVENT_SIGNALING_GONE {
+			/* Signaling link cleared. */
+			Action Disassociate_Signaling_Link;
+		}
+		Stimulus CC_EVENT_LINK_CANCEL {
+			/* Received ccCancel */
+			Action Pass_Up_CC_Cancel;
+			Action Post_HANGUP_SIGNALING;
+			Action Stop_T_SUPERVISION;
+			Next_State CC_STATE_WAIT_DESTRUCTION;
+		}
+		Stimulus CC_EVENT_CANCEL {
+			Test == Get_Signaling_Link_Active;
+			Test == TRUE {
+				Action Send_CC_Cancel(Q931_ANY_MESSAGE);
+				Action Hangup_Signaling_Link;
+				Action Stop_T_SUPERVISION;
+				Action Set_Selfdestruct;
+				Next_State CC_STATE_IDLE;
+			}
+			Action Send_CC_Cancel(Q931_SETUP);
+			Action Stop_T_SUPERVISION;
+			Next_State CC_STATE_WAIT_DESTRUCTION;
+		}
+	}
+	State CC_STATE_SUSPENDED {
+		Stimulus CC_EVENT_RESUME {
+			Action Send_CC_Resume;
+			Action Reset_A_Status;
+			Next_State CC_STATE_ACTIVATED;
+		}
+		Stimulus CC_EVENT_TIMEOUT_T_SUPERVISION {
+			Action Pass_Up_CC_Cancel;
+			Test == Get_Signaling_Link_Active;
+			Test == TRUE {
+				Action Send_CC_Cancel(Q931_ANY_MESSAGE);
+				Action Post_HANGUP_SIGNALING;
+			}
+			Test != TRUE {
+				Action Send_CC_Cancel(Q931_SETUP);
+			}
+			Action Stop_T_SUPERVISION;
+			Next_State CC_STATE_WAIT_DESTRUCTION;
+		}
+		Stimulus CC_EVENT_SIGNALING_GONE {
+			/* Signaling link cleared. */
+			Action Disassociate_Signaling_Link;
+		}
+		Stimulus CC_EVENT_LINK_CANCEL {
+			/* Received ccCancel */
+			Action Pass_Up_CC_Cancel;
+			Action Post_HANGUP_SIGNALING;
+			Action Stop_T_SUPERVISION;
+			Next_State CC_STATE_WAIT_DESTRUCTION;
+		}
+		Stimulus CC_EVENT_CANCEL {
+			Test == Get_Signaling_Link_Active;
+			Test == TRUE {
+				Action Send_CC_Cancel(Q931_ANY_MESSAGE);
+				Action Hangup_Signaling_Link;
+				Action Stop_T_SUPERVISION;
+				Action Set_Selfdestruct;
+				Next_State CC_STATE_IDLE;
+			}
+			Action Send_CC_Cancel(Q931_SETUP);
+			Action Stop_T_SUPERVISION;
+			Next_State CC_STATE_WAIT_DESTRUCTION;
+		}
+	}
+}

Propchange: team/group/ccss/doc/cc_qsig_monitor_flattened.fsm
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/group/ccss/doc/cc_qsig_monitor_flattened.fsm
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/group/ccss/doc/cc_qsig_monitor_flattened.fsm
------------------------------------------------------------------------------
    svn:mime-type = text/plain




More information about the libpri-commits mailing list