diff options
author | bbryant <bbryant@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-09-09 18:51:52 +0000 |
---|---|---|
committer | bbryant <bbryant@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-09-09 18:51:52 +0000 |
commit | 722eb3c4c3cfa1c0cee915c949c5f95199ee24dd (patch) | |
tree | 25683963c5e51bdedd6211cd0ea92a85639505c3 /channels/chan_dahdi.c | |
parent | 815b5b09da5e555add7bba3d8fca588e7611248a (diff) |
Merged revisions 285710 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2
........
r285710 | bbryant | 2010-09-09 14:50:13 -0400 (Thu, 09 Sep 2010) | 8 lines
Fixes an issue with dialplan pattern matching where the specificity for pattern ranges and pattern special characters was inconsistent.
(closes issue #16903)
Reported by: Nick_Lewis
Patches:
pbx.c-specificity.patch uploaded by Nick Lewis (license 657)
Tested by: Nick_Lewis
........
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.8@285711 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_dahdi.c')
-rw-r--r-- | channels/chan_dahdi.c | 52 |
1 files changed, 32 insertions, 20 deletions
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c index df03a5805..364c85d04 100644 --- a/channels/chan_dahdi.c +++ b/channels/chan_dahdi.c @@ -38,7 +38,7 @@ */ /*** MODULEINFO - <depend>res_smdi</depend> + <use>res_smdi</use> <depend>dahdi</depend> <depend>tonezone</depend> <use>pri</use> @@ -2887,6 +2887,7 @@ static void my_pri_fixup_chans(void *chan_old, void *chan_new) /* More stuff to transfer to the new channel. */ new_chan->law = old_chan->law; + strcpy(new_chan->dialstring, old_chan->dialstring); } #endif /* defined(HAVE_PRI) */ @@ -3111,7 +3112,7 @@ static void dahdi_pri_update_span_devstate(struct sig_pri_span *pri) if (pri->pvts[idx]->owner #if defined(HAVE_PRI_SERVICE_MESSAGES) /* Out-of-service B channels are "in-use". */ - && pri->pvts[idx]->service_status + || pri->pvts[idx]->service_status #endif /* defined(HAVE_PRI_SERVICE_MESSAGES) */ ) { ++in_use; @@ -13708,25 +13709,36 @@ static char *handle_pri_debug(struct ast_cli_entry *e, int cmd, struct ast_cli_a ast_cli(a->fd, "No PRI running on span %d\n", span); return CLI_SUCCESS; } + + /* Set debug level in libpri */ for (x = 0; x < SIG_PRI_NUM_DCHANS; x++) { - if (pris[span-1].pri.dchans[x]) { - if (level == 1) { - pri_set_debug(pris[span-1].pri.dchans[x], SIG_PRI_DEBUG_NORMAL); - ast_cli(a->fd, "Enabled debugging on span %d\n", span); - } else if (level == 0) { - pri_set_debug(pris[span-1].pri.dchans[x], 0); - /* close the file if it's set */ - ast_mutex_lock(&pridebugfdlock); - close(pridebugfd); - pridebugfd = -1; - ast_cli(a->fd, "PRI debug output to file disabled\n"); - ast_mutex_unlock(&pridebugfdlock); - } else { - pri_set_debug(pris[span-1].pri.dchans[x], SIG_PRI_DEBUG_INTENSE); - ast_cli(a->fd, "Enabled debugging on span %d\n", span); + if (pris[span - 1].pri.dchans[x]) { + switch (level) { + case 0: + pri_set_debug(pris[span - 1].pri.dchans[x], 0); + break; + case 1: + pri_set_debug(pris[span - 1].pri.dchans[x], SIG_PRI_DEBUG_NORMAL); + break; + default: + pri_set_debug(pris[span - 1].pri.dchans[x], SIG_PRI_DEBUG_INTENSE); + break; } } } + if (level == 0) { + /* Close the debugging file if it's set */ + ast_mutex_lock(&pridebugfdlock); + if (0 <= pridebugfd) { + close(pridebugfd); + pridebugfd = -1; + ast_cli(a->fd, "Disabled PRI debug output to file '%s'\n", + pridebugfilename); + } + ast_mutex_unlock(&pridebugfdlock); + } + pris[span - 1].pri.debug = (level) ? 1 : 0; + ast_cli(a->fd, "%s debugging on span %d\n", (level) ? "Enabled" : "Disabled", span); return CLI_SUCCESS; } #endif /* defined(HAVE_PRI) */ @@ -13943,7 +13955,7 @@ static char *handle_pri_show_debug(struct ast_cli_entry *e, int cmd, struct ast_ int x; int span; int count=0; - int debug=0; + int debug; switch (cmd) { case CLI_INIT: @@ -13959,7 +13971,6 @@ static char *handle_pri_show_debug(struct ast_cli_entry *e, int cmd, struct ast_ for (span = 0; span < NUM_SPANS; span++) { if (pris[span].pri.pri) { for (x = 0; x < SIG_PRI_NUM_DCHANS; x++) { - debug = 0; if (pris[span].pri.dchans[x]) { debug = pri_get_debug(pris[span].pri.dchans[x]); ast_cli(a->fd, "Span %d: Debug: %s\tIntense: %s\n", span+1, (debug&PRI_DEBUG_Q931_STATE)? "Yes" : "No" ,(debug&PRI_DEBUG_Q921_RAW)? "Yes" : "No" ); @@ -13975,7 +13986,7 @@ static char *handle_pri_show_debug(struct ast_cli_entry *e, int cmd, struct ast_ ast_mutex_unlock(&pridebugfdlock); if (!count) - ast_cli(a->fd, "No debug set or no PRI running\n"); + ast_cli(a->fd, "No PRI running\n"); return CLI_SUCCESS; } #endif /* defined(HAVE_PRI) */ @@ -17915,4 +17926,5 @@ AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, tdesc, .unload = unload_module, .reload = reload, .load_pri = AST_MODPRI_CHANNEL_DRIVER, + .nonoptreq = "res_smdi", ); |