Fix recording the agent's calls by default
authorMartin Pycko <martinp@digium.com>
Thu, 12 Feb 2004 22:28:35 +0000 (22:28 +0000)
committerMartin Pycko <martinp@digium.com>
Thu, 12 Feb 2004 22:28:35 +0000 (22:28 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2160 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_agent.c

index bedf0cf..fd21df6 100755 (executable)
@@ -96,12 +96,12 @@ static ast_mutex_t usecnt_lock = AST_MUTEX_INITIALIZER;
 /* Protect the interface list (of sip_pvt's) */
 static ast_mutex_t agentlock = AST_MUTEX_INITIALIZER;
 
-int recordagentcalls = 0;
-char recordformat[AST_MAX_BUF];
-char recordformatext[AST_MAX_BUF];
-int createlink = 0;
-char urlprefix[AST_MAX_BUF];
-char savecallsin[AST_MAX_BUF];
+static int recordagentcalls = 0;
+static char recordformat[AST_MAX_BUF];
+static char recordformatext[AST_MAX_BUF];
+static int createlink = 0;
+static char urlprefix[AST_MAX_BUF];
+static char savecallsin[AST_MAX_BUF];
 
 #define GETAGENTBYCALLERID     "AGENTBYCALLERID"
 
@@ -354,7 +354,7 @@ static struct ast_frame  *agent_read(struct ast_channel *ast)
        }
        CLEANUP(ast,p);
        ast_mutex_unlock(&p->lock);
-       if (f == &answer_frame)
+       if (recordagentcalls && f == &answer_frame)
                agent_start_monitoring(ast,0);
        return f;
 }
@@ -484,7 +484,8 @@ static int agent_call(struct ast_channel *ast, char *dest, int timeout)
                        ast_setstate(ast, AST_STATE_RINGING);
                else {
                        ast_setstate(ast, AST_STATE_UP);
-                       agent_start_monitoring(ast,0);
+                       if (recordagentcalls)
+                               agent_start_monitoring(ast,0);
                        p->acknowledged = 1;
                }
                res = 0;