[asterisk-commits] jpeeler: branch jpeeler/chan_dahdi14 r119305 - in /team/jpeeler/chan_dahdi14:...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri May 30 12:13:38 CDT 2008


Author: jpeeler
Date: Fri May 30 12:13:38 2008
New Revision: 119305

URL: http://svn.digium.com/view/asterisk?view=rev&rev=119305
Log:
Replace zapata.conf with chan_dahdi.conf. In the event that chan_dahdi.conf doesn't exist try and load zapata.conf.

Modified:
    team/jpeeler/chan_dahdi14/apps/app_getcpeid.c
    team/jpeeler/chan_dahdi14/channels/chan_zap.c

Modified: team/jpeeler/chan_dahdi14/apps/app_getcpeid.c
URL: http://svn.digium.com/view/asterisk/team/jpeeler/chan_dahdi14/apps/app_getcpeid.c?view=diff&rev=119305&r1=119304&r2=119305
==============================================================================
--- team/jpeeler/chan_dahdi14/apps/app_getcpeid.c (original)
+++ team/jpeeler/chan_dahdi14/apps/app_getcpeid.c Fri May 30 12:13:38 2008
@@ -49,7 +49,7 @@
 
 static char *descrip =
 "  GetCPEID: Obtains and displays ADSI CPE ID and other information in order\n"
-"to properly setup zapata.conf for on-hook operations.\n";
+"to properly setup chan_dahdi.conf for on-hook operations.\n";
 
 
 static int cpeid_setstatus(struct ast_channel *chan, char *stuff[], int voice)

Modified: team/jpeeler/chan_dahdi14/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/team/jpeeler/chan_dahdi14/channels/chan_zap.c?view=diff&rev=119305&r1=119304&r2=119305
==============================================================================
--- team/jpeeler/chan_dahdi14/channels/chan_zap.c (original)
+++ team/jpeeler/chan_dahdi14/channels/chan_zap.c Fri May 30 12:13:38 2008
@@ -157,13 +157,13 @@
 /*! \brief Signaling types that need to use MF detection should be placed in this macro */
 #define NEED_MFDETECT(p) (((p)->sig == SIG_FEATDMF) || ((p)->sig == SIG_FEATDMF_TA) || ((p)->sig == SIG_E911) || ((p)->sig == SIG_FGC_CAMA) || ((p)->sig == SIG_FGC_CAMAMF) || ((p)->sig == SIG_FEATB)) 
 
-static const char tdesc[] = "Zapata Telephony Driver"
+static const char tdesc[] = "DAHDI Telephony Driver"
 #ifdef HAVE_PRI
                " w/PRI"
 #endif
 ;
 
-static const char config[] = "zapata.conf";
+static const char config[] = "chan_dahdi.conf";
 
 #define SIG_EM		DAHDI_SIG_EM
 #define SIG_EMWINK 	(0x0100000 | DAHDI_SIG_EM)
@@ -577,8 +577,8 @@
 	char begindigit;
 } *iflist = NULL, *ifend = NULL;
 
-/*! \brief Channel configuration from zapata.conf .
- * This struct is used for parsing the [channels] section of zapata.conf.
+/*! \brief Channel configuration from chan_dahdi.conf .
+ * This struct is used for parsing the [channels] section of chan_dahdi.conf.
  * Generally there is a field here for every possible configuration item.
  *
  * The state of fields is saved along the parsing and whenever a 'channel'
@@ -6285,7 +6285,7 @@
 								if (p->ringt < p->ringt_base/2)
 									break;
 								/* Increment the ringT counter so we can match it against
-								   values in zapata.conf for distinctive ring */
+								   values in chan_dahdi.conf for distinctive ring */
 								if (++receivedRingT == (sizeof(curRingData) / sizeof(curRingData[0])))
 									break;
 							} else if (i & DAHDI_IOMUX_READ) {
@@ -6312,7 +6312,7 @@
 							ast_verbose( VERBOSE_PREFIX_3 "Detected ring pattern: %d,%d,%d\n",curRingData[0],curRingData[1],curRingData[2]);
 	
 						for (counter = 0; counter < 3; counter++) {
-							/* Check to see if the rings we received match any of the ones in zapata.conf for this
+							/* Check to see if the rings we received match any of the ones in chan_dahdi.conf for this
 							channel */
 							distMatches = 0;
 							for (counter1 = 0; counter1 < 3; counter1++) {
@@ -6398,7 +6398,7 @@
 						if (p->ringt < p->ringt_base/2)
 							break;
 						/* Increment the ringT counter so we can match it against
-						   values in zapata.conf for distinctive ring */
+						   values in chan_dahdi.conf for distinctive ring */
 						if (++receivedRingT == (sizeof(curRingData) / sizeof(curRingData[0])))
 							break;
 					} else if (i & DAHDI_IOMUX_READ) {
@@ -6461,7 +6461,7 @@
 							if (p->ringt < p->ringt_base/2)
 								break;
 							/* Increment the ringT counter so we can match it against
-							   values in zapata.conf for distinctive ring */
+							   values in chan_dahdi.conf for distinctive ring */
 							if (++receivedRingT == (sizeof(curRingData) / sizeof(curRingData[0])))
 								break;
 						} else if (i & DAHDI_IOMUX_READ) {
@@ -6490,7 +6490,7 @@
 						ast_verbose( VERBOSE_PREFIX_3 "Detected ring pattern: %d,%d,%d\n",curRingData[0],curRingData[1],curRingData[2]);
 
 					for (counter = 0; counter < 3; counter++) {
-						/* Check to see if the rings we received match any of the ones in zapata.conf for this
+						/* Check to see if the rings we received match any of the ones in chan_dahdi.conf for this
 						channel */
 						if (option_verbose > 2)
 							/* this only shows up if you have n of the dring patterns filled in */
@@ -10213,7 +10213,7 @@
 static char zap_restart_usage[] =
 	"Usage: zap restart\n"
 	"	Restarts the zaptel channels: destroys them all and then\n"
-	"	re-reads them from zapata.conf.\n"
+	"	re-reads them from chan_dahdi.conf.\n"
 	"	Note that this will STOP any running CALL on zaptel channels.\n"
 	"";
 
@@ -10388,7 +10388,7 @@
 	const char *id = astman_get_header(m, "ActionID");
 	char idText[256] = "";
 
-	astman_send_ack(s, m, "Zapata channel status will follow");
+	astman_send_ack(s, m, "DAHDI channel status will follow");
 	if (!ast_strlen_zero(id))
 		snprintf(idText, sizeof(idText) - 1, "ActionID: %s\r\n", id);
 
@@ -11287,10 +11287,14 @@
 
 	cfg = ast_config_load(config);
 
-	/* Error if we have no config file */
+	/* Error if we have no chan_dahdi config file... */
 	if (!cfg) {
-		ast_log(LOG_ERROR, "Unable to load config %s\n", config);
-		return 0;
+		/* ...so try and load zapata.conf */
+		cfg = ast_config_load("zapata.conf");
+		if (!cfg) {
+			ast_log(LOG_ERROR, "Unable to load either config %s or zapata.conf\n", config);
+			return 0;
+		}
 	}
 
 	/* It's a little silly to lock it, but we mind as well just to be sure */
@@ -11309,22 +11313,22 @@
 						while (c && (i < NUM_DCHANS)) {
 							dchannels[i] = atoi(c + 1);
 							if (dchannels[i] < 0) {
-								ast_log(LOG_WARNING, "D-channel for trunk group %d must be a postiive number at line %d of zapata.conf\n", trunkgroup, v->lineno);
+								ast_log(LOG_WARNING, "D-channel for trunk group %d must be a postiive number at line %d of chan_dahdi.conf\n", trunkgroup, v->lineno);
 							} else
 								i++;
 							c = strchr(c + 1, ',');
 						}
 						if (i) {
 							if (pri_create_trunkgroup(trunkgroup, dchannels)) {
-								ast_log(LOG_WARNING, "Unable to create trunk group %d with Primary D-channel %d at line %d of zapata.conf\n", trunkgroup, dchannels[0], v->lineno);
+								ast_log(LOG_WARNING, "Unable to create trunk group %d with Primary D-channel %d at line %d of chan_dahdi.conf\n", trunkgroup, dchannels[0], v->lineno);
 							} else if (option_verbose > 1)
 								ast_verbose(VERBOSE_PREFIX_2 "Created trunk group %d with Primary D-channel %d and %d backup%s\n", trunkgroup, dchannels[0], i - 1, (i == 1) ? "" : "s");
 						} else
-							ast_log(LOG_WARNING, "Trunk group %d lacks any valid D-channels at line %d of zapata.conf\n", trunkgroup, v->lineno);
+							ast_log(LOG_WARNING, "Trunk group %d lacks any valid D-channels at line %d of chan_dahdi.conf\n", trunkgroup, v->lineno);
 					} else
-						ast_log(LOG_WARNING, "Trunk group %d lacks a primary D-channel at line %d of zapata.conf\n", trunkgroup, v->lineno);
+						ast_log(LOG_WARNING, "Trunk group %d lacks a primary D-channel at line %d of chan_dahdi.conf\n", trunkgroup, v->lineno);
 				} else
-					ast_log(LOG_WARNING, "Trunk group identifier must be a positive integer at line %d of zapata.conf\n", v->lineno);
+					ast_log(LOG_WARNING, "Trunk group identifier must be a positive integer at line %d of chan_dahdi.conf\n", v->lineno);
 			} else if (!strcasecmp(v->name, "spanmap")) {
 				spanno = atoi(v->value);
 				if (spanno > 0) {
@@ -11341,13 +11345,13 @@
 								} else if (option_verbose > 1) 
 									ast_verbose(VERBOSE_PREFIX_2 "Mapped span %d to trunk group %d (logical span %d)\n", spanno, trunkgroup, logicalspan);
 							} else
-								ast_log(LOG_WARNING, "Logical span must be a postive number, or '0' (for unspecified) at line %d of zapata.conf\n", v->lineno);
+								ast_log(LOG_WARNING, "Logical span must be a postive number, or '0' (for unspecified) at line %d of chan_dahdi.conf\n", v->lineno);
 						} else
-							ast_log(LOG_WARNING, "Trunk group must be a postive number at line %d of zapata.conf\n", v->lineno);
+							ast_log(LOG_WARNING, "Trunk group must be a postive number at line %d of chan_dahdi.conf\n", v->lineno);
 					} else
-						ast_log(LOG_WARNING, "Missing trunk group for span map at line %d of zapata.conf\n", v->lineno);
+						ast_log(LOG_WARNING, "Missing trunk group for span map at line %d of chan_dahdi.conf\n", v->lineno);
 				} else
-					ast_log(LOG_WARNING, "Span number must be a postive integer at line %d of zapata.conf\n", v->lineno);
+					ast_log(LOG_WARNING, "Span number must be a postive integer at line %d of chan_dahdi.conf\n", v->lineno);
 			} else {
 				ast_log(LOG_NOTICE, "Ignoring unknown keyword '%s' in trunkgroups\n", v->name);
 			}
@@ -11562,13 +11566,13 @@
 }
 
 /* This is a workaround so that menuselect displays a proper description
- * AST_MODULE_INFO(, , "Zapata Telephony"
+ * AST_MODULE_INFO(, , "DAHDI Telephony"
  */
 
 #ifdef ZAPATA_PRI
-#define tdesc "Zapata Telephony w/PRI"
+#define tdesc "DAHDI Telephony w/PRI"
 #else
-#define tdesc "Zapata Telephony"
+#define tdesc "DAHDI Telephony"
 #endif
 
 AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, tdesc,




More information about the asterisk-commits mailing list