Timeout events with subcmds should clear any old subcmds.

git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1084 2fbb986a-6c06-0410-b554-c9c1f0a7f128
This commit is contained in:
Richard Mudgett 2009-09-15 22:24:12 +00:00
parent 25b2496b0f
commit c8de5d057b

29
q931.c
View File

@ -623,6 +623,20 @@ int q931_party_id_presentation(const struct q931_party_id *id)
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)
{
int x;
@ -3736,6 +3750,7 @@ static void pri_release_finaltimeout(void *data)
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;
@ -4136,20 +4151,6 @@ int q931_hangup(struct pri *ctrl, q931_call *c, int cause)
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)
{
if ((!ctrl) || (!mh) || (!c)) {