aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_agent.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-07-03 04:19:09 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-07-03 04:19:09 +0000
commit60f32b41b9db75c382cc8339aa4e2c713b3b5b2a (patch)
treef3793ab046d5cd71925de15d7fd949e84ea541b9 /channels/chan_agent.c
parentc7bae4c5900fb330ea3125bb184ada50d929cea4 (diff)
use ast_set_callerid to be more consistent and to make sure that the
"callerid" option in the conf files is always handled the same way and sets ANI (issue #7285, gkloepfer) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@36725 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_agent.c')
-rw-r--r--channels/chan_agent.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/channels/chan_agent.c b/channels/chan_agent.c
index 0d0c9eba1..e41ee0994 100644
--- a/channels/chan_agent.c
+++ b/channels/chan_agent.c
@@ -661,18 +661,8 @@ static int agent_call(struct ast_channel *ast, char *dest, int timeout)
/* Call on this agent */
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "outgoing agentcall, to agent '%s', on '%s'\n", p->agent, p->chan->name);
- if (p->chan->cid.cid_num)
- free(p->chan->cid.cid_num);
- if (ast->cid.cid_num)
- p->chan->cid.cid_num = strdup(ast->cid.cid_num);
- else
- p->chan->cid.cid_num = NULL;
- if (p->chan->cid.cid_name)
- free(p->chan->cid.cid_name);
- if (ast->cid.cid_name)
- p->chan->cid.cid_name = strdup(ast->cid.cid_name);
- else
- p->chan->cid.cid_name = NULL;
+ ast_set_callerid(p->chan,
+ ast->cid.cid_num, ast->cid.cid_name, NULL);
ast_channel_inherit_variables(ast, p->chan);
res = ast_call(p->chan, p->loginchan, 0);
CLEANUP(ast,p);