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

Function mod_init

modules/mi_http/mi_http.c:140–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138}
139
140static int mod_init(void)
141{
142 http_root.len = strlen(http_root.s);
143
144 /* Load httpd api */
145 if(load_httpd_api(&httpd_api)<0) {
146 LM_ERR("Failed to load httpd api\n");
147 return -1;
148 }
149
150 /* Load httpd hooks */
151 httpd_api.register_httpdcb(exports.name, &http_root,
152 &mi_json_answer_to_connection,
153 &mi_json_flush_data,
154 HTTPD_APPLICATION_JSON_CNT_TYPE,
155 &proc_init);
156
157 if (trace_destination_name.s) {
158 trace_destination_name.len = strlen( trace_destination_name.s);
159
160 try_load_trace_api();
161 if (mi_trace_api && mi_trace_api->get_trace_dest_by_name) {
162 t_dst = mi_trace_api->get_trace_dest_by_name(&trace_destination_name);
163 }
164
165 mi_trace_mod_id = register_mi_trace_mod();
166 }
167
168 return 0;
169}
170
171
172static void destroy(void)

Callers

nothing calls this directly

Calls 3

load_httpd_apiFunction · 0.85
try_load_trace_apiFunction · 0.85
register_mi_trace_modFunction · 0.85

Tested by

no test coverage detected