diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-08-26 02:38:24 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-08-26 02:38:24 +0000 |
commit | ee779c29a0dd4450c736715920bfe84c8673dcfd (patch) | |
tree | 1cf4015b8f664684fd3b1ae71e85b61d44649c65 /channels | |
parent | d19b505e8526ba3634d74ab15c86cb1ea79fce83 (diff) |
Make chan_zap compile without libpri again
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1434 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rwxr-xr-x | channels/chan_zap.c | 129 |
1 files changed, 66 insertions, 63 deletions
diff --git a/channels/chan_zap.c b/channels/chan_zap.c index 3c1ad5292..161486779 100755 --- a/channels/chan_zap.c +++ b/channels/chan_zap.c @@ -5125,11 +5125,13 @@ static struct zt_pvt *mkintf(int channel, int signalling, int radio) /* Hang it up to be sure it's good */ zt_set_hook(tmp->subs[SUB_REAL].zfd, ZT_ONHOOK); } +#ifdef ZAPATA_PRI /* the dchannel is down so put the channel in alarm */ if (tmp->pri && tmp->pri->up == 0) tmp->inalarm = 1; else tmp->inalarm = 0; +#endif memset(&si, 0, sizeof(si)); if (ioctl(tmp->subs[SUB_REAL].zfd,ZT_SPANSTAT,&si) == -1) { ast_log(LOG_ERROR, "Unable to get span status: %s\n", strerror(errno)); @@ -6251,6 +6253,70 @@ static int handle_pri_debug(int fd, int argc, char *argv[]) } + +static int handle_pri_no_debug(int fd, int argc, char *argv[]) +{ + int span; + if (argc < 5) + return RESULT_SHOWUSAGE; + span = atoi(argv[4]); + if ((span < 1) || (span > NUM_SPANS)) { + ast_cli(fd, "Invalid span %s. Should be a number %d to %d\n", argv[4], 1, NUM_SPANS); + return RESULT_SUCCESS; + } + if (!pris[span-1].pri) { + ast_cli(fd, "No PRI running on span %d\n", span); + return RESULT_SUCCESS; + } + pri_set_debug(pris[span-1].pri, 0); + ast_cli(fd, "Disabled debugging on span %d\n", span); + return RESULT_SUCCESS; +} + +static int handle_pri_really_debug(int fd, int argc, char *argv[]) +{ + int span; + if (argc < 5) + return RESULT_SHOWUSAGE; + span = atoi(argv[4]); + if ((span < 1) || (span > NUM_SPANS)) { + ast_cli(fd, "Invalid span %s. Should be a number %d to %d\n", argv[4], 1, NUM_SPANS); + return RESULT_SUCCESS; + } + if (!pris[span-1].pri) { + ast_cli(fd, "No PRI running on span %d\n", span); + return RESULT_SUCCESS; + } + pri_set_debug(pris[span-1].pri, (PRI_DEBUG_Q931_DUMP | PRI_DEBUG_Q921_DUMP | PRI_DEBUG_Q921_RAW | PRI_DEBUG_Q921_STATE)); + ast_cli(fd, "Enabled EXTENSIVE debugging on span %d\n", span); + return RESULT_SUCCESS; +} + +static char pri_debug_help[] = + "Usage: pri debug span <span>\n" + " Enables debugging on a given PRI span\n"; + +static char pri_no_debug_help[] = + "Usage: pri no debug span <span>\n" + " Disables debugging on a given PRI span\n"; + +static char pri_really_debug_help[] = + "Usage: pri intensive debug span <span>\n" + " Enables debugging down to the Q.921 level\n"; + +static struct ast_cli_entry pri_debug = { + { "pri", "debug", "span", NULL }, handle_pri_debug, "Enables PRI debugging on a span", pri_debug_help, complete_span +}; + +static struct ast_cli_entry pri_no_debug = { + { "pri", "no", "debug", "span", NULL }, handle_pri_no_debug, "Disables PRI debugging on a span", pri_no_debug_help, complete_span }; + +static struct ast_cli_entry pri_really_debug = { + { "pri", "intense", "debug", "span", NULL }, handle_pri_really_debug, "Enables REALLY INTENSE PRI debugging", pri_really_debug_help, complete_span }; + +#endif /* ZAPATA_PRI */ + + #ifdef ZAPATA_R2 static int handle_r2_no_debug(int fd, int argc, char *argv[]) { @@ -6328,69 +6394,6 @@ static struct ast_cli_entry r2_no_debug = { #endif -static int handle_pri_no_debug(int fd, int argc, char *argv[]) -{ - int span; - if (argc < 5) - return RESULT_SHOWUSAGE; - span = atoi(argv[4]); - if ((span < 1) || (span > NUM_SPANS)) { - ast_cli(fd, "Invalid span %s. Should be a number %d to %d\n", argv[4], 1, NUM_SPANS); - return RESULT_SUCCESS; - } - if (!pris[span-1].pri) { - ast_cli(fd, "No PRI running on span %d\n", span); - return RESULT_SUCCESS; - } - pri_set_debug(pris[span-1].pri, 0); - ast_cli(fd, "Disabled debugging on span %d\n", span); - return RESULT_SUCCESS; -} - -static int handle_pri_really_debug(int fd, int argc, char *argv[]) -{ - int span; - if (argc < 5) - return RESULT_SHOWUSAGE; - span = atoi(argv[4]); - if ((span < 1) || (span > NUM_SPANS)) { - ast_cli(fd, "Invalid span %s. Should be a number %d to %d\n", argv[4], 1, NUM_SPANS); - return RESULT_SUCCESS; - } - if (!pris[span-1].pri) { - ast_cli(fd, "No PRI running on span %d\n", span); - return RESULT_SUCCESS; - } - pri_set_debug(pris[span-1].pri, (PRI_DEBUG_Q931_DUMP | PRI_DEBUG_Q921_DUMP | PRI_DEBUG_Q921_RAW | PRI_DEBUG_Q921_STATE)); - ast_cli(fd, "Enabled EXTENSIVE debugging on span %d\n", span); - return RESULT_SUCCESS; -} - -static char pri_debug_help[] = - "Usage: pri debug span <span>\n" - " Enables debugging on a given PRI span\n"; - -static char pri_no_debug_help[] = - "Usage: pri no debug span <span>\n" - " Disables debugging on a given PRI span\n"; - -static char pri_really_debug_help[] = - "Usage: pri intensive debug span <span>\n" - " Enables debugging down to the Q.921 level\n"; - -static struct ast_cli_entry pri_debug = { - { "pri", "debug", "span", NULL }, handle_pri_debug, "Enables PRI debugging on a span", pri_debug_help, complete_span -}; - -static struct ast_cli_entry pri_no_debug = { - { "pri", "no", "debug", "span", NULL }, handle_pri_no_debug, "Disables PRI debugging on a span", pri_no_debug_help, complete_span }; - -static struct ast_cli_entry pri_really_debug = { - { "pri", "intense", "debug", "span", NULL }, handle_pri_really_debug, "Enables REALLY INTENSE PRI debugging", pri_really_debug_help, complete_span }; - -#endif /* ZAPATA_PRI */ - - static int zap_destroy_channel(int fd, int argc, char **argv) { int channel = 0; |