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

Function ul_event_init

modules/usrloc/ul_evi.c:84–368  ·  view source on GitHub ↗

! \brief * Initialize event structures */

Source from the content-addressed store, hash-verified

82 * Initialize event structures
83 */
84int ul_event_init(void)
85{
86 /* Event IDs */
87
88 ei_ins_id = evi_publish_event(str_init(UL_EV_AOR_INSERT));
89 if (ei_ins_id == EVI_ERROR) {
90 LM_ERR("cannot register aor insert event\n");
91 return -1;
92 }
93
94 ei_del_id = evi_publish_event(str_init(UL_EV_AOR_DELETE));
95 if (ei_del_id == EVI_ERROR) {
96 LM_ERR("cannot register aor delete event\n");
97 return -1;
98 }
99
100 ei_c_ins_id = evi_publish_event(str_init(UL_EV_CT_INSERT));
101 if (ei_c_ins_id == EVI_ERROR) {
102 LM_ERR("cannot register contact insert event\n");
103 return -1;
104 }
105
106 ei_c_update_id = evi_publish_event(str_init(UL_EV_CT_UPDATE));
107 if (ei_c_update_id == EVI_ERROR) {
108 LM_ERR("cannot register contact update event\n");
109 return -1;
110 }
111
112 ei_c_del_id = evi_publish_event(str_init(UL_EV_CT_DELETE));
113 if (ei_c_del_id == EVI_ERROR) {
114 LM_ERR("cannot register contact delete event\n");
115 return -1;
116 }
117
118 ei_c_refresh_id = evi_publish_event(str_init(UL_EV_CT_REFRESH));
119 if (ei_c_refresh_id == EVI_ERROR) {
120 LM_ERR("cannot register contact refresh event\n");
121 return -1;
122 }
123
124 ei_c_latency_update_id = evi_publish_event(str_init(UL_EV_LATENCY_UPDATE));
125 if (ei_c_latency_update_id == EVI_ERROR) {
126 LM_ERR("cannot register contact latency update event\n");
127 return -1;
128 }
129
130 /* AoR event params */
131
132 ul_aor_event_params = pkg_malloc(sizeof(evi_params_t));
133 if (!ul_aor_event_params) {
134 LM_ERR("no more pkg memory\n");
135 return -1;
136 }
137 memset(ul_aor_event_params, 0, sizeof(evi_params_t));
138
139 ul_aor_event.domain = evi_param_create(ul_aor_event_params,
140 _str(UL_EV_PARAM_DOMAIN));
141 if (!ul_aor_event.domain) {

Callers 1

mod_initFunction · 0.85

Calls 3

evi_publish_eventFunction · 0.85
evi_param_createFunction · 0.85
_strClass · 0.85

Tested by

no test coverage detected