[svn-commits] rmudgett: branch rmudgett/q931_fsm r2250 - /team/rmudgett/q931_fsm/doc/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Mar 10 20:26:58 CST 2011


Author: rmudgett
Date: Thu Mar 10 20:26:52 2011
New Revision: 2250

URL: http://svnview.digium.com/svn/libpri?view=rev&rev=2250
Log:
Q.931 user side FSM states.  Need superstate events handling.

Modified:
    team/rmudgett/q931_fsm/doc/q931_user.fsm

Modified: team/rmudgett/q931_fsm/doc/q931_user.fsm
URL: http://svnview.digium.com/svn/libpri/team/rmudgett/q931_fsm/doc/q931_user.fsm?view=diff&rev=2250&r1=2249&r2=2250
==============================================================================
--- team/rmudgett/q931_fsm/doc/q931_user.fsm (original)
+++ team/rmudgett/q931_fsm/doc/q931_user.fsm Thu Mar 10 20:26:52 2011
@@ -18,12 +18,20 @@
 		/* Terminate the FSM */
 		Next_State *;
 	}
+	Stimulus Q931_EV_MSG_STATUS_ENQUIRY {
+		Action Send(STATUS(Current_state));
+	}
 	Stimulus Q931_EV_MSG_STATUS {
+		if (!Get_STATUS_Call_State) {
+			Action Post_Mgmt(HANGUP(cause));
+			Next_State q931_user_null;
+		}
 	}
 	Stimulus Q931_EV_MSG_RELEASE_COMPLETE {
 	}
 	Stimulus Q931_EV_MSG_other {
-		Action Send(STATUS(PRI_CAUSE_INVALID_CALL_REFERENCE));
+		//Action Send(STATUS(PRI_CAUSE_WRONG_CALL_STATE));
+		//Action Send(STATUS(PRI_CAUSE_INVALID_CALL_REFERENCE));
 	}
 
 	State q931_user_null {// aka U0
@@ -34,6 +42,38 @@
 		}
 		Epilog {
 		}
+		Stimulus Q931_EV_MGMT_RESUME_REQ(call_id) {
+			/* Need to pick a new call reference */
+			Action Pick_Call_Reference;
+			Action Send(RESUME(call_id));
+			Action Start_T318;
+			Next_State q931_user_resume_request;
+		}
+		Stimulus Q931_EV_MSG_SETUP {
+			Action Post_Mgmt(SETUP);
+			Next_State q931_user_call_present;
+		}
+		Stimulus Q931_EV_MGMT_SETUP {
+			/* Call reference already selected when call structure created. */
+			//Action Pick_Call_Reference;
+			Action Send(SETUP);
+			Action Start_T303;
+			Next_State q931_user_call_initiated;
+		}
+		Stimulus Q931_EV_MSG_STATUS {
+			if (Get_STATUS_Call_State) {
+				Action Send(RELEASE_COMPLETE(PRI_CAUSE_WRONG_CALL_STATE));
+			}
+		}
+		Stimulus Q931_EV_MSG_RELEASE {
+			Action Send(RELEASE_COMPLETE(PRI_CAUSE_NORMAL_CLEARING));
+		}
+		Stimulus Q931_EV_MSG_RELEASE_COMPLETE {
+			/* Ignore RELEASE_COMPLETE messages. */
+		}
+		Stimulus Q931_EV_MSG_other {
+			Action Send(RELEASE_COMPLETE(PRI_CAUSE_INVALID_CALL_REFERENCE));
+		}
 	}
 
 	State q931_user_call_initiated {// aka U1
@@ -44,6 +84,57 @@
 		}
 		Epilog {
 		}
+		Stimulus Q931_EV_MGMT_OVERLAP_DIGIT(digit) {
+			Action Save_Overlap_Digit(digit);
+		}
+		Stimulus Q931_EV_MGMT_DISCONNECT_REQUEST(cause) {
+			Action Send(DISCONNECT(cause));
+			Action Stop_T303;
+			Action Start_T305;
+			Next_State q931_user_disconnect_request;
+		}
+		Stimulus Q931_EV_MSG_SETUP_ACKNOWLEDGE {
+			Action Stop_T303;
+			if (Stored_Overlap_Digits) {
+				Action Send(INFORMATION(Stored_Overlap_Digits));
+			}
+			Action Post_Mgmt(SETUP_ACKNOWLEDGE);
+			Action Start_T304;
+			Next_State q931_user_overlap_sending;
+		}
+		Stimulus Q931_EV_MSG_RELEASE_COMPLETE {
+			Action Stop_T303;
+			Action Post_Mgmt(HANGUP(cause));
+			Next_State q931_user_null;
+		}
+		Stimulus Q931_EV_MSG_PROCEEDING {
+			Action Stop_T303;
+			Action Start_T310;
+			Action Post_Mgmt(PROCEEDING);
+			Next_State q931_user_outgoing_call_proceeding;
+		}
+		Stimulus Q931_EV_TIMEOUT_T303 {
+			if (First_Time) {
+				Action Send(SETUP);
+				Action Start_T303;
+			} else {
+				Action Post_Mgmt(HANGUP(PRI_CAUSE_NO_USER_RESPONSE));
+				Next_State q931_user_null;
+			}
+		}
+		Stimulus Q931_EV_MSG_ALERTING {
+			Action Stop_T303;
+			Action Post_Mgmt(ALERTING);
+			Next_State q931_user_call_delivered;
+		}
+		Stimulus Q931_EV_MSG_CONNECT {
+			Action Stop_T303;
+			Action Post_Mgmt(CONNECT);
+			if (Connect_Ack_Option) {
+				Action Send(CONNECT_ACKNOWLEDGE);
+			}
+			Next_State q931_user_active;
+		}
 	}
 
 	State q931_user_overlap_sending {// aka U2
@@ -54,6 +145,49 @@
 		}
 		Epilog {
 		}
+		Stimulus Q931_EV_MGMT_OVERLAP_DIGIT(digit) {
+			Action Send(INFORMATION(digit));
+			Action Stop_T304;
+			Action Start_T304;
+		}
+		Stimulus Q931_EV_MSG_PROCEEDING {
+			Action Stop_T304;
+			Action Start_T310;
+			Action Post_Mgmt(PROCEEDING);
+			Next_State q931_user_outgoing_call_proceeding;
+		}
+		Stimulus Q931_EV_MSG_ALERTING {
+			Action Stop_T304;
+			Action Post_Mgmt(ALERTING);
+			Next_State q931_user_call_delivered;
+		}
+		Stimulus Q931_EV_MSG_PROGRESS {
+			/* PROGRESS with interworking or tone code */
+			if (interworking) {
+				Action Stop_T304;
+			}
+			Action Post_Mgmt(PROGRESS);
+		}
+		Stimulus Q931_EV_MSG_CONNECT {
+			Action Stop_T304;
+			Action Post_Mgmt(CONNECT);
+			if (Connect_Ack_Option) {
+				Action Send(CONNECT_ACKNOWLEDGE);
+			}
+			Next_State q931_user_active;
+		}
+		Stimulus Q931_EV_MGMT_RELEASE_REQ {
+			Action Send(RELEASE(PRI_CAUSE_CHANNEL_UNACCEPTABLE));
+			Action Stop_T304;
+			Action Start_T308;
+			Next_State q931_user_release_request;
+		}
+		Stimulus Q931_EV_TIMEOUT_T304 {
+			Action Send(DISCONNECT());
+			Action Start_T305;
+			Action Post_Mgmt(HANGUP(cause));
+			Next_State q931_user_disconnect_request;
+		}
 	}
 
 	State q931_user_outgoing_call_proceeding {// aka U3
@@ -64,6 +198,36 @@
 		}
 		Epilog {
 		}
+		Stimulus Q931_EV_MSG_PROGRESS {
+			Action Stop_T310;
+			Action Post_Mgmt(PROGRESS);
+		}
+		Stimulus Q931_EV_MSG_ALERTING {
+			Action Stop_T310;
+			Action Start_T301;
+			Action Post_Mgmt(ALERTING);
+			Next_State q931_user_call_delivered;
+		}
+		Stimulus Q931_EV_MSG_CONNECT {
+			Action Stop_T310;
+			Action Post_Mgmt(CONNECT);
+			if (Connect_Ack_Option) {
+				Action Send(CONNECT_ACKNOWLEDGE);
+			}
+			Next_State q931_user_active;
+		}
+		Stimulus Q931_EV_TIMEOUT_T310 {
+			Action Send(DISCONNECT());
+			Action Start_T305;
+			Action Post_Mgmt(HANGUP(cause));
+			Next_State q931_user_disconnect_request;
+		}
+		Stimulus Q931_EV_MGMT_RELEASE_REQ {
+			Action Stop_T310;
+			Action Send(RELEASE(PRI_CAUSE_CHANNEL_UNACCEPTABLE));
+			Action Start_T308;
+			Next_State q931_user_release_request;
+		}
 	}
 
 	State q931_user_call_delivered {// aka U4
@@ -74,6 +238,13 @@
 		}
 		Epilog {
 		}
+		Stimulus Q931_EV_MSG_CONNECT {
+			Action Post_Mgmt(CONNECT);
+			if (Connect_Ack_Option) {
+				Action Send(CONNECT_ACKNOWLEDGE);
+			}
+			Next_State q931_user_active;
+		}
 	}
 
 	State q931_user_call_present {// aka U6
@@ -84,6 +255,42 @@
 		}
 		Epilog {
 		}
+		Stimulus Q931_EV_MGMT_SETUP_ACKNOWLEDGE {
+			Action Send(SETUP_ACKNOWLEDGE);
+			Action Start_T302;
+			Next_State q931_user_overlap_receiving;
+		}
+		Stimulus Q931_EV_MGMT_ALERTING {
+			Action Send(ALERTING);
+			Action Start_T302;
+			Next_State q931_user_call_delivered;
+		}
+		Stimulus Q931_EV_MGMT_CONNECT {
+			Action Send(CONNECT);
+			Action Start_T313;
+			Next_State q931_user_connect_request;
+		}
+		Stimulus Q931_EV_MGMT_REJECT_REQ(cause) {
+			/* Section 5.2.5.1 */
+			if (Reject_Option) {
+				Send(RELEASE_COMPLETE(PRI_CAUSE_INCOMPATIBLE_DESTINATION))
+			}
+			Action Post_Event(Q931_EV_MGMT_DESTROY);
+			Next_State q931_user_null;
+		}
+		Stimulus Q931_EV_MGMT_PROCEEDING {
+			Action Send(PROCEEDING);
+			Next_State q931_user_incoming_call_proceeding;
+		}
+		Stimulus Q931_EV_MSG_RELEASE {
+			Action Post_Mgmt(HANGUP(cause));
+			Action Send(RELEASE_COMPLETE);
+			Next_State q931_user_null;
+		}
+		Stimulus Q931_EV_MSG_DISCONNECT {
+			Action Post_Mgmt(HANGUP_REQ(cause));
+			Next_State q931_user_disconnect_indication;
+		}
 	}
 
 	State q931_user_call_received {// aka U7
@@ -94,6 +301,11 @@
 		}
 		Epilog {
 		}
+		Stimulus Q931_EV_MGMT_CONNECT {
+			Action Send(CONNECT);
+			Action Start_T313;
+			Next_State q931_user_connect_request;
+		}
 	}
 
 	State q931_user_connect_request {// aka U8
@@ -104,6 +316,17 @@
 		}
 		Epilog {
 		}
+		Stimulus Q931_EV_TIMEOUT_T313 {
+			Action Send(DISCONNECT);
+			Action Start_T305;
+			Action Post_Mgmt(HANGUP(cause));
+			Next_State q931_user_disconnect_request;
+		}
+		Stimulus Q931_EV_MSG_CONNECT_ACKNOWLEDGE {
+			Action Stop_T313;
+			Action Post_Mgmt(CONNECT_ACKNOWLEDGE);
+			Next_State q931_user_active;
+		}
 	}
 
 	State q931_user_incoming_call_proceeding {// aka U9
@@ -114,6 +337,18 @@
 		}
 		Epilog {
 		}
+		Stimulus Q931_EV_MGMT_CONNECT {
+			Action Send(CONNECT);
+			Action Start_T313;
+			Next_State q931_user_connect_request;
+		}
+		Stimulus Q931_EV_MGMT_ALERTING {
+			Action Send(ALERTING);
+			Next_State q931_user_call_received;
+		}
+		Stimulus Q931_EV_MGMT_PROGRESS {
+			Action Send(PROGRESS);
+		}
 	}
 
 	State q931_user_active {// aka U10
@@ -124,6 +359,17 @@
 		}
 		Epilog {
 		}
+		Stimulus Q931_EV_MGMT_SUSPEND_REQ(call_id) {
+			Action Send(SUSPEND(call_id));
+			Action Start_T319;
+			Next_State q931_user_suspend_request;
+		}
+		Stimulus Q931_EV_MSG_NOTIFY {
+			Action Post_Mgmt(NOTIFY);
+		}
+		Stimulus Q931_EV_MGMT_NOTIFY {
+			Action Send(NOTIFY);
+		}
 	}
 
 	State q931_user_disconnect_request {// aka U11
@@ -134,6 +380,27 @@
 		}
 		Epilog {
 		}
+		Stimulus Q931_EV_MSG_RELEASE {
+			Action Stop_T305;
+			Action Post_Mgmt(HANGUP(cause));
+			Action Send(RELEASE_COMPLETE(cause));
+			Next_State q931_user_null;
+		}
+		Stimulus Q931_EV_MSG_DISCONNECT {
+			Action Stop_T305;
+			Action Send(RELEASE(cause));
+			Action Start_T308;
+			Next_State q931_user_release_request;
+		}
+		Stimulus Q931_EV_TIMEOUT_T305 {
+			Action Send(RELEASE(cause));
+			Action Start_T308;
+			Next_State q931_user_release_request;
+		}
+		//Stimulus Q931_EV_MSG_NOTIFY {
+		//	There does not seem to be any reason for
+		//	this being here in the spec.
+		//}
 	}
 
 	State q931_user_disconnect_indication {// aka U12
@@ -144,6 +411,16 @@
 		}
 		Epilog {
 		}
+		Stimulus Q931_EV_MSG_RELEASE {
+			Action Post_Mgmt(HANGUP(cause));
+			Action Send(RELEASE_COMPLETE(cause));
+			Next_State q931_user_null;
+		}
+		Stimulus Q931_EV_MGMT_RELEASE_REQ {
+			Action Send(RELEASE(cause));
+			Action Start_T308;
+			Next_State q931_user_release_request;
+		}
 	}
 
 	State q931_user_suspend_request {// aka U15
@@ -154,6 +431,31 @@
 		}
 		Epilog {
 		}
+		Stimulus Q931_EV_MSG_SUSPEND_ACKNOWLEDGE {
+			Action Stop_T319;
+			Action Post_Mgmt(SUSPEND_ACKNOWLEDGE);
+			Next_State q931_user_null;
+		}
+		Stimulus Q931_EV_MSG_SUSPEND_REJECT {
+			Action Stop_T319;
+			Action Post_Mgmt(SUSPEND_REJECT(cause));
+			Next_State q931_user_active;
+		}
+		Stimulus Q931_EV_MSG_DISCONNECT {
+			Action Stop_T319;
+			Action Post_Mgmt(HANGUP_REQ(cause));
+			Next_State q931_user_disconnect_indication;
+		}
+		Stimulus Q931_EV_MSG_RELEASE {
+			Action Stop_T319;
+			Action Post_Mgmt(HANGUP(cause));
+			Action Send(RELEASE_COMPLETE(cause));
+			Next_State q931_user_null;
+		}
+		Stimulus Q931_EV_TIMEOUT_T319 {
+			Action Post_Mgmt(SUSPEND_REJECT(timeout));
+			Next_State q931_user_active;
+		}
 	}
 
 	State q931_user_resume_request {// aka U17
@@ -164,6 +466,23 @@
 		}
 		Epilog {
 		}
+		Stimulus Q931_EV_MSG_RESUME_ACKNOWLEDGE {
+			Action Stop_T318;
+			Action Post_Mgmt(RESUME_ACKNOWLEDGE);
+			Next_State q931_user_active;
+		}
+		Stimulus Q931_EV_MSG_RESUME_REJECT {
+			Action Stop_T318;
+			Action Post_Mgmt(RESUME_REJECT(cause));
+			Action Release_Call_Reference;
+			Next_State q931_user_null;
+		}
+		Stimulus Q931_EV_TIMEOUT_T318 {
+			Action Post_Mgmt(RESUME_REJECT(timeout));
+			Action Send(RELEASE(cause));
+			Action Start_T308;
+			Next_State q931_user_release_request;
+		}
 	}
 
 	State q931_user_release_request {// aka U19
@@ -174,6 +493,29 @@
 		}
 		Epilog {
 		}
+		Stimulus Q931_EV_MSG_RELEASE_COMPLETE {
+			Action Stop_T308;
+			Action Post_Mgmt(HANGUP_ACKNOWLEDGE);
+			Action Post_Event(Q931_EV_MGMT_DESTROY);
+			Next_State q931_user_null;
+		}
+		Stimulus Q931_EV_MSG_RELEASE {
+			Action Stop_T308;
+			Action Post_Mgmt(HANGUP_ACKNOWLEDGE);
+			Action Post_Event(Q931_EV_MGMT_DESTROY);
+			Next_State q931_user_null;
+		}
+		Stimulus Q931_EV_TIMEOUT_T308 {
+			if (First_Timeout) {
+				Action Send(RELEASE(cause));
+				Action Start_T308;
+			} else {
+				/* B channel should be placed in maintenance mode */
+				Action Post_Mgmt(HANGUP_ACKNOWLEDGE(timeout));
+				Action Post_Event(Q931_EV_MGMT_DESTROY);
+				Next_State q931_user_null;
+			}
+		}
 	}
 
 	State q931_user_overlap_receiving {// aka U25
@@ -184,6 +526,32 @@
 		}
 		Epilog {
 		}
+		Stimulus Q931_EV_MSG_INFORMATION {
+			Action Post_Mgmt(INFORMATION(digits));
+			Action Start_T302;
+		}
+		Stimulus Q931_EV_MGMT_PROCEEDING {
+			Action Stop_T302;
+			Action Send(PROCEEDING);
+			Next_State q931_user_incoming_call_proceeding;
+		}
+		Stimulus Q931_EV_MGMT_ALERTING {
+			Action Stop_T302;
+			Action Send(ALERTING);
+			Next_State q931_user_call_received;
+		}
+		Stimulus Q931_EV_MGMT_CONNECT {
+			Action Stop_T302;
+			Action Send(CONNECT);
+			Action Start_T313;
+			Next_State q931_user_connect_request;
+		}
+		Stimulus Q931_EV_TIMEOUT_T302 {
+			Post_Mgmt(OVERLAP_TIMEOUT);
+		}
+		Stimulus Q931_EV_MGMT_PROGRESS {
+			Action Send(PROGRESS);
+		}
 	}
 
 	State q931_user_call_independent_service {// aka U31
@@ -194,5 +562,20 @@
 		}
 		Epilog {
 		}
+		Stimulus Q931_EV_MSG_FACILITY {
+			Action Post_Mgmt(FACILITY);
+		}
+		Stimulus Q931_EV_MSG_DISCONNECT {
+			Action Send(RELEASE(PRI_CAUSE_NORMAL_CLEARING));
+		}
+		Stimulus Q931_EV_MSG_RELEASE {
+			Action Send(RELEASE_COMPLETE(PRI_CAUSE_NORMAL_CLEARING));
+			Action Post_Event(Q931_EV_MGMT_DESTROY);
+			Next_State q931_user_null;
+		}
+		Stimulus Q931_EV_MSG_RELEASE_COMPLETE {
+			Action Post_Event(Q931_EV_MGMT_DESTROY);
+			Next_State q931_user_null;
+		}
 	}
 }




More information about the svn-commits mailing list