--- channels/chan_agent.c.orig Thu Apr 6 20:54:11 2006 +++ channels/chan_agent.c Thu Apr 6 21:27:29 2006 @@ -154,6 +154,7 @@ static int autologoff; static int wrapuptime; static int ackcall; +static int endcall; static int maxlogintries = 3; static char agentgoodbye[AST_MAX_FILENAME_LEN] = "vm-goodbye"; @@ -185,6 +186,7 @@ int abouttograb; /**< About to grab */ int autologoff; /**< Auto timeout time */ int ackcall; /**< ackcall */ + int endcall; /**< endcall */ time_t loginstart; /**< When agent first logged in (0 when logged off) */ time_t start; /**< When call started */ struct timeval lastdisc; /**< When last disconnected */ @@ -372,6 +374,7 @@ ast_copy_string(p->name, name ? name : "", sizeof(p->name)); ast_copy_string(p->moh, moh, sizeof(p->moh)); p->ackcall = ackcall; + p->endcall = endcall; p->autologoff = autologoff; /* If someone reduces the wrapuptime and reloads, we want it @@ -523,7 +526,7 @@ p->acknowledged = 1; ast_frfree(f); f = &answer_frame; - } else if (f->subclass == '*') { + } else if (f->subclass == '*' && p->endcall) { /* terminates call */ ast_frfree(f); f = NULL; @@ -1031,6 +1034,7 @@ autologoff = 0; wrapuptime = 0; ackcall = 0; + endcall = 1; cfg = ast_config_load(config); if (!cfg) { ast_log(LOG_NOTICE, "No agent configuration found -- agent support disabled\n"); @@ -1074,6 +1078,11 @@ ackcall = 1; else ackcall = 0; + } else if (!strcasecmp(v->name, "endcall")) { + if (ast_true(v->value)) + endcall = 1; + else + endcall = 0; } else if (!strcasecmp(v->name, "wrapuptime")) { wrapuptime = atoi(v->value); if (wrapuptime < 0) --- configs/agents.conf.sample.orig Thu Apr 6 21:28:43 2006 +++ configs/agents.conf.sample Thu Apr 6 21:29:32 2006 @@ -22,6 +22,11 @@ ; ;ackcall=no ; +; Define endcall to allow an agent to hangup a call by '*'. +; Default is "yes". Set this to "no" to ignore '*'. +; +;endcall=yes +; ; Define wrapuptime. This is the minimum amount of time when ; after disconnecting before the caller can receive a new call ; note this is in milliseconds.