Hi Daniel,<br><br>thanks for quick response and clarification, it helped a lot. <br><br>I was indeed expecting records in database at runtime, but until your latest updates to imc module, the module didn't write to database even at shutdown. Now, I can see records in the database when I shutdown Kamailio. When I start up Kamailio it populates cache based on records from database and deletes records in the database.<br>
<br>Best regards,<br>Ozren<br><br><br><div class="gmail_quote">On Wed, Jun 1, 2011 at 12:41 PM, Daniel-Constantin Mierla <span dir="ltr"><<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div bgcolor="#FFFFFF" text="#000000">
Hello,<br>
<br>
the module is writing to database only at shutdown, otherwise it
keeps everything in cache -- just in case you expected to see some
records in database at runtime. However, I think there was an issue
that even at shutdown the module didn't write back to database.
Please fetch the latest git branch 3.1 and try again for this
purpose.<br>
<br>
Thanks,<br>
Daniel <br><div><div></div><div class="h5">
<br>
On 6/1/11 10:48 AM, Ozren Lapcevic wrote:
</div></div><blockquote type="cite"><div><div></div><div class="h5">Hi, <br>
<br>
did anyone run into similar problems or have successfully set up
IMC module with mysql? Can you please share your know-how on the
subject?<br>
<br>
Besides issue described below, I also had several other issues,
but I think they all might be related to the fact that my rooms
and members are only stored in cache, but not in the database. To
repeat, this is really strange behavior because all other modules
that I'm using write to the database without a problem. <br>
<br>
Best regards <br>
Ozren<br>
<br>
<br>
<div class="gmail_quote">On Mon, May 30, 2011 at 6:28 PM, Ozren
Lapcevic <span dir="ltr"><<a href="mailto:ozren.lapcevic@gmail.com" target="_blank">ozren.lapcevic@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi all,<br>
<br>
I'm trying to configure IMC module and get it to work properly
but I've run into problems with saving IMC module data to
mysql database.<br>
<br>
I'm using following code provided in IMC module documentation:<br>
<br>
modparam("imc", "db_url", DBURL)<br>
<br>
## route block ###<br>
if(is_method("MESSAGE") && (uri=~
<a>"sip:chat-[0-9]+@"</a>) || (uri=~ <a>"sip:chat-manager@"</a>)) {<br>
xlog("L_INFO", "going to imc: F [$fu] T [$tu]
B [$rb]\n");<br>
<br>
if(imc_manager())<br>
sl_send_reply("200", "ok -
imc_manager()");<br>
else<br>
sl_send_reply("500", "command error");<br>
exit;<br>
}<br>
<br>
I am creating chat room with following message sent to <a href="mailto:chat-manager@abc.hr" target="_blank">chat-manager@abc.hr</a>: "#create chat-111"<br>
<br>
DEBUG log returns following:<br>
May 30 18:01:23 ser-test
/usr/local/kamailio-ozren/sbin/kamailio[13225]: INFO:
<script>: going to imc: F [<a href="mailto:sip%3Aoz@abc.hr" target="_blank">sip:oz@abc.hr</a>]
T [<a href="mailto:sip%3Achat-manager@abc.hr" target="_blank">sip:chat-manager@abc.hr</a>]
B [#create chat-111]<br>
May 30 18:01:23 ser-test
/usr/local/kamailio-ozren/sbin/kamailio[13225]: DEBUG: imc
[imc.c:525]: found command<br>
May 30 18:01:23 ser-test
/usr/local/kamailio-ozren/sbin/kamailio[13225]: DEBUG: imc
[imc_cmd.c:146]: command: [create]<br>
May 30 18:01:23 ser-test
/usr/local/kamailio-ozren/sbin/kamailio[13225]: DEBUG: imc
[imc_cmd.c:151]: parameter 0=[chat-111]<br>
May 30 18:01:23 ser-test
/usr/local/kamailio-ozren/sbin/kamailio[13225]: DEBUG: imc
[imc_cmd.c:171]: new room [chat-111]<br>
May 30 18:01:23 ser-test
/usr/local/kamailio-ozren/sbin/kamailio[13225]: DEBUG: imc
[imc_cmd.c:186]: added room uri= <a href="mailto:sip%3Achat-111@abc.hr" target="_blank">sip:chat-111@abc.hr</a><br>
May 30 18:01:23 ser-test
/usr/local/kamailio-ozren/sbin/kamailio[13225]: DEBUG: imc
[imc_mng.c:322]: [uri]= <a href="mailto:sip%3Aoz@abc.hr" target="_blank">sip:oz@abc.hr</a><br>
May 30 18:01:23 ser-test
/usr/local/kamailio-ozren/sbin/kamailio[13225]: DEBUG: imc
[imc_mng.c:326]: [user]= oz<br>
May 30 18:01:23 ser-test
/usr/local/kamailio-ozren/sbin/kamailio[13225]: DEBUG: imc
[imc_cmd.c:196]: added the owner as the first member [<a href="mailto:sip%3Aoz@abc.hr" target="_blank">sip:oz@abc.hr</a>]<br>
<br>
"./kamctl fifo imc_list_rooms" returns following:<br>
ROOM:: URI=<a href="mailto:sip%3Achat-111@abc.hr" target="_blank">sip:chat-111@abc.hr</a>
MEMBERS=0 OWNER=<a href="mailto:sip%3Aoz@abc.hr" target="_blank">sip:oz@abc.hr</a><br>
<br>
"./kamctl fifo imc_list_members <a href="mailto:sip%3Achat-111@abc.hr" target="_blank">sip:chat-111@abc.hr</a>"
returns following:<br>
ROOM:: <a href="mailto:sip%3Achat-111@abc.hr" target="_blank">sip:chat-111@abc.hr</a>
NR_OF_MEMBERS=1<br>
MEMBER:: <a href="mailto:sip%3Aoz@abc.hr" target="_blank">sip:oz@abc.hr</a><br>
<br>
However, that data is not persisted/saved in the imc_rooms and
imc_members tables in the database. Any clues what might be
the problem here?<br>
<br>
Any help is greatly appreciated.<br>
<br>
Best regards,<br>
Ozren Lapcevic<br>
<br>
PS<br>
I'm runing Kamailio 3.1.4 with default cfg file with enabled
mysql, multidomain, usrlocdb, auth and NAT. I can register
clients, establish calls, send IMs, etc. imc_rooms and
imc_members tables were created when kamailio was installed.
I've also checked imc-create.sql script and tables are
correctly created. <br>
<br>
The same DBURL used for imc is also used for auth_db, domain
and usrloc modules and I haven't experienced any problems with
those modules and database connection/persistence. domain,
location, version and subscriber tables are correctly
populated. <br>
<br>
I'm not getting any errors from imc_manager(), it returns 200
OK. I can't trace any errors in DEBUG related to problems with
mysql database.<br>
</blockquote>
</div>
<br>
<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>
</pre>
</blockquote>
<br>
<pre cols="72">--
Daniel-Constantin Mierla -- <a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a>
<a href="http://linkedin.com/in/miconda" target="_blank">http://linkedin.com/in/miconda</a> -- <a href="http://twitter.com/miconda" target="_blank">http://twitter.com/miconda</a></pre>
</div>
</blockquote></div><br>