mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-19 19:52:48 +00:00
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: https://origsvn.digium.com/svn/asterisk/trunk@2149 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -272,9 +272,10 @@ static int __agent_start_monitoring(struct ast_channel *ast, struct agent_pvt *p
|
|||||||
return -1;
|
return -1;
|
||||||
if (!ast->monitor) {
|
if (!ast->monitor) {
|
||||||
snprintf(filename, sizeof(filename), "agent-%s-%s",p->agent, ast->uniqueid);
|
snprintf(filename, sizeof(filename), "agent-%s-%s",p->agent, ast->uniqueid);
|
||||||
snprintf(tmp, sizeof(tmp), "%s%s",savecallsin ? savecallsin : "", filename);
|
/* substitute . for - */
|
||||||
if ((pointer = strchr(tmp, '.')))
|
if ((pointer = strchr(filename, '.')))
|
||||||
*pointer = '-';
|
*pointer = '-';
|
||||||
|
snprintf(tmp, sizeof(tmp), "%s%s",savecallsin ? savecallsin : "", filename);
|
||||||
ast_monitor_start(ast, recordformat, tmp, needlock);
|
ast_monitor_start(ast, recordformat, tmp, needlock);
|
||||||
ast_monitor_setjoinfiles(ast, 1);
|
ast_monitor_setjoinfiles(ast, 1);
|
||||||
snprintf(tmp2, sizeof(tmp2), "%s%s.%s", urlprefix ? urlprefix : "", filename, recordformatext);
|
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))
|
if (!strlen(p->loginchan))
|
||||||
filename = "agent-loggedoff";
|
filename = "agent-loggedoff";
|
||||||
p->acknowledged = 0;
|
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) {
|
if (chan->callerid) {
|
||||||
char agentvar[AST_MAX_BUF];
|
char agentvar[AST_MAX_BUF];
|
||||||
snprintf(agentvar, sizeof(agentvar), "%s_%s",GETAGENTBYCALLERID, chan->callerid);
|
snprintf(agentvar, sizeof(agentvar), "%s_%s",GETAGENTBYCALLERID, chan->callerid);
|
||||||
|
if (!strlen(p->loginchan))
|
||||||
pbx_builtin_setvar_helper(NULL, agentvar, NULL);
|
pbx_builtin_setvar_helper(NULL, agentvar, NULL);
|
||||||
|
else
|
||||||
|
pbx_builtin_setvar_helper(NULL, agentvar, p->agent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -1274,12 +1278,6 @@ static int __login_exec(struct ast_channel *chan, void *data, int callbackmode)
|
|||||||
res = ast_waitstream(chan, "");
|
res = ast_waitstream(chan, "");
|
||||||
if (!res)
|
if (!res)
|
||||||
res = ast_safe_sleep(chan, 1000);
|
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);
|
ast_mutex_unlock(&p->lock);
|
||||||
} else if (!res) {
|
} else if (!res) {
|
||||||
#ifdef HONOR_MUSIC_CLASS
|
#ifdef HONOR_MUSIC_CLASS
|
||||||
|
Reference in New Issue
Block a user