diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c index aa3c71fd849a60f0d08c981e90ea8a31801ddfb6..f0ae82650e2b66c4117b41cd63549381df42df9f 100644 --- a/channels/chan_dahdi.c +++ b/channels/chan_dahdi.c @@ -3615,7 +3615,18 @@ static void my_handle_notify_message(struct ast_channel *chan, void *pvt, int ci } } +static int my_have_progressdetect(void *pvt) +{ + struct dahdi_pvt *p = pvt; + if ((p->callprogress & CALLPROGRESS_PROGRESS) + && CANPROGRESSDETECT(p) && p->dsp && p->outgoing) { + return 1; + } else { + /* Don't have progress detection. */ + return 0; + } +} static struct analog_callback dahdi_analog_callbacks = { @@ -3683,6 +3694,7 @@ static struct analog_callback dahdi_analog_callbacks = .start_polarityswitch = my_start_polarityswitch, .answer_polarityswitch = my_answer_polarityswitch, .hangup_polarityswitch = my_hangup_polarityswitch, + .have_progressdetect = my_have_progressdetect, }; /*! Round robin search locations. */ diff --git a/channels/sig_analog.c b/channels/sig_analog.c index 00356376734c7ed1fca16eacf8c2b18a700c8a0c..edfd0da9ec4c1478b0ccdec61ff19d90b1807bee 100644 --- a/channels/sig_analog.c +++ b/channels/sig_analog.c @@ -200,6 +200,15 @@ static int analog_wait_event(struct analog_pvt *p) return -1; } +static int analog_have_progressdetect(struct analog_pvt *p) +{ + if (p->calls->have_progressdetect) { + return p->calls->have_progressdetect(p->chan_pvt); + } + /* Don't have progress detection. */ + return 0; +} + enum analog_cid_start analog_str_to_cidstart(const char *value) { if (!strcasecmp(value, "ring")) { @@ -2744,7 +2753,9 @@ static struct ast_frame *__analog_handle_event(struct analog_pvt *p, struct ast_ } } if (ast->_state == AST_STATE_DIALING) { - if (analog_check_confirmanswer(p) || (!p->dialednone + if (analog_have_progressdetect(p)) { + ast_debug(1, "Done dialing, but waiting for progress detection before doing more...\n"); + } else if (analog_check_confirmanswer(p) || (!p->dialednone && ((mysig == ANALOG_SIG_EM) || (mysig == ANALOG_SIG_EM_E1) || (mysig == ANALOG_SIG_EMWINK) || (mysig == ANALOG_SIG_FEATD) || (mysig == ANALOG_SIG_FEATDMF_TA) || (mysig == ANALOG_SIG_FEATDMF) diff --git a/channels/sig_analog.h b/channels/sig_analog.h index 0f1a6563d5f4772d9263745fa3b1a0c55e52b240..fd19b535282daafcd8244aab8b1272e8c0a48d07 100644 --- a/channels/sig_analog.h +++ b/channels/sig_analog.h @@ -235,6 +235,7 @@ struct analog_callback { void (* const set_new_owner)(void *pvt, struct ast_channel *new_owner); const char *(* const get_orig_dialstring)(void *pvt); + int (* const have_progressdetect)(void *pvt); };