summaryrefslogtreecommitdiff
path: root/main/features.c
diff options
context:
space:
mode:
authorDavid Vossel <dvossel@digium.com>2009-06-02 21:17:49 +0000
committerDavid Vossel <dvossel@digium.com>2009-06-02 21:17:49 +0000
commit3830c415c74dff744d044271453e15d36e6c4bb4 (patch)
treed601a0e2ddfaa00461f18697efcbf6ee54f01f5b /main/features.c
parent61bc1854d578cc5a55d36b80bc1afa1b322522b4 (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 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: https://origsvn.digium.com/svn/asterisk/trunk@198856 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/features.c')
-rw-r--r--main/features.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/main/features.c b/main/features.c
index 6c15f258d..d4a5e5db6 100644
--- a/main/features.c
+++ b/main/features.c
@@ -2380,6 +2380,12 @@ static struct ast_channel *feature_request_and_dial(struct ast_channel *caller,
continue;
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;