|
@@ -10,7 +10,7 @@ Daniel-Constantin Mierla
|
|
|
|
|
|
<[email protected]>
|
|
<[email protected]>
|
|
|
|
|
|
- Copyright © 2014 asipto.com
|
|
|
|
|
|
+ Copyright © 2014 asipto.com
|
|
__________________________________________________________________
|
|
__________________________________________________________________
|
|
|
|
|
|
Table of Contents
|
|
Table of Contents
|
|
@@ -98,6 +98,8 @@ Chapter 1. Admin Guide
|
|
running Kamailio with this module loaded:
|
|
running Kamailio with this module loaded:
|
|
* mongo-c-driver - available at
|
|
* mongo-c-driver - available at
|
|
https://github.com/mongodb/mongo-c-driver
|
|
https://github.com/mongodb/mongo-c-driver
|
|
|
|
+ Note: if you use tls module, use at least mongo-c-driver v1.2.1 -
|
|
|
|
+ there were reports of issues inside earlier versions of the driver.
|
|
|
|
|
|
3. Parameters
|
|
3. Parameters
|
|
|
|
|
|
@@ -133,7 +135,7 @@ modparam("ndb_mongodb", "server", "name=mgs2;uri='mongodb://127.0.0.2/kamailio'"
|
|
4.5. mongodb_next(replyid)
|
|
4.5. mongodb_next(replyid)
|
|
4.6. mongodb_free(replyid)
|
|
4.6. mongodb_free(replyid)
|
|
|
|
|
|
-4.1. mongodb_cmd(srvname, dbname, cname, command, replyid)
|
|
|
|
|
|
+4.1. mongodb_cmd(srvname, dbname, cname, command, replyid)
|
|
|
|
|
|
Send a valid command to MongoDB server identified by srvname. The reply
|
|
Send a valid command to MongoDB server identified by srvname. The reply
|
|
will be stored in a local container identified by replyid. All the
|
|
will be stored in a local container identified by replyid. All the
|
|
@@ -165,7 +167,7 @@ if(mongodb_cmd("mgs1", "kamailio", "acc", "{ \"collStats\": \"acc\" }", "mgr1"))
|
|
}
|
|
}
|
|
...
|
|
...
|
|
|
|
|
|
-4.2. mongodb_cmd_simple(srvname, dbname, cname, command, replyid)
|
|
|
|
|
|
+4.2. mongodb_cmd_simple(srvname, dbname, cname, command, replyid)
|
|
|
|
|
|
Send a valid command to MongoDB server identified by srvname. The reply
|
|
Send a valid command to MongoDB server identified by srvname. The reply
|
|
will be stored in a local container identified by replyid. All the
|
|
will be stored in a local container identified by replyid. All the
|
|
@@ -191,7 +193,7 @@ mgr1")) {
|
|
}
|
|
}
|
|
...
|
|
...
|
|
|
|
|
|
-4.3. mongodb_find(srvname, dbname, cname, command, replyid)
|
|
|
|
|
|
+4.3. mongodb_find(srvname, dbname, cname, command, replyid)
|
|
|
|
|
|
Send a find command to MongoDB server identified by srvname. The reply
|
|
Send a find command to MongoDB server identified by srvname. The reply
|
|
will be stored in a local container identified by replyid. All the
|
|
will be stored in a local container identified by replyid. All the
|
|
@@ -220,7 +222,7 @@ if(mongodb_find("mgs1", "kamailio", "acc", "{ \"src_user\" : \"111\" }", "mgr1")
|
|
}
|
|
}
|
|
...
|
|
...
|
|
|
|
|
|
-4.4. mongodb_find_one(srvname, dbname, cname, command, replyid)
|
|
|
|
|
|
+4.4. mongodb_find_one(srvname, dbname, cname, command, replyid)
|
|
|
|
|
|
Similar to mongodb_find(...), but it stops searching after first match,
|
|
Similar to mongodb_find(...), but it stops searching after first match,
|
|
returning the result with one object - faster when expecting to have a
|
|
returning the result with one object - faster when expecting to have a
|
|
@@ -237,7 +239,7 @@ if(mongodb_find_one("mgs1", "kamailio", "subscriber", "{ \"username\" : \"111\"
|
|
}
|
|
}
|
|
...
|
|
...
|
|
|
|
|
|
-4.5. mongodb_next(replyid)
|
|
|
|
|
|
+4.5. mongodb_next(replyid)
|
|
|
|
|
|
Moves to next document in a MongoDB reply. This function can be used
|
|
Moves to next document in a MongoDB reply. This function can be used
|
|
after a succesful mongodb_cmd() or mongodb_find(). It returns true if
|
|
after a succesful mongodb_cmd() or mongodb_find(). It returns true if
|
|
@@ -256,7 +258,7 @@ if(mongodb_find("mgs1", "kamailio", "acc", "{ \"src_user\" : \"111\" }", "mgr1")
|
|
mongodb_free("mgr1");
|
|
mongodb_free("mgr1");
|
|
...
|
|
...
|
|
|
|
|
|
-4.6. mongodb_free(replyid)
|
|
|
|
|
|
+4.6. mongodb_free(replyid)
|
|
|
|
|
|
Frees data in a previous reply from memory. After this function call,
|
|
Frees data in a previous reply from memory. After this function call,
|
|
accessing to a freed replyid returns null value.
|
|
accessing to a freed replyid returns null value.
|