Make features configurable and easier to implement

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4650 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Spencer
2005-01-04 04:01:40 +00:00
parent 7754314450
commit e7d4ae8efa
6 changed files with 412 additions and 195 deletions

View File

@@ -1135,12 +1135,18 @@ static int dial_exec(struct ast_channel *chan, void *data)
if (!res) {
memset(&config,0,sizeof(struct ast_bridge_config));
config.play_to_caller=play_to_caller;
config.play_to_callee=play_to_callee;
config.allowredirect_in = allowredir_in;
config.allowredirect_out = allowredir_out;
config.allowdisconnect_in = allowdisconnect_in;
config.allowdisconnect_out = allowdisconnect_out;
if (play_to_caller)
config.features_caller |= AST_FEATURE_PLAY_WARNING;
if (play_to_callee)
config.features_callee |= AST_FEATURE_PLAY_WARNING;
if (allowredir_in)
config.features_callee |= AST_FEATURE_REDIRECT;
if (allowredir_out)
config.features_caller |= AST_FEATURE_REDIRECT;
if (allowdisconnect_in)
config.features_callee |= AST_FEATURE_DISCONNECT;
if (allowdisconnect_out)
config.features_caller |= AST_FEATURE_DISCONNECT;
config.timelimit = timelimit;
config.play_warning = play_warning;
config.warning_freq = warning_freq;

View File

@@ -1480,10 +1480,14 @@ static int try_calling(struct queue_ent *qe, char *options, char *announceoverri
time(&callstart);
memset(&config,0,sizeof(struct ast_bridge_config));
config.allowredirect_in = ast_test_flag(&flags, QUEUE_FLAG_REDIR_IN);
config.allowredirect_out = ast_test_flag(&flags, QUEUE_FLAG_REDIR_OUT);
config.allowdisconnect_in = ast_test_flag(&flags, QUEUE_FLAG_DISCON_IN);
config.allowdisconnect_out = ast_test_flag(&flags, QUEUE_FLAG_DISCON_OUT);
if (ast_test_flag(&flags, QUEUE_FLAG_REDIR_IN))
config.features_callee |= AST_FEATURE_REDIRECT;
if (ast_test_flag(&flags, QUEUE_FLAG_REDIR_OUT))
config.features_caller |= AST_FEATURE_REDIRECT;
if (ast_test_flag(&flags, QUEUE_FLAG_DISCON_IN))
config.features_callee |= AST_FEATURE_DISCONNECT;
if (ast_test_flag(&flags, QUEUE_FLAG_DISCON_OUT))
config.features_caller |= AST_FEATURE_DISCONNECT;
bridge = ast_bridge_call(qe->chan,peer,&config);
if (strcasecmp(oldcontext, qe->chan->context) || strcasecmp(oldexten, qe->chan->exten)) {