[libpri-commits] rmudgett: branch rmudgett/facility r1083 - /team/rmudgett/facility/q931.c

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


Author: rmudgett
Date: Tue Sep 15 17:14:23 2009
New Revision: 1083

URL: http://svn.asterisk.org/svn-view/libpri?view=rev&rev=1083
Log:
A couple more places needing subcmds.

Modified:
    team/rmudgett/facility/q931.c

Modified: team/rmudgett/facility/q931.c
URL: http://svn.asterisk.org/svn-view/libpri/team/rmudgett/facility/q931.c?view=diff&rev=1083&r1=1082&r2=1083
==============================================================================
--- team/rmudgett/facility/q931.c (original)
+++ team/rmudgett/facility/q931.c Tue Sep 15 17:14:23 2009
@@ -655,6 +655,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)
@@ -3795,6 +3809,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;
@@ -4087,11 +4102,13 @@
 
 	UPDATE_HOLD_STATE(ctrl, call, Q931_HOLD_STATE_IDLE);
 
+	q931_clr_subcommands(ctrl);
 	ctrl->schedev = 1;
 	ctrl->ev.e = PRI_EVENT_HOLD_REJ;
 	ctrl->ev.hold_rej.channel = q931_encode_channel(call);
 	ctrl->ev.hold_rej.call = call;
 	ctrl->ev.hold_rej.cause = PRI_CAUSE_MESSAGE_TYPE_NONEXIST;
+	ctrl->ev.hold_rej.subcmds = &ctrl->subcmds;
 }
 
 /*!
@@ -4279,11 +4296,13 @@
 	call->ds1explicit = 0;
 	call->chanflags = 0;
 
+	q931_clr_subcommands(ctrl);
 	ctrl->schedev = 1;
 	ctrl->ev.e = PRI_EVENT_RETRIEVE_REJ;
 	ctrl->ev.retrieve_rej.channel = q931_encode_channel(call);
 	ctrl->ev.retrieve_rej.call = call;
 	ctrl->ev.retrieve_rej.cause = PRI_CAUSE_MESSAGE_TYPE_NONEXIST;
+	ctrl->ev.retrieve_rej.subcmds = &ctrl->subcmds;
 }
 
 /*!
@@ -4573,20 +4592,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