summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2016-07-21 18:26:39 -0500
committerGerrit Code Review <gerrit2@gerrit.digium.api>2016-07-21 18:26:39 -0500
commit0b8448a74be219b98e55b9128c939f8f51859c3b (patch)
tree19d1a2b65e7e3c609e88cf432f73e84c82f6e354 /channels
parentefebb1b9e0c36690b890a891d2735ee84867a522 (diff)
parent676aeede3643dbe9b79fd7117ce7e335f236d151 (diff)
Merge changes from topic 'ASTERISK-26214' into 13
* changes: res_fax: Fix FAXOPT(faxdetect) timeout option. chan_dahdi: Add faxdetect_timeout option.
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_dahdi.c15
-rw-r--r--channels/chan_dahdi.h5
2 files changed, 19 insertions, 1 deletions
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c
index e9d0b5bd3..ae6a8a44c 100644
--- a/channels/chan_dahdi.c
+++ b/channels/chan_dahdi.c
@@ -2348,7 +2348,6 @@ static void my_pri_ss7_open_media(void *p)
if (pvt->dsp_features && pvt->dsp) {
ast_dsp_set_features(pvt->dsp, pvt->dsp_features);
- pvt->dsp_features = 0;
}
}
#endif /* defined(HAVE_PRI) || defined(HAVE_SS7) */
@@ -8643,6 +8642,15 @@ static struct ast_frame *dahdi_read(struct ast_channel *ast)
/* Perform busy detection etc on the dahdi line */
int mute;
+ if ((p->dsp_features & DSP_FEATURE_FAX_DETECT)
+ && p->faxdetect_timeout
+ && p->faxdetect_timeout <= ast_channel_get_up_time(ast)) {
+ p->dsp_features &= ~DSP_FEATURE_FAX_DETECT;
+ ast_dsp_set_features(p->dsp, p->dsp_features);
+ ast_debug(1, "Channel driver fax CNG detection timeout on %s\n",
+ ast_channel_name(ast));
+ }
+
f = ast_dsp_process(ast, p->dsp, &p->subs[idx].f);
/* Check if DSP code thinks we should be muting this frame and mute the conference if so */
@@ -12542,6 +12550,7 @@ static struct dahdi_pvt *mkintf(int channel, const struct dahdi_chan_conf *conf,
tmp->callprogress = conf->chan.callprogress;
tmp->waitfordialtone = conf->chan.waitfordialtone;
tmp->dialtone_detect = conf->chan.dialtone_detect;
+ tmp->faxdetect_timeout = conf->chan.faxdetect_timeout;
tmp->cancallforward = conf->chan.cancallforward;
tmp->dtmfrelax = conf->chan.dtmfrelax;
tmp->callwaiting = tmp->permcallwaiting;
@@ -17793,6 +17802,10 @@ static int process_dahdi(struct dahdi_chan_conf *confp, const char *cat, struct
confp->chan.callprogress |= CALLPROGRESS_FAX_OUTGOING;
} else if (!strcasecmp(v->value, "both") || ast_true(v->value))
confp->chan.callprogress |= CALLPROGRESS_FAX_INCOMING | CALLPROGRESS_FAX_OUTGOING;
+ } else if (!strcasecmp(v->name, "faxdetect_timeout")) {
+ if (sscanf(v->value, "%30u", &confp->chan.faxdetect_timeout) != 1) {
+ confp->chan.faxdetect_timeout = 0;
+ }
} else if (!strcasecmp(v->name, "echocancel")) {
process_echocancel(confp, v->value, v->lineno);
} else if (!strcasecmp(v->name, "echotraining")) {
diff --git a/channels/chan_dahdi.h b/channels/chan_dahdi.h
index 4bb5d19a2..ab5c1eba9 100644
--- a/channels/chan_dahdi.h
+++ b/channels/chan_dahdi.h
@@ -612,6 +612,11 @@ struct dahdi_pvt {
*/
int dialtone_detect;
int dialtone_scanning_time_elapsed; /*!< Amount of audio scanned for dialtone, in frames */
+ /*!
+ * \brief The number of seconds into call to disable fax detection. (0 = disabled)
+ * \note Set from the "faxdetect_timeout" value read in from chan_dahdi.conf
+ */
+ unsigned int faxdetect_timeout;
struct timeval waitingfordt; /*!< Time we started waiting for dialtone */
struct timeval flashtime; /*!< Last flash-hook time */
/*! \brief Opaque DSP configuration structure. */