summaryrefslogtreecommitdiff
path: root/channels/chan_zap.c
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2008-04-03 14:35:47 +0000
committerMark Michelson <mmichelson@digium.com>2008-04-03 14:35:47 +0000
commit3fd8236d28aae356dfd838430f32b8ead9dcb680 (patch)
tree0d4d56e2fb63d0be96925c3313a277191ca2f664 /channels/chan_zap.c
parent0e6140c564e8c1376a1a069f8d6d1338e019e6ea (diff)
Merged revisions 112599 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r112599 | mmichelson | 2008-04-03 09:32:20 -0500 (Thu, 03 Apr 2008) | 9 lines 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: https://origsvn.digium.com/svn/asterisk/trunk@112600 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_zap.c')
-rw-r--r--channels/chan_zap.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/channels/chan_zap.c b/channels/chan_zap.c
index beb3c33fc..1666596ae 100644
--- a/channels/chan_zap.c
+++ b/channels/chan_zap.c
@@ -4978,15 +4978,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_debug(1, "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_debug(1, "Sent deferred digit string: %s\n", p->dop.dialstr);
+ }
p->dop.dialstr[0] = '\0';
break;
default:
@@ -5007,15 +5007,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_debug(1, "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_debug(1, "Sent deferred digit string: %s\n", p->dop.dialstr);
+ }
p->dop.dialstr[0] = '\0';
p->dop.op = ZT_DIAL_OP_REPLACE;
break;