dect
/
asterisk
Archived
13
0
Fork 0

Added 'c' option to AgentMonitorOutgoing (like in wiki, wiki, wiki) which

changes source channel in CDR to agent id.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4418 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
jim 2004-12-10 17:37:20 +00:00
parent 65ad0cc7b4
commit 940085ffcb
1 changed files with 5 additions and 0 deletions

View File

@ -80,6 +80,7 @@ static char *descrip3 =
" AgentMonitorOutgoing([options]):\n"
"Tries to figure out the id of the agent who is placing outgoing call based on comparision of the callerid of the current interface and the global variable placed by the AgentCallbackLogin application. That's why it should be used only with the AgentCallbackLogin app. Uses the monitoring functions in chan_agent instead of Monitor application. That have to be configured in the agents.conf file. Normally the app returns 0 unless the options are passed. Also if the callerid or the agentid are not specified it'll look for n+101 priority. The options are:\n"
" 'd' - make the app return -1 if there is an error condition and there is no extension n+101\n"
" 'c' - change the CDR so that the source of the call is 'Agent/agent_id'\n"
" 'n' - don't generate the warnings when there is no callerid or the agentid is not known. It's handy if you want to have one context for agent and non-agent calls.\n";
static char mandescr_agents[] =
@ -1761,6 +1762,7 @@ static int agentmonitoroutgoing_exec(struct ast_channel *chan, void *data)
{
int exitifnoagentid = 0;
int nowarnings = 0;
int changeoutgoing = 0;
int res = 0;
char agent[AST_MAX_AGENT], *tmp;
if (data) {
@ -1768,6 +1770,8 @@ static int agentmonitoroutgoing_exec(struct ast_channel *chan, void *data)
exitifnoagentid = 1;
if (strchr(data, 'n'))
nowarnings = 1;
if (strchr(data, 'c'))
changeoutgoing = 1;
}
if (chan->cid.cid_num) {
char agentvar[AST_MAX_BUF];
@ -1778,6 +1782,7 @@ static int agentmonitoroutgoing_exec(struct ast_channel *chan, void *data)
ast_mutex_lock(&agentlock);
while (p) {
if (!strcasecmp(p->agent, tmp)) {
if (changeoutgoing) snprintf(chan->cdr->channel, sizeof(chan->cdr->channel), "Agent/%s", p->agent);
__agent_start_monitoring(chan, p, 1);
break;
}