diff options
author | mogorman <mogorman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-05-23 18:23:05 +0000 |
---|---|---|
committer | mogorman <mogorman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-05-23 18:23:05 +0000 |
commit | ec8ef55d83c680b3010ff9370cd2c0a027c1d28b (patch) | |
tree | 9072f302e62271737f22a758ef0a370d92db277f /res | |
parent | 1df81b557eef43ecd357f21b2d7f5439ffb2f291 (diff) |
allows for configurable answer timeout on attended transfer
patch 0006763 with minor changes.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@29766 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rw-r--r-- | res/res_features.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/res/res_features.c b/res/res_features.c index 54c9a4c3b..35c203451 100644 --- a/res/res_features.c +++ b/res/res_features.c @@ -70,6 +70,7 @@ static void FREE(void *ptr) #define DEFAULT_PARK_TIME 45000 #define DEFAULT_TRANSFER_DIGIT_TIMEOUT 3000 #define DEFAULT_FEATURE_DIGIT_TIMEOUT 500 +#define DEFAULT_NOANSWER_TIMEOUT_ATTENDED_TRANSFER 15000 #define AST_MAX_WATCHERS 256 @@ -96,6 +97,8 @@ static int adsipark; static int transferdigittimeout; static int featuredigittimeout; +static int atxfernoanswertimeout; + static char *registrar = "res_features"; /*!< Registrar for operations */ /* module and CLI command definitions */ @@ -722,7 +725,7 @@ static int builtin_atxfer(struct ast_channel *chan, struct ast_channel *peer, st l = strlen(xferto); snprintf(xferto + l, sizeof(xferto) - l, "@%s/n", transferer_real_context); /* append context */ newchan = ast_feature_request_and_dial(transferer, "Local", ast_best_codec(transferer->nativeformats), - xferto, 15000, &outstate, transferer->cid.cid_num, transferer->cid.cid_name); + xferto, atxfernoanswertimeout, &outstate, transferer->cid.cid_num, transferer->cid.cid_name); ast_indicate(transferer, -1); if (!newchan) { finishup(transferee); @@ -1986,6 +1989,7 @@ static int load_config(void) transferdigittimeout = DEFAULT_TRANSFER_DIGIT_TIMEOUT; featuredigittimeout = DEFAULT_FEATURE_DIGIT_TIMEOUT; + atxfernoanswertimeout = DEFAULT_NOANSWER_TIMEOUT_ATTENDED_TRANSFER; cfg = ast_config_load("features.conf"); if (cfg) { @@ -2022,6 +2026,12 @@ static int load_config(void) ast_log(LOG_WARNING, "%s is not a valid featuredigittimeout\n", var->value); featuredigittimeout = DEFAULT_FEATURE_DIGIT_TIMEOUT; } + } else if (!strcasecmp(var->name, "atxfernoanswertimeout")) { + if ((sscanf(var->value, "%d", &atxfernoanswertimeout) != 1) || (atxfernoanswertimeout < 1)) { + ast_log(LOG_WARNING, "%s is not a valid atxfernoanswertimeout\n", var->value); + atxfernoanswertimeout = DEFAULT_NOANSWER_TIMEOUT_ATTENDED_TRANSFER; + } else + atxfernoanswertimeout = atxfernoanswertimeout * 1000; } else if (!strcasecmp(var->name, "courtesytone")) { ast_copy_string(courtesytone, var->value, sizeof(courtesytone)); } else if (!strcasecmp(var->name, "parkedplay")) { |