diff options
author | Doug Bailey <dbailey@digium.com> | 2009-01-07 17:05:37 +0000 |
---|---|---|
committer | Doug Bailey <dbailey@digium.com> | 2009-01-07 17:05:37 +0000 |
commit | 08e142b1e7a239b8f0a19f062803e746a6023388 (patch) | |
tree | 8f21da6eba7adaf58c6e74c7dc1751a8d9a708bf | |
parent | 82af1445e72b97bcdba20c47b8a854d2bc9d5dae (diff) |
Cleanup fsk spill if off hook is detected during mwi spill.
Correct logic error in handling events when sending mwi spill
(closes issue #14143)
Reported by: alecdavis
Patches:
chan_dahdi.handle_init_event2.diff.txt uploaded by dbailey
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@167416 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r-- | channels/chan_dahdi.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c index 218d55079..043f1a1c6 100644 --- a/channels/chan_dahdi.c +++ b/channels/chan_dahdi.c @@ -7824,6 +7824,17 @@ static int mwi_send_process_event(struct dahdi_pvt * pvt, int event) } } break; + /* Going off hook, I need to punt this spill */ + case DAHDI_EVENT_RINGOFFHOOK: + if (pvt->cidspill) { + ast_free(pvt->cidspill); + pvt->cidspill = NULL; + pvt->cidpos = 0; + pvt->cidlen = 0; + } + pvt->mwisend_data.mwisend_current = MWI_SEND_DONE; + pvt->mwisendactive = 0; + break; case DAHDI_EVENT_RINGERON: case DAHDI_EVENT_HOOKCOMPLETE: break; @@ -8271,7 +8282,7 @@ static void *do_monitor(void *data) ast_debug(1, "Monitor doohicky got event %s on channel %d\n", event2str(res), i->channel); /* Don't hold iflock while handling init events */ ast_mutex_unlock(&iflock); - if (0 == i->mwisendactive || 0 != mwi_send_process_event(i, res)) { + if (0 == i->mwisendactive || 0 == mwi_send_process_event(i, res)) { handle_init_event(i, res); } ast_mutex_lock(&iflock); |