<div dir="ltr">Hi,<div>Well i didn't noticed before, but after create a document in mongodb the error that kamailio gives now is different but it still related with table version check.</div><div><br></div><div>Seems that kamailio can query the document successfully and get the table_version field.</div><div><br></div><div><div> 0(3068) DEBUG: db_mongodb [mongodb_dbase.c:671]: db_mongodb_convert_result(): selected document: { "_id" : { "$oid" : "55d2fc84b04c015195aee4b2" }, "table_version" : 4 }</div><div> 0(3068) DEBUG: <core> [db_row.c:117]: db_allocate_row(): allocate 32 bytes for row values at 0x7fe6fee76390</div><div> 0(3068) DEBUG: db_mongodb [mongodb_dbase.c:522]: db_mongodb_convert_bson(): looking for field[0] named: table_version</div><div> 0(3068) DEBUG: db_mongodb [mongodb_dbase.c:610]: db_mongodb_convert_bson(): RES_NAMES(0x7fe6fee72490)[0]=[table_version] (1)</div><div> 0(3068) DEBUG: db_mongodb [mongodb_dbase.c:682]: db_mongodb_convert_result(): retrieved number of rows: 1</div><div> <b>0(3068) ERROR: <core> [db.c:414]: db_table_version(): invalid type (2) or nul (0) version columns for presentity</b></div></div><div><br></div><div><br></div><div><br></div><div>ALL Log:</div><div><br></div><div><div>Listening on </div><div> udp: <a href="http://10.0.20.100:5080">10.0.20.100:5080</a></div><div>Aliases: </div><div><br></div><div> 0(3066) DEBUG: <core> [cfg/cfg.c:176]: cfg_declare(): DEBUG: register_cfg_def(): new config group has been registered: 'core' (num=50, size=200)</div><div> 0(3066) DEBUG: <core> [cfg/cfg.c:176]: cfg_declare(): DEBUG: register_cfg_def(): new config group has been registered: 'tcp' (num=26, size=104)</div><div> 0(3066) DEBUG: <core> [timer.c:255]: init_timer(): starting with *ticks=1210106959</div><div> 0(3066) DEBUG: <core> [timer.c:297]: init_timer(): timer_list between 0x7fe6ebf85728 and 0x7fe6ebfc9728</div><div> 0(3066) INFO: <core> [tcp_main.c:4656]: init_tcp(): using epoll_lt as the io watch method (auto detected)</div><div> 0(3068) DEBUG: <core> [daemonize.c:207]: enable_dumpable(): trying enable core dumping...</div><div> 0(3068) DEBUG: <core> [daemonize.c:225]: enable_dumpable(): core dumping is enabled now (1)...</div><div> 0(3068) DEBUG: <core> [daemonize.c:583]: set_core_dump(): core dump limits set to 18446744073709551615</div><div> 0(3068) DEBUG: <core> [async_task.c:88]: async_task_init(): start initializing asynk task framework</div><div> 0(3068) DEBUG: <core> [sr_module.c:942]: init_mod(): db_text</div><div> 0(3068) DEBUG: <core> [sr_module.c:942]: init_mod(): db_mysql</div><div> 0(3068) DEBUG: db_mysql [km_db_mysql.c:86]: kam_mysql_mod_init(): MySQL client version is 5.1.73</div><div> 0(3068) DEBUG: <core> [sr_module.c:942]: init_mod(): db_mongodb</div><div> 0(3068) DEBUG: db_mongodb [db_mongodb_mod.c:98]: mod_init(): module initializing</div><div> 0(3068) DEBUG: <core> [sr_module.c:942]: init_mod(): sl</div><div> 0(3068) DEBUG: <core> [md5utils.c:67]: MD5StringArray(): MD5 calculated: f452807bca511b98621cbbe6e749d8ef</div><div> 0(3068) DEBUG: <core> [sr_module.c:672]: find_mod_export_record(): find_export_record: found <load_tm> in module tm [/usr/local/lib64/kamailio/modules/tm.so]</div><div> 0(3068) ERROR: tm [tm_load.c:37]: load_tm(): tm:load_tm: Module not initialized yet, make sure that all modules that need tm module are loaded after tm in the configuration file</div><div> 0(3068) INFO: sl [sl.c:157]: mod_init(): could not bind tm module - only stateless mode available during modules initialization</div><div> 0(3068) DEBUG: <core> [sr_module.c:942]: init_mod(): maxfwd</div><div> 0(3068) DEBUG: <core> [cfg/cfg.c:176]: cfg_declare(): DEBUG: register_cfg_def(): new config group has been registered: 'maxfwd' (num=1, size=4)</div><div> 0(3068) DEBUG: <core> [sr_module.c:942]: init_mod(): textops</div><div> 0(3068) DEBUG: <core> [sr_module.c:942]: init_mod(): tm</div><div> 0(3068) DEBUG: tm [tm.c:756]: mod_init(): TM - (sizeof cell=488, sip_msg=1768) initializing...</div><div> 0(3068) DEBUG: tm [callid.c:101]: init_callid(): Call-ID initialization: '76bf762544f60619'</div><div> 0(3068) DEBUG: tm [lock.c:74]: lock_initialize(): DEBUG: lock_initialize: lock initialization started</div><div> 0(3068) DEBUG: tm [timer.c:199]: tm_init_timers(): tm: tm_init_timers: fr=480 fr_inv=1920 wait=80 delete=4 t1=500 t2=4000 max_inv_lifetime=2880 max_noninv_lifetime=512</div><div> 0(3068) DEBUG: <core> [cfg/cfg.c:176]: cfg_declare(): DEBUG: register_cfg_def(): new config group has been registered: 'tm' (num=36, size=168)</div><div> 0(3068) DEBUG: <core> [md5utils.c:67]: MD5StringArray(): MD5 calculated: eabd4dc455c32eca91da2be9405373ce</div><div> 0(3068) DEBUG: <core> [md5utils.c:67]: MD5StringArray(): MD5 calculated: 176231eb72a239b3e7f931a1ef6c4100</div><div> 0(3068) DEBUG: <core> [sr_module.c:942]: init_mod(): rr</div><div> 0(3068) DEBUG: <core> [sr_module.c:678]: find_mod_export_record(): find_export_record: <bind_ob> not found </div><div> 0(3068) INFO: rr [../outbound/api.h:54]: ob_load_api(): Failed to import bind_ob</div><div> 0(3068) INFO: rr [rr_mod.c:174]: mod_init(): outbound module not available</div><div> 0(3068) DEBUG: <core> [sr_module.c:942]: init_mod(): presence</div><div> 0(3068) DEBUG: presence [presence.c:274]: mod_init(): db_url=mongodb://localhost/kamailio/28/0x7fe6fee55608</div><div> 0(3068) DEBUG: <core> [sr_module.c:672]: find_mod_export_record(): find_export_record: found <bind_sl> in module sl [/usr/local/lib64/kamailio/modules/sl.so]</div><div> 0(3068) DEBUG: <core> [sr_module.c:672]: find_mod_export_record(): find_export_record: found <load_tm> in module tm [/usr/local/lib64/kamailio/modules/tm.so]</div><div> 0(3068) DEBUG: <core> [sr_module.c:672]: find_mod_export_record(): find_export_record: found <t_newtran> in module tm [/usr/local/lib64/kamailio/modules/tm.so]</div><div> 0(3068) DEBUG: <core> [sr_module.c:672]: find_mod_export_record(): find_export_record: found <t_relay_to_tcp> in module tm [/usr/local/lib64/kamailio/modules/tm.so]</div><div> 0(3068) DEBUG: <core> [sr_module.c:672]: find_mod_export_record(): find_export_record: found <t_relay_to_udp> in module tm [/usr/local/lib64/kamailio/modules/tm.so]</div><div> 0(3068) DEBUG: <core> [sr_module.c:672]: find_mod_export_record(): find_export_record: found <t_relay> in module tm [/usr/local/lib64/kamailio/modules/tm.so]</div><div> 0(3068) DEBUG: <core> [sr_module.c:672]: find_mod_export_record(): find_export_record: found <t_forward_nonack> in module tm [/usr/local/lib64/kamailio/modules/tm.so]</div><div> 0(3068) DEBUG: <core> [sr_module.c:672]: find_mod_export_record(): find_export_record: found <t_release> in module tm [/usr/local/lib64/kamailio/modules/tm.so]</div><div> 0(3068) DEBUG: <core> [sr_module.c:672]: find_mod_export_record(): find_export_record: found <db_bind_api> in module db_mongodb [/usr/local/lib64/kamailio/modules/db_mongodb.so]</div><div> 0(3068) DEBUG: <core> [db.c:205]: db_bind_mod(): using db bind api for db_mongodb</div><div> 0(3068) DEBUG: <core> [db.c:310]: db_do_init2(): connection 0x7fe6fee72190 not found in pool</div><div> 0(3068) DEBUG: db_mongodb [mongodb_connection.c:55]: db_mongodb_new_connection(): connection open to: mongodb://localhost/kamailio</div><div> 0(3068) DEBUG: db_mongodb [mongodb_dbase.c:851]: db_mongodb_query(): query to collection [version]</div><div> 0(3068) DEBUG: db_mongodb [mongodb_dbase.c:885]: db_mongodb_query(): query filter: { "table_name" : "presentity" }</div><div> 0(3068) DEBUG: db_mongodb [mongodb_dbase.c:904]: db_mongodb_query(): columns filter: { "table_version" : 1 }</div><div> 0(3068) DEBUG: <core> [db_res.c:116]: db_new_result(): allocate 56 bytes for result set at 0x7fe6fee72338</div><div> 0(3068) DEBUG: db_mongodb [mongodb_dbase.c:349]: db_mongodb_get_columns(): 1 columns returned from the query</div><div> 0(3068) DEBUG: <core> [db_res.c:154]: db_allocate_columns(): allocate 8 bytes for result names at 0x7fe6fee72410</div><div> 0(3068) DEBUG: <core> [db_res.c:165]: db_allocate_columns(): allocate 4 bytes for result types at 0x7fe6fee72450</div><div> 0(3068) DEBUG: db_mongodb [mongodb_dbase.c:377]: db_mongodb_get_columns(): Found a field[0] named: table_version</div><div> 0(3068) DEBUG: db_mongodb [mongodb_dbase.c:396]: db_mongodb_get_columns(): allocate 16 bytes for RES_NAMES[0] at 0x7fe6fee72490</div><div> 0(3068) DEBUG: db_mongodb [mongodb_dbase.c:416]: db_mongodb_get_columns(): use DB1_DOUBLE result type</div><div> 0(3068) DEBUG: db_mongodb [mongodb_dbase.c:460]: db_mongodb_get_columns(): RES_NAMES(0x7fe6fee72490)[0]=[table_version] (1)</div><div> 0(3068) DEBUG: <core> [db_res.c:184]: db_allocate_rows(): allocate 16000 bytes for rows at 0x7fe6fee724d8</div><div> 0(3068) DEBUG: db_mongodb [mongodb_dbase.c:671]: db_mongodb_convert_result(): selected document: { "_id" : { "$oid" : "55d2fc84b04c015195aee4b2" }, "table_version" : 4 }</div><div> 0(3068) DEBUG: <core> [db_row.c:117]: db_allocate_row(): allocate 32 bytes for row values at 0x7fe6fee76390</div><div> 0(3068) DEBUG: db_mongodb [mongodb_dbase.c:522]: db_mongodb_convert_bson(): looking for field[0] named: table_version</div><div> 0(3068) DEBUG: db_mongodb [mongodb_dbase.c:610]: db_mongodb_convert_bson(): RES_NAMES(0x7fe6fee72490)[0]=[table_version] (1)</div><div> 0(3068) DEBUG: db_mongodb [mongodb_dbase.c:682]: db_mongodb_convert_result(): retrieved number of rows: 1</div><div> 0(3068) ERROR: <core> [db.c:414]: db_table_version(): invalid type (2) or nul (0) version columns for presentity</div><div> 0(3068) DEBUG: <core> [db_res.c:79]: db_free_columns(): freeing 1 columns</div><div> 0(3068) DEBUG: <core> [db_res.c:83]: db_free_columns(): freeing RES_NAMES[0] at 0x7fe6fee72490</div><div> 0(3068) DEBUG: <core> [db_res.c:92]: db_free_columns(): freeing result names at 0x7fe6fee72410</div><div> 0(3068) DEBUG: <core> [db_res.c:97]: db_free_columns(): freeing result types at 0x7fe6fee72450</div><div> 0(3068) DEBUG: <core> [db_res.c:52]: db_free_rows(): freeing 1 rows</div><div> 0(3068) DEBUG: <core> [db_row.c:95]: db_free_row(): freeing row values at 0x7fe6fee76390</div><div> 0(3068) DEBUG: <core> [db_res.c:60]: db_free_rows(): freeing rows at 0x7fe6fee724d8</div><div> 0(3068) DEBUG: <core> [db_res.c:134]: db_free_result(): freeing result set at 0x7fe6fee72338</div><div> 0(3068) ERROR: <core> [db.c:432]: db_check_table_version(): querying version for table presentity</div><div><b> 0(3068) ERROR: presence [presence.c:358]: mod_init(): error during table version check</b></div><div><b> 0(3068) ERROR: <core> [sr_module.c:945]: init_mod(): Error while initializing module presence (/usr/local/lib64/kamailio/modules/presence.so)</b></div><div>ERROR: error while initializing modules</div><div> 0(3068) DEBUG: <core> [db_pool.c:100]: pool_remove(): removing connection from the pool</div><div> 0(3068) DEBUG: tm [t_funcs.c:86]: tm_shutdown(): DEBUG: tm_shutdown : start</div><div> 0(3068) DEBUG: tm [t_funcs.c:89]: tm_shutdown(): DEBUG: tm_shutdown : emptying hash table</div><div> 0(3068) DEBUG: tm [t_funcs.c:91]: tm_shutdown(): DEBUG: tm_shutdown : removing semaphores</div><div> 0(3068) DEBUG: tm [t_funcs.c:93]: tm_shutdown(): DEBUG: tm_shutdown : destroying tmcb lists</div><div> 0(3068) DEBUG: tm [t_funcs.c:96]: tm_shutdown(): DEBUG: tm_shutdown : done</div><div> 0(3068) DEBUG: db_text [dbtext.c:106]: destroy(): destroy ...</div><div> 0(3068) INFO: <core> [sctp_core.c:53]: sctp_core_destroy(): SCTP API not initialized</div><div> 0(3068) DEBUG: <core> [mem/shm_mem.c:232]: shm_mem_destroy(): shm_mem_destroy</div><div> 0(3068) DEBUG: <core> [mem/shm_mem.c:235]: shm_mem_destroy(): destroying the shared memory lock</div></div><div><br></div><div><br></div><div>Best regards</div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-08-18 12:03 GMT+01:00 Daniel-Constantin Mierla <span dir="ltr"><<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
Hello,<br>
<br>
can you run with debug=3 and see what is printed in syslog?<br>
<br>
Cheers,<br>
Daniel<div><div class="h5"><br>
<br>
<div>On 18/08/15 11:36, José Seabra wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">Hi Daniel,
<div><br>
</div>
<div>Thank you for your reply,</div>
<div><br>
</div>
<div>I did what you suggested in your last email, but the issue
remains, maybe i did something wrong, so in order we try
understand if i did or not something wrong please have a look
at the mongodb commands to create db, collection and document.</div>
<div><br>
</div>
<div>
<div>> use kamailio</div>
<div>switched to db kamailio</div>
<div>> </div>
</div>
<div>> db<br>
</div>
<div>
<div>kamailio</div>
<div>> db.createCollection("version")<br>
</div>
</div>
<div>
<div>> show collections</div>
<div>system.indexes</div>
<div>version</div>
<div>> </div>
</div>
<div>> db.getCollection("version").insert({table_name:
"presentity", table_version: 4 })<br>
</div>
<div>WriteResult({ "nInserted" : 1 })<br>
</div>
<div>> db.getCollection("version").find({})<br>
</div>
<div>
<div>{ "_id" : ObjectId("55d2fb67b04c015195aee4b1"),
"table_name" : "presentity", "table_version" : 4 }</div>
</div>
<div><br>
</div>
<div>Best Regards</div>
<div>José Seabra</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">2015-08-18 7:09 GMT+01:00
Daniel-Constantin Mierla <span dir="ltr"><<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"> Indeed the issue is
related to checking the version table. You have to create
a collection named "version" in kamailio database, then
add the records for the tables you are using with the
fields:<br>
<br>
- table_name corresponding to the table name (e.g.,
presentity)<br>
- table_version value as in lib/srdb1/schema/* (e.g., 4)<br>
<br>
If you have kamailio database created in mysql (or other
sql server), you can simply look at the content of table
"version".<br>
<br>
If I get to better internet connection while traveling
these days, I will try to put together proper guidelines.<br>
<br>
Cheers,<br>
Daniel
<div>
<div><br>
<br>
<div>On 17/08/15 19:10, José Seabra wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">This shouldn't check the table
version in mongodb or i'm wrong?
<div>Best regards</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">2015-08-17 16:45
GMT+01:00 José Seabra <span dir="ltr"><<a href="mailto:joseseabra4@gmail.com" target="_blank">joseseabra4@gmail.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">I have tried that but kamailio
gave me the following error:
<div><br>
<div>
<div> 0(2344) ERROR: <core>
[db.c:435]: db_check_table_version():
invalid version 0 for table presentity
found, expected 4 (check table
structure and table "version")</div>
<div> 0(2344) ERROR: presence
[presence.c:358]: mod_init(): error
during table version check</div>
<div> 0(2344) ERROR: <core>
[sr_module.c:945]: init_mod(): Error
while initializing module presence
(/usr/local/lib64/kamailio/modules/presence.so)</div>
<div>ERROR: error while initializing
modules</div>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>Presence module configuration:</div>
<div><br>
</div>
<div>
<div>modparam("presence",
"server_address", "sip:<a href="http://10.0.20.100:5080" target="_blank">10.0.20.100:5080</a>")</div>
<div>modparam("presence",
"subs_db_mode", 3)</div>
<div>modparam("presence",
"expires_offset", 60)</div>
<div>modparam("presence",
"send_fast_notify", 0)</div>
<div>modparam("presence",
"clean_period", 30)</div>
<div>modparam("presence", "publ_cache",
0)</div>
<div>modparam("presence",
"sip_uri_match", 1)<br>
</div>
<div>modparam("presence", "waitn_time",
1)</div>
<div>modparam("presence",
"notifier_processes", 0)</div>
<div>modparam("presence", "db_url",
"mongodb://localhost/kamailio")<br>
</div>
</div>
<div><br>
</div>
<div>Best Regards</div>
<div>José Seabra</div>
<div><br>
</div>
</div>
</div>
<div>
<div>
<div class="gmail_extra"><br>
<div class="gmail_quote">2015-08-17
16:33 GMT+01:00 Daniel-Constantin
Mierla <span dir="ltr"><<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"> Hello,<br>
<br>
do not remember exactly if you
need to create an empty
collection, anyhow, the main idea
is that there is no table
definition, because mongo is a
document-storage like engine. The
records store all the details
about all the fields.<br>
<br>
In other words, you should be
ready to go after basic setup of
mongodb collection and configuring
kamailio modules to use the
server.<br>
<br>
Cheers,<br>
Daniel
<div>
<div><br>
<br>
<div>On 17/08/15 16:51, José
Seabra wrote:<br>
</div>
</div>
</div>
<blockquote type="cite">
<div>
<div>
<div dir="ltr">Hello all,
<div>
<div>I would like to
test my presence
server using
db_mongodb as database
server instead of
using mysql, but i
don't find any
documentation
explaining how i can
configure mongodb
database(data
structure) for
presence or even for
the other kamailio
modules.</div>
<div><br>
</div>
<div>
<div>Can someone
guide me in this
setup?<br>
</div>
<div><br>
</div>
Best Regards</div>
<div><br>
</div>
<div>
<div>-- <br>
</div>
<div>Cumprimentos
<div>José Seabra</div>
</div>
</div>
</div>
</div>
<br>
<fieldset></fieldset>
<br>
</div>
</div>
<pre>_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><span><font color="#888888">
</font></span></pre>
<span><font color="#888888"> </font></span></blockquote>
<span><font color="#888888"> <br>
<pre cols="72">--
Daniel-Constantin Mierla
<a href="http://twitter.com/#%21/miconda" target="_blank">http://twitter.com/#!/miconda</a> - <a href="http://www.linkedin.com/in/miconda" target="_blank">http://www.linkedin.com/in/miconda</a>
Book: SIP Routing With Kamailio - <a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a></pre>
</font></span></div>
<br>
_______________________________________________<br>
SIP Express Router (SER) and
Kamailio (OpenSER) - sr-users
mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br>
</blockquote>
</div>
<br>
</div>
<br clear="all">
<div><br>
</div>
-- <br>
</div>
</div>
<div>Cumprimentos<span><font color="#888888">
<div>José Seabra</div>
</font></span></div>
</blockquote>
</div>
<br>
</div>
<br clear="all">
<div><br>
</div>
-- <br>
<div>Cumprimentos
<div>José Seabra</div>
</div>
</blockquote>
<br>
<pre cols="72">--
Daniel-Constantin Mierla
<a href="http://twitter.com/#%21/miconda" target="_blank">http://twitter.com/#!/miconda</a> - <a href="http://www.linkedin.com/in/miconda" target="_blank">http://www.linkedin.com/in/miconda</a>
Book: SIP Routing With Kamailio - <a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a></pre>
</div>
</div>
</div>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
<div>Cumprimentos
<div>José Seabra</div>
</div>
</div>
</blockquote>
<br>
<pre cols="72">--
Daniel-Constantin Mierla
<a href="http://twitter.com/#!/miconda" target="_blank">http://twitter.com/#!/miconda</a> - <a href="http://www.linkedin.com/in/miconda" target="_blank">http://www.linkedin.com/in/miconda</a>
Book: SIP Routing With Kamailio - <a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a></pre>
</div></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Cumprimentos<div>José Seabra</div></div>
</div>