diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-04-11 18:03:59 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-04-11 18:03:59 +0000 |
commit | 1717a020de2c90d5af80b26aa98e5efe8f05ecdb (patch) | |
tree | 33055b88818a1ea85ede2b293ac8da31b332ee07 /channels | |
parent | c729fc22e98dc349bf2bd09d1840a3ea7e7e609d (diff) |
Fix deferred dialing on FXO
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@830 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rwxr-xr-x | channels/chan_zap.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/channels/chan_zap.c b/channels/chan_zap.c index e67621cd8..7999d1952 100755 --- a/channels/chan_zap.c +++ b/channels/chan_zap.c @@ -1191,7 +1191,7 @@ static int zt_call(struct ast_channel *ast, char *rdest, int timeout) } if (c) { p->dop.op = ZT_DIAL_OP_REPLACE; - snprintf(p->dop.dialstr, sizeof(p->dop.dialstr), "T%s", c); + snprintf(p->dop.dialstr, sizeof(p->dop.dialstr), "Tw%s", c); ast_log(LOG_DEBUG, "FXO: setup deferred dialstring: %s\n", c); } else { strcpy(p->dop.dialstr, ""); @@ -2588,19 +2588,23 @@ static struct ast_frame *zt_handle_event(struct ast_channel *ast) /* Ignore answer if "confirm answer" is selected */ p->subs[index].f.frametype = AST_FRAME_NULL; p->subs[index].f.subclass = 0; - } else - ast_setstate(ast, AST_STATE_UP); - if (strlen(p->dop.dialstr)) { + } else if (strlen(p->dop.dialstr)) { /* nick@dccinc.com 4/3/03 - fxo should be able to do deferred dialing */ res = ioctl(p->subs[SUB_REAL].zfd, ZT_DIAL, &p->dop); 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); + } else { + ast_log(LOG_DEBUG, "Sent FXO deferred digit string: %s\n", p->dop.dialstr); + p->subs[index].f.frametype = AST_FRAME_NULL; + p->subs[index].f.subclass = 0; + p->dialing = 1; + } p->dop.dialstr[0] = '\0'; - } + ast_setstate(ast, AST_STATE_DIALING); + } else + ast_setstate(ast, AST_STATE_UP); return &p->subs[index].f; case AST_STATE_DOWN: ast_setstate(ast, AST_STATE_RING); |