diff options
author | dvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-06-03 15:49:46 +0000 |
---|---|---|
committer | dvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-06-03 15:49:46 +0000 |
commit | ec2b265188e685c041b0dbd1f5e978a633e84a25 (patch) | |
tree | b5c72ee1283d4635873fb2ca516923fddfd876ce /res | |
parent | a72bf02d896b823eb9560b7f4e87a65a1b571a4a (diff) |
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 res_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.4@198891 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rw-r--r-- | res/res_features.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/res/res_features.c b/res/res_features.c index f5aca846f..235d46ea1 100644 --- a/res/res_features.c +++ b/res/res_features.c @@ -1445,7 +1445,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; |