| 306 | |
| 307 | |
| 308 | static 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 | |
| 337 | static inline void move_cc_agent_to_end( struct cc_data *data, |
no outgoing calls
no test coverage detected