aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_agent.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2005-03-22 19:10:21 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2005-03-22 19:10:21 +0000
commitcb40ed923620e575770a13b9da0edc0e9123e301 (patch)
treecf4149fd4186f1c1454a1c10a8fdf58dc79b8d7a /channels/chan_agent.c
parent61ade402beb2d8479f864b6d077b6cae351343ca (diff)
Fix chan_agent segfault (bug #3590)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5229 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_agent.c')
-rwxr-xr-xchannels/chan_agent.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/channels/chan_agent.c b/channels/chan_agent.c
index bec6526be..3e0749c7f 100755
--- a/channels/chan_agent.c
+++ b/channels/chan_agent.c
@@ -381,10 +381,10 @@ static struct ast_frame *agent_read(struct ast_channel *ast)
if (!f) {
/* If there's a channel, hang it up (if it's on a callback) make it NULL */
if (p->chan) {
+ p->chan->_bridge = NULL;
/* Note that we don't hangup if it's not a callback because Asterisk will do it
for us when the PBX instance that called login finishes */
if (!ast_strlen_zero(p->loginchan)) {
- p->chan->_bridge = NULL;
if (p->chan)
ast_log(LOG_DEBUG, "Bridge on '%s' being cleared (2)\n", p->chan->name);
ast_hangup(p->chan);
@@ -639,6 +639,7 @@ static int agent_hangup(struct ast_channel *ast)
} else
p->start = 0;
if (p->chan) {
+ p->chan->_bridge = NULL;
/* If they're dead, go ahead and hang up on the agent now */
if (!ast_strlen_zero(p->loginchan)) {
/* Store last disconnect time */
@@ -2119,7 +2120,7 @@ int load_module()
ast_register_application(app2, callback_exec, synopsis2, descrip2);
ast_register_application(app3, agentmonitoroutgoing_exec, synopsis3, descrip3);
/* Manager command */
- ast_manager_register2("Agents", 0, action_agents, "Lists agents and their status", mandescr_agents);
+ ast_manager_register2("Agents", EVENT_FLAG_AGENT, action_agents, "Lists agents and their status", mandescr_agents);
/* CLI Application */
ast_cli_register(&cli_show_agents);
ast_cli_register(&cli_agent_logoff);