summaryrefslogtreecommitdiff
path: root/channels/chan_agent.c
diff options
context:
space:
mode:
authorTerry Wilson <twilson@digium.com>2012-02-13 17:27:06 +0000
committerTerry Wilson <twilson@digium.com>2012-02-13 17:27:06 +0000
commit34c55e8e7c87a92181fca3e0101dc456eef2475b (patch)
treead27fca98a7df582348e14b0aaa42f0065cdef99 /channels/chan_agent.c
parenta955a4770fcdd7874e1337e7df694bcd293e020e (diff)
Opaquify char * and char[] in ast_channel
Review: https://reviewboard.asterisk.org/r/1733/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354968 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_agent.c')
-rw-r--r--channels/chan_agent.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/channels/chan_agent.c b/channels/chan_agent.c
index ca9a9ed21..a0fd09a98 100644
--- a/channels/chan_agent.c
+++ b/channels/chan_agent.c
@@ -1103,9 +1103,9 @@ static struct ast_channel *agent_new(struct agent_pvt *p, int state, const char
}
#endif
if (p->pending)
- tmp = ast_channel_alloc(0, state, 0, 0, "", p->chan ? p->chan->exten:"", p->chan ? p->chan->context:"", linkedid, 0, "Agent/P%s-%d", p->agent, (int) ast_random() & 0xffff);
+ tmp = ast_channel_alloc(0, state, 0, 0, "", p->chan ? ast_channel_exten(p->chan):"", p->chan ? ast_channel_context(p->chan):"", linkedid, 0, "Agent/P%s-%d", p->agent, (int) ast_random() & 0xffff);
else
- tmp = ast_channel_alloc(0, state, 0, 0, "", p->chan ? p->chan->exten:"", p->chan ? p->chan->context:"", linkedid, 0, "Agent/%s", p->agent);
+ tmp = ast_channel_alloc(0, state, 0, 0, "", p->chan ? ast_channel_exten(p->chan):"", p->chan ? ast_channel_context(p->chan):"", linkedid, 0, "Agent/%s", p->agent);
if (!tmp) {
ast_log(LOG_WARNING, "Unable to allocate agent channel structure\n");
return NULL;
@@ -1119,8 +1119,8 @@ static struct ast_channel *agent_new(struct agent_pvt *p, int state, const char
ast_format_copy(&tmp->readformat, &p->chan->readformat);
ast_format_copy(&tmp->rawreadformat, &p->chan->readformat);
ast_channel_language_set(tmp, ast_channel_language(p->chan));
- ast_copy_string(tmp->context, p->chan->context, sizeof(tmp->context));
- ast_copy_string(tmp->exten, p->chan->exten, sizeof(tmp->exten));
+ ast_channel_context_set(tmp, ast_channel_context(p->chan));
+ ast_channel_exten_set(tmp, ast_channel_exten(p->chan));
/* XXX Is this really all we copy form the originating channel?? */
} else {
ast_format_set(&tmp->writeformat, AST_FORMAT_SLINEAR, 0);
@@ -1353,7 +1353,7 @@ static int check_availability(struct agent_pvt *newlyavailable, int needlock)
/* Safe -- agent lock already held */
ast_setstate(parent, AST_STATE_UP);
ast_setstate(chan, AST_STATE_UP);
- ast_copy_string(parent->context, chan->context, sizeof(parent->context));
+ ast_channel_context_set(parent, ast_channel_context(chan));
ast_channel_masquerade(parent, chan);
ast_hangup(chan);
p->abouttograb = 0;