diff options
author | bweschke <bweschke@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-05-22 16:43:43 +0000 |
---|---|---|
committer | bweschke <bweschke@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-05-22 16:43:43 +0000 |
commit | fb49b068213949756fa23ce19f695e26967e69b3 (patch) | |
tree | 6bd3ba904b5634988db52e6c9201ed21e4ac4613 /res | |
parent | 2ab75628b15e3fa4f49d7bd5b46a30d3512ce232 (diff) |
This is part 2/2 of the patches for #7090. Adds one-step call parking to /trunk via builtin functions and 'k' 'K' application options added to app_dial. This also resolves #6340.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@29467 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rw-r--r-- | res/res_features.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/res/res_features.c b/res/res_features.c index f71f6a913..8ab36c6c8 100644 --- a/res/res_features.c +++ b/res/res_features.c @@ -426,6 +426,37 @@ static void set_peers(struct ast_channel **caller, struct ast_channel **callee, } } +static int builtin_parkcall(struct ast_channel *chan, struct ast_channel *peer, struct ast_bridge_config *config, char *code, int sense) +{ + struct ast_channel *parker; + struct ast_channel *parkee; + + int res=0; + struct localuser *u; + LOCAL_USER_ADD(u); + + set_peers(&parker, &parkee, peer, chan, sense); + /* Setup the exten/priority to be s/1 since we don't know + where this call should return */ + strcpy(chan->exten, "s"); + chan->priority = 1; + if (chan->_state != AST_STATE_UP) + res = ast_answer(chan); + if (!res) + res = ast_safe_sleep(chan, 1000); + if (!res) + res = ast_park_call(parkee, parker, 0, NULL); + LOCAL_USER_REMOVE(u); + if (!res) { + if (sense == FEATURE_SENSE_CHAN) + res = AST_PBX_NO_HANGUP_PEER; + else + res = AST_PBX_KEEPALIVE; + } + return res; + +} + static int builtin_automonitor(struct ast_channel *chan, struct ast_channel *peer, struct ast_bridge_config *config, char *code, int sense) { char *caller_chan_id = NULL, *callee_chan_id = NULL, *args = NULL, *touch_filename = NULL; @@ -779,6 +810,7 @@ struct ast_call_feature builtin_features[] = { AST_FEATURE_REDIRECT, "Attended Transfer", "atxfer", "", "", builtin_atxfer, AST_FEATURE_FLAG_NEEDSDTMF }, { AST_FEATURE_AUTOMON, "One Touch Monitor", "automon", "", "", builtin_automonitor, AST_FEATURE_FLAG_NEEDSDTMF }, { AST_FEATURE_DISCONNECT, "Disconnect Call", "disconnect", "*", "*", builtin_disconnect, AST_FEATURE_FLAG_NEEDSDTMF }, + { AST_FEATURE_PARKCALL, "Park Call", "parkcall", "", "", builtin_parkcall, AST_FEATURE_FLAG_NEEDSDTMF }, }; |