]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Cleaning up a few things in detect disconnect patch
authorDavid Vossel <dvossel@digium.com>
Thu, 19 Mar 2009 19:40:07 +0000 (19:40 +0000)
committerDavid Vossel <dvossel@digium.com>
Thu, 19 Mar 2009 19:40:07 +0000 (19:40 +0000)
Initialized ast_call_feature in detect_disconnect to avoid accessing uninitialized memory.  Cleaned up /param tags in features.h.  No longer send dynamic features in ast_feature_detect.

issue #11583

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@183386 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_dial.c
include/asterisk/features.h
res/res_features.c

index 63d00a7d427c42d633bb85e1a648c51d810d2ac6..bb5e9570c293847f34b079900df4c7b72d6d4706 100644 (file)
@@ -792,7 +792,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct dial_l
 static int detect_disconnect(struct ast_channel *chan, char code, char *featurecode, int len)
 {
        struct ast_flags features = { AST_FEATURE_DISCONNECT }; /* only concerned with disconnect feature */
-       struct ast_call_feature feature;
+       struct ast_call_feature feature = { 0, };
        char *tmp;
        int res;
 
index 7e4de197267b7e8090fa509eccb9c31e722c20fe..4ecf593769d58de94ee562a623e4b96c511e7e3c 100644 (file)
@@ -101,7 +101,11 @@ char *ast_pickup_ext(void);
 int ast_bridge_call(struct ast_channel *chan, struct ast_channel *peer,struct ast_bridge_config *config);
 
 /*! \brief detect a feature before bridging 
-    \param chan, ast_flags ptr, code, ast_call_feature ptr to be set if found */
+    \param chan
+    \param ast_flags ptr
+    \param char ptr of input code
+    \retval ast_call_feature ptr to be set if found 
+    \return result, was feature found or not */
 int ast_feature_detect(struct ast_channel *chan, struct ast_flags *features, char *code, struct ast_call_feature *feature);
 
 /*! \brief Pickup a call */
index 631d8ebca8ede2f9903fbde922ed7e886c1612dc..c6d00e810e6c8007b002c415f82bfdd72299f990 100644 (file)
@@ -1344,12 +1344,7 @@ static int feature_interpret(struct ast_channel *chan, struct ast_channel *peer,
 
 int ast_feature_detect(struct ast_channel *chan, struct ast_flags *features, char *code, struct ast_call_feature *feature) {
 
-       char *dynamic_features;
-       ast_channel_lock(chan);
-       dynamic_features = ast_strdupa(S_OR(pbx_builtin_getvar_helper(chan, "DYNAMIC_FEATURES"),""));
-       ast_channel_unlock(chan);
-
-       return feature_interpret_helper(chan, NULL, NULL, code, 0, dynamic_features, features, 0, feature);
+       return feature_interpret_helper(chan, NULL, NULL, code, 0, NULL, features, 0, feature);
 }
 
 static void set_config_flags(struct ast_channel *chan, struct ast_channel *peer, struct ast_bridge_config *config)