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

Function mod_init

modules/cgrates/cgrates.c:227–263  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

225}
226
227static int mod_init(void)
228{
229 if (cgre_retry_tout < 0) {
230 LM_ERR("Invalid retry connection timeout\n");
231 return -1;
232 }
233
234 if (cgrc_max_conns < 1) {
235 LM_WARN("Invalid number of maximum async connections: %d! "
236 "Async mode disabled!\n", cgrc_max_conns);
237 cgrc_max_conns = 0;
238 }
239
240 /* load the TM API */
241 if (load_tm_api(&cgr_tmb)!=0) {
242 LM_INFO("TM not loaded- cannot store variables in transaction!\n");
243 } else {
244 cgr_tm_ctx_idx = cgr_tmb.t_ctx_register_ptr(cgr_free_ctx);
245 /* register a routine to move the pointer in tm when the transaction
246 * is created! */
247 if (cgr_tmb.register_tmcb(0, 0, TMCB_REQUEST_IN, cgr_move_ctx, 0, 0)<=0) {
248 LM_ERR("cannot register tm callbacks\n");
249 return -2;
250 }
251 }
252
253 if (cgr_acc_init() < 0)
254 return -2;
255
256 if (cgre_bind_ip.s)
257 cgre_bind_ip.len = strlen(cgre_bind_ip.s);
258
259 cgr_ctx_idx = context_register_ptr(CONTEXT_GLOBAL, cgr_free_ctx);
260 cgr_ctx_local_idx = context_register_ptr(CONTEXT_GLOBAL, cgr_free_local_ctx);
261
262 return 0;
263}
264
265static int child_init(int rank)
266{

Callers

nothing calls this directly

Calls 3

load_tm_apiFunction · 0.85
cgr_acc_initFunction · 0.85
context_register_ptrFunction · 0.85

Tested by

no test coverage detected