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

Function mod_init

modules/b2b_sca/b2b_sca.c:210–353  ·  view source on GitHub ↗

Module init function */

Source from the content-addressed store, hash-verified

208
209/** Module init function */
210static int mod_init(void)
211{
212 unsigned int i;
213
214 LM_DBG("start\n");
215
216 init_db_url( db_url , 0 /*cannot be null*/);
217
218 /* load tm api */
219 if(load_tm_api(&tmb)==-1)
220 {
221 LM_ERR("can't load tm functions\n");
222 return -1;
223 }
224
225 /* load pua api */
226 if(load_pua_api(&pua_api) < 0)
227 {
228 LM_ERR("Can't bind pua\n");
229 return -1;
230 }
231 /* add event in pua module */
232 if(pua_api.add_event(CALLINFO_EVENT, "call-info", NULL, 0) < 0) {
233 LM_ERR("failed to add 'call-info' event to pua module\n");
234 return -1;
235 }
236
237 /* load b2b_logic api */
238 if(load_b2b_logic_api(&b2bl_api)< 0)
239 {
240 LM_ERR("Failed to load b2b_logic api\n");
241 return -1;
242 }
243
244 if(b2b_sca_hsize<1 || b2b_sca_hsize>20)
245 {
246 LM_ERR("Wrong hash size. Needs to be greater than 1"
247 " and smaller than 20. Be aware that you should set the log 2"
248 " value of the real size\n");
249 return -1;
250 }
251 b2b_sca_hsize = 1<<b2b_sca_hsize;
252
253 if(presence_server.s)
254 presence_server.len = strlen(presence_server.s);
255 LM_DBG("fix db columns\n");
256 sca_table_name.len = strlen(sca_table_name.s);
257 shared_line_column.len = strlen(shared_line_column.s);
258 watchers_column.len = strlen(watchers_column.s);
259 for (i=0; i<MAX_APPEARANCE_INDEX; i++) {
260 app_shared_entity_column[i].len = strlen(app_shared_entity_column[i].s);
261 app_call_state_column[i].len = strlen(app_call_state_column[i].s);
262 app_call_info_uri_column[i].len = strlen(app_call_info_uri_column[i].s);
263 app_call_info_appearance_uri_column[i].len =
264 strlen(app_call_info_appearance_uri_column[i].s);
265 app_b2bl_key_column[i].len = strlen(app_b2bl_key_column[i].s);
266 }
267

Callers

nothing calls this directly

Calls 7

load_tm_apiFunction · 0.85
load_pua_apiFunction · 0.85
load_b2b_logic_apiFunction · 0.85
pv_parse_specFunction · 0.85
pv_get_avp_nameFunction · 0.85
init_b2b_sca_htableFunction · 0.85
init_sca_dbFunction · 0.85

Tested by

no test coverage detected