<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=FR link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal><span lang=EN-US>Hi,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>In a previous post (<a href="https://lists.kamailio.org/pipermail/sr-users/2018-August/102442.html">[SR-Users] Questions about changes between 5.0.1 and 5.0.7 </a>), I reported problem to upgrade my kamailio from 5.0.1 to 5.0.7-7 level.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>With help from some people, it was finally fixed on my test server in my lab.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Now I was expecting to do the same upgrade on a real server using these packages:<o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US>kamailio-5.0.7-7.el7.x86_64.rpm<o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US>kamailio-ims-5.0.7-7.el7.x86_64.rpm<o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US>kamailio-mysql-5.0.7-7.el7.x86_64.rpm<o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US>kamailio-perl-5.0.7-7.el7.x86_64.rpm<o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US>kamailio-snmpstats-5.0.7-7.el7.x86_64.rpm<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>But kamailio failed to connect the local MySQL server :<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US>Aug 31 08:16:20 in52inmvt2router1-mvt-tpm-sipr /usr/sbin/kamailio[6365]: DEBUG: <core> [db.c:209]: db_bind_mod(): using db bind api for db_mysql<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US>Aug 31 08:16:20 in52inmvt2router1-mvt-tpm-sipr /usr/sbin/kamailio[6365]: DEBUG: <core> [db.c:314]: db_do_init2(): connection 0x7fef779958f8 not found in pool<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US>Aug 31 08:16:20 in52inmvt2router1-mvt-tpm-sipr /usr/sbin/kamailio[6365]: DEBUG: db_mysql [km_my_con.c:98]: db_mysql_new_connection(): opening connection: mysql://xxxx:xxxx@localhost/siprouter<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US>Aug 31 08:16:20 in52inmvt2router1-mvt-tpm-sipr /usr/sbin/kamailio[6365]: ERROR: db_mysql [km_my_con.c:129]: db_mysql_new_connection(): driver error: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13 "Permission denied")<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US>Aug 31 08:16:20 in52inmvt2router1-mvt-tpm-sipr /usr/sbin/kamailio[6365]: ERROR: <core> [db.c:318]: db_do_init2(): could not add connection to the pool<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US>Aug 31 08:16:20 in52inmvt2router1-mvt-tpm-sipr /usr/sbin/kamailio[6365]: ERROR: htable [ht_db.c:92]: ht_db_open_con(): failed to connect to the database<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US>Aug 31 08:16:20 in52inmvt2router1-mvt-tpm-sipr /usr/sbin/kamailio[6365]: ERROR: <core> [core/sr_module.c:974]: init_mod(): Error while initializing module htable (/usr/lib64/kamailio/modules/htable.so)<o:p></o:p></span></i></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>My “kamailio.cfg” contains the following command:<o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US>modparam("htable", "db_url", "mysql://siprouter:password@localhost/siprouter") <o:p></o:p></span></i></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>The service unit : “/usr/lib/systemd/system/kamailio.service” content is :<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US> [Unit]<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US>Description=Kamailio (OpenSER) - the Open Source SIP Server<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US>After=network.target mysql.service<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US><o:p> </o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US>[Service]<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US>Type=simple<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US>User=kamailio<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US>Group=kamailio<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i>Environment='CFGFILE=/etc/kamailio/kamailio.cfg'<o:p></o:p></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US>Environment='SHM_MEMORY=1024'<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US>Environment='PKG_MEMORY=8'<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US>EnvironmentFile=-/etc/sysconfig/kamailio<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US>ExecStart=/usr/sbin/kamailio -DD -P /var/run/kamailio/kamailio.pid -f $CFGFILE -m $SHM_MEMORY -M $PKG_MEMORY<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US>Restart=on-failure<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US><o:p> </o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US>[Install]<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US>WantedBy=multi-user.target<o:p></o:p></span></i></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>The “/etc/sysconfig/kamailio” content is :<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US>#<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US># Kamailio startup options<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US>#<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US><o:p> </o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US>#<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US># Kamailio startup options<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US>#<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US><o:p> </o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US># Set to yes to enable kamailio, once configured properly.<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US>RUN_KAMAILIO=yes<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US><o:p> </o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US># User to run as<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US>USER=kamailio<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US><o:p> </o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US># Group to run as<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US>GROUP=kamailio<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US><o:p> </o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US># Amount of shared memory to allocate for the running Kamailio server (in Mb)<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US>SHM_MEMORY=1024<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US><o:p> </o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US># Amount of per-process (package) memory to allocate for Kamailio (in Mb)<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US>PKG_MEMORY=8<o:p></o:p></span></i></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Below the existing user in mysql :<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US style='font-family:"Courier New"'>mysql:root:(none)> use mysql;<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US style='font-family:"Courier New"'>Database changed<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US style='font-family:"Courier New"'>mysql:root:mysql> select user,host from user;<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US style='font-family:"Courier New"'>+-----------+-----------+<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US style='font-family:"Courier New"'>| user | host |<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US style='font-family:"Courier New"'>+-----------+-----------+<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US style='font-family:"Courier New"'>| myadmin | % |<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US style='font-family:"Courier New"'>| siprouter | % |<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US style='font-family:"Courier New"'>| kamailio | localhost |<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US style='font-family:"Courier New"'>| root | localhost |<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US style='font-family:"Courier New"'>+-----------+-----------+<o:p></o:p></span></i></p><p class=MsoNormal><span lang=EN-US>I have a symlink to locate the my.cnf : ln -s /myqdata/mysiprdb/data/my.cnf /etc/my.cnf<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>And also this link to fix a htable reload problem : ln -s /myqdata/mysiprdb/data/mysiprdb.sock /var/lib/mysql/mysql.sock<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>I don’t find what the problem is this time.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>So if there is people that could help on the issue, thanks in advance.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><div style='mso-element:para-border-div;border:none;border-top:solid #CCCCCC 1.0pt;padding:4.0pt 0cm 0cm 0cm'><p class=MsoNormal style='margin-bottom:3.0pt;border:none;padding:0cm'><span lang=FR-BE style='color:#444444;mso-fareast-language:FR'>Cordialement.<o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:3.0pt;border:none;padding:0cm'><b><span lang=FR-BE style='color:#444444;mso-fareast-language:FR'>Patrick GINHOUX</span></b><span lang=FR-BE style='color:#444444;mso-fareast-language:FR'> <o:p></o:p></span></p></div><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p></div></body></html>