* init module function */
| 158 | * init module function |
| 159 | */ |
| 160 | static 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 | |
| 187 | static int child_init(int rank) |
| 188 | { |
nothing calls this directly
no test coverage detected