Module init function */
| 208 | |
| 209 | /** Module init function */ |
| 210 | static 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 |
nothing calls this directly
no test coverage detected