* Initialize OSP module * return 0 success, -1 failure */
| 302 | * return 0 success, -1 failure |
| 303 | */ |
| 304 | static int ospInitMod(void) |
| 305 | { |
| 306 | bind_auth_t bind_auth; |
| 307 | |
| 308 | LM_INFO("initializing...\n"); |
| 309 | |
| 310 | if (ospVerifyParameters() != 0) { |
| 311 | /* At least one parameter incorrect -> error */ |
| 312 | return -1; |
| 313 | } |
| 314 | |
| 315 | /* Load the RR API */ |
| 316 | if (load_rr_api(&osp_rr) != 0) { |
| 317 | LM_WARN("failed to load the RR API. Check if you load the rr module\n"); |
| 318 | LM_WARN("add_rr_param is required for reporting duration for OSP transactions\n"); |
| 319 | memset(&osp_rr, 0, sizeof(osp_rr)); |
| 320 | } |
| 321 | |
| 322 | /* Load the AUTH API */ |
| 323 | bind_auth = (bind_auth_t)find_export("bind_auth", 0); |
| 324 | if ((bind_auth == NULL) || (bind_auth(&osp_auth) != 0)) { |
| 325 | LM_WARN("failed to load the AUTH API. Check if you load the auth module.\n"); |
| 326 | LM_WARN("rpid_avp & rpid_avp_type is required for calling number translation\n"); |
| 327 | memset(&osp_auth, 0, sizeof(osp_auth)); |
| 328 | } |
| 329 | |
| 330 | if (ospInitSig() != 0) { |
| 331 | return -1; |
| 332 | } |
| 333 | |
| 334 | if (ospInitTm() != 0) { |
| 335 | return -1; |
| 336 | } |
| 337 | |
| 338 | if(ospParseAvps() != 0) { |
| 339 | return -1; |
| 340 | } |
| 341 | |
| 342 | /* everything is fine, initialization done */ |
| 343 | return 0; |
| 344 | } |
| 345 | |
| 346 | /* |
| 347 | * Destrroy OSP module |
nothing calls this directly
no test coverage detected