[asterisk-commits] rmudgett: branch 10 r347007 - in /branches/10: ./ channels/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Dec 5 11:42:40 CST 2011


Author: rmudgett
Date: Mon Dec  5 11:42:36 2011
New Revision: 347007

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=347007
Log:
Restore call progress code for analog ports.

Extracting sig_analog from chan_dahdi lost call progress detection
functionality.

* Fix analog ports from considering a call answered immediately after
dialing has completed if the callprogress option is enabled.

(closes issue ASTERISK-18841)
Reported by: Richard Miller
Patches:
      chan_dahdi.diff (license #5685) patch uploaded by Richard Miller (Modified by me)
      sig_analog.c.diff (license #5685) patch uploaded by Richard Miller (Modified by me)
      sig_analog.h.diff (license #5685) patch uploaded by Richard Miller
........

Merged revisions 347006 from http://svn.asterisk.org/svn/asterisk/branches/1.8

Modified:
    branches/10/   (props changed)
    branches/10/channels/chan_dahdi.c
    branches/10/channels/sig_analog.c
    branches/10/channels/sig_analog.h

Propchange: branches/10/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: branches/10/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/branches/10/channels/chan_dahdi.c?view=diff&rev=347007&r1=347006&r2=347007
==============================================================================
--- branches/10/channels/chan_dahdi.c (original)
+++ branches/10/channels/chan_dahdi.c Mon Dec  5 11:42:36 2011
@@ -3615,7 +3615,18 @@
 	}
 }
 
-
+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 @@
 	.start_polarityswitch = my_start_polarityswitch,
 	.answer_polarityswitch = my_answer_polarityswitch,
 	.hangup_polarityswitch = my_hangup_polarityswitch,
+	.have_progressdetect = my_have_progressdetect,
 };
 
 /*! Round robin search locations. */

Modified: branches/10/channels/sig_analog.c
URL: http://svnview.digium.com/svn/asterisk/branches/10/channels/sig_analog.c?view=diff&rev=347007&r1=347006&r2=347007
==============================================================================
--- branches/10/channels/sig_analog.c (original)
+++ branches/10/channels/sig_analog.c Mon Dec  5 11:42:36 2011
@@ -198,6 +198,15 @@
 		return p->calls->wait_event(p->chan_pvt);
 	}
 	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)
@@ -2744,7 +2753,9 @@
 					}
 				}
 				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)

Modified: branches/10/channels/sig_analog.h
URL: http://svnview.digium.com/svn/asterisk/branches/10/channels/sig_analog.h?view=diff&rev=347007&r1=347006&r2=347007
==============================================================================
--- branches/10/channels/sig_analog.h (original)
+++ branches/10/channels/sig_analog.h Mon Dec  5 11:42:36 2011
@@ -235,6 +235,7 @@
 	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);
 };
 
 




More information about the asterisk-commits mailing list