diff options
author | Mark Spencer <markster@digium.com> | 2003-05-14 05:33:06 +0000 |
---|---|---|
committer | Mark Spencer <markster@digium.com> | 2003-05-14 05:33:06 +0000 |
commit | 8f27350e65509ac51e7e922b6934217226664634 (patch) | |
tree | 23b90a95ccbc1acc8ade932120bf3a913ab9b097 /channel.c | |
parent | 8e280ab712912b526a44021cd84915a491e80faa (diff) |
Add transfer to IAX2, and transfer application
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1016 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channel.c')
-rwxr-xr-x | channel.c | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -1568,6 +1568,26 @@ int ast_call(struct ast_channel *chan, char *addr, int timeout) return res; } +int ast_transfer(struct ast_channel *chan, char *dest) +{ + /* Place an outgoing call, but don't wait any longer than timeout ms before returning. + If the remote end does not answer within the timeout, then do NOT hang up, but + return anyway. */ + int res = -1; + /* Stop if we're a zombie or need a soft hangup */ + ast_pthread_mutex_lock(&chan->lock); + if (!chan->zombie && !ast_check_hangup(chan)) { + if (chan->pvt->transfer) { + res = chan->pvt->transfer(chan, dest); + if (!res) + res = 1; + } else + res = 0; + } + pthread_mutex_unlock(&chan->lock); + return res; +} + int ast_readstring(struct ast_channel *c, char *s, int len, int timeout, int ftimeout, char *enders) { int pos=0; |