[svn-commits] rmudgett: trunk r251538 - in /trunk/channels: chan_dahdi.c sig_pri.c sig_pri.h

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Mar 9 21:16:54 CST 2010


Author: rmudgett
Date: Tue Mar  9 21:16:50 2010
New Revision: 251538

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=251538
Log:
Reduce the amount of database access for HAVE_PRI_SERVICE_MESSAGES.

Rework HAVE_PRI_SERVICE_MESSAGES to not use the active values directly
from the database.  Database access is likely expensive.  Database access
now only happens on initialization, destruction, and when the B channel is
taken in or out of service.

This change is not related to call waiting but it would cause the search
for a call waiting interface to be very expensive and slow down D channel
message servicing.

Modified:
    trunk/channels/chan_dahdi.c
    trunk/channels/sig_pri.c
    trunk/channels/sig_pri.h

Modified: trunk/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_dahdi.c?view=diff&rev=251538&r1=251537&r2=251538
==============================================================================
--- trunk/channels/chan_dahdi.c (original)
+++ trunk/channels/chan_dahdi.c Tue Mar  9 21:16:50 2010
@@ -975,7 +975,6 @@
 
 #if defined(HAVE_PRI)
 	struct sig_pri_pri *pri;
-	int prioffset;
 	int logicalspan;
 #endif
 #if defined(HAVE_PRI) || defined(HAVE_SS7)
@@ -5170,9 +5169,11 @@
 		p = iflist;
 
 		chan = p->channel;
-#ifdef HAVE_PRI_SERVICE_MESSAGES
+#if defined(HAVE_PRI_SERVICE_MESSAGES)
 		{
-			char db_chan_name[20], db_answer[5], state;
+			char db_chan_name[20];
+			char db_answer[5];
+			char state;
 			int why = -1;
 
 			snprintf(db_chan_name, sizeof(db_chan_name), "%s/%d:%d", dahdi_db, p->span, chan);
@@ -5184,7 +5185,7 @@
 				ast_db_del(db_chan_name, SRVST_DBKEY);
 			}
 		}
-#endif
+#endif	/* defined(HAVE_PRI_SERVICE_MESSAGES) */
 		/* Free associated memory */
 		destroy_dahdi_pvt(p);
 		ast_verb(3, "Unregistered channel %d\n", chan);
@@ -11422,9 +11423,9 @@
 						pris[span].pri.overlapdial = conf->pri.pri.overlapdial;
 						pris[span].pri.qsigchannelmapping = conf->pri.pri.qsigchannelmapping;
 						pris[span].pri.discardremoteholdretrieval = conf->pri.pri.discardremoteholdretrieval;
-#ifdef HAVE_PRI_SERVICE_MESSAGES
+#if defined(HAVE_PRI_SERVICE_MESSAGES)
 						pris[span].pri.enable_service_message_support = conf->pri.pri.enable_service_message_support;
-#endif
+#endif	/* defined(HAVE_PRI_SERVICE_MESSAGES) */
 #ifdef HAVE_PRI_INBANDDISCONNECT
 						pris[span].pri.inbanddisconnect = conf->pri.pri.inbanddisconnect;
 #endif
@@ -11445,12 +11446,6 @@
 
 						for (x = 0; x < PRI_MAX_TIMERS; x++) {
 							pris[span].pri.pritimers[x] = conf->pri.pri.pritimers[x];
-						}
-
-						if (si.spanno != span + 1) { /* in another trunkgroup */
-							tmp->prioffset = pris[span].pri.numchans;
-						} else {
-							tmp->prioffset = p.chanpos;
 						}
 					} else {
 						ast_log(LOG_ERROR, "Channel %d is reserved for D-channel.\n", p.chanpos);
@@ -11753,17 +11748,35 @@
 			case SIG_PRI_LIB_HANDLE_CASES:
 			case SIG_SS7:
 				tmp->inservice = 0;
-#ifdef HAVE_PRI_SERVICE_MESSAGES
+#if defined(HAVE_PRI_SERVICE_MESSAGES)
+				((struct sig_pri_chan *) tmp->sig_pvt)->service_status = 0;
 				if (chan_sig == SIG_PRI) {
-					char db_chan_name[20], db_answer[5];
-
+					char db_chan_name[20];
+					char db_answer[5];
+
+					/*
+					 * Initialize the active out-of-service status
+					 * and delete any record if the feature is not enabled.
+					 */
 					snprintf(db_chan_name, sizeof(db_chan_name), "%s/%d:%d", dahdi_db, tmp->span, tmp->channel);
-					if (ast_db_get(db_chan_name, SRVST_DBKEY, db_answer, sizeof(db_answer))) {
-						snprintf(db_answer, sizeof(db_answer), "%s:%d", SRVST_TYPE_OOS, SRVST_INITIALIZED);
-						ast_db_put(db_chan_name, SRVST_DBKEY, db_answer);
+					if (!ast_db_get(db_chan_name, SRVST_DBKEY, db_answer, sizeof(db_answer))) {
+						unsigned *why;
+
+						why = &((struct sig_pri_chan *) tmp->sig_pvt)->service_status;
+						if (tmp->pri->enable_service_message_support) {
+							char state;
+
+							sscanf(db_answer, "%1c:%30u", &state, why);
+
+							/* Ensure that only the implemented bits could be set.*/
+							*why &= (SRVST_NEAREND | SRVST_FAREND);
+						}
+						if (!*why) {
+							ast_db_del(db_chan_name, SRVST_DBKEY);
+						}
 					}
 				}
-#endif
+#endif	/* defined(HAVE_PRI_SERVICE_MESSAGES) */
 				break;
 			default:
 				 /* We default to in service on protocols that don't have a reset */
@@ -13489,16 +13502,15 @@
 }
 #endif	/* defined(HAVE_PRI) */
 
-#ifdef HAVE_PRI_SERVICE_MESSAGES
+#if defined(HAVE_PRI_SERVICE_MESSAGES)
 static char *handle_pri_service_generic(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a, int changestatus)
 {
-	int why;
+	unsigned *why;
 	int channel;
 	int trunkgroup;
 	int x, y, fd = a->fd;
 	int interfaceid = 0;
 	char *c;
-	char state;
 	char db_chan_name[20], db_answer[5];
 	struct dahdi_pvt *tmp;
 	struct dahdi_pri *pri;
@@ -13550,38 +13562,33 @@
 	ast_mutex_lock(&iflock);
 	for (tmp = iflist; tmp; tmp = tmp->next) {
 		if (tmp->pri && tmp->channel == channel) {
+			ast_mutex_unlock(&iflock);
+			ast_mutex_lock(&tmp->pri->lock);
 			if (!tmp->pri->enable_service_message_support) {
-				ast_mutex_unlock(&iflock);
+				ast_mutex_unlock(&tmp->pri->lock);
 				ast_cli(fd,
 					"\n\tThis operation has not been enabled in chan_dahdi.conf, set 'service_message_support=yes' to use this operation.\n"
 					"\tNote only 4ESS and 5ESS switch types are supported.\n\n");
 				return CLI_SUCCESS;
 			}
-			why = -1;
 			snprintf(db_chan_name, sizeof(db_chan_name), "%s/%d:%d", dahdi_db, tmp->span, channel);
-			if (!ast_db_get(db_chan_name, SRVST_DBKEY, db_answer, sizeof(db_answer))) {
-				sscanf(db_answer, "%1c:%30d", &state, &why);
-				ast_db_del(db_chan_name, SRVST_DBKEY);
-			}
+			why = &((struct sig_pri_chan *) tmp->sig_pvt)->service_status;
 			switch(changestatus) {
 			case 0: /* enable */
-				if (why > -1) {
-					if (why & SRVST_FAREND) {
-						why = SRVST_FAREND;
-						snprintf(db_answer, sizeof(db_answer), "%s:%d", SRVST_TYPE_OOS, why);
-						ast_db_put(db_chan_name, SRVST_DBKEY, db_answer);
-						ast_debug(2, "channel '%d' service state { near: in-service,  far: out-of-service }\n", channel);
-					}
+				/* Near end wants to be in service now. */
+				ast_db_del(db_chan_name, SRVST_DBKEY);
+				*why &= ~SRVST_NEAREND;
+				if (*why) {
+					snprintf(db_answer, sizeof(db_answer), "%s:%u", SRVST_TYPE_OOS, *why);
+					ast_db_put(db_chan_name, SRVST_DBKEY, db_answer);
 				}
 				break;
 			/* case 1:  -- loop */
 			case 2: /* disable */
-				if (why == -1) {
-					why = SRVST_NEAREND;
-				} else {
-					why |= SRVST_NEAREND;
-				}
-				snprintf(db_answer, sizeof(db_answer), "%s:%d", SRVST_TYPE_OOS, why);
+				/* Near end wants to be out-of-service now. */
+				ast_db_del(db_chan_name, SRVST_DBKEY);
+				*why |= SRVST_NEAREND;
+				snprintf(db_answer, sizeof(db_answer), "%s:%u", SRVST_TYPE_OOS, *why);
 				ast_db_put(db_chan_name, SRVST_DBKEY, db_answer);
 				break;
 			/* case 3:  -- continuity */
@@ -13590,8 +13597,6 @@
 				ast_log(LOG_WARNING, "Unsupported changestatus: '%d'\n", changestatus);
 				break;
 			}
-			ast_mutex_unlock(&iflock);
-			ast_mutex_lock(&tmp->pri->lock);
 			pri_maintenance_bservice(tmp->pri->pri, tmp->sig_pvt, changestatus);
 			ast_mutex_unlock(&tmp->pri->lock);
 			return CLI_SUCCESS;
@@ -13636,7 +13641,7 @@
 	}
 	return handle_pri_service_generic(e, cmd, a, 2);
 }
-#endif
+#endif	/* defined(HAVE_PRI_SERVICE_MESSAGES) */
 
 #if defined(HAVE_PRI)
 static char *handle_pri_show_spans(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
@@ -13766,10 +13771,10 @@
 #if defined(HAVE_PRI)
 static struct ast_cli_entry dahdi_pri_cli[] = {
 	AST_CLI_DEFINE(handle_pri_debug, "Enables PRI debugging on a span"),
-#ifdef HAVE_PRI_SERVICE_MESSAGES
+#if defined(HAVE_PRI_SERVICE_MESSAGES)
  	AST_CLI_DEFINE(handle_pri_service_enable_channel, "Return a channel to service"),
  	AST_CLI_DEFINE(handle_pri_service_disable_channel, "Remove a channel from service"),
-#endif
+#endif	/* defined(HAVE_PRI_SERVICE_MESSAGES) */
 	AST_CLI_DEFINE(handle_pri_show_spans, "Displays PRI Information"),
 	AST_CLI_DEFINE(handle_pri_show_span, "Displays PRI Information"),
 	AST_CLI_DEFINE(handle_pri_show_debug, "Displays current PRI debug settings"),
@@ -16422,14 +16427,14 @@
 #endif
 			} else if (!strcasecmp(v->name, "discardremoteholdretrieval")) {
 				confp->pri.pri.discardremoteholdretrieval = ast_true(v->value);
-#ifdef HAVE_PRI_SERVICE_MESSAGES
+#if defined(HAVE_PRI_SERVICE_MESSAGES)
 			} else if (!strcasecmp(v->name, "service_message_support")) {
 				/* assuming switchtype for this channel group has been configured already */
 				if ((confp->pri.pri.switchtype == PRI_SWITCH_ATT4ESS || confp->pri.pri.switchtype == PRI_SWITCH_LUCENT5E) && ast_true(v->value))
 					confp->pri.pri.enable_service_message_support = 1;
 				else
 					confp->pri.pri.enable_service_message_support = 0;
-#endif
+#endif	/* defined(HAVE_PRI_SERVICE_MESSAGES) */
 #ifdef HAVE_PRI_INBANDDISCONNECT
 			} else if (!strcasecmp(v->name, "inbanddisconnect")) {
 				confp->pri.pri.inbanddisconnect = ast_true(v->value);

Modified: trunk/channels/sig_pri.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/sig_pri.c?view=diff&rev=251538&r1=251537&r2=251538
==============================================================================
--- trunk/channels/sig_pri.c (original)
+++ trunk/channels/sig_pri.c Tue Mar  9 21:16:50 2010
@@ -1059,9 +1059,9 @@
 /*! \note Assumes the pri->lock is already obtained. */
 static int pri_check_restart(struct sig_pri_pri *pri)
 {
-#ifdef HAVE_PRI_SERVICE_MESSAGES
+#if defined(HAVE_PRI_SERVICE_MESSAGES)
 tryanotherpos:
-#endif
+#endif	/* defined(HAVE_PRI_SERVICE_MESSAGES) */
 	do {
 		pri->resetpos++;
 	} while (pri->resetpos < pri->numchans
@@ -1070,23 +1070,16 @@
 			|| pri->pvts[pri->resetpos]->call
 			|| pri->pvts[pri->resetpos]->resetting));
 	if (pri->resetpos < pri->numchans) {
-#ifdef HAVE_PRI_SERVICE_MESSAGES
-		char db_chan_name[20], db_answer[5], state;
-		int why;
-
-		/* check if the channel is out of service */
-		snprintf(db_chan_name, sizeof(db_chan_name), "%s/%d:%d", dahdi_db, pri->span, pri->pvts[pri->resetpos]->channel);
-
-		/* if so, try next channel */
-		if (!ast_db_get(db_chan_name, SRVST_DBKEY, db_answer, sizeof(db_answer))) {
-			sscanf(db_answer, "%1c:%30d", &state, &why);
-			if (why) {
-				ast_log(LOG_NOTICE, "span '%d' channel '%d' out-of-service (reason: %s), not sending RESTART\n", pri->span,
-					pri->pvts[pri->resetpos]->channel, (why & SRVST_FAREND) ? (why & SRVST_NEAREND) ? "both ends" : "far end" : "near end");
-				goto tryanotherpos;
-			}
-		}
-#endif
+#if defined(HAVE_PRI_SERVICE_MESSAGES)
+		unsigned why;
+
+		why = pri->pvts[pri->resetpos]->service_status;
+		if (why) {
+			ast_log(LOG_NOTICE, "span '%d' channel '%d' out-of-service (reason: %s), not sending RESTART\n", pri->span,
+				pri->pvts[pri->resetpos]->channel, (why & SRVST_FAREND) ? (why & SRVST_NEAREND) ? "both ends" : "far end" : "near end");
+			goto tryanotherpos;
+		}
+#endif	/* defined(HAVE_PRI_SERVICE_MESSAGES) */
 
 		/* Mark the channel as resetting and restart it */
 		pri->pvts[pri->resetpos]->resetting = 1;
@@ -2149,35 +2142,28 @@
 						ast_log(LOG_WARNING, "Restart requested on odd/unavailable channel number %d/%d on span %d\n",
 							PRI_SPAN(e->restart.channel), PRI_CHANNEL(e->restart.channel), pri->span);
 					else {
-#ifdef HAVE_PRI_SERVICE_MESSAGES
-						char db_chan_name[20], db_answer[5], state;
-						int why, skipit = 0;
-
-						snprintf(db_chan_name, sizeof(db_chan_name), "%s/%d:%d", dahdi_db, pri->span, pri->pvts[chanpos]->channel);
-						if (!ast_db_get(db_chan_name, SRVST_DBKEY, db_answer, sizeof(db_answer))) {
-							sscanf(db_answer, "%1c:%30d", &state, &why);
-							if (why) {
-								ast_log(LOG_NOTICE, "span '%d' channel '%d' out-of-service (reason: %s), ignoring RESTART\n", pri->span,
-									PRI_CHANNEL(e->restart.channel), (why & SRVST_FAREND) ? (why & SRVST_NEAREND) ? "both ends" : "far end" : "near end");
-								skipit = 1;
-							} else {
-								ast_db_del(db_chan_name, SRVST_DBKEY);
-							}
+						int skipit = 0;
+#if defined(HAVE_PRI_SERVICE_MESSAGES)
+						unsigned why;
+
+						why = pri->pvts[chanpos]->service_status;
+						if (why) {
+							ast_log(LOG_NOTICE,
+								"span '%d' channel '%d' out-of-service (reason: %s), ignoring RESTART\n",
+								pri->span, PRI_CHANNEL(e->restart.channel),
+								(why & SRVST_FAREND) ? (why & SRVST_NEAREND) ? "both ends" : "far end" : "near end");
+							skipit = 1;
 						}
-#endif
+#endif	/* defined(HAVE_PRI_SERVICE_MESSAGES) */
 						sig_pri_lock_private(pri->pvts[chanpos]);
-#ifdef HAVE_PRI_SERVICE_MESSAGES
 						if (!skipit) {
-#endif
 							ast_verb(3, "B-channel %d/%d restarted on span %d\n",
 								PRI_SPAN(e->restart.channel), PRI_CHANNEL(e->restart.channel), pri->span);
 							if (pri->pvts[chanpos]->call) {
 								pri_destroycall(pri->pri, pri->pvts[chanpos]->call);
 								pri->pvts[chanpos]->call = NULL;
 							}
-#ifdef HAVE_PRI_SERVICE_MESSAGES
 						}
-#endif
 						/* Force soft hangup if appropriate */
 						if (pri->pvts[chanpos]->owner)
 							ast_softhangup_nolock(pri->pvts[chanpos]->owner, AST_SOFTHANGUP_DEV);
@@ -2257,43 +2243,43 @@
 					}
 				}
 				break;
-#ifdef HAVE_PRI_SERVICE_MESSAGES
+#if defined(HAVE_PRI_SERVICE_MESSAGES)
 			case PRI_EVENT_SERVICE:
 				chanpos = pri_find_principle(pri, e->service.channel, NULL);
 				if (chanpos < 0) {
 					ast_log(LOG_WARNING, "Received service change status %d on unconfigured channel %d/%d span %d\n",
 						e->service_ack.changestatus, PRI_SPAN(e->service_ack.channel), PRI_CHANNEL(e->service_ack.channel), pri->span);
 				} else {
-					char db_chan_name[20], db_answer[5], state;
-					int ch, why = -1;
+					char db_chan_name[20];
+					char db_answer[5];
+					int ch;
+					unsigned *why;
 
 					ch = pri->pvts[chanpos]->channel;
 					snprintf(db_chan_name, sizeof(db_chan_name), "%s/%d:%d", dahdi_db, pri->span, ch);
-					if (!ast_db_get(db_chan_name, SRVST_DBKEY, db_answer, sizeof(db_answer))) {
-						sscanf(db_answer, "%1c:%30d", &state, &why);
-						ast_db_del(db_chan_name, SRVST_DBKEY);
-					}
+					why = &pri->pvts[chanpos]->service_status;
 					switch (e->service.changestatus) {
 					case 0: /* in-service */
-						if (why > -1) {
-							if (why & SRVST_NEAREND) {
-								snprintf(db_answer, sizeof(db_answer), "%s:%d", SRVST_TYPE_OOS, SRVST_NEAREND);
-								ast_db_put(db_chan_name, SRVST_DBKEY, db_answer);
-								ast_debug(2, "channel '%d' service state { near: out-of-service,  far: in-service }\n", ch);
-							}
+						/* Far end wants to be in service now. */
+						ast_db_del(db_chan_name, SRVST_DBKEY);
+						*why &= ~SRVST_FAREND;
+						if (*why) {
+							snprintf(db_answer, sizeof(db_answer), "%s:%u",
+								SRVST_TYPE_OOS, *why);
+							ast_db_put(db_chan_name, SRVST_DBKEY, db_answer);
 						}
 						break;
 					case 2: /* out-of-service */
-						if (why == -1) {
-							why = SRVST_FAREND;
-						} else {
-							why |= SRVST_FAREND;
-						}
-						snprintf(db_answer, sizeof(db_answer), "%s:%d", SRVST_TYPE_OOS, why);
+						/* Far end wants to be out-of-service now. */
+						ast_db_del(db_chan_name, SRVST_DBKEY);
+						*why |= SRVST_FAREND;
+						snprintf(db_answer, sizeof(db_answer), "%s:%u", SRVST_TYPE_OOS,
+							*why);
 						ast_db_put(db_chan_name, SRVST_DBKEY, db_answer);
 						break;
 					default:
 						ast_log(LOG_ERROR, "Huh?  changestatus is: %d\n", e->service.changestatus);
+						break;
 					}
 					ast_log(LOG_NOTICE, "Channel %d/%d span %d (logical: %d) received a change of service message, status '%d'\n",
 						PRI_SPAN(e->service.channel), PRI_CHANNEL(e->service.channel), pri->span, ch, e->service.changestatus);
@@ -2309,7 +2295,7 @@
 						PRI_SPAN(e->service_ack.channel), PRI_CHANNEL(e->service_ack.channel), pri->span, e->service_ack.changestatus);
 				}
 				break;
-#endif
+#endif	/* defined(HAVE_PRI_SERVICE_MESSAGES) */
 			case PRI_EVENT_RING:
 				if (!ast_strlen_zero(pri->msn_list)
 					&& !sig_pri_msn_match(pri->msn_list, e->ring.callednum)) {
@@ -3881,16 +3867,9 @@
 {
 	/* If no owner and interface has a B channel then likely available */
 	if (!p->owner && !p->no_b_channel && p->pri) {
-#ifdef HAVE_PRI_SERVICE_MESSAGES
-		char db_chan_name[20], db_answer[5], state;
-		int why = 0;
-
-		snprintf(db_chan_name, sizeof(db_chan_name), "%s/%d:%d", dahdi_db, p->pri->span, p->channel);
-		if (!ast_db_get(db_chan_name, SRVST_DBKEY, db_answer, sizeof(db_answer))) {
-			sscanf(db_answer, "%1c:%30d", &state, &why);
-		}
-		if (p->resetting || p->call || why) {
-			if (why) {
+#if defined(HAVE_PRI_SERVICE_MESSAGES)
+		if (p->resetting || p->call || p->service_status) {
+			if (p->service_status) {
 				*reason = AST_CAUSE_REQUESTED_CHAN_UNAVAIL;
 			}
 			return 0;
@@ -3899,7 +3878,7 @@
 		if (p->resetting || p->call) {
 			return 0;
 		}
-#endif
+#endif	/* defined(HAVE_PRI_SERVICE_MESSAGES) */
 		return 1;
 	}
 
@@ -3951,11 +3930,11 @@
 			break;
 		default:
 			pri->dchans[i] = pri_new(pri->fds[i], pri->nodetype, pri->switchtype);
-#ifdef HAVE_PRI_SERVICE_MESSAGES
+#if defined(HAVE_PRI_SERVICE_MESSAGES)
 			if (pri->enable_service_message_support) {
 				pri_set_service_message_support(pri->dchans[i], 1);
 			}
-#endif
+#endif	/* defined(HAVE_PRI_SERVICE_MESSAGES) */
 			break;
 		}
 
@@ -4174,7 +4153,7 @@
 	return res;
 }
 
-#ifdef HAVE_PRI_SERVICE_MESSAGES
+#if defined(HAVE_PRI_SERVICE_MESSAGES)
 int pri_maintenance_bservice(struct pri *pri, struct sig_pri_chan *p, int changestatus)
 {
 	int channel = PVT_TO_CHANNEL(p);
@@ -4182,7 +4161,7 @@
 
 	return pri_maintenance_service(pri, span, channel, changestatus);
 }
-#endif
+#endif	/* defined(HAVE_PRI_SERVICE_MESSAGES) */
 
 void sig_pri_fixup(struct ast_channel *oldchan, struct ast_channel *newchan, struct sig_pri_chan *pchan)
 {

Modified: trunk/channels/sig_pri.h
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/sig_pri.h?view=diff&rev=251538&r1=251537&r2=251538
==============================================================================
--- trunk/channels/sig_pri.h (original)
+++ trunk/channels/sig_pri.h Tue Mar  9 21:16:50 2010
@@ -97,7 +97,7 @@
 #define DAHDI_OVERLAPDIAL_INCOMING 2
 #define DAHDI_OVERLAPDIAL_BOTH (DAHDI_OVERLAPDIAL_INCOMING|DAHDI_OVERLAPDIAL_OUTGOING)
 
-#ifdef HAVE_PRI_SERVICE_MESSAGES
+#if defined(HAVE_PRI_SERVICE_MESSAGES)
 /*! \brief Persistent Service State */
 #define SRVST_DBKEY "service-state"
 /*! \brief The out-of-service SERVICE state */
@@ -117,7 +117,7 @@
 
 /*! \brief The AstDB family */
 static const char dahdi_db[] = "dahdi/registry";
-#endif
+#endif	/* defined(HAVE_PRI_SERVICE_MESSAGES) */
 
 struct sig_pri_chan {
 	/* Options to be set by user */
@@ -173,6 +173,10 @@
 	int prioffset;					/*!< channel number in span */
 	int logicalspan;				/*!< logical span number within trunk group */
 	int mastertrunkgroup;			/*!< what trunk group is our master */
+#if defined(HAVE_PRI_SERVICE_MESSAGES)
+	/*! \brief Active SRVST_DBKEY out-of-service status value. */
+	unsigned service_status;
+#endif	/* defined(HAVE_PRI_SERVICE_MESSAGES) */
 
 	struct sig_pri_callback *calls;
 	void *chan_pvt;					/*!< Private structure of the user of this module. */
@@ -190,9 +194,9 @@
 	int facilityenable;								/*!< Enable facility IEs */
 	int dchan_logical_span[NUM_DCHANS];				/*!< Logical offset the DCHAN sits in */
 	int fds[NUM_DCHANS];							/*!< FD's for d-channels */
-#ifdef HAVE_PRI_SERVICE_MESSAGES
+#if defined(HAVE_PRI_SERVICE_MESSAGES)
 	unsigned int enable_service_message_support:1;	/*!< enable SERVICE message support */
-#endif
+#endif	/* defined(HAVE_PRI_SERVICE_MESSAGES) */
 #ifdef HAVE_PRI_INBANDDISCONNECT
 	unsigned int inbanddisconnect:1;				/*!< Should we support inband audio after receiving DISCONNECT? */
 #endif
@@ -287,9 +291,9 @@
 int pri_send_keypad_facility_exec(struct sig_pri_chan *p, const char *digits);
 int pri_send_callrerouting_facility_exec(struct sig_pri_chan *p, enum ast_channel_state chanstate, const char *destination, const char *original, const char *reason);
 
-#ifdef HAVE_PRI_SERVICE_MESSAGES
+#if defined(HAVE_PRI_SERVICE_MESSAGES)
 int pri_maintenance_bservice(struct pri *pri, struct sig_pri_chan *p, int changestatus);
-#endif
+#endif	/* defined(HAVE_PRI_SERVICE_MESSAGES) */
 
 void sig_pri_fixup(struct ast_channel *oldchan, struct ast_channel *newchan, struct sig_pri_chan *pchan);
 




More information about the svn-commits mailing list