[svn-commits] rmudgett: branch 1.4 r2079 - in /branches/1.4: ./ doc/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Oct 21 13:00:06 CDT 2010


Author: rmudgett
Date: Thu Oct 21 13:00:03 2010
New Revision: 2079

URL: http://svnview.digium.com/svn/libpri?view=rev&rev=2079
Log:
Fixes CC agents not automatically clearing if T309 clears the original call.

Incoming calls with CC enabled will not automatically clear the CC offer
record when the call is aborted by T309 processing.  All CC agent FSM's
have this problem (PTMP, PTP, and Q.SIG).

To reproduce:
1) Place incoming call to Asterisk/libpri
2) Either before or after the call is answered, bring the ISDN link down.
3) T309 processing, T309 timeout, or TEI removal will leave the CC agent
FSM in the CC available state.

The problem is indicated by the "cc report status" CLI command showing a
status of CC offered to caller but it will never timeout.

The FSM's can be manually cleared by using the "cc cancel all" or "cc
cancel core" CLI commands.

JIRA LIBPRI-46
JIRA SWP-2241

Modified:
    branches/1.4/doc/cc_ptmp_agent.fsm
    branches/1.4/doc/cc_ptmp_agent_flattened.fsm
    branches/1.4/doc/cc_ptp_agent.fsm
    branches/1.4/doc/cc_ptp_agent_flattened.fsm
    branches/1.4/doc/cc_qsig_agent.fsm
    branches/1.4/doc/cc_qsig_agent_flattened.fsm
    branches/1.4/pri_cc.c
    branches/1.4/pri_internal.h
    branches/1.4/q931.c

Modified: branches/1.4/doc/cc_ptmp_agent.fsm
URL: http://svnview.digium.com/svn/libpri/branches/1.4/doc/cc_ptmp_agent.fsm?view=diff&rev=2079&r1=2078&r2=2079
==============================================================================
--- branches/1.4/doc/cc_ptmp_agent.fsm (original)
+++ branches/1.4/doc/cc_ptmp_agent.fsm Thu Oct 21 13:00:03 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: branches/1.4/doc/cc_ptmp_agent_flattened.fsm
URL: http://svnview.digium.com/svn/libpri/branches/1.4/doc/cc_ptmp_agent_flattened.fsm?view=diff&rev=2079&r1=2078&r2=2079
==============================================================================
--- branches/1.4/doc/cc_ptmp_agent_flattened.fsm (original)
+++ branches/1.4/doc/cc_ptmp_agent_flattened.fsm Thu Oct 21 13:00:03 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: branches/1.4/doc/cc_ptp_agent.fsm
URL: http://svnview.digium.com/svn/libpri/branches/1.4/doc/cc_ptp_agent.fsm?view=diff&rev=2079&r1=2078&r2=2079
==============================================================================
--- branches/1.4/doc/cc_ptp_agent.fsm (original)
+++ branches/1.4/doc/cc_ptp_agent.fsm Thu Oct 21 13:00:03 2010
@@ -24,6 +24,10 @@
 		Stimulus CC_EVENT_MSG_DISCONNECT {
 			Action Send_CC_Available(Q931_DISCONNECT);
 			Next_State CC_STATE_AVAILABLE;
+		}
+		Stimulus CC_EVENT_INTERNAL_CLEARING {
+			Action Pass_Up_CC_Cancel;
+			Next_State CC_STATE_IDLE;
 		}
 		Stimulus CC_EVENT_CANCEL {
 			Next_State CC_STATE_IDLE;
@@ -52,6 +56,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 Pass_Up_CC_Cancel;

Modified: branches/1.4/doc/cc_ptp_agent_flattened.fsm
URL: http://svnview.digium.com/svn/libpri/branches/1.4/doc/cc_ptp_agent_flattened.fsm?view=diff&rev=2079&r1=2078&r2=2079
==============================================================================
--- branches/1.4/doc/cc_ptp_agent_flattened.fsm (original)
+++ branches/1.4/doc/cc_ptp_agent_flattened.fsm Thu Oct 21 13:00:03 2010
@@ -19,6 +19,11 @@
 		Stimulus CC_EVENT_MSG_DISCONNECT {
 			Action Send_CC_Available(Q931_DISCONNECT);
 			Next_State CC_STATE_AVAILABLE;
+		}
+		Stimulus CC_EVENT_INTERNAL_CLEARING {
+			Action Pass_Up_CC_Cancel;
+			Action Set_Selfdestruct;
+			Next_State CC_STATE_IDLE;
 		}
 		Stimulus CC_EVENT_CANCEL {
 			Action Set_Selfdestruct;
@@ -46,6 +51,10 @@
 			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 Pass_Up_CC_Cancel;
 			Action Stop_T_RETENTION;

Modified: branches/1.4/doc/cc_qsig_agent.fsm
URL: http://svnview.digium.com/svn/libpri/branches/1.4/doc/cc_qsig_agent.fsm?view=diff&rev=2079&r1=2078&r2=2079
==============================================================================
--- branches/1.4/doc/cc_qsig_agent.fsm (original)
+++ branches/1.4/doc/cc_qsig_agent.fsm Thu Oct 21 13:00:03 2010
@@ -40,6 +40,10 @@
 			/* Send Q931_CALL_PROCEEDING message on signaling link. */
 			Action Send_Call_Proceeding;
 			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 Pass_Up_CC_Cancel;

Modified: branches/1.4/doc/cc_qsig_agent_flattened.fsm
URL: http://svnview.digium.com/svn/libpri/branches/1.4/doc/cc_qsig_agent_flattened.fsm?view=diff&rev=2079&r1=2078&r2=2079
==============================================================================
--- branches/1.4/doc/cc_qsig_agent_flattened.fsm (original)
+++ branches/1.4/doc/cc_qsig_agent_flattened.fsm Thu Oct 21 13:00:03 2010
@@ -33,6 +33,10 @@
 			Action Send_Call_Proceeding;
 			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 Pass_Up_CC_Cancel;

Modified: branches/1.4/pri_cc.c
URL: http://svnview.digium.com/svn/libpri/branches/1.4/pri_cc.c?view=diff&rev=2079&r1=2078&r2=2079
==============================================================================
--- branches/1.4/pri_cc.c (original)
+++ branches/1.4/pri_cc.c Thu Oct 21 13:00:03 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);
@@ -5275,6 +5289,11 @@
 		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_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_set_self_destruct(ctrl, cc_record);
 		cc_record->state = CC_STATE_IDLE;
@@ -5314,6 +5333,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_pass_up_cc_cancel(ctrl, cc_record);
@@ -5913,6 +5936,10 @@
 		pri_cc_act_send_call_proceeding(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_pass_up_cc_cancel(ctrl, cc_record);

Modified: branches/1.4/pri_internal.h
URL: http://svnview.digium.com/svn/libpri/branches/1.4/pri_internal.h?view=diff&rev=2079&r1=2078&r2=2079
==============================================================================
--- branches/1.4/pri_internal.h (original)
+++ branches/1.4/pri_internal.h Thu Oct 21 13:00:03 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: branches/1.4/q931.c
URL: http://svnview.digium.com/svn/libpri/branches/1.4/q931.c?view=diff&rev=2079&r1=2078&r2=2079
==============================================================================
--- branches/1.4/q931.c (original)
+++ branches/1.4/q931.c Thu Oct 21 13:00:03 2010
@@ -8472,22 +8472,31 @@
 		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);
+		} else 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