sql=switch_mprintf("UPDATE members SET state = '%q', session_uuid = '', abandoned_epoch = '%"SWITCH_TIME_T_FMT"' WHERE system = 'single_box' AND uuid = '%q' AND state != '%q'",
sql=switch_mprintf("UPDATE members SET state = '%q', session_uuid = '', abandoned_epoch = '%"SWITCH_TIME_T_FMT"' WHERE system = 'single_box' AND uuid = '%q' AND state != '%q'",
/* Do not remove uuid of the agent if we are a standby agent */
/* Do not remove uuid of the agent if we are a standby agent */
sql=switch_mprintf("UPDATE agents SET %s last_bridge_end = %"SWITCH_TIME_T_FMT", talk_time = talk_time + (%"SWITCH_TIME_T_FMT"-last_bridge_start) WHERE name = '%q' AND system = '%q';"
sql=switch_mprintf("UPDATE agents SET %s last_bridge_end = %"SWITCH_TIME_T_FMT", talk_time = talk_time + (%"SWITCH_TIME_T_FMT"-last_bridge_start) WHERE name = '%q' AND system = '%q';"
sql=switch_mprintf("DELETE FROM members WHERE system = 'single_box' AND uuid = '%q' AND (abandoned_epoch = '%"SWITCH_TIME_T_FMT"' OR joined_epoch = '%q')",cbt.member_uuid,abandoned_epoch,cbt.member_joined_epoch);
sql=switch_mprintf("DELETE FROM members WHERE system = 'single_box' AND uuid = '%q' AND (abandoned_epoch = '%"SWITCH_TIME_T_FMT"' OR joined_epoch = '%q')",cbt.member_uuid,abandoned_epoch,cbt.member_joined_epoch);
cc_execute_sql(NULL,sql,NULL);
cc_execute_sql(NULL,sql,NULL);
switch_safe_free(sql);
switch_safe_free(sql);
...
@@ -2100,7 +2110,7 @@ static int members_callback(void *pArg, int argc, char **argv, char **columnName
...
@@ -2100,7 +2110,7 @@ static int members_callback(void *pArg, int argc, char **argv, char **columnName
switch_log_printf(SWITCH_CHANNEL_LOG,SWITCH_LOG_WARNING,"Queue %s not found locally, skip this member\n",cbt.queue_name);
switch_log_printf(SWITCH_CHANNEL_LOG,SWITCH_LOG_WARNING,"Queue %s not found locally, skip this member\n",cbt.queue_name);
@@ -2141,7 +2151,7 @@ void *SWITCH_THREAD_FUNC cc_agent_dispatch_thread_run(switch_thread_t *thread, v
...
@@ -2141,7 +2151,7 @@ void *SWITCH_THREAD_FUNC cc_agent_dispatch_thread_run(switch_thread_t *thread, v
char*sql=NULL;
char*sql=NULL;
sql=switch_mprintf("SELECT queue,uuid,session_uuid,cid_number,cid_name,joined_epoch,(%"SWITCH_TIME_T_FMT"-joined_epoch)+base_score+skill_score AS score, state, abandoned_epoch FROM members"
sql=switch_mprintf("SELECT queue,uuid,session_uuid,cid_number,cid_name,joined_epoch,(%"SWITCH_TIME_T_FMT"-joined_epoch)+base_score+skill_score AS score, state, abandoned_epoch FROM members"
" WHERE state = '%q' OR state = '%q' OR (serving_agent = 'ring-all' AND state = '%q') ORDER BY score DESC",
" WHERE state = '%q' OR state = '%q' OR (serving_agent = 'ring-all' AND state = '%q') ORDER BY score DESC",
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(member_session),SWITCH_LOG_DEBUG,"Member %s <%s> in queue '%s' reached max wait time\n",m->member_cid_name,m->member_cid_number,m->queue_name);
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(member_session),SWITCH_LOG_DEBUG,"Member %s <%s> in queue '%s' reached max wait time\n",m->member_cid_name,m->member_cid_number,m->queue_name);
sql=switch_mprintf("UPDATE members SET state = '%q', session_uuid = '', abandoned_epoch = '%"SWITCH_TIME_T_FMT"' WHERE system = 'single_box' AND uuid = '%q'",
sql=switch_mprintf("UPDATE members SET state = '%q', session_uuid = '', abandoned_epoch = '%"SWITCH_TIME_T_FMT"' WHERE system = 'single_box' AND uuid = '%q'",