MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / remove_cc_agent

Function remove_cc_agent

modules/call_center/cc_data.h:308–334  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

306
307
308static inline void remove_cc_agent(struct cc_data* data,
309 struct cc_agent* agent, struct cc_agent* prev_agent)
310{
311 struct cc_agent* tmp_agent;
312 if(prev_agent == agent) /* if on top of the list*/
313 data->agents[agent->logged_in] = agent->next;
314 else
315 prev_agent->next = agent->next;
316
317 if (agent->logged_in && data->last_online_agent == agent) {
318 /* if agent was the last in the list */
319 if (data->agents[CC_AG_ONLINE] == NULL)
320 data->last_online_agent = NULL;
321 else {
322 if (prev_agent == agent) {
323 LM_CRIT("last_online_agent pointer not correct"
324 "- pointing to the first record in list but next not NULL\n");
325 /* search for the real last */
326 for(tmp_agent= data->agents[CC_AG_ONLINE]; tmp_agent;
327 tmp_agent= tmp_agent->next)
328 data->last_online_agent = tmp_agent;
329 }
330 else
331 data->last_online_agent = prev_agent;
332 }
333 }
334}
335
336
337static inline void move_cc_agent_to_end( struct cc_data *data,

Callers 3

move_cc_agent_to_endFunction · 0.85
agent_switch_loginFunction · 0.85
add_cc_agentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected