]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
(closes issue #13425)
authorJeff Peeler <jpeeler@digium.com>
Fri, 3 Oct 2008 20:44:22 +0000 (20:44 +0000)
committerJeff Peeler <jpeeler@digium.com>
Fri, 3 Oct 2008 20:44:22 +0000 (20:44 +0000)
Reported by: mdu113
Tested by: mdu113

Similar to r143204, masquerade the channel in the case of Park being called from AGI.

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

include/asterisk/features.h
res/res_agi.c
res/res_features.c

index 7072406ab79fea8de338047bc3ba5824f1b1de51..e4e60fbc5b62b6bfd332b4215dc98c58933782e9 100644 (file)
@@ -31,6 +31,8 @@
 #define FEATURE_EXTEN_LEN      32
 #define FEATURE_MOH_LEN                80  /* same as MAX_MUSICCLASS from channel.h */
 
+#define PARK_APP_NAME "Park"
+
 /*! \brief main call feature structure */
 struct ast_call_feature {
        int feature_mask;
index 20bb9331b806eae282638c94189206f7c1055de2..a60155087c4c65f9b94dfeb9c4c94475dfff163f 100644 (file)
@@ -64,6 +64,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #include "asterisk/lock.h"
 #include "asterisk/strings.h"
 #include "asterisk/agi.h"
+#include "asterisk/features.h"
 
 #define MAX_ARGS 128
 #define MAX_COMMANDS 128
@@ -1110,6 +1111,9 @@ static int handle_exec(struct ast_channel *chan, AGI *agi, int argc, char **argv
        app = pbx_findapp(argv[1]);
 
        if (app) {
+               if(!strcasecmp(argv[1], PARK_APP_NAME)) {
+                       ast_masq_park_call(chan, NULL, 0, NULL);
+               }
                res = pbx_exec(chan, app, argv[2]);
        } else {
                ast_log(LOG_WARNING, "Could not find application (%s)\n", argv[1]);
@@ -2035,7 +2039,7 @@ static int agi_exec_full(struct ast_channel *chan, void *data, int enhanced, int
        int fds[2];
        int efd = -1;
        int pid;
-        char *stringp;
+       char *stringp;
        AGI agi;
 
        if (ast_strlen_zero(data)) {
index ce9b1d71716e4f16ba547caf3dbb9fc7408d320f..491ee40267f518c26148f2d2e0be7caacd4f0a10 100644 (file)
@@ -118,7 +118,7 @@ static char *descrip = "ParkedCall(exten):"
 "into the dialplan, although you should include the 'parkedcalls'\n"
 "context.\n";
 
-static char *parkcall = "Park";
+static char *parkcall = PARK_APP_NAME;
 
 static char *synopsis2 = "Park yourself";
 
@@ -565,7 +565,7 @@ 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, void *data)
 {
        struct ast_channel *parker;
-        struct ast_channel *parkee;
+       struct ast_channel *parkee;
        int res = 0;
        struct ast_module_user *u;