--- channels/chan_agent.c.orig Sat Apr 15 17:24:39 2006 +++ channels/chan_agent.c Sat Apr 15 17:29:01 2006 @@ -156,6 +156,7 @@ static int autologoff; static int wrapuptime; static int ackcall; +static int endcall; static int multiplelogin = 1; static int autologoffunavail = 0; @@ -182,6 +183,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 */ @@ -342,6 +344,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 @@ -498,7 +501,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; @@ -988,6 +991,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"); @@ -1032,6 +1036,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)