MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / mod_init

Function mod_init

modules/event_routing/event_routing.c:187–219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

185/********************* module interface functions ************************/
186
187static 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
222void ebr_bind(ebr_api_t *api)

Callers

nothing calls this directly

Calls 4

register_event_modFunction · 0.85
ipc_register_handlerFunction · 0.85
load_tm_apiFunction · 0.85
register_timerFunction · 0.85

Tested by

no test coverage detected