[asterisk-commits] rmudgett: branch rmudgett/sig_ss7 r263200 - /team/rmudgett/sig_ss7/channels/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri May 14 16:09:14 CDT 2010


Author: rmudgett
Date: Fri May 14 16:09:10 2010
New Revision: 263200

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=263200
Log:
Make all HAVE_SS7 conditionals use the same format

Modified:
    team/rmudgett/sig_ss7/channels/chan_dahdi.c
    team/rmudgett/sig_ss7/channels/sig_ss7.c
    team/rmudgett/sig_ss7/channels/sig_ss7.h

Modified: team/rmudgett/sig_ss7/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/sig_ss7/channels/chan_dahdi.c?view=diff&rev=263200&r1=263199&r2=263200
==============================================================================
--- team/rmudgett/sig_ss7/channels/chan_dahdi.c (original)
+++ team/rmudgett/sig_ss7/channels/chan_dahdi.c Fri May 14 16:09:10 2010
@@ -73,9 +73,9 @@
 #include "sig_pri.h"
 #endif
 
-#ifdef HAVE_SS7
+#if defined(HAVE_SS7)
 #include "sig_ss7.h"
-#endif
+#endif	/* defined(HAVE_SS7) */
 
 #ifdef HAVE_OPENR2
 /* put this here until sig_mfcr2 comes along */
@@ -303,24 +303,22 @@
 static const char tdesc[] = "DAHDI Telephony Driver"
 #if defined(HAVE_PRI) || defined(HAVE_SS7) || defined(HAVE_OPENR2)
 	" w/"
-#endif
-#ifdef HAVE_PRI
-	"PRI"
-#endif
-#ifdef HAVE_SS7
-	#ifdef HAVE_PRI
-	" & SS7"
-	#else
-	"SS7"
-	#endif
-#endif
-#ifdef HAVE_OPENR2
-	#if defined(HAVE_PRI) || defined(HAVE_SS7)
-	" & MFC/R2"
-	#else
-	"MFC/R2"
-	#endif
-#endif
+	#if defined(HAVE_PRI)
+		"PRI"
+	#endif	/* defined(HAVE_PRI) */
+	#if defined(HAVE_SS7)
+		#if defined(HAVE_PRI)
+		" & "
+		#endif	/* defined(HAVE_PRI) */
+		"SS7"
+	#endif	/* defined(HAVE_SS7) */
+	#if defined(HAVE_OPENR2)
+		#if defined(HAVE_PRI) || defined(HAVE_SS7)
+		" & "
+		#endif	/* defined(HAVE_PRI) || defined(HAVE_SS7) */
+		"MFC/R2"
+	#endif	/* defined(HAVE_OPENR2) */
+#endif	/* defined(HAVE_PRI) || defined(HAVE_SS7) || defined(HAVE_OPENR2) */
 ;
 
 static const char config[] = "chan_dahdi.conf";
@@ -513,7 +511,7 @@
  */
 static int ringt_base = DEFAULT_RINGT;
 
-#ifdef HAVE_SS7
+#if defined(HAVE_SS7)
 
 struct dahdi_ss7 {
 	struct sig_ss7_linkset ss7;
@@ -528,7 +526,7 @@
 static int cur_adjpointcode = -1;
 static int cur_networkindicator = -1;
 static int cur_defaultdpc = -1;
-#endif /* HAVE_SS7 */
+#endif	/* defined(HAVE_SS7) */
 
 #ifdef HAVE_OPENR2
 struct dahdi_mfcr2 {
@@ -992,10 +990,10 @@
 	 */
 	char mohsuggest[MAX_MUSICCLASS];
 	char parkinglot[AST_MAX_EXTENSION]; /*!< Parking lot for this channel */
-#if defined(PRI_ANI) || defined(HAVE_SS7)
+#if defined(HAVE_PRI) || defined(HAVE_SS7)
 	/*! \brief Automatic Number Identification number (Alternate PRI caller ID number) */
 	char cid_ani[AST_MAX_EXTENSION];
-#endif
+#endif	/* defined(HAVE_PRI) || defined(HAVE_SS7) */
 	/*! \brief Automatic Number Identification code from PRI */
 	int cid_ani2;
 	/*! \brief Caller ID number from an incoming call. */
@@ -1160,10 +1158,10 @@
 	int polarity;
 	/*! \brief DSP feature flags: DSP_FEATURE_xxx */
 	int dsp_features;
-#ifdef HAVE_SS7
+#if defined(HAVE_SS7)
 	/*! \brief SS7 control parameters */
 	struct sig_ss7_linkset *ss7;
-#endif
+#endif	/* defined(HAVE_SS7) */
 #ifdef HAVE_OPENR2
 	struct dahdi_mfcr2 *mfcr2;
 	openr2_chan_t *r2chan;
@@ -1223,9 +1221,9 @@
 	struct dahdi_pri pri;
 #endif
 
-#ifdef HAVE_SS7
+#if defined(HAVE_SS7)
 	struct dahdi_ss7 ss7;
-#endif
+#endif	/* defined(HAVE_SS7) */
 
 #ifdef HAVE_OPENR2
 	struct dahdi_mfcr2_conf mfcr2;
@@ -1273,7 +1271,7 @@
 			.resetinterval = -1,
 		},
 #endif
-#ifdef HAVE_SS7
+#if defined(HAVE_SS7)
 		.ss7.ss7 = {
 			.called_nai = SS7_NAI_NATIONAL,
 			.calling_nai = SS7_NAI_NATIONAL,
@@ -1282,7 +1280,7 @@
 			.subscriberprefix = "",
 			.unknownprefix = ""
 		},
-#endif
+#endif	/* defined(HAVE_SS7) */
 #ifdef HAVE_OPENR2
 		.mfcr2 = {
 			.variant = OR2_VAR_ITU,
@@ -2328,7 +2326,7 @@
 		return res;
 	return 0;
 }
-#endif
+#endif	/* defined(HAVE_PRI) || defined(HAVE_SS7) */
 
 #if defined(HAVE_PRI)
 static struct ast_channel *my_new_pri_ast_channel(void *pvt, int state, enum sig_pri_law law, char *exten, const struct ast_channel *requestor)
@@ -7427,10 +7425,10 @@
 			break;
 		}
 #endif
-#ifdef HAVE_SS7
+#if defined(HAVE_SS7)
 		if (p->sig == SIG_SS7)
 			break;
-#endif
+#endif	/* defined(HAVE_SS7) */
 #ifdef HAVE_OPENR2
 		if (p->sig == SIG_MFCR2)
 			break;
@@ -8930,7 +8928,7 @@
 					i->dsp_features = features & ~DSP_PROGRESS_TALK;
 					features = 0;
 				}
-#endif
+#endif	/* defined(HAVE_PRI) || defined(HAVE_SS7) */
 				ast_dsp_set_features(i->dsp, features);
 				ast_dsp_set_digitmode(i->dsp, DSP_DIGITMODE_DTMF | i->dtmfrelax);
 				if (!ast_strlen_zero(progzone))
@@ -8978,14 +8976,14 @@
 
 	/* Don't use ast_set_callerid() here because it will
 	 * generate a needless NewCallerID event */
-#ifdef PRI_ANI
+#if defined(HAVE_PRI) || defined(HAVE_SS7)
 	if (!ast_strlen_zero(i->cid_ani))
 		tmp->cid.cid_ani = ast_strdup(i->cid_ani);
 	else
 		tmp->cid.cid_ani = ast_strdup(i->cid_num);
 #else
 	tmp->cid.cid_ani = ast_strdup(i->cid_num);
-#endif
+#endif	/* defined(HAVE_PRI) || defined(HAVE_SS7) */
 	tmp->cid.cid_pres = i->callingpres;
 	tmp->cid.cid_ton = i->cid_ton;
 	tmp->cid.cid_ani2 = i->cid_ani2;
@@ -13956,7 +13954,7 @@
 {
 #if defined(HAVE_PRI) || defined(HAVE_SS7)
 	int i, j;
-#endif
+#endif	/* defined(HAVE_PRI) || defined(HAVE_SS7) */
 	int cancel_code;
 	struct dahdi_pvt *p;
 
@@ -13990,7 +13988,7 @@
 			ast_debug(4, "Joined thread of span %d\n", i);
 		}
 	}
-#endif
+#endif	/* defined(HAVE_SS7) */
 
 	ast_mutex_lock(&monlock);
 	if (monitor_thread && (monitor_thread != AST_PTHREADT_STOP) && (monitor_thread != AST_PTHREADT_NULL)) {
@@ -14042,7 +14040,7 @@
 	pri_set_error(dahdi_pri_error);
 	pri_set_message(dahdi_pri_message);
 #endif
-#ifdef HAVE_SS7
+#if defined(HAVE_SS7)
 	for (i = 0; i < NUM_SPANS; i++) {
 		for (j = 0; j < SIG_SS7_NUM_DCHANS; j++)
 			dahdi_close_ss7_fd(&(linksets[i]), j);
@@ -14057,7 +14055,7 @@
 	}
 	ss7_set_error(dahdi_ss7_error);
 	ss7_set_message(dahdi_ss7_message);
-#endif
+#endif	/* defined(HAVE_SS7) */
 
 	if (setup_dahdi(2) != 0) {
 		ast_log(LOG_WARNING, "Reload channels from dahdi config failed!\n");
@@ -14319,13 +14317,13 @@
 				ast_cli(a->fd, "MFC/R2 Call Files Directory: %s\n", openr2_context_get_log_directory(r2context, calldir, sizeof(calldir)));
 			}
 #endif
-#ifdef HAVE_SS7
+#if defined(HAVE_SS7)
 			if (tmp->ss7) {
 				struct sig_ss7_chan *chan = tmp->sig_pvt;
 
 				ast_cli(a->fd, "CIC: %d\n", chan->cic);
 			}
-#endif
+#endif	/* defined(HAVE_SS7) */
 #ifdef HAVE_PRI
 			if (tmp->pri) {
 				struct sig_pri_chan *chan = tmp->sig_pvt;
@@ -15496,7 +15494,7 @@
 	struct dahdi_pvt *p;
 #if defined(HAVE_PRI) || defined(HAVE_SS7)
 	int i, j;
-#endif
+#endif	/* defined(HAVE_PRI) || defined(HAVE_SS7) */
 
 #ifdef HAVE_PRI
 	for (i = 0; i < NUM_SPANS; i++) {
@@ -15515,7 +15513,7 @@
 			pthread_cancel(linksets[i].ss7.master);
 		}
 	ast_cli_unregister_multiple(dahdi_ss7_cli, ARRAY_LEN(dahdi_ss7_cli));
-#endif
+#endif	/* defined(HAVE_SS7) */
 #if defined(HAVE_OPENR2)
 	dahdi_r2_destroy_links();
 	ast_cli_unregister_multiple(dahdi_mfcr2_cli, ARRAY_LEN(dahdi_mfcr2_cli));
@@ -15574,7 +15572,7 @@
 			dahdi_close_ss7_fd(&(linksets[i]), j);
 		}
 	}
-#endif
+#endif	/* defined(HAVE_SS7) */
 	ast_cond_destroy(&ss_thread_complete);
 	return 0;
 }
@@ -15583,15 +15581,15 @@
 {
 #if defined(HAVE_PRI) || defined(HAVE_SS7)
 	int y;
-#endif
+#endif	/* defined(HAVE_PRI) || defined(HAVE_SS7) */
 #ifdef HAVE_PRI
 	for (y = 0; y < NUM_SPANS; y++)
 		ast_mutex_destroy(&pris[y].pri.lock);
 #endif
-#ifdef HAVE_SS7
+#if defined(HAVE_SS7)
 	for (y = 0; y < NUM_SPANS; y++)
 		ast_mutex_destroy(&linksets[y].ss7.lock);
-#endif /* HAVE_SS7 */
+#endif	/* defined(HAVE_SS7) */
 	return __unload_module();
 }
 
@@ -16129,10 +16127,10 @@
 					ast_log(LOG_WARNING, "How cool would it be if someone implemented this mode!  For now, sucks for you. (line %d)\n", v->lineno);
 #endif	/* !defined(HAVE_PRI_CALL_HOLD) */
 #endif
-#ifdef HAVE_SS7
+#if defined(HAVE_SS7)
 				} else if (!strcasecmp(v->value, "ss7")) {
 					confp->chan.sig = SIG_SS7;
-#endif
+#endif	/* defined(HAVE_SS7) */
 #ifdef HAVE_OPENR2
 				} else if (!strcasecmp(v->value, "mfcr2")) {
 					confp->chan.sig = SIG_MFCR2;
@@ -16396,7 +16394,7 @@
 				}
 #endif	/* defined(HAVE_PRI_CCSS) */
 #endif /* HAVE_PRI */
-#ifdef HAVE_SS7
+#if defined(HAVE_SS7)
 			} else if (!strcasecmp(v->name, "ss7type")) {
 				if (!strcasecmp(v->value, "itu")) {
 					cur_ss7type = SS7_ITU;
@@ -16473,7 +16471,7 @@
 				}
 				if (ast_true(v->value))
 					link->ss7.flags |= LINKSET_FLAG_EXPLICITACM;
-#endif /* HAVE_SS7 */
+#endif	/* defined(HAVE_SS7) */
 #ifdef HAVE_OPENR2
 			} else if (!strcasecmp(v->name, "mfcr2_advanced_protocol_file")) {
 				ast_copy_string(confp->mfcr2.r2proto_file, v->value, sizeof(confp->mfcr2.r2proto_file));
@@ -16962,7 +16960,7 @@
 		}
 	}
 #endif
-#ifdef HAVE_SS7
+#if defined(HAVE_SS7)
 	if (reload != 1) {
 		int x;
 		for (x = 0; x < NUM_SPANS; x++) {
@@ -16976,7 +16974,7 @@
 			}
 		}
 	}
-#endif
+#endif	/* defined(HAVE_SS7) */
 #ifdef HAVE_OPENR2
 	if (reload != 1) {
 		int x;
@@ -17024,12 +17022,12 @@
 static int load_module(void)
 {
 	int res;
-#if defined(HAVE_PRI) || defined (HAVE_SS7)
+#if defined(HAVE_PRI) || defined(HAVE_SS7)
 	int y;
-#endif
+#endif	/* defined(HAVE_PRI) || defined(HAVE_SS7) */
 #if defined(HAVE_SS7)
 	int i;
-#endif
+#endif	/* defined(HAVE_SS7) */
 #ifdef HAVE_PRI
 	memset(pris, 0, sizeof(pris));
 	for (y = 0; y < NUM_SPANS; y++) {
@@ -17059,7 +17057,7 @@
 		return AST_MODULE_LOAD_FAILURE;
 	}
 #endif
-#ifdef HAVE_SS7
+#if defined(HAVE_SS7)
 	memset(linksets, 0, sizeof(linksets));
 	for (y = 0; y < NUM_SPANS; y++) {
 		ast_mutex_init(&linksets[y].ss7.lock);
@@ -17069,7 +17067,7 @@
 	}
 	ss7_set_error(dahdi_ss7_error);
 	ss7_set_message(dahdi_ss7_message);
-#endif /* HAVE_SS7 */
+#endif	/* defined(HAVE_SS7) */
 	res = setup_dahdi(0);
 	/* Make sure we can register our DAHDI channel type */
 	if (res)
@@ -17082,9 +17080,9 @@
 #ifdef HAVE_PRI
 	ast_cli_register_multiple(dahdi_pri_cli, ARRAY_LEN(dahdi_pri_cli));
 #endif
-#ifdef HAVE_SS7
+#if defined(HAVE_SS7)
 	ast_cli_register_multiple(dahdi_ss7_cli, ARRAY_LEN(dahdi_ss7_cli));
-#endif
+#endif	/* defined(HAVE_SS7) */
 #ifdef HAVE_OPENR2
 	ast_cli_register_multiple(dahdi_mfcr2_cli, ARRAY_LEN(dahdi_mfcr2_cli));
 	ast_register_application_xml(dahdi_accept_r2_call_app, dahdi_accept_r2_call_exec);

Modified: team/rmudgett/sig_ss7/channels/sig_ss7.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/sig_ss7/channels/sig_ss7.c?view=diff&rev=263200&r1=263199&r2=263200
==============================================================================
--- team/rmudgett/sig_ss7/channels/sig_ss7.c (original)
+++ team/rmudgett/sig_ss7/channels/sig_ss7.c Fri May 14 16:09:10 2010
@@ -20,6 +20,7 @@
  * \file
  * \brief SS7 signaling module.
  *
+ * \author Matthew Fredrickson <creslin at digium.com>
  * \author Richard Mudgett <rmudgett at digium.com>
  *
  * See Also:

Modified: team/rmudgett/sig_ss7/channels/sig_ss7.h
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/sig_ss7/channels/sig_ss7.h?view=diff&rev=263200&r1=263199&r2=263200
==============================================================================
--- team/rmudgett/sig_ss7/channels/sig_ss7.h (original)
+++ team/rmudgett/sig_ss7/channels/sig_ss7.h Fri May 14 16:09:10 2010
@@ -20,6 +20,7 @@
  * \file
  * \brief Interface header for SS7 signaling module.
  *
+ * \author Matthew Fredrickson <creslin at digium.com>
  * \author Richard Mudgett <rmudgett at digium.com>
  *
  * See Also:




More information about the asterisk-commits mailing list