[svn-commits] rmudgett: branch rmudgett/t309_cc r2059 - in /team/rmudgett/t309_cc: ./ doc/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Oct 20 13:57:30 CDT 2010


Author: rmudgett
Date: Wed Oct 20 13:57:27 2010
New Revision: 2059

URL: http://svnview.digium.com/svn/libpri?view=rev&rev=2059
Log:
PTMP agent handling of T309 abnormal call clearing.

Modified:
    team/rmudgett/t309_cc/doc/cc_ptmp_agent.fsm
    team/rmudgett/t309_cc/doc/cc_ptmp_agent_flattened.fsm
    team/rmudgett/t309_cc/pri_cc.c
    team/rmudgett/t309_cc/pri_internal.h
    team/rmudgett/t309_cc/q931.c

Modified: team/rmudgett/t309_cc/doc/cc_ptmp_agent.fsm
URL: http://svnview.digium.com/svn/libpri/team/rmudgett/t309_cc/doc/cc_ptmp_agent.fsm?view=diff&rev=2059&r1=2058&r2=2059
==============================================================================
--- team/rmudgett/t309_cc/doc/cc_ptmp_agent.fsm (original)
+++ team/rmudgett/t309_cc/doc/cc_ptmp_agent.fsm Wed Oct 20 13:57:27 2010
@@ -25,7 +25,13 @@
 			Action Send_CC_Available(Q931_DISCONNECT);
 			Next_State CC_STATE_AVAILABLE;
 		}
-		Stimulus CC_EVENT_CANCEL {
+		Stimulus CC_EVENT_INTERNAL_CLEARING {
+			Action Release_LinkID;
+			Action Pass_Up_CC_Cancel;
+			Next_State CC_STATE_IDLE;
+		}
+		Stimulus CC_EVENT_CANCEL {
+			Action Release_LinkID;
 			Next_State CC_STATE_IDLE;
 		}
 	}
@@ -44,6 +50,10 @@
 		Stimulus CC_EVENT_CC_REQUEST {
 			Action Pass_Up_CC_Request;
 			Next_State CC_STATE_REQUESTED;
+		}
+		Stimulus CC_EVENT_INTERNAL_CLEARING {
+			Action Stop_T_RETENTION;
+			Action Start_T_RETENTION;
 		}
 		Stimulus CC_EVENT_TIMEOUT_T_RETENTION {
 			Action Send_EraseCallLinkageID;

Modified: team/rmudgett/t309_cc/doc/cc_ptmp_agent_flattened.fsm
URL: http://svnview.digium.com/svn/libpri/team/rmudgett/t309_cc/doc/cc_ptmp_agent_flattened.fsm?view=diff&rev=2059&r1=2058&r2=2059
==============================================================================
--- team/rmudgett/t309_cc/doc/cc_ptmp_agent_flattened.fsm (original)
+++ team/rmudgett/t309_cc/doc/cc_ptmp_agent_flattened.fsm Wed Oct 20 13:57:27 2010
@@ -20,7 +20,14 @@
 			Action Send_CC_Available(Q931_DISCONNECT);
 			Next_State CC_STATE_AVAILABLE;
 		}
-		Stimulus CC_EVENT_CANCEL {
+		Stimulus CC_EVENT_INTERNAL_CLEARING {
+			Action Release_LinkID;
+			Action Pass_Up_CC_Cancel;
+			Action Set_Selfdestruct;
+			Next_State CC_STATE_IDLE;
+		}
+		Stimulus CC_EVENT_CANCEL {
+			Action Release_LinkID;
 			Action Set_Selfdestruct;
 			Next_State CC_STATE_IDLE;
 		}
@@ -38,6 +45,10 @@
 			Action Pass_Up_CC_Request;
 			Action Stop_T_RETENTION;
 			Next_State CC_STATE_REQUESTED;
+		}
+		Stimulus CC_EVENT_INTERNAL_CLEARING {
+			Action Stop_T_RETENTION;
+			Action Start_T_RETENTION;
 		}
 		Stimulus CC_EVENT_TIMEOUT_T_RETENTION {
 			Action Send_EraseCallLinkageID;

Modified: team/rmudgett/t309_cc/pri_cc.c
URL: http://svnview.digium.com/svn/libpri/team/rmudgett/t309_cc/pri_cc.c?view=diff&rev=2059&r1=2058&r2=2059
==============================================================================
--- team/rmudgett/t309_cc/pri_cc.c (original)
+++ team/rmudgett/t309_cc/pri_cc.c Wed Oct 20 13:57:27 2010
@@ -2613,6 +2613,9 @@
 	case CC_EVENT_CANCEL:
 		str = "CC_EVENT_CANCEL";
 		break;
+	case CC_EVENT_INTERNAL_CLEARING:
+		str = "CC_EVENT_INTERNAL_CLEARING";
+		break;
 	case CC_EVENT_SIGNALING_GONE:
 		str = "CC_EVENT_SIGNALING_GONE";
 		break;
@@ -4351,7 +4354,14 @@
 		pri_cc_act_send_cc_available(ctrl, cc_record, call, Q931_DISCONNECT);
 		cc_record->state = CC_STATE_AVAILABLE;
 		break;
+	case CC_EVENT_INTERNAL_CLEARING:
+		pri_cc_act_release_link_id(ctrl, cc_record);
+		pri_cc_act_pass_up_cc_cancel(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_release_link_id(ctrl, cc_record);
 		pri_cc_act_set_self_destruct(ctrl, cc_record);
 		cc_record->state = CC_STATE_IDLE;
 		break;
@@ -4383,6 +4393,10 @@
 		pri_cc_act_pass_up_cc_request(ctrl, cc_record);
 		pri_cc_act_stop_t_retention(ctrl, cc_record);
 		cc_record->state = CC_STATE_REQUESTED;
+		break;
+	case CC_EVENT_INTERNAL_CLEARING:
+		pri_cc_act_stop_t_retention(ctrl, cc_record);
+		pri_cc_act_start_t_retention(ctrl, cc_record);
 		break;
 	case CC_EVENT_TIMEOUT_T_RETENTION:
 		pri_cc_act_send_erase_call_linkage_id(ctrl, cc_record);

Modified: team/rmudgett/t309_cc/pri_internal.h
URL: http://svnview.digium.com/svn/libpri/team/rmudgett/t309_cc/pri_internal.h?view=diff&rev=2059&r1=2058&r2=2059
==============================================================================
--- team/rmudgett/t309_cc/pri_internal.h (original)
+++ team/rmudgett/t309_cc/pri_internal.h Wed Oct 20 13:57:27 2010
@@ -664,6 +664,8 @@
 	CC_EVENT_LINK_CANCEL,
 	/*! Tear down CC request from upper layer. */
 	CC_EVENT_CANCEL,
+	/*! Abnormal clearing of original call.  (T309 processing/T309 timeout/TEI removal) */
+	CC_EVENT_INTERNAL_CLEARING,
 	/*! Received message indicating tear down of CC signaling link completed. */
 	CC_EVENT_SIGNALING_GONE,
 	/*! Delayed hangup request for the signaling link to allow subcmd events to be passed up. */

Modified: team/rmudgett/t309_cc/q931.c
URL: http://svnview.digium.com/svn/libpri/team/rmudgett/t309_cc/q931.c?view=diff&rev=2059&r1=2058&r2=2059
==============================================================================
--- team/rmudgett/t309_cc/q931.c (original)
+++ team/rmudgett/t309_cc/q931.c Wed Oct 20 13:57:27 2010
@@ -8472,22 +8472,32 @@
 		pri_message(ctrl, "clearing, alive %d, hangupack %d\n", c->alive, c->sendhangupack);
 	}
 
-	if (c->cc.record && c->cc.record->signaling == c) {
-		pri_cc_event(ctrl, c, c->cc.record, CC_EVENT_SIGNALING_GONE);
+	if (c->cc.record) {
+		if (c->cc.record->signaling == c) {
+			pri_cc_event(ctrl, c, c->cc.record, CC_EVENT_SIGNALING_GONE);
+		}
+		if (c->cc.record->original_call == c) {
+			pri_cc_event(ctrl, c, c->cc.record, CC_EVENT_INTERNAL_CLEARING);
+		}
 	}
 
 	/* Free resources */
 	if (c->alive) {
+		c->alive = 0;
 		ctrl->ev.e = PRI_EVENT_HANGUP;
 		res = Q931_RES_HAVEEVENT;
-		c->alive = 0;
 	} else if (c->sendhangupack) {
+		pri_hangup(ctrl, c, c->cause);
+		ctrl->ev.e = PRI_EVENT_HANGUP_ACK;
 		res = Q931_RES_HAVEEVENT;
-		ctrl->ev.e = PRI_EVENT_HANGUP_ACK;
+	} else {
 		pri_hangup(ctrl, c, c->cause);
-	} else {
-		res = 0;
-		pri_hangup(ctrl, c, c->cause);
+		if (ctrl->subcmds.counter_subcmd) {
+			q931_fill_facility_event(ctrl, ctrl->link.dummy_call);
+			res = Q931_RES_HAVEEVENT;
+		} else {
+			res = 0;
+		}
 	}
 
 	return res;




More information about the svn-commits mailing list