struct dahdi_pvt *round_robin[32];
-#ifdef HAVE_PRI
+#if defined(HAVE_PRI)
static inline int pri_grab(struct dahdi_pvt *pvt, struct dahdi_pri *pri)
{
int res;
pthread_kill(pri->master, SIGURG);
return 0;
}
-#endif
+#endif /* defined(HAVE_PRI) */
-#ifdef HAVE_SS7
+#if defined(HAVE_SS7)
static inline void ss7_rel(struct dahdi_ss7 *ss7)
{
ast_mutex_unlock(&ss7->lock);
}
+#endif /* defined(HAVE_SS7) */
+#if defined(HAVE_SS7)
static inline int ss7_grab(struct dahdi_pvt *pvt, struct dahdi_ss7 *pri)
{
int res;
pthread_kill(pri->master, SIGURG);
return 0;
}
-#endif
+#endif /* defined(HAVE_SS7) */
#define NUM_CADENCE_MAX 25
static int num_cadence = 4;
static int user_has_defined_cadences = 0;
chan_pvt->subs[sub_num].dfd = -1;
}
-#ifdef HAVE_PRI
+#if defined(HAVE_PRI)
static void dahdi_close_pri_fd(struct dahdi_pri *pri, int fd_num)
{
dahdi_close(pri->fds[fd_num]);
pri->fds[fd_num] = -1;
}
-#endif
+#endif /* defined(HAVE_PRI) */
-#ifdef HAVE_SS7
+#if defined(HAVE_SS7)
static void dahdi_close_ss7_fd(struct dahdi_ss7 *ss7, int fd_num)
{
dahdi_close(ss7->fds[fd_num]);
ss7->fds[fd_num] = -1;
}
-#endif
+#endif /* defined(HAVE_SS7) */
static int dahdi_setlinear(int dfd, int linear)
{
return 0;
}
-#ifdef HAVE_SS7
+#if defined(HAVE_SS7)
static unsigned char cid_pres2ss7pres(int cid_pres)
{
return (cid_pres >> 5) & 0x03;
}
+#endif /* defined(HAVE_SS7) */
+#if defined(HAVE_SS7)
static unsigned char cid_pres2ss7screen(int cid_pres)
{
return cid_pres & 0x03;
}
-#endif
+#endif /* defined(HAVE_SS7) */
static int dahdi_call(struct ast_channel *ast, char *rdest, int timeout)
{
ast_mutex_unlock(&iflock);
}
-#ifdef HAVE_PRI
+#if defined(HAVE_PRI)
static char *dahdi_send_keypad_facility_app = "DAHDISendKeypadFacility";
static int dahdi_send_keypad_facility_exec(struct ast_channel *chan, void *data)
return 0;
}
+#endif /* defined(HAVE_PRI) */
-#ifdef HAVE_PRI_PROG_W_CAUSE
-
+#if defined(HAVE_PRI)
+#if defined(HAVE_PRI_PROG_W_CAUSE)
static char *dahdi_send_callrerouting_facility_app = "DAHDISendCallreroutingFacility";
static int dahdi_send_callrerouting_facility_exec(struct ast_channel *chan, void *data)
return res;
}
+#endif /* defined(HAVE_PRI_PROG_W_CAUSE) */
+#endif /* defined(HAVE_PRI) */
-#endif
-
+#if defined(HAVE_PRI)
static int pri_is_up(struct dahdi_pri *pri)
{
int x;
}
return 0;
}
+#endif /* defined(HAVE_PRI) */
+#if defined(HAVE_PRI)
static int pri_assign_bearer(struct dahdi_pvt *crv, struct dahdi_pri *pri, struct dahdi_pvt *bearer)
{
bearer->owner = &inuse;
crv->pri = pri;
return 0;
}
+#endif /* defined(HAVE_PRI) */
+#if defined(HAVE_PRI)
static char *pri_order(int level)
{
switch (level) {
return "<Unknown>";
}
}
+#endif /* defined(HAVE_PRI) */
+#if defined(HAVE_PRI)
/* Returns fd of the active dchan */
static int pri_active_dchan_fd(struct dahdi_pri *pri)
{
return pri->fds[x];
}
+#endif /* defined(HAVE_PRI) */
+#if defined(HAVE_PRI)
static int pri_find_dchan(struct dahdi_pri *pri)
{
int oldslot = -1;
pri->pri = pri->dchans[newslot];
return 0;
}
-#endif
+#endif /* defined(HAVE_PRI) */
static int dahdi_hangup(struct ast_channel *ast)
{
return 0;
}
-#ifdef HAVE_PRI
+#if defined(HAVE_PRI)
static int pri_resolve_span(int *span, int channel, int offset, struct dahdi_spaninfo *si)
{
int x;
}
return 0;
}
+#endif /* defined(HAVE_PRI) */
+#if defined(HAVE_PRI)
static int pri_create_trunkgroup(int trunkgroup, int *channels)
{
struct dahdi_spaninfo si;
}
return 0;
}
+#endif /* defined(HAVE_PRI) */
+#if defined(HAVE_PRI)
static int pri_create_spanmap(int span, int trunkgroup, int logicalspan)
{
if (pris[span].mastertrunkgroup) {
pris[span].prilogicalspan = logicalspan;
return 0;
}
+#endif /* defined(HAVE_PRI) */
-#endif
-
-#ifdef HAVE_SS7
-
+#if defined(HAVE_SS7)
static unsigned int parse_pointcode(const char *pcstring)
{
unsigned int code1, code2, code3;
return 0;
}
+#endif /* defined(HAVE_SS7) */
+#if defined(HAVE_SS7)
static struct dahdi_ss7 * ss7_resolve_linkset(int linkset)
{
if ((linkset < 0) || (linkset >= NUM_SPANS))
else
return &linksets[linkset - 1];
}
-#endif /* HAVE_SS7 */
+#endif /* defined(HAVE_SS7) */
/* converts a DAHDI sigtype to signalling as can be configured from
* chan_dahdi.conf.
return p;
}
-
-#ifdef HAVE_PRI
+#if defined(HAVE_PRI)
static int pri_find_empty_chan(struct dahdi_pri *pri, int backwards)
{
int x;
}
return -1;
}
-#endif
+#endif /* defined(HAVE_PRI) */
static struct ast_channel *dahdi_request(const char *type, int format, void *data, int *cause)
{
{
return ioctl(dfd, DAHDI_SETLAW, &law);
}
-#endif
-
-#ifdef HAVE_SS7
+#endif /* defined(HAVE_PRI) || defined(HAVE_SS7) */
+#if defined(HAVE_SS7)
static int ss7_find_cic(struct dahdi_ss7 *linkset, int cic, unsigned int dpc)
{
int i;
}
return winner;
}
+#endif /* defined(HAVE_SS7) */
+#if defined(HAVE_SS7)
static void ss7_handle_cqm(struct dahdi_ss7 *linkset, int startcic, int endcic, unsigned int dpc)
{
unsigned char status[32];
ast_log(LOG_WARNING, "Could not find any equipped circuits within CQM CICs\n");
}
+#endif /* defined(HAVE_SS7) */
+#if defined(HAVE_SS7)
static inline void ss7_hangup_cics(struct dahdi_ss7 *linkset, int startcic, int endcic, unsigned int dpc)
{
int i;
}
}
}
+#endif /* defined(HAVE_SS7) */
+#if defined(HAVE_SS7)
static inline void ss7_block_cics(struct dahdi_ss7 *linkset, int startcic, int endcic, unsigned int dpc, unsigned char state[], int block)
{
int i;
}
}
}
+#endif /* defined(HAVE_SS7) */
+#if defined(HAVE_SS7)
static void ss7_inservice(struct dahdi_ss7 *linkset, int startcic, int endcic, unsigned int dpc)
{
int i;
linkset->pvts[i]->inservice = 1;
}
}
+#endif /* defined(HAVE_SS7) */
+#if defined(HAVE_SS7)
static void ss7_reset_linkset(struct dahdi_ss7 *linkset)
{
int i, startcic = -1, endcic, dpc;
}
}
}
+#endif /* defined(HAVE_SS7) */
+#if defined(HAVE_SS7)
static void dahdi_loopback(struct dahdi_pvt *p, int enable)
{
if (p->loopedback != enable) {
p->loopedback = enable;
}
}
+#endif /* defined(HAVE_SS7) */
+#if defined(HAVE_SS7)
/* XXX: This function is assumed to be called with the private channel lock and linkset lock held */
static void ss7_start_call(struct dahdi_pvt *p, struct dahdi_ss7 *linkset)
{
ast_mutex_lock(&p->lock);
ast_mutex_lock(&linkset->lock);
}
+#endif /* defined(HAVE_SS7) */
+#if defined(HAVE_SS7)
static void ss7_apply_plan_to_number(char *buf, size_t size, const struct dahdi_ss7 *ss7, const char *number, const unsigned nai)
{
switch (nai) {
break;
}
}
+#endif /* defined(HAVE_SS7) */
+
+#if defined(HAVE_SS7)
static int ss7_pres_scr2cid_pres(char presentation_ind, char screening_ind)
{
return ((presentation_ind & 0x3) << 5) | (screening_ind & 0x3);
}
+#endif /* defined(HAVE_SS7) */
+#if defined(HAVE_SS7)
static void *ss7_linkset(void *data)
{
int res, i;
return 0;
}
+#endif /* defined(HAVE_SS7) */
+#if defined(HAVE_SS7)
static void dahdi_ss7_message(struct ss7 *ss7, char *s)
{
#if 0
ast_verbose("%s", s);
#endif
}
+#endif /* defined(HAVE_SS7) */
+#if defined(HAVE_SS7)
static void dahdi_ss7_error(struct ss7 *ss7, char *s)
{
#if 0
ast_log(LOG_ERROR, "%s", s);
#endif
}
+#endif /* defined(HAVE_SS7) */
-#endif /* HAVE_SS7 */
-
-#ifdef HAVE_PRI
+#if defined(HAVE_PRI)
static struct dahdi_pvt *pri_find_crv(struct dahdi_pri *pri, int crv)
{
struct dahdi_pvt *p;
}
return NULL;
}
+#endif /* defined(HAVE_PRI) */
-
+#if defined(HAVE_PRI)
static int pri_find_principle(struct dahdi_pri *pri, int channel)
{
int x;
return principle;
}
+#endif /* defined(HAVE_PRI) */
+#if defined(HAVE_PRI)
static int pri_fixup_principle(struct dahdi_pri *pri, int principle, q931_call *c)
{
int x;
ast_log(LOG_WARNING, "Call specified, but not found?\n");
return -1;
}
+#endif /* defined(HAVE_PRI) */
+#if defined(HAVE_PRI)
static void *do_idle_thread(void *vchan)
{
struct ast_channel *chan = vchan;
ast_hangup(chan);
return NULL;
}
+#endif /* defined(HAVE_PRI) */
+#if defined(HAVE_PRI)
#ifndef PRI_RESTART
#error "Upgrade your libpri"
#endif
ast_mutex_unlock(&pridebugfdlock);
}
+#endif /* defined(HAVE_PRI) */
+#if defined(HAVE_PRI)
static void dahdi_pri_error(struct pri *pri, char *s)
{
int x, y;
ast_mutex_unlock(&pridebugfdlock);
}
+#endif /* defined(HAVE_PRI) */
+#if defined(HAVE_PRI)
static int pri_check_restart(struct dahdi_pri *pri)
{
do {
}
return 0;
}
+#endif /* defined(HAVE_PRI) */
+#if defined(HAVE_PRI)
static int pri_hangup_all(struct dahdi_pvt *p, struct dahdi_pri *pri)
{
int x;
ast_mutex_lock(&pri->lock);
return 0;
}
+#endif /* defined(HAVE_PRI) */
+#if defined(HAVE_PRI)
static char * redirectingreason2str(int redirectingreason)
{
switch (redirectingreason) {
return "NOREDIRECT";
}
}
+#endif /* defined(HAVE_PRI) */
+#if defined(HAVE_PRI)
static void apply_plan_to_number(char *buf, size_t size, const struct dahdi_pri *pri, const char *number, const int plan)
{
if (pri->dialplan == -2) { /* autodetect the TON but leave the number untouched */
break;
}
}
+#endif /* defined(HAVE_PRI) */
-
+#if defined(HAVE_PRI)
static void *pri_dchannel(void *vpri)
{
struct dahdi_pri *pri = vpri;
/* Never reached */
return NULL;
}
+#endif /* defined(HAVE_PRI) */
+#if defined(HAVE_PRI)
static int start_pri(struct dahdi_pri *pri)
{
int res, x;
}
return 0;
}
+#endif /* defined(HAVE_PRI) */
+#if defined(HAVE_PRI)
static char *complete_span_helper(const char *line, const char *word, int pos, int state, int rpos)
{
int which, span;
}
return ret;
}
+#endif /* defined(HAVE_PRI) */
+#if defined(HAVE_PRI)
static char *complete_span_4(const char *line, const char *word, int pos, int state)
{
return complete_span_helper(line,word,pos,state,3);
}
+#endif /* defined(HAVE_PRI) */
+#if defined(HAVE_PRI)
static char *handle_pri_set_debug_file(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
int myfd;
ast_cli(a->fd, "PRI debug output will be sent to '%s'\n", a->argv[4]);
return CLI_SUCCESS;
}
+#endif /* defined(HAVE_PRI) */
+#if defined(HAVE_PRI)
static char *handle_pri_debug(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
int span;
}
return CLI_SUCCESS;
}
+#endif /* defined(HAVE_PRI) */
+#if defined(HAVE_PRI)
static void build_status(char *s, size_t len, int status, int active)
{
if (!s || len < 1) {
strncat(s, ", Standby", len - strlen(s) - 1);
s[len - 1] = '\0';
}
+#endif /* defined(HAVE_PRI) */
+#if defined(HAVE_PRI)
static char *handle_pri_show_spans(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
int span;
}
return CLI_SUCCESS;
}
+#endif /* defined(HAVE_PRI) */
+#if defined(HAVE_PRI)
static char *handle_pri_show_span(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
int span;
}
return CLI_SUCCESS;
}
+#endif /* defined(HAVE_PRI) */
+#if defined(HAVE_PRI)
static char *handle_pri_show_debug(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
int x;
ast_cli(a->fd, "No debug set or no PRI running\n");
return CLI_SUCCESS;
}
+#endif /* defined(HAVE_PRI) */
+#if defined(HAVE_PRI)
static char *handle_pri_version(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
switch (cmd) {
return CLI_SUCCESS;
}
+#endif /* defined(HAVE_PRI) */
+#if defined(HAVE_PRI)
static struct ast_cli_entry dahdi_pri_cli[] = {
AST_CLI_DEFINE(handle_pri_debug, "Enables PRI debugging on a span"),
AST_CLI_DEFINE(handle_pri_show_spans, "Displays PRI Information"),
AST_CLI_DEFINE(handle_pri_set_debug_file, "Sends PRI debug output to the specified file"),
AST_CLI_DEFINE(handle_pri_version, "Displays libpri version"),
};
-
-#endif /* HAVE_PRI */
+#endif /* defined(HAVE_PRI) */
static char *dahdi_destroy_channel(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
return 0;
}
-#ifdef HAVE_SS7
+#if defined(HAVE_SS7)
static int linkset_addsigchan(int sigchan)
{
struct dahdi_ss7 *link;
return 0;
}
+#endif /* defined(HAVE_SS7) */
+#if defined(HAVE_SS7)
static char *handle_ss7_debug(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
int span;
return CLI_SUCCESS;
}
+#endif /* defined(HAVE_SS7) */
+#if defined(HAVE_SS7)
static char *handle_ss7_block_cic(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
int linkset, cic;
return CLI_SUCCESS;
}
+#endif /* defined(HAVE_SS7) */
+#if defined(HAVE_SS7)
static char *handle_ss7_block_linkset(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
int linkset;
return CLI_SUCCESS;
}
+#endif /* defined(HAVE_SS7) */
+#if defined(HAVE_SS7)
static char *handle_ss7_unblock_cic(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
int linkset, cic;
return CLI_SUCCESS;
}
+#endif /* defined(HAVE_SS7) */
+#if defined(HAVE_SS7)
static char *handle_ss7_unblock_linkset(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
int linkset;
return CLI_SUCCESS;
}
+#endif /* defined(HAVE_SS7) */
+#if defined(HAVE_SS7)
static char *handle_ss7_show_linkset(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
int linkset;
return CLI_SUCCESS;
}
+#endif /* defined(HAVE_SS7) */
+#if defined(HAVE_SS7)
static char *handle_ss7_version(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
switch (cmd) {
return CLI_SUCCESS;
}
+#endif /* defined(HAVE_SS7) */
+#if defined(HAVE_SS7)
static struct ast_cli_entry dahdi_ss7_cli[] = {
AST_CLI_DEFINE(handle_ss7_debug, "Enables SS7 debugging on a linkset"),
AST_CLI_DEFINE(handle_ss7_block_cic, "Blocks the given CIC"),
AST_CLI_DEFINE(handle_ss7_show_linkset, "Shows the status of a linkset"),
AST_CLI_DEFINE(handle_ss7_version, "Displays libss7 version"),
};
-#endif /* HAVE_SS7 */
+#endif /* defined(HAVE_SS7) */
static int __unload_module(void)
{