aboutsummaryrefslogtreecommitdiffstats
path: root/channels/sig_pri.h
diff options
context:
space:
mode:
authorrmudgett <rmudgett@f38db490-d61c-443f-a65b-d21fe96a405b>2010-03-10 03:16:50 +0000
committerrmudgett <rmudgett@f38db490-d61c-443f-a65b-d21fe96a405b>2010-03-10 03:16:50 +0000
commit8bb352d623b242752a3e876d37961e2663f77def (patch)
tree52221e2c3b9b82d6ea92c85e69908ccde7e45166 /channels/sig_pri.h
parent7f3494f4bf7ad8fe4d6a3decba70ab99916bc8e4 (diff)
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. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@251538 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/sig_pri.h')
-rw-r--r--channels/sig_pri.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/channels/sig_pri.h b/channels/sig_pri.h
index 05256985d..ed42ffd8f 100644
--- a/channels/sig_pri.h
+++ b/channels/sig_pri.h
@@ -97,7 +97,7 @@ struct sig_pri_callback {
#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 @@ struct sig_pri_callback {
/*! \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 @@ struct sig_pri_chan {
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 @@ struct sig_pri_pri {
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 @@ void sig_pri_cli_show_span(int fd, int *dchannels, struct sig_pri_pri *pri);
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);