diff -urN asterisk-1.2.18.orig/channels/chan_agent.c asterisk-1.2.18/channels/chan_agent.c --- asterisk-1.2.18.orig/channels/chan_agent.c 2007-03-01 03:55:45.000000000 +0900 +++ asterisk-1.2.18/channels/chan_agent.c 2007-07-09 18:47:59.730549640 +0900 @@ -2322,7 +2322,7 @@ continue; if (!ast_strlen_zero(cur_agent->loginchan)) { - snprintf(buf, sizeof(buf), "%s;%s", cur_agent->loginchan, cur_agent->logincallerid); + snprintf(buf, sizeof(buf), "%s;%s;%d;%d;%d", cur_agent->loginchan, cur_agent->logincallerid, cur_agent->ackcall, cur_agent->autologoff, cur_agent->wrapuptime); if (ast_db_put(pa_family, cur_agent->agent, buf)) ast_log(LOG_WARNING, "failed to create persistent entry!\n"); else if (option_debug) @@ -2347,6 +2347,9 @@ char *parse; char *agent_chan; char *agent_callerid; + char *agent_ackcall; + char *agent_autologoff; + char *agent_wrapuptime; db_tree = ast_db_gettree(pa_family, NULL); @@ -2372,12 +2375,24 @@ parse = agent_data; agent_chan = strsep(&parse, ";"); agent_callerid = strsep(&parse, ";"); + agent_ackcall = strsep(&parse, ";"); + agent_autologoff = strsep(&parse, ";"); + agent_wrapuptime = strsep(&parse, ";"); ast_copy_string(cur_agent->loginchan, agent_chan, sizeof(cur_agent->loginchan)); if (agent_callerid) { ast_copy_string(cur_agent->logincallerid, agent_callerid, sizeof(cur_agent->logincallerid)); set_agentbycallerid(cur_agent->logincallerid, cur_agent->agent); } else cur_agent->logincallerid[0] = '\0'; + cur_agent->ackcall = agent_ackcall ? atoi(agent_ackcall) : 0; + if (cur_agent->ackcall < 0 && cur_agent->ackcall > 2) + cur_agent->ackcall = 0; + cur_agent->autologoff = agent_autologoff ? atoi(agent_autologoff) : 0; + if (cur_agent->autologoff < 0) + cur_agent->autologoff = 0; + cur_agent->wrapuptime = agent_wrapuptime ? atoi(agent_wrapuptime) : 0; + if (cur_agent->wrapuptime < 0) + cur_agent->wrapuptime = 0; if (cur_agent->loginstart == 0) time(&cur_agent->loginstart); ast_device_state_changed("Agent/%s", cur_agent->agent);