This shows you the differences between two versions of the page.
Next revision | Previous revision Next revision Both sides next revision | ||
tutorials:kamailio-and-mongodb [2015/09/08 21:27] miconda created |
tutorials:kamailio-and-mongodb [2015/09/08 21:36] miconda [Other Tables] |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Kamailio and MongoDB ====== | ====== Kamailio and MongoDB ====== | ||
- | ====== Kamailio Database | + | ===== Kamailio Database ===== |
The **use** command in mongodb client **mongo** creates the database if it doesn' | The **use** command in mongodb client **mongo** creates the database if it doesn' | ||
Line 18: | Line 18: | ||
Note that a database is not shown by the above command if it is empty -- you need to add some records to it. | Note that a database is not shown by the above command if it is empty -- you need to add some records to it. | ||
- | ===== Version Table ===== | + | ==== Version Table ==== |
Kamailio uses version table to check if the structure of a database table has the structure version the C code expects. | Kamailio uses version table to check if the structure of a database table has the structure version the C code expects. | ||
Line 37: | Line 37: | ||
</ | </ | ||
- | ==== Version Table Records | + | === Version Table Records === |
Add the records for the other Kamailio tables you are going to use. Some examples: | Add the records for the other Kamailio tables you are going to use. Some examples: | ||
Line 55: | Line 55: | ||
</ | </ | ||
- | ===== Other Tables ===== | + | To learn what is the version number for a specific table, look inside **lib/ |
- | MongoDB doesn' | + | ==== Other Tables ==== |
+ | MongoDB doesn' | ||
+ | |||
+ | Anyhow, if you want, you can create the collections in advance, using: | ||
+ | |||
+ | < | ||
+ | > db.createCollection(" | ||
+ | </ | ||
+ | ===== DB URL in Kamailio Config ===== | ||
+ | |||
+ | The corresponding database URL in kamailio.cfg: | ||
+ | |||
+ | * if MongoDB is on local host and there is no username and password to connect to it: | ||
+ | |||
+ | < | ||
+ | #!define DBURL " | ||
+ | </ | ||
+ | |||
+ | * if MongoDB is on local host and there is an username and password to connect to it: | ||
+ | |||
+ | < | ||
+ | #!define DBURL " | ||
+ | </ |