[libpri-commits] rmudgett: branch 1.4 r1084 - /branches/1.4/q931.c

SVN commits to the libpri project libpri-commits at lists.digium.com
Tue Sep 15 17:24:16 CDT 2009


Author: rmudgett
Date: Tue Sep 15 17:24:12 2009
New Revision: 1084

URL: http://svn.asterisk.org/svn-view/libpri?view=rev&rev=1084
Log:
Timeout events with subcmds should clear any old subcmds.

Modified:
    branches/1.4/q931.c

Modified: branches/1.4/q931.c
URL: http://svn.asterisk.org/svn-view/libpri/branches/1.4/q931.c?view=diff&rev=1084&r1=1083&r2=1084
==============================================================================
--- branches/1.4/q931.c (original)
+++ branches/1.4/q931.c Tue Sep 15 17:24:12 2009
@@ -621,6 +621,20 @@
 	}
 
 	return number_value | number_screening;
+}
+
+static void q931_clr_subcommands(struct pri *ctrl)
+{
+	ctrl->subcmds.counter_subcmd = 0;
+}
+
+struct pri_subcommand *q931_alloc_subcommand(struct pri *ctrl)
+{
+	if (ctrl->subcmds.counter_subcmd < PRI_MAX_SUBCOMMANDS) {
+		return &ctrl->subcmds.subcmd[ctrl->subcmds.counter_subcmd++];
+	}
+
+	return NULL;
 }
 
 static char *code2str(int code, struct msgtype *codes, int max)
@@ -3736,6 +3750,7 @@
 	c->t308_timedout++;
 	c->ourcallstate = Q931_CALL_STATE_NULL;
 	c->peercallstate = Q931_CALL_STATE_NULL;
+	q931_clr_subcommands(ctrl);
 	ctrl->schedev = 1;
 	ctrl->ev.e = PRI_EVENT_HANGUP_ACK;
 	ctrl->ev.hangup.subcmds = &ctrl->subcmds;
@@ -4134,20 +4149,6 @@
 	}
 	/* we did handle hangup properly at this point */
 	return 0;
-}
-
-static void q931_clr_subcommands(struct pri *ctrl)
-{
-	ctrl->subcmds.counter_subcmd = 0;
-}
-
-struct pri_subcommand *q931_alloc_subcommand(struct pri *ctrl)
-{
-	if (ctrl->subcmds.counter_subcmd < PRI_MAX_SUBCOMMANDS) {
-		return &ctrl->subcmds.subcmd[ctrl->subcmds.counter_subcmd++];
-	}
-
-	return NULL;
 }
 
 static int prepare_to_handle_maintenance_message(struct pri *ctrl, q931_mh *mh, q931_call *c)




More information about the libpri-commits mailing list