| 185 | /********************* module interface functions ************************/ |
| 186 | |
| 187 | static int mod_init(void) |
| 188 | { |
| 189 | /* register function for EVI transport API */ |
| 190 | if (register_event_mod(&evi_backend_ebr)) { |
| 191 | LM_ERR("cannot register EVI backend for event-based-routing\n"); |
| 192 | return -1; |
| 193 | } |
| 194 | |
| 195 | /* register with the IPC layer */ |
| 196 | ebr_ipc_type = ipc_register_handler( handle_ebr_ipc, "EBR"); |
| 197 | if (ipc_bad_handler_type(ebr_ipc_type)) { |
| 198 | LM_ERR("cannot register IPC handler for 'EBR'\n"); |
| 199 | return -1; |
| 200 | } |
| 201 | |
| 202 | /* try binding to TM if available */ |
| 203 | memset( &ebr_tmb, 0, sizeof(ebr_tmb) ); |
| 204 | |
| 205 | /* TM may be used passing the transaction context to the |
| 206 | * notification routes */ |
| 207 | LM_DBG("trying to load TM API, if available\n"); |
| 208 | if (load_tm_api(&ebr_tmb) < 0) |
| 209 | LM_NOTICE("unable to load TM API, so TM context will not be " |
| 210 | "available in notification routes\n"); |
| 211 | |
| 212 | if (register_timer( "EBR timeout", ebr_timeout, NULL, 1, |
| 213 | TIMER_FLAG_SKIP_ON_DELAY)<0 ) { |
| 214 | LM_ERR("failed to register timer, halting..."); |
| 215 | return -1; |
| 216 | } |
| 217 | |
| 218 | return 0; |
| 219 | } |
| 220 | |
| 221 | |
| 222 | void ebr_bind(ebr_api_t *api) |
nothing calls this directly
no test coverage detected