* initialize database connection */
| 37 | * initialize database connection |
| 38 | */ |
| 39 | int mqueue_db_init_con(void) |
| 40 | { |
| 41 | LM_DBG("mqueue_db_url=[%.*s]\n", mqueue_db_url.len, mqueue_db_url.s); |
| 42 | if(mqueue_db_url.len <= 0) { |
| 43 | LM_ERR("failed to connect to the database, no db url\n"); |
| 44 | return -1; |
| 45 | } |
| 46 | /* binding to DB module */ |
| 47 | if(db_bind_mod(&mqueue_db_url, &mq_dbf)) { |
| 48 | LM_ERR("database module not found\n"); |
| 49 | return -1; |
| 50 | } |
| 51 | |
| 52 | if(!DB_CAPABILITY(mq_dbf, DB_CAP_ALL)) { |
| 53 | LM_ERR("database module does not " |
| 54 | "implement all functions needed by the module\n"); |
| 55 | return -1; |
| 56 | } |
| 57 | return 0; |
| 58 | } |
| 59 | |
| 60 | /** |
| 61 | * open database connection |
no test coverage detected