Make PRI debug easier to read if you're not using NFAS
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6081 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
parent
9f210028d1
commit
e67bc60c40
|
@ -7525,23 +7525,29 @@ static void zt_pri_message(struct pri *pri, char *s)
|
||||||
{
|
{
|
||||||
int x, y;
|
int x, y;
|
||||||
int dchan = -1, span = -1;
|
int dchan = -1, span = -1;
|
||||||
|
int dchancount = 0;
|
||||||
|
|
||||||
if (pri) {
|
if (pri) {
|
||||||
for (x = 0; x < NUM_SPANS; x++) {
|
for (x = 0; x < NUM_SPANS; x++) {
|
||||||
for (y = 0; y < NUM_DCHANS; y++) {
|
for (y = 0; y < NUM_DCHANS; y++) {
|
||||||
if (pris[x].dchans[y] == pri) {
|
if (pris[x].dchans[y])
|
||||||
|
dchancount++;
|
||||||
|
|
||||||
|
if (pris[x].dchans[y] == pri)
|
||||||
dchan = y;
|
dchan = y;
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (dchan >= 0) {
|
if (dchan >= 0) {
|
||||||
span = x;
|
span = x;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
dchancount = 0;
|
||||||
}
|
}
|
||||||
if ((dchan >= 0) && (span >= 0))
|
if ((dchan >= 0) && (span >= 0)) {
|
||||||
ast_verbose("[Span %d D-Channel %d]%s", span, dchan, s);
|
if (dchancount > 1)
|
||||||
else
|
ast_verbose("[Span %d D-Channel %d]%s", span, dchan, s);
|
||||||
|
else
|
||||||
|
ast_verbose("%s", s);
|
||||||
|
} else
|
||||||
ast_verbose("PRI debug error: could not find pri associated it with debug message output\n");
|
ast_verbose("PRI debug error: could not find pri associated it with debug message output\n");
|
||||||
} else
|
} else
|
||||||
ast_verbose("%s", s);
|
ast_verbose("%s", s);
|
||||||
|
@ -7549,7 +7555,7 @@ static void zt_pri_message(struct pri *pri, char *s)
|
||||||
ast_mutex_lock(&pridebugfdlock);
|
ast_mutex_lock(&pridebugfdlock);
|
||||||
|
|
||||||
if (pridebugfd >= 0)
|
if (pridebugfd >= 0)
|
||||||
write (pridebugfd, s, strlen(s));
|
write(pridebugfd, s, strlen(s));
|
||||||
|
|
||||||
ast_mutex_unlock(&pridebugfdlock);
|
ast_mutex_unlock(&pridebugfdlock);
|
||||||
}
|
}
|
||||||
|
@ -7558,23 +7564,29 @@ static void zt_pri_error(struct pri *pri, char *s)
|
||||||
{
|
{
|
||||||
int x, y;
|
int x, y;
|
||||||
int dchan = -1, span = -1;
|
int dchan = -1, span = -1;
|
||||||
|
int dchancount = 0;
|
||||||
|
|
||||||
if (pri) {
|
if (pri) {
|
||||||
for (x = 0; x < NUM_SPANS; x++) {
|
for (x = 0; x < NUM_SPANS; x++) {
|
||||||
for (y = 0; y < NUM_DCHANS; y++) {
|
for (y = 0; y < NUM_DCHANS; y++) {
|
||||||
if (pris[x].dchans[y] == pri) {
|
if (pris[x].dchans[y])
|
||||||
|
dchancount++;
|
||||||
|
|
||||||
|
if (pris[x].dchans[y] == pri)
|
||||||
dchan = y;
|
dchan = y;
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (dchan >= 0) {
|
if (dchan >= 0) {
|
||||||
span = x;
|
span = x;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
dchancount = 0;
|
||||||
}
|
}
|
||||||
if ((dchan >= 0) && (span >= 0))
|
if ((dchan >= 0) && (span >= 0)) {
|
||||||
ast_log(LOG_WARNING, "[Span %d D-Channel %d] PRI: %s", span, dchan, s);
|
if (dchancount > 1)
|
||||||
else
|
ast_log(LOG_WARNING, "[Span %d D-Channel %d] PRI: %s", span, dchan, s);
|
||||||
|
else
|
||||||
|
ast_verbose("%s", s);
|
||||||
|
} else
|
||||||
ast_verbose("PRI debug error: could not find pri associated it with debug message output\n");
|
ast_verbose("PRI debug error: could not find pri associated it with debug message output\n");
|
||||||
} else
|
} else
|
||||||
ast_log(LOG_WARNING, "%s", s);
|
ast_log(LOG_WARNING, "%s", s);
|
||||||
|
|
Loading…
Reference in New Issue