[asterisk-commits] dbailey: trunk r203126 - /trunk/channels/chan_dahdi.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jun 25 11:18:53 CDT 2009


Author: dbailey
Date: Thu Jun 25 11:18:48 2009
New Revision: 203126

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=203126
Log:
Insure ring cadence is set for fxs ports

Moved SETCADENCE ioctl call to before call into new analog signal module
to insure that it gets set. 

(closes issue #15381)
Reported by: alecdavis
Patches:
      fix15381.diff uploaded by dbailey (license 819)
Tested by: dbailey


Modified:
    trunk/channels/chan_dahdi.c

Modified: trunk/channels/chan_dahdi.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/channels/chan_dahdi.c?view=diff&rev=203126&r1=203125&r2=203126
==============================================================================
--- trunk/channels/chan_dahdi.c (original)
+++ trunk/channels/chan_dahdi.c Thu Jun 25 11:18:48 2009
@@ -4154,41 +4154,15 @@
 	p->outgoing = 1;
 
 	set_actual_gain(p->subs[SUB_REAL].dfd, 0, p->rxgain, p->txgain, p->law);
-
-	/* If this is analog signalling we can exit here */
-	if (analog_lib_handles(p->sig, p->radio, p->oprmode)) {
-		p->callwaitrings = 0;
-		res = analog_call(p->sig_pvt, ast, rdest, timeout);
-		ast_mutex_unlock(&p->lock);
-		return res;
-	}
-
+	/* Set the ring cadence */
 	mysig = p->sig;
 	if (p->outsigmod > -1)
 		mysig = p->outsigmod;
-
 	switch (mysig) {
 	case SIG_FXOLS:
 	case SIG_FXOGS:
 	case SIG_FXOKS:
 		if (p->owner == ast) {
-			/* Normal ring, on hook */
-
-			/* Don't send audio while on hook, until the call is answered */
-			p->dialing = 1;
-			if (p->use_callerid) {
-				/* Generate the Caller-ID spill if desired */
-				if (p->cidspill) {
-					ast_log(LOG_WARNING, "cidspill already exists??\n");
-					ast_free(p->cidspill);
-				}
-				p->callwaitcas = 0;
-				if ((p->cidspill = ast_malloc(MAX_CALLERID_SIZE))) {
-					p->cidlen = ast_callerid_generate(p->cidspill, ast->connected.id.name, ast->connected.id.number, AST_LAW(p));
-					p->cidpos = 0;
-					send_callerid(p);
-				}
-			}
 			/* Choose proper cadence */
 			if ((p->distinctivering > 0) && (p->distinctivering <= num_cadence)) {
 				if (ioctl(p->subs[SUB_REAL].dfd, DAHDI_SETCADENCE, &cadences[p->distinctivering - 1]))
@@ -4199,7 +4173,40 @@
 					ast_log(LOG_WARNING, "Unable to reset default ring on '%s': %s\n", ast->name, strerror(errno));
 				p->cidrings = p->sendcalleridafter;
 			}
-
+		}
+		break;
+	}
+	
+	/* If this is analog signalling we can exit here */
+	if (analog_lib_handles(p->sig, p->radio, p->oprmode)) {
+		p->callwaitrings = 0;
+		res = analog_call(p->sig_pvt, ast, rdest, timeout);
+		ast_mutex_unlock(&p->lock);
+		return res;
+	}
+
+	switch (mysig) {
+	case SIG_FXOLS:
+	case SIG_FXOGS:
+	case SIG_FXOKS:
+		if (p->owner == ast) {
+			/* Normal ring, on hook */
+
+			/* Don't send audio while on hook, until the call is answered */
+			p->dialing = 1;
+			if (p->use_callerid) {
+				/* Generate the Caller-ID spill if desired */
+				if (p->cidspill) {
+					ast_log(LOG_WARNING, "cidspill already exists??\n");
+					ast_free(p->cidspill);
+				}
+				p->callwaitcas = 0;
+				if ((p->cidspill = ast_malloc(MAX_CALLERID_SIZE))) {
+					p->cidlen = ast_callerid_generate(p->cidspill, ast->connected.id.name, ast->connected.id.number, AST_LAW(p));
+					p->cidpos = 0;
+					send_callerid(p);
+				}
+			}
 			/* nick at dccinc.com 4/3/03 mods to allow for deferred dialing */
 			c = strchr(dest, '/');
 			if (c)




More information about the asterisk-commits mailing list