From 9764d18ab1b24633dfbe1ce6bc846f52f2ddd8b8 Mon Sep 17 00:00:00 2001 From: murf Date: Mon, 2 Feb 2009 19:02:24 +0000 Subject: This reverts the changes I made for 11583; will reviewboard this before committing again... reopened 11583 until all Russell's issues are resolved. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@172929 f38db490-d61c-443f-a65b-d21fe96a405b --- apps/app_dial.c | 57 ++------------------------------------------------------- 1 file changed, 2 insertions(+), 55 deletions(-) (limited to 'apps/app_dial.c') diff --git a/apps/app_dial.c b/apps/app_dial.c index 3fff300ca..849c0c527 100644 --- a/apps/app_dial.c +++ b/apps/app_dial.c @@ -560,7 +560,6 @@ struct chanlist { uint64_t flags; }; -static int detect_disconnect(struct ast_channel *chan, char code); static void hanguptree(struct chanlist *outgoing, struct ast_channel *exception, int answered_elsewhere) { @@ -1055,8 +1054,8 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, } if (ast_test_flag64(peerflags, OPT_CALLER_HANGUP) && - detect_disconnect(in, f->subclass)) { - ast_verb(3, "User requested call disconnect.\n"); + (f->subclass == '*')) { /* hmm it it not guaranteed to be '*' anymore. */ + ast_verb(3, "User hit %c to disconnect call.\n", f->subclass); *to = 0; strcpy(pa->status, "CANCEL"); ast_cdr_noanswer(in->cdr); @@ -1100,58 +1099,6 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, return peer; } -static char featurecode[FEATURE_MAX_LEN + 1] = ""; - -static int detect_disconnect(struct ast_channel *chan, char code) -{ - struct feature_interpret_result result; - int x; - struct ast_flags features; - int res = FEATURE_RETURN_PASSDIGITS; - struct ast_call_feature *feature; - char *cptr; - const char *dynamic_features = pbx_builtin_getvar_helper(chan, "DYNAMIC_FEATURES"); - int len; - - len = strlen(featurecode); - if (len >= FEATURE_MAX_LEN) { - featurecode[0] = '\0'; - } - cptr = &featurecode[strlen(featurecode)]; - cptr[0] = code; - cptr[1] = '\0'; - - memset(&features, 0, sizeof(struct ast_flags)); - ast_set_flag(&features, AST_FEATURE_DISCONNECT); - - ast_features_lock(); - - res = ast_feature_detect(chan, &features, featurecode, &result, dynamic_features); - - if (res != FEATURE_RETURN_STOREDIGITS) - featurecode[0] = '\0'; - - - if (result.builtin_feature && result.builtin_feature->feature_mask & AST_FEATURE_DISCONNECT) { - ast_features_unlock(); - return 1; - } - - for (x = 0; x < result.num_dyn_features; ++x) { - feature = result.dynamic_features[x]; - if (feature->feature_mask & AST_FEATURE_DISCONNECT) { - ast_features_unlock(); - return 1; - } - } - - ast_features_unlock(); - - return 0; -} - - - static void replace_macro_delimiter(char *s) { for (; *s; s++) -- cgit v1.2.3