aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_chanspy.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/app_chanspy.c')
-rwxr-xr-xapps/app_chanspy.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/apps/app_chanspy.c b/apps/app_chanspy.c
index defb190fe..fefce3163 100755
--- a/apps/app_chanspy.c
+++ b/apps/app_chanspy.c
@@ -540,24 +540,26 @@ static int chanspy_exec(struct ast_channel *chan, void *data)
return -1;
}
+ LOCAL_USER_ADD(u);
+
oldrf = chan->readformat;
oldwf = chan->writeformat;
if (ast_set_read_format(chan, AST_FORMAT_SLINEAR) < 0) {
ast_log(LOG_ERROR, "Could Not Set Read Format.\n");
+ LOCAL_USER_REMOVE(u);
return -1;
}
if (ast_set_write_format(chan, AST_FORMAT_SLINEAR) < 0) {
ast_log(LOG_ERROR, "Could Not Set Write Format.\n");
+ LOCAL_USER_REMOVE(u);
return -1;
}
- LOCAL_USER_ADD(u);
ast_answer(chan);
ast_set_flag(chan, AST_FLAG_SPYING); /* so nobody can spy on us while we are spying */
-
if ((argc = ast_separate_app_args(args, '|', argv, sizeof(argv) / sizeof(argv[0])))) {
spec = argv[0];
if ( argc > 1) {