aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_agent.c
diff options
context:
space:
mode:
authormartinp <martinp@f38db490-d61c-443f-a65b-d21fe96a405b>2004-02-10 21:14:48 +0000
committermartinp <martinp@f38db490-d61c-443f-a65b-d21fe96a405b>2004-02-10 21:14:48 +0000
commit54cc2eeabf0999f337198f5df53c97d296177182 (patch)
tree7934131265a890ebe5a44f8f69d185a554ff6b55 /channels/chan_agent.c
parentfc25b74b7629ca21849965a197b67089f23fef12 (diff)
Fix some minor errors: when logging off using AgentCallbackLogin don't put again the global *AGENTID* variable. Remove the '.' from the link that is put in the userfiled of CDR record
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@2149 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_agent.c')
-rwxr-xr-xchannels/chan_agent.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/channels/chan_agent.c b/channels/chan_agent.c
index 8e16bcfe1..bedf0cf1d 100755
--- a/channels/chan_agent.c
+++ b/channels/chan_agent.c
@@ -272,9 +272,10 @@ static int __agent_start_monitoring(struct ast_channel *ast, struct agent_pvt *p
return -1;
if (!ast->monitor) {
snprintf(filename, sizeof(filename), "agent-%s-%s",p->agent, ast->uniqueid);
- snprintf(tmp, sizeof(tmp), "%s%s",savecallsin ? savecallsin : "", filename);
- if ((pointer = strchr(tmp, '.')))
+ /* substitute . for - */
+ if ((pointer = strchr(filename, '.')))
*pointer = '-';
+ snprintf(tmp, sizeof(tmp), "%s%s",savecallsin ? savecallsin : "", filename);
ast_monitor_start(ast, recordformat, tmp, needlock);
ast_monitor_setjoinfiles(ast, 1);
snprintf(tmp2, sizeof(tmp2), "%s%s.%s", urlprefix ? urlprefix : "", filename, recordformatext);
@@ -1228,11 +1229,14 @@ static int __login_exec(struct ast_channel *chan, void *data, int callbackmode)
if (!strlen(p->loginchan))
filename = "agent-loggedoff";
p->acknowledged = 0;
- /* clear the global variable that stores agentid based on the callerid */
+ /* store/clear the global variable that stores agentid based on the callerid */
if (chan->callerid) {
char agentvar[AST_MAX_BUF];
snprintf(agentvar, sizeof(agentvar), "%s_%s",GETAGENTBYCALLERID, chan->callerid);
- pbx_builtin_setvar_helper(NULL, agentvar, NULL);
+ if (!strlen(p->loginchan))
+ pbx_builtin_setvar_helper(NULL, agentvar, NULL);
+ else
+ pbx_builtin_setvar_helper(NULL, agentvar, p->agent);
}
}
} else {
@@ -1274,12 +1278,6 @@ static int __login_exec(struct ast_channel *chan, void *data, int callbackmode)
res = ast_waitstream(chan, "");
if (!res)
res = ast_safe_sleep(chan, 1000);
- /* store agent id based on the callerid as a global variable */
- if (chan->callerid) {
- char agentvar[AST_MAX_BUF];
- snprintf(agentvar, sizeof(agentvar), "%s_%s",GETAGENTBYCALLERID, chan->callerid);
- pbx_builtin_setvar_helper(NULL, agentvar, p->agent);
- }
ast_mutex_unlock(&p->lock);
} else if (!res) {
#ifdef HONOR_MUSIC_CLASS