* Load TM API * return 0 success, -1 failure */
| 46 | * return 0 success, -1 failure |
| 47 | */ |
| 48 | int ospInitTm(void) |
| 49 | { |
| 50 | if (load_tm_api(&osp_tmb) != 0) { |
| 51 | LM_ERR("failed to load TM API\n"); |
| 52 | LM_ERR("TM is required for reporting call setup usage\n"); |
| 53 | return -1; |
| 54 | } |
| 55 | |
| 56 | /* Register callbacks, listen for all incoming requests */ |
| 57 | if (osp_tmb.register_tmcb(0, 0, TMCB_REQUEST_IN, ospOnReq, 0, 0) <= 0) { |
| 58 | LM_ERR("failed to register TMCB_REQUEST_IN callback\n"); |
| 59 | LM_ERR("TM callbacks are required for reporting call set up usage\n"); |
| 60 | return -1; |
| 61 | } |
| 62 | |
| 63 | return 0; |
| 64 | } |
| 65 | |
| 66 | /* |
| 67 | * Register OSP callback function |
no test coverage detected