aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-04-03 14:32:20 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-04-03 14:32:20 +0000
commit89d6dfb83d1f008c9372fcfc831e2ddd8a3e8175 (patch)
treec8168974d9c4d1f908211abe5577e4e2859962b7 /channels
parent744a3dc1f28d3ff10308f8821c173aa59507ea55 (diff)
Fix the testing of the "res" variable so that it is more logically correct and
makes the correct warning and debug messages print. (closes issue #12361) Reported by: one47 Patches: chan_zap_deferred_digit.patch uploaded by one47 (license 23) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@112599 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_zap.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/channels/chan_zap.c b/channels/chan_zap.c
index 48d694f36..45ca1320e 100644
--- a/channels/chan_zap.c
+++ b/channels/chan_zap.c
@@ -4413,14 +4413,15 @@ static struct ast_frame *zt_handle_event(struct ast_channel *ast)
case SIG_SF_FEATDMF:
case SIG_SF_FEATB:
/* FGD MF *Must* wait for wink */
- if (!ast_strlen_zero(p->dop.dialstr))
+ if (!ast_strlen_zero(p->dop.dialstr)) {
res = ioctl(p->subs[SUB_REAL].zfd, ZT_DIAL, &p->dop);
- else if (res < 0) {
- ast_log(LOG_WARNING, "Unable to initiate dialing on trunk channel %d\n", p->channel);
- p->dop.dialstr[0] = '\0';
- return NULL;
- } else
- ast_log(LOG_DEBUG, "Sent deferred digit string: %s\n", p->dop.dialstr);
+ if (res < 0) {
+ ast_log(LOG_WARNING, "Unable to initiate dialing on trunk channel %d\n", p->channel);
+ p->dop.dialstr[0] = '\0';
+ return NULL;
+ } else
+ ast_log(LOG_DEBUG, "Sent deferred digit string: %s\n", p->dop.dialstr);
+ }
p->dop.dialstr[0] = '\0';
break;
default:
@@ -4441,14 +4442,15 @@ static struct ast_frame *zt_handle_event(struct ast_channel *ast)
case SIG_SF:
case SIG_SFWINK:
case SIG_SF_FEATD:
- if (!ast_strlen_zero(p->dop.dialstr))
+ if (!ast_strlen_zero(p->dop.dialstr)) {
res = ioctl(p->subs[SUB_REAL].zfd, ZT_DIAL, &p->dop);
- else if (res < 0) {
- ast_log(LOG_WARNING, "Unable to initiate dialing on trunk channel %d\n", p->channel);
- p->dop.dialstr[0] = '\0';
- return NULL;
- } else
- ast_log(LOG_DEBUG, "Sent deferred digit string: %s\n", p->dop.dialstr);
+ if (res < 0) {
+ ast_log(LOG_WARNING, "Unable to initiate dialing on trunk channel %d\n", p->channel);
+ p->dop.dialstr[0] = '\0';
+ return NULL;
+ } else
+ ast_log(LOG_DEBUG, "Sent deferred digit string: %s\n", p->dop.dialstr);
+ }
p->dop.dialstr[0] = '\0';
p->dop.op = ZT_DIAL_OP_REPLACE;
break;