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

Function clean_cc_unref_data

modules/call_center/cc_data.c:998–1032  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

996
997
998void clean_cc_unref_data(struct cc_data *data)
999{
1000 struct cc_agent *agent, **prv_agent;
1001 struct cc_flow *flow, **prv_flow;
1002
1003 /* clean unref flows */
1004 flow = data->old_flows;
1005 prv_flow = &(data->old_flows);
1006 while(flow) {
1007 if (flow->ref_cnt!=0) {
1008 prv_flow = &(flow->next);
1009 flow = flow->next;
1010 } else {
1011 *prv_flow = flow->next;
1012 free_cc_flow(flow);
1013 flow = (*prv_flow);
1014 }
1015 }
1016
1017 /* clean unref agents */
1018 agent = data->old_agents;
1019 prv_agent = &(data->old_agents);
1020 while(agent) {
1021 if (agent->ref_cnt!=0) {
1022 prv_agent = &(agent->next);
1023 agent = agent->next;
1024 } else {
1025 *prv_agent = agent->next;
1026 free_cc_agent(agent);
1027 agent = (*prv_agent);
1028 }
1029 }
1030
1031 return;
1032}
1033
1034
1035void print_queue(struct cc_data *data)

Callers 1

cc_timer_cleanupFunction · 0.85

Calls 2

free_cc_flowFunction · 0.85
free_cc_agentFunction · 0.85

Tested by

no test coverage detected