aboutsummaryrefslogtreecommitdiffstats
path: root/channel.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-05-14 05:33:06 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-05-14 05:33:06 +0000
commit67b5919a15a97bce261c4dc98a14c5d8aeab0154 (patch)
tree23b90a95ccbc1acc8ade932120bf3a913ab9b097 /channel.c
parent1fbfb13dba848484eb0bcf1364c35d348b96ca8d (diff)
Add transfer to IAX2, and transfer application
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1016 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channel.c')
-rwxr-xr-xchannel.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/channel.c b/channel.c
index 0a9363a8f..ecd7c5fa4 100755
--- a/channel.c
+++ b/channel.c
@@ -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;