summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2009-08-10 15:53:23 +0000
committerRichard Mudgett <rmudgett@digium.com>2009-08-10 15:53:23 +0000
commitbc0a3453cdc2b5544cbf36074b0ea9bc2e30439c (patch)
tree0e2a92556be2297fe018ae1b7bba3f0a1016cd1a /channels
parent724c1239fc41020818a279f3587586c437671268 (diff)
Restoring some code to sig_pri. Not sure if it is really needed.
Putting some DSP code back into sig_pri that was removed by the chan_dahdi/sig_pri reorganization. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@211392 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_dahdi.c7
-rw-r--r--channels/sig_pri.c19
-rw-r--r--channels/sig_pri.h1
3 files changed, 24 insertions, 3 deletions
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c
index d704c4aa5..2a979dd66 100644
--- a/channels/chan_dahdi.c
+++ b/channels/chan_dahdi.c
@@ -2614,6 +2614,7 @@ static struct sig_pri_callback dahdi_pri_callbacks =
.handle_dchan_exception = my_handle_dchan_exception,
.play_tone = my_pri_play_tone,
.set_echocanceller = my_set_echocanceller,
+ .dsp_reset_and_flush_digits = my_dsp_reset_and_flush_digits,
.lock_private = my_lock_private,
.unlock_private = my_unlock_private,
.new_ast_channel = my_new_pri_ast_channel,
@@ -8040,9 +8041,9 @@ static struct ast_channel *dahdi_new(struct dahdi_pvt *i, int state, int startpb
i->dsp = NULL;
if (i->dsp) {
i->dsp_features = features;
-#if defined(HAVE_SS7)
- /* We cannot do progress detection until receives PROGRESS message */
- if (i->outgoing && (i->sig == SIG_SS7)) {
+#if defined(HAVE_PRI) || defined(HAVE_SS7)
+ /* We cannot do progress detection until receive PROGRESS message */
+ if (i->outgoing && ((i->sig == SIG_PRI) || (i->sig == SIG_BRI) || (i->sig == SIG_BRI_PTMP) || (i->sig == SIG_SS7))) {
/* Remember requested DSP features, don't treat
talking as ANSWER */
i->dsp_features = features & ~DSP_PROGRESS_TALK;
diff --git a/channels/sig_pri.c b/channels/sig_pri.c
index d6f732138..6d9bf66b9 100644
--- a/channels/sig_pri.c
+++ b/channels/sig_pri.c
@@ -192,6 +192,22 @@ static inline int pri_grab(struct sig_pri_chan *p, struct sig_pri_pri *pri)
return 0;
}
+/*!
+ * \internal
+ * \brief Reset DTMF detector.
+ * \since 1.6.3
+ *
+ * \param p sig_pri channel structure.
+ *
+ * \return Nothing
+ */
+static void sig_pri_dsp_reset_and_flush_digits(struct sig_pri_chan *p)
+{
+ if (p->calls->dsp_reset_and_flush_digits) {
+ p->calls->dsp_reset_and_flush_digits(p->chan_pvt);
+ }
+}
+
static int sig_pri_set_echocanceller(struct sig_pri_chan *p, int enable)
{
if (p->calls->set_echocanceller)
@@ -618,6 +634,8 @@ static void *pri_ss_thread(void *data)
ast_verb(3, "Starting simple switch on '%s'\n", chan->name);
+ sig_pri_dsp_reset_and_flush_digits(p);
+
/* Now loop looking for an extension */
ast_copy_string(exten, p->exten, sizeof(exten));
len = strlen(exten);
@@ -652,6 +670,7 @@ static void *pri_ss_thread(void *data)
if (ast_exists_extension(chan, chan->context, exten, 1, p->cid_num)) {
/* Start the real PBX */
ast_copy_string(chan->exten, exten, sizeof(chan->exten));
+ sig_pri_dsp_reset_and_flush_digits(p);
sig_pri_set_echocanceller(p, 1);
ast_setstate(chan, AST_STATE_RING);
res = ast_pbx_run(chan);
diff --git a/channels/sig_pri.h b/channels/sig_pri.h
index 11b1e9fd9..7179d5639 100644
--- a/channels/sig_pri.h
+++ b/channels/sig_pri.h
@@ -63,6 +63,7 @@ struct sig_pri_callback {
int (* const set_echocanceller)(void *pvt, int enable);
int (* const train_echocanceller)(void *pvt);
+ int (* const dsp_reset_and_flush_digits)(void *pvt);
struct ast_channel * (* const new_ast_channel)(void *pvt, int state, int startpbx, enum sig_pri_law law, int transfercapability, char *exten, const struct ast_channel *chan);