| 138 | } |
| 139 | |
| 140 | static 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 | |
| 172 | static void destroy(void) |
nothing calls this directly
no test coverage detected