Hello, if you keep getting 401/407 replies, then the password might be invalid.
You can run kamailio with debug=3 and look in the syslog for the debug messages, you should see there more details about what happens and why the authentication fails Cheers, Daniel On 21/04/15 14:54, Gabrielle Eymard wrote: > Hello everyone, > > I’m currently running Kamailio 4.2.4 with PostrgreSQL 9.3 database, each one > on CentOS 6.6 > I have installed and configured Kamailio with PostgreSQL without any problem. > But now, I don’t want my phones register be recorded on Kamailio (on cache) > but immediately on the external database. > For that, I follow your advices and configure the kamailio.cfg this way : > I added these lines : > #!ifdef WITH_PGSQL > #!define DBURL "postgres://user:passwd@database.domain:5432/kamailio" > #!endif > … > #!ifdef WITH_PGSQL > loadmodule "db_postgres.so" > #!endif > … > And I have all these modules laoded : > loadmodule "mi_fifo.so" > loadmodule "kex.so" > loadmodule "corex.so" > loadmodule "tm.so" > loadmodule "tmx.so" > loadmodule "sl.so" > loadmodule "rr.so" > loadmodule "pv.so" > loadmodule "maxfwd.so" > loadmodule "usrloc.so" > loadmodule "outbound.so" > loadmodule "registrar.so" > loadmodule "textops.so" > loadmodule "siputils.so" > loadmodule "xlog.so" > loadmodule "sanity.so" > loadmodule "ctl.so" > loadmodule "cfg_rpc.so" > loadmodule "mi_rpc.so" > loadmodule "acc.so" > loadmodule "stun.so" > > I also set 3 to the usrloc param so my registration are directly on my > database : > # ----- usrloc params ----- > /* enable DB persistency for location entries */ > #!ifdef WITH_USRLOCDB > modparam("usrloc", "db_url", DBURL) > modparam("usrloc", "db_mode", 3) > modparam("usrloc", "use_domain", MULTIDOMAIN) > #!endif > > Then, when I restart my Kamailio server, I saw on my postgres database that > the connection with this user and passwd is ok but my sip phones didn’t > registered. Thanks to Wireshark, I saw that the first REGISTER is send by my > sip-phone to Kamailio. The first UNAUTHORIZED response came, as expected, > with the WWW-Authenticate information. My phone sent a new REGISTER with the > good realm and nonce-value (so I can see with wireshark) but Kamailio still > refuse it by another UNAUTHORIZED message (same as the first one). > Can you please explain to me where am I wrong ? > > If it helps, this is what I got on the kamailio logs : > Apr 21 14:27:39 fiducial-vm-centos66-sipr1 /usr/sbin/kamailio[20466]: NOTICE: > <core> [main.c:739]: handle_sigs(): Thank you for flying kamailio!!! > Apr 21 14:27:39 fiducial-vm-centos66-sipr1 /usr/sbin/kamailio[20475]: INFO: > <core> [main.c:850]: sig_usr(): signal 15 received > Apr 21 14:27:39 fiducial-vm-centos66-sipr1 /usr/sbin/kamailio[20474]: INFO: > <core> [main.c:850]: sig_usr(): signal 15 received > Apr 21 14:27:39 fiducial-vm-centos66-sipr1 /usr/sbin/kamailio[20473]: INFO: > <core> [main.c:850]: sig_usr(): signal 15 received > Apr 21 14:27:39 fiducial-vm-centos66-sipr1 /usr/sbin/kamailio[20472]: INFO: > <core> [main.c:850]: sig_usr(): signal 15 received > Apr 21 14:27:39 fiducial-vm-centos66-sipr1 /usr/sbin/kamailio[20471]: INFO: > <core> [main.c:850]: sig_usr(): signal 15 received > Apr 21 14:27:39 fiducial-vm-centos66-sipr1 /usr/sbin/kamailio[20470]: INFO: > <core> [main.c:850]: sig_usr(): signal 15 received > Apr 21 14:27:39 fiducial-vm-centos66-sipr1 /usr/sbin/kamailio[20469]: INFO: > <core> [main.c:850]: sig_usr(): signal 15 received > Apr 21 14:27:39 fiducial-vm-centos66-sipr1 /usr/sbin/kamailio[20468]: INFO: > <core> [main.c:850]: sig_usr(): signal 15 received > Apr 21 14:27:39 fiducial-vm-centos66-sipr1 /usr/sbin/kamailio[20467]: INFO: > <core> [main.c:850]: sig_usr(): signal 15 received > Apr 21 14:27:39 fiducial-vm-centos66-sipr1 kamailio: INFO: <core> > [tcp_main.c:4746]: init_tcp(): using epoll_lt as the io watch method (auto > detected) > Apr 21 14:27:39 fiducial-vm-centos66-sipr1 /usr/sbin/kamailio[22331]: INFO: > usrloc [hslot.c:53]: ul_init_locks(): locks array size 1024 > Apr 21 14:27:39 fiducial-vm-centos66-sipr1 /usr/sbin/kamailio[22331]: INFO: > auth [auth_mod.c:350]: mod_init(): auth: qop set, but nonce-count > (nc_enabled) support disabled > Apr 21 14:27:39 fiducial-vm-centos66-sipr1 /usr/sbin/kamailio[22331]: INFO: > <core> [udp_server.c:175]: probe_max_receive_buffer(): SO_RCVBUF is initially > 124928 > Apr 21 14:27:39 fiducial-vm-centos66-sipr1 /usr/sbin/kamailio[22331]: INFO: > <core> [udp_server.c:225]: probe_max_receive_buffer(): SO_RCVBUF is finally > 249856 > Apr 21 14:27:39 fiducial-vm-centos66-sipr1 /usr/sbin/kamailio[22339]: INFO: > ctl [io_listener.c:225]: io_listen_loop(): io_listen_loop: using epoll_lt io > watch method (config) > > Hope someone could help me, > > Thank you in advance anyway > > Gab > > _______________________________________________ > SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list > sr-users@lists.sip-router.org > http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users -- Daniel-Constantin Mierla http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda Kamailio World Conference, May 27-29, 2015 Berlin, Germany - http://www.kamailioworld.com _______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users