diff options
author | dvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-06-03 15:26:16 +0000 |
---|---|---|
committer | dvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-06-03 15:26:16 +0000 |
commit | 26530c23e074d50110d825efcc986b1c38d43f22 (patch) | |
tree | 80951f31760dca6d1367acf93f8323838ad6fab6 /main/features.c | |
parent | a92d6019ce3c45f6033956e7f7b68838660cc28d (diff) |
Merged revisions 198856 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
........
r198856 | dvossel | 2009-06-02 16:17:49 -0500 (Tue, 02 Jun 2009) | 10 lines
Generic call forward api, ast_call_forward()
The function ast_call_forward() forwards a call to an extension specified in an ast_channel's call_forward string. After an ast_channel is called, if the channel's call_forward string is set this function can be used to forward the call to a new channel and terminate the original one. I have included this api call in both channel.c's ast_request_and_dial() and feature.c's feature_request_and_dial(). App_dial and app_queue already contain call forward logic specific for their application and options.
(closes issue #13630)
Reported by: festr
Review: https://reviewboard.asterisk.org/r/271/
........
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.1@198887 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/features.c')
-rw-r--r-- | main/features.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/main/features.c b/main/features.c index 86347bb46..57fc12c0c 100644 --- a/main/features.c +++ b/main/features.c @@ -2155,7 +2155,13 @@ static struct ast_channel *ast_feature_request_and_dial(struct ast_channel *call if (!active_channel) continue; - if (chan && (chan == active_channel)){ + if (chan && (chan == active_channel)) { + if (!ast_strlen_zero(chan->call_forward)) { + if (!(chan = ast_call_forward(caller, chan, &to, format, NULL, outstate))) { + return NULL; + } + continue; + } f = ast_read(chan); if (f == NULL) { /*doh! where'd he go?*/ state = AST_CONTROL_HANGUP; |