From 6c452a64086f85b72b5e566d74677e292233910e Mon Sep 17 00:00:00 2001
From: Matthew Fredrickson <creslin@digium.com>
Date: Sat, 27 Oct 2007 00:43:59 +0000
Subject: [PATCH] Make sure we turn on the DSP when we answer the call

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@87231 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 channels/chan_zap.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/channels/chan_zap.c b/channels/chan_zap.c
index 9428a43594..0b2fb8885b 100644
--- a/channels/chan_zap.c
+++ b/channels/chan_zap.c
@@ -5604,7 +5604,7 @@ static struct ast_channel *zt_new(struct zt_pvt *i, int state, int startpbx, int
 				i->dsp = NULL;
 			if (i->dsp) {
 				i->dsp_features = features & ~DSP_PROGRESS_TALK;
-#ifdef HAVE_PRI
+#if defined(HAVE_PRI) || defined(HAVE_SS7)
 				/* We cannot do progress detection until receives PROGRESS message */
 				if (i->outgoing && ((i->sig == SIG_PRI) || (i->sig == SIG_SS7))) {
 					/* Remember requested DSP features, don't treat
@@ -8699,6 +8699,10 @@ static void *ss7_linkset(void *data)
 						ast_debug(1, "Queuing frame PROGRESS on CIC %d\n", p->cic);
 						zap_queue_frame(p, &f, linkset);
 						p->progress = 1;
+						if (p->dsp && p->dsp_features) {
+						        ast_dsp_set_features(p->dsp, p->dsp_features);
+						        p->dsp_features = 0;
+						}
 					}
 					break;
 				default:
@@ -8978,6 +8982,10 @@ static void *ss7_linkset(void *data)
 					p = linkset->pvts[chanpos];
 					ast_mutex_lock(&p->lock);
 					p->subs[SUB_REAL].needanswer = 1;
+					if (p->dsp && p->dsp_features) {
+					        ast_dsp_set_features(p->dsp, p->dsp_features);
+					        p->dsp_features = 0;
+					}
 					zt_enable_ec(p);
 					ast_mutex_unlock(&p->lock);
 				}
-- 
GitLab