diff options
author | Joshua Colp <jcolp@digium.com> | 2009-04-03 16:47:27 +0000 |
---|---|---|
committer | Joshua Colp <jcolp@digium.com> | 2009-04-03 16:47:27 +0000 |
commit | 2d9c6ef3d501b1fb7ebdd2fa5bc2e530ed55b6c0 (patch) | |
tree | 9a47da9503ee4492361033db1e1d338c3bfd5816 /channels/chan_iax2.c | |
parent | 547b5c7e90af7d0088cb81a16a0fe8afd156d3a0 (diff) |
Add better support for relaying success or failure of the ast_transfer() API call.
This API call now waits for a special frame from the underlying channel driver to
indicate success or failure. This allows the return value to truly convey whether
the transfer worked or not. In the case of the Transfer() dialplan application this
means the value of the TRANSFERSTATUS dialplan variable is actually true.
(closes issue #12713)
Reported by: davidw
Tested by: file
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186382 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_iax2.c')
-rw-r--r-- | channels/chan_iax2.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index 47f1ddc84..860e1d614 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -4413,6 +4413,7 @@ static int iax2_transfer(struct ast_channel *c, const char *dest) unsigned short callno = PTR_TO_CALLNO(c->tech_pvt); struct iax_ie_data ied = { "", }; char tmp[256], *context; + enum ast_control_transfer message = AST_TRANSFER_SUCCESS; ast_copy_string(tmp, dest, sizeof(tmp)); context = strchr(tmp, '@'); if (context) { @@ -4423,6 +4424,7 @@ static int iax2_transfer(struct ast_channel *c, const char *dest) if (context) iax_ie_append_str(&ied, IAX_IE_CALLED_CONTEXT, context); ast_debug(1, "Transferring '%s' to '%s'\n", c->name, dest); + ast_queue_control_data(c, AST_CONTROL_TRANSFER, &message, sizeof(message)); return send_command_locked(callno, AST_FRAME_IAX, IAX_COMMAND_TRANSFER, 0, ied.buf, ied.pos, -1); } |