aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-07-27 04:27:18 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-07-27 04:27:18 +0000
commit3041b05fcae21ac62faa50b7f6aca0ddfb48f18e (patch)
tree185df46fe544ba5f2ed82fae0bc82cd547240288
parent8ce804e1c170fd3453ed44cdf87b432ca62a5f5d (diff)
Properly handle hangups on agent, improve formatting of sample agents.conf
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1228 f38db490-d61c-443f-a65b-d21fe96a405b
-rwxr-xr-xchannels/chan_agent.c9
-rwxr-xr-xconfigs/agents.conf.sample1
2 files changed, 7 insertions, 3 deletions
diff --git a/channels/chan_agent.c b/channels/chan_agent.c
index 86a0149e5..34ae3dc4e 100755
--- a/channels/chan_agent.c
+++ b/channels/chan_agent.c
@@ -225,9 +225,11 @@ static struct ast_frame *agent_read(struct ast_channel *ast)
else
f = &null_frame;
if (!f) {
- /* If there's a channel, make it NULL */
- if (p->chan)
+ /* If there's a channel, hang it up and make it NULL */
+ if (p->chan) {
+ ast_hangup(p->chan);
p->chan = NULL;
+ }
}
if (f && (f->frametype == AST_FRAME_CONTROL) && (f->subclass == AST_CONTROL_ANSWER)) {
/* Don't pass answer along */
@@ -384,6 +386,7 @@ static int agent_hangup(struct ast_channel *ast)
ast_hangup(p->chan);
p->chan = NULL;
}
+ ast_log(LOG_DEBUG, "Hungup, howlong is %d, autologoff is %d\n", howlong, p->autologoff);
if (howlong && p->autologoff && (howlong > p->autologoff)) {
ast_log(LOG_NOTICE, "Agent '%s' didn't answer/confirm within %d seconds (waited %d)\n", p->name, p->autologoff, howlong);
strcpy(p->loginchan, "");
@@ -880,7 +883,7 @@ static int __login_exec(struct ast_channel *chan, void *data, int callbackmode)
if( options )
if( strchr( options, 's' ) )
play_announcement = 0;
- if( play_announcement )
+ if( !res && play_announcement )
res = ast_streamfile(chan, filename, chan->language);
if (!res)
ast_waitstream(chan, "");
diff --git a/configs/agents.conf.sample b/configs/agents.conf.sample
index b12892e7d..7914405e5 100755
--- a/configs/agents.conf.sample
+++ b/configs/agents.conf.sample
@@ -7,6 +7,7 @@
; Define autologoff times if appropriate. This is how long
; the phone has to ring with no answer before the agent is
; automatically logged off (in seconds)
+;
;autologoff=15
;
; Define the default musiconhold for agents