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

Function mod_init

modules/mqueue/mqueue_mod.c:160–185  ·  view source on GitHub ↗

* init module function */

Source from the content-addressed store, hash-verified

158 * init module function
159 */
160static int mod_init(void)
161{
162 mq_head_t *mh = NULL;
163
164 LM_DBG("initializing...\n");
165
166 init_db_url( mqueue_db_url , 1 /*can be null*/);
167
168 if(!mq_head_defined())
169 LM_WARN("no mqueue defined\n");
170 else {
171 mh = _mq_head_list;
172 while(mh != NULL) {
173 if (mh->dbmode == 1 || mh->dbmode == 2) {
174 LM_DBG("queue=[%.*s]\n", mh->name.len, mh->name.s);
175 if(mqueue_db_load_queue(&mh->name) < 0) {
176 LM_ERR("error loading mqueue: %.*s from DB\n", mh->name.len, mh->name.s);
177 return -1;
178 }
179 }
180 mh = mh->next;
181 }
182 }
183
184 return 0;
185}
186
187static int child_init(int rank)
188{

Callers

nothing calls this directly

Calls 2

mq_head_definedFunction · 0.85
mqueue_db_load_queueFunction · 0.85

Tested by

no test coverage detected