Add transfer to IAX2, and transfer application

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1016 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Spencer
2003-05-14 05:33:06 +00:00
parent 8e280ab712
commit 8f27350e65
10 changed files with 164 additions and 4 deletions

View File

@@ -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;