<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>Hello,<br>
</p>
<br>
<div class="moz-cite-prefix">On 01/07/16 16:39, C. wrote:<br>
</div>
<blockquote
cite="mid:DC888046-83B3-4B45-9734-B52BA8AFE762@gmail.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
Hi,
<div class="">I have followed instructions on setting up Kamailio
with MongoDB backend, and successfully compiled and installed
kamailio with the db_mongo module. It can start successfully.
However, when I tried to add users using the command:</div>
<div class=""><br class="">
</div>
<div class=""><span style="color: rgb(41, 249, 20); font-family:
'Andale Mono'; font-size: 14px; background-color: rgb(0, 0,
0);" class="">kamctl add test testpasswd <a
moz-do-not-send="true" href="mailto:test@mysipserver.com"
class=""><a class="moz-txt-link-abbreviated" href="mailto:test@mysipserver.com">test@mysipserver.com</a></a></span></div>
<div class=""><br class="">
</div>
<div class="">It fails because it is trying to default to MYSQL.
Here is the result of that command:</div>
<div class=""><br class="">
</div>
<div style="margin: 0px; font-size: 14px; line-height: normal;
font-family: 'Andale Mono'; color: rgb(52, 189, 38);
background-color: rgb(0, 0, 0);" class=""><span
style="font-variant-ligatures: no-common-ligatures" class="">WARNING:
database engine not found - tried 'MYSQL'</span></div>
<div class=""><span style="color: rgb(195, 55, 32); font-family:
'Andale Mono'; font-size: 14px; background-color: rgb(0, 0,
0);" class="">ERROR: This command requires a database engine -
none was loaded</span></div>
<div class=""><br class="">
</div>
<div class="">When I take a look at the kamctl script, it lists
all the other kinds of database engines, except MongoDb, so this
is probably why it is failing. How can I use kamctl to create
the required Mongodb collections (like users, subscribers, etc)
that Kamaiio will then use?My kamailio.cfg seem to be working
ok, as I seem to be able to connect to the database (I modified
the file to use db_mongo module), and I create the initial
collections as listed here - <a moz-do-not-send="true"
href="https://www.kamailio.org/wiki/tutorials/kamailio-and-mongodb"
class="">https://www.kamailio.org/wiki/tutorials/kamailio-and-mongodb</a></div>
<div class=""><br class="">
</div>
</blockquote>
indeed, kamctl doesn't support mongodb and it cannot be used to add
subscribers. Practically, behind adding a subscriber (when Mysql is
used) is an SQL INSERT query.<br>
<br>
What you have to do is using mongodb insert command, like:<br>
<br>
<meta charset="utf-8">
db.getCollection("subscriber").insert( { username: "alice", domain:
"a.com", password: "secret" } )<br>
<br>
For whatever table you need in the mongodb, look inside:<br>
<br>
- utils/kamctl/mongodb/kamailio/<br>
<br>
There are some json files that provide some attributes about the
columns, their types and default values.<br>
<br>
Cheers,<br>
Daniel<br>
<br>
<pre class="moz-signature" cols="72">--
Daniel-Constantin Mierla
<a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a> - <a class="moz-txt-link-freetext" href="http://www.kamailio.org">http://www.kamailio.org</a>
<a class="moz-txt-link-freetext" href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a></pre>
</body>
</html>