From c93dfbae5f1889f39b429183be18272964c35b2f Mon Sep 17 00:00:00 2001 From: Joshua Colp Date: Thu, 21 Feb 2008 16:38:11 +0000 Subject: [PATCH] If inband audio is being provided with a disconnect message let the audio be heard before releasing the channel. (closes issue #10552) Reported by: paravoid Patches: disconnect-audio.diff uploaded by paravoid (license 200) git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@528 2fbb986a-6c06-0410-b554-c9c1f0a7f128 --- q931.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/q931.c b/q931.c index b6fa459..5621103 100644 --- a/q931.c +++ b/q931.c @@ -3716,6 +3716,12 @@ int q931_receive(struct pri *pri, q931_h *h, int len) UPDATE_OURCALLSTATE(pri, c, Q931_CALL_STATE_DISCONNECT_INDICATION); c->peercallstate = Q931_CALL_STATE_DISCONNECT_REQUEST; c->sendhangupack = 1; + + /* wait for a RELEASE so that sufficient time has passed + for the inband audio to be heard */ + if (c->progressmask & PRI_PROG_INBAND_AVAILABLE) + break; + /* Return such an event */ pri->ev.e = PRI_EVENT_HANGUP_REQ; pri->ev.hangup.channel = c->channelno | (c->ds1no << 8) | (c->ds1explicit << 16);