if (option_debug)
ast_log(LOG_DEBUG, "Enabled echo cancellation on channel %d\n", p->channel);
}
- } else {
- if (option_debug)
- ast_log(LOG_DEBUG, "No echo cancellation requested\n");
- }
+ } else if (option_debug)
+ ast_log(LOG_DEBUG, "No echo cancellation requested\n");
}
static void zt_train_ec(struct zt_pvt *p)
res = ioctl(p->subs[SUB_REAL].zfd, ZT_ECHOCANCEL, &x);
if (res)
ast_log(LOG_WARNING, "Unable to disable echo cancellation on channel %d\n", p->channel);
- else {
- if (option_debug)
- ast_log(LOG_DEBUG, "disabled echo cancellation on channel %d\n", p->channel);
- }
+ else if (option_debug)
+ ast_log(LOG_DEBUG, "disabled echo cancellation on channel %d\n", p->channel);
}
p->echocanon = 0;
}
struct zt_pvt *p = ast->tech_pvt;
struct ast_frame *f = *dest;
- ast_log(LOG_DEBUG, "DTMF digit: %c on %s\n", f->subclass, ast->name);
+ if (option_debug)
+ ast_log(LOG_DEBUG, "DTMF digit: %c on %s\n", f->subclass, ast->name);
+
if (p->confirmanswer) {
- ast_log(LOG_DEBUG, "Confirm answer on %s!\n", ast->name);
+ if (option_debug)
+ ast_log(LOG_DEBUG, "Confirm answer on %s!\n", ast->name);
/* Upon receiving a DTMF digit, consider this an answer confirmation instead
of a DTMF digit */
p->subs[index].f.frametype = AST_FRAME_CONTROL;
p->confirmanswer = 0;
} else if (p->callwaitcas) {
if ((f->subclass == 'A') || (f->subclass == 'D')) {
- ast_log(LOG_DEBUG, "Got some DTMF, but it's for the CAS\n");
+ if (option_debug)
+ ast_log(LOG_DEBUG, "Got some DTMF, but it's for the CAS\n");
if (p->cidspill)
free(p->cidspill);
send_cwcidspill(p);
ast_log(LOG_WARNING, "Failed to async goto '%s' into fax of '%s'\n", ast->name, target_context);
} else
ast_log(LOG_NOTICE, "Fax detected, but no fax extension\n");
- } else
+ } else if (option_debug)
ast_log(LOG_DEBUG, "Already in a fax extension, not redirecting\n");
- } else
+ } else if (option_debug)
ast_log(LOG_DEBUG, "Fax already handled\n");
zt_confmute(p, 0);
p->subs[index].f.frametype = AST_FRAME_NULL;
f = &p->subs[index].f;
return f;
}
- if (!(p->radio || (p->oprmode < 0))) {
- if (option_debug)
- ast_log(LOG_DEBUG, "Exception on %d, channel %d\n", ast->fds[0],p->channel);
- }
+ if (!(p->radio || (p->oprmode < 0)) && option_debug)
+ ast_log(LOG_DEBUG, "Exception on %d, channel %d\n", ast->fds[0],p->channel);
/* If it's not us, return NULL immediately */
if (ast != p->owner) {
ast_log(LOG_WARNING, "We're %s, not %s\n", ast->name, p->owner->name);