[svn-commits] rmudgett: branch 1.8 r347006 - /branches/1.8/channels/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Dec 5 11:39:37 CST 2011


Author: rmudgett
Date: Mon Dec  5 11:39:33 2011
New Revision: 347006

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=347006
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

Modified:
    branches/1.8/channels/chan_dahdi.c
    branches/1.8/channels/sig_analog.c
    branches/1.8/channels/sig_analog.h

Modified: branches/1.8/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/channels/chan_dahdi.c?view=diff&rev=347006&r1=347005&r2=347006
==============================================================================
--- branches/1.8/channels/chan_dahdi.c (original)
+++ branches/1.8/channels/chan_dahdi.c Mon Dec  5 11:39:33 2011
@@ -3576,7 +3576,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 =
 {
@@ -3644,6 +3655,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/1.8/channels/sig_analog.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/channels/sig_analog.c?view=diff&rev=347006&r1=347005&r2=347006
==============================================================================
--- branches/1.8/channels/sig_analog.c (original)
+++ branches/1.8/channels/sig_analog.c Mon Dec  5 11:39:33 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)
@@ -2741,7 +2750,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/1.8/channels/sig_analog.h
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/channels/sig_analog.h?view=diff&rev=347006&r1=347005&r2=347006
==============================================================================
--- branches/1.8/channels/sig_analog.h (original)
+++ branches/1.8/channels/sig_analog.h Mon Dec  5 11:39:33 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 svn-commits mailing list