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

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Aug 8 14:58:56 CDT 2012


Author: rmudgett
Date: Wed Aug  8 14:58:52 2012
New Revision: 370900

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=370900
Log:
Fix the analog dial *0 flash-hook of bridged peer feature.

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=370900&r1=370899&r2=370900
==============================================================================
--- branches/1.8/channels/chan_dahdi.c (original)
+++ branches/1.8/channels/chan_dahdi.c Wed Aug  8 14:58:52 2012
@@ -1546,6 +1546,47 @@
 	return handles;
 }
 
+static int analog_lib_handles(int signalling, int radio, int oprmode)
+{
+	switch (signalling) {
+	case SIG_FXOLS:
+	case SIG_FXOGS:
+	case SIG_FXOKS:
+	case SIG_FXSLS:
+	case SIG_FXSGS:
+	case SIG_FXSKS:
+	case SIG_EMWINK:
+	case SIG_EM:
+	case SIG_EM_E1:
+	case SIG_FEATD:
+	case SIG_FEATDMF:
+	case SIG_E911:
+	case SIG_FGC_CAMA:
+	case SIG_FGC_CAMAMF:
+	case SIG_FEATB:
+	case SIG_SFWINK:
+	case SIG_SF:
+	case SIG_SF_FEATD:
+	case SIG_SF_FEATDMF:
+	case SIG_FEATDMF_TA:
+	case SIG_SF_FEATB:
+		break;
+	default:
+		/* The rest of the function should cover the remainder of signalling types */
+		return 0;
+	}
+
+	if (radio) {
+		return 0;
+	}
+
+	if (oprmode) {
+		return 0;
+	}
+
+	return 1;
+}
+
 static enum analog_sigtype dahdisig_to_analogsig(int sig)
 {
 	switch (sig) {
@@ -2196,11 +2237,16 @@
 
 static void *my_get_sigpvt_bridged_channel(struct ast_channel *chan)
 {
-	struct dahdi_pvt *p = ast_bridged_channel(chan)->tech_pvt;
-	if (p)
-		return p->sig_pvt;
-	else
-		return NULL;
+	struct ast_channel *bridged = ast_bridged_channel(chan);
+
+	if (bridged && bridged->tech == &dahdi_tech) {
+		struct dahdi_pvt *p = bridged->tech_pvt;
+
+		if (analog_lib_handles(p->sig, p->radio, p->oprmode)) {
+			return p->sig_pvt;
+		}
+	}
+	return NULL;
 }
 
 static int my_get_sub_fd(void *pvt, enum analog_sub sub)
@@ -4653,45 +4699,6 @@
 }
 
 #define sig2str dahdi_sig2str
-
-static int analog_lib_handles(int signalling, int radio, int oprmode)
-{
-	switch (signalling) {
-	case SIG_FXOLS:
-	case SIG_FXOGS:
-	case SIG_FXOKS:
-	case SIG_FXSLS:
-	case SIG_FXSGS:
-	case SIG_FXSKS:
-	case SIG_EMWINK:
-	case SIG_EM:
-	case SIG_EM_E1:
-	case SIG_FEATD:
-	case SIG_FEATDMF:
-	case SIG_E911:
-	case SIG_FGC_CAMA:
-	case SIG_FGC_CAMAMF:
-	case SIG_FEATB:
-	case SIG_SFWINK:
-	case SIG_SF:
-	case SIG_SF_FEATD:
-	case SIG_SF_FEATDMF:
-	case SIG_FEATDMF_TA:
-	case SIG_SF_FEATB:
-		break;
-	default:
-		/* The rest of the function should cover the remainder of signalling types */
-		return 0;
-	}
-
-	if (radio)
-		return 0;
-
-	if (oprmode)
-		return 0;
-
-	return 1;
-}
 
 static int conf_add(struct dahdi_pvt *p, struct dahdi_subchannel *c, int idx, int slavechannel)
 {
@@ -13108,7 +13115,6 @@
 				analog_p->callwaitingcallerid = conf->chan.callwaitingcallerid;
 				analog_p->ringt = conf->chan.ringt;
 				analog_p->ringt_base = ringt_base;
-				analog_p->chan_tech = &dahdi_tech;
 				analog_p->onhooktime = time(NULL);
 				if (chan_sig & __DAHDI_SIG_FXO) {
 					memset(&p, 0, sizeof(p));

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=370900&r1=370899&r2=370900
==============================================================================
--- branches/1.8/channels/sig_analog.c (original)
+++ branches/1.8/channels/sig_analog.c Wed Aug  8 14:58:52 2012
@@ -1701,7 +1701,7 @@
 static void *analog_get_bridged_channel(struct analog_pvt *p, struct ast_channel *chan)
 {
 	if (p->calls->get_sigpvt_bridged_channel) {
-		return p->calls->get_sigpvt_bridged_channel;
+		return p->calls->get_sigpvt_bridged_channel(chan);
 	}
 	return NULL;
 }
@@ -2305,18 +2305,16 @@
 				struct ast_channel *nbridge = p->subs[ANALOG_SUB_THREEWAY].owner;
 				struct analog_pvt *pbridge = NULL;
 				/* set up the private struct of the bridged one, if any */
-				if (nbridge && ast_bridged_channel(nbridge)) {
+				if (nbridge) {
 					pbridge = analog_get_bridged_channel(p, nbridge);
 				}
-				if (nbridge && pbridge &&
-				    (nbridge->tech == p->chan_tech) &&
-				    (ast_bridged_channel(nbridge)->tech == p->chan_tech) &&
-				    ISTRUNK(pbridge)) {
+				if (pbridge && ISTRUNK(pbridge)) {
 					/* Clear out the dial buffer */
 					p->dop.dialstr[0] = '\0';
 					/* flash hookswitch */
-					if ((analog_flash(p) == -1) && (errno != EINPROGRESS)) {
-						ast_log(LOG_WARNING, "Unable to flash external trunk on channel %s: %s\n",
+					if ((analog_flash(pbridge) == -1) && (errno != EINPROGRESS)) {
+						ast_log(LOG_WARNING,
+							"Unable to flash-hook bridged trunk from channel %s: %s\n",
 							nbridge->name, strerror(errno));
 					}
 					analog_swap_subs(p, ANALOG_SUB_REAL, ANALOG_SUB_THREEWAY);

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=370900&r1=370899&r2=370900
==============================================================================
--- branches/1.8/channels/sig_analog.h (original)
+++ branches/1.8/channels/sig_analog.h Wed Aug  8 14:58:52 2012
@@ -288,7 +288,6 @@
 	unsigned int use_smdi:1;
 	/*! \brief The SMDI interface to get SMDI messages from. */
 	struct ast_smdi_interface *smdi_iface;
-	const struct ast_channel_tech *chan_tech;
 
 	/* Not used for anything but log messages.  Could be just the TCID */
 	int channel;					/*!< Channel Number */




More information about the svn-commits mailing list