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

Function mod_init

modules/script_helper/script_helper.c:108–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106};
107
108int mod_init(void)
109{
110 LM_DBG("initializing module...\n");
111
112 if (seq_route) {
113 seq_route_ref = ref_script_route_by_name(seq_route,
114 sroutes->request, RT_NO, REQUEST_ROUTE, 0);
115 if (!ref_script_route_is_valid(seq_route_ref))
116 LM_ERR("route \"%s\" does not exist! ignoring\n", seq_route);
117 }
118
119 if (load_tm_api(&tm_api) != 0) {
120 LM_ERR("failed to load tm API\n");
121 return -1;
122 }
123
124 if (use_dialog && load_dlg_api(&dlg_api) != 0) {
125 LM_ERR("failed to load dialog API\n");
126 return -1;
127 }
128
129 if (load_rr_api(&rr_api) != 0) {
130 LM_ERR("failed to load rr API\n");
131 return -1;
132 }
133
134 if (load_sl_api(&sl_api) != 0) {
135 LM_ERR("failed to load sl API\n");
136 return -1;
137 }
138
139 if (__register_script_cb(run_helper_logic,
140 PRE_SCRIPT_CB|REQ_TYPE_CB, NULL, -1) != 0) {
141 LM_ERR("cannot register script callback\n");
142 return -1;
143 }
144
145 return 0;
146}
147
148int run_helper_logic(struct sip_msg *msg, void *param)
149{

Callers

nothing calls this directly

Calls 6

ref_script_route_by_nameFunction · 0.85
load_tm_apiFunction · 0.85
load_dlg_apiFunction · 0.85
load_rr_apiFunction · 0.85
load_sl_apiFunction · 0.85
__register_script_cbFunction · 0.85

Tested by

no test coverage detected