summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Peeler <jpeeler@digium.com>2008-10-06 23:08:21 +0000
committerJeff Peeler <jpeeler@digium.com>2008-10-06 23:08:21 +0000
commit2ec290b09dee72f1ed2b19f7ed071df8b4acc696 (patch)
treed5b45e9bcc4844c04446f17d406498ed115bb4ea
parent623bc9d82ab1a42c6c35224b01a06965e124ab59 (diff)
Similar to r143204, masquerade the channel in the case of Park being called from AGI.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@146923 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r--include/asterisk/features.h2
-rw-r--r--main/features.c2
-rw-r--r--res/res_agi.c4
3 files changed, 7 insertions, 1 deletions
diff --git a/include/asterisk/features.h b/include/asterisk/features.h
index ac745101d..723373f94 100644
--- a/include/asterisk/features.h
+++ b/include/asterisk/features.h
@@ -33,6 +33,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 */
enum {
diff --git a/main/features.c b/main/features.c
index 87d130528..41fc088e9 100644
--- a/main/features.c
+++ b/main/features.c
@@ -159,7 +159,7 @@ static char *descrip = "ParkedCall(exten): "
"context. If no extension is provided, then the first available\n"
"parked call will be acquired.\n";
-static char *parkcall = "Park";
+static char *parkcall = PARK_APP_NAME;
static char *synopsis2 = "Park yourself";
diff --git a/res/res_agi.c b/res/res_agi.c
index d5cd0961f..d4cbd6f16 100644
--- a/res/res_agi.c
+++ b/res/res_agi.c
@@ -56,6 +56,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/ast_version.h"
#include "asterisk/speech.h"
#include "asterisk/manager.h"
+#include "asterisk/features.h"
#define MAX_ARGS 128
#define AGI_NANDFS_RETRY 3
@@ -1457,6 +1458,9 @@ static int handle_exec(struct ast_channel *chan, AGI *agi, int argc, char **argv
ast_verb(3, "AGI Script Executing Application: (%s) Options: (%s)\n", argv[1], argv[2]);
if ((app_to_exec = pbx_findapp(argv[1]))) {
+ if(!strcasecmp(argv[1], PARK_APP_NAME)) {
+ ast_masq_park_call(chan, NULL, 0, NULL);
+ }
if (ast_compat_res_agi && !ast_strlen_zero(argv[2])) {
char *compat = alloca(strlen(argv[2]) * 2 + 1), *cptr, *vptr;
for (cptr = compat, vptr = argv[2]; *vptr; vptr++) {