| 143 | } |
| 144 | |
| 145 | static int mod_init(void) |
| 146 | { |
| 147 | http_root.len = strlen(http_root.s); |
| 148 | |
| 149 | if (http_method<0 || http_method>1) { |
| 150 | LM_ERR("mi_http_method can be between [0,1]\n"); |
| 151 | return -1; |
| 152 | } |
| 153 | /* Load httpd api */ |
| 154 | if(load_httpd_api(&httpd_api)<0) { |
| 155 | LM_ERR("Failed to load httpd api\n"); |
| 156 | return -1; |
| 157 | } |
| 158 | /* Load httpd hooks */ |
| 159 | httpd_api.register_httpdcb(exports.name, &http_root, |
| 160 | &mi_http_answer_to_connection, |
| 161 | &mi_http_flush_data, |
| 162 | HTTPD_TEXT_HTML_TYPE, |
| 163 | &proc_init); |
| 164 | |
| 165 | if (trace_destination_name.s) { |
| 166 | trace_destination_name.len = strlen( trace_destination_name.s); |
| 167 | |
| 168 | try_load_trace_api(); |
| 169 | if (mi_trace_api && mi_trace_api->get_trace_dest_by_name) { |
| 170 | t_dst = mi_trace_api->get_trace_dest_by_name(&trace_destination_name); |
| 171 | } |
| 172 | |
| 173 | mi_trace_mod_id = register_mi_trace_mod(); |
| 174 | } |
| 175 | |
| 176 | return 0; |
| 177 | } |
| 178 | |
| 179 | |
| 180 | static void destroy(void) |
nothing calls this directly
no test coverage detected