[Serdev] Lastest CVS mysql authentication problems
Glenn Dalgliesh
ser at techhat.com
Fri Jan 23 22:11:50 UTC 2004
My apologize I must have done something wrong just recompile and try again
in order to get you debug info and Auth seems to be work fine. But I can't
add an aliases to work in this version.
[root at serv1 sip_router]# serctl alias add 4102959745
sip:1638 at sipdemo.routerboy.com
sip:1638 at sipdemo.routerboy.com
500 Error while adding contact
('4102959745','sip:1638 at sipdemo.routerboy.com') in table 'aliases'
[root at serv1 sip_router]#
[root at serv1 sip_router]# ser -V
version: ser 0.8.13-dev-23-merged (i386/linux)
flags: STATS:Off, USE_IPV6, USE_TCP, DISABLE_NAGLE, DNS_IP_HACK, SHM_MEM,
SHM_MMAP, PKG_MALLOC, FAST_LOCK-ADAPTIVE_WAIT
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16,
MAX_URI_SIZE 1024, BUF_SIZE 65535
@(#) $Id: main.c,v 1.174 2003/11/26 23:43:59 andrei Exp $
main.c compiled on 14:47:56 Jan 23 2004 with gcc 3.2
----- Original Message -----
From: "Jan Janak" <jan at iptel.org>
To: "Glenn Dalgliesh" <ser at techhat.com>
Cc: <serdev at lists.iptel.org>
Sent: Friday, January 23, 2004 4:54 PM
Subject: Re: [Serdev] Lastest CVS mysql authentication problems
> Is there any error message in the logs ?
>
> Jan.
>
> On 23-01 16:58, Glenn Dalgliesh wrote:
> > I had already corrected that issue. Seems to be something else. I have
> > attached my config
> >
> > #
> > # Stun & rtpproxy working
> > #
> >
> > # ----------- global configuration parameters ------------------------
> >
> > debug=7 # debug level (cmd line: -dddddddddd)
> > #debug=3 # debug level (cmd line: -dddddddddd)
> > fork=yes
> > log_stderror=no # (cmd line: -E)
> >
> > #fork=no
> > #log_stderror=yes
> >
> > check_via=no # (cmd. line: -v)
> > dns=no # (cmd. line: -r)
> > rev_dns=no # (cmd. line: -R)
> > port=5060
> > children=4
> > fifo="/tmp/ser_fifo"
> > # fifo_db_url="/tmp/ser_fifo_db"
> > # ------------------ module loading ----------------------------------
> >
> > # Uncomment this if you want to use SQL database
> > loadmodule "/usr/local/lib/ser/modules/mysql.so"
> >
> > loadmodule "/usr/local/lib/ser/modules/sl.so"
> > loadmodule "/usr/local/lib/ser/modules/tm.so"
> > loadmodule "/usr/local/lib/ser/modules/acc.so"
> > loadmodule "/usr/local/lib/ser/modules/rr.so"
> > loadmodule "/usr/local/lib/ser/modules/maxfwd.so"
> > loadmodule "/usr/local/lib/ser/modules/usrloc.so"
> > loadmodule "/usr/local/lib/ser/modules/registrar.so"
> > loadmodule "/usr/local/lib/ser/modules/textops.so"
> >
> > # Uncomment this if you want digest authentication
> > # mysql.so must be loaded !
> > loadmodule "/usr/local/lib/ser/modules/auth.so"
> > loadmodule "/usr/local/lib/ser/modules/auth_db.so"
> >
> > # loadmodule "/usr/local/lib/ser/modules/nathelper.so"
> >
> >
> > # ----------------- setting module-specific parameters ---------------
> >
> > # -- usrloc params --
> >
> > # modparam("usrloc", "db_mode", 0)
> >
> > # Uncomment this if you want to use SQL database
> > # for persistent storage and comment the previous line
> > modparam("usrloc", "db_mode", 2)
> >
> > # -- auth params --
> > # Uncomment if you are using auth module
> > #
> > modparam("auth_db", "calculate_ha1", yes)
> > #
> > # If you set "calculate_ha1" parameter to yes (which true in this
config),
> > # uncomment also the following parameter)
> > #
> > modparam("auth_db", "password_column", "password")
> >
> > modparam("usrloc", "db_url","mysql://ser:heslo@127.0.0.1:3306/ser")
> >
> >
> > # -- acc params --
> > # set the reporting log level
> > modparam("acc", "log_level", 2)
> > # number of flag, which will be used for accounting; if a message is
> > # labeled with this flag, its completion status will be reported
> > modparam("acc", "log_flag", 2 )
> >
> > # -- rr params --
> > # add value to ;lr param to make some broken UAs happy
> > modparam("rr", "enable_full_lr", 1)
> >
> > # We will you flag 6 to mark NATed contacts
> > # modparam("registrar", "nat_flag", 6)
> >
> > # Enable NAT pinging
> > # modparam("nathelper", "natping_interval", 30)
> >
> > # Ping only contacts that are known to be
> > # behind NAT
> > # modparam("nathelper", "ping_nated_only", 1)
> >
> >
> >
> > # ------------------------- request routing logic -------------------
> >
> >
> > # main routing logic
> >
> > alias="sipdemo.routerboy.com"
> >
> > route{
> > # allows sipdemo and sipdemonat to call each other
> > if (uri=~"sipdemonat.routerboy.com") {
> > rewritehost("sipdemo.routerboy.com");
> > };
> >
> > # initial sanity checks -- messages with
> > # max_forwards==0, or excessively long requests
> > if (!mf_process_maxfwd_header("10")) {
> > sl_send_reply("483","Too Many Hops");
> > break;
> > };
> > if (msg:len >= max_len ) {
> > sl_send_reply("513", "Message too big");
> > break;
> > };
> >
> > # we record-route all messages -- to make sure that
> > # subsequent messages will go through our proxy; that's
> > # particularly good if upstream and downstream entities
> > # use different transport protocol
> > if (!method=="REGISTER") record_route();
> >
> > # subsequent messages withing a dialog should take the
> > # path determined by record-routing
> > setflag(2);
> > if (loose_route()) {
> > log(1, "LOG: loose_route\n");
> > # mark routing logic in request
> > append_hf("P-hint: rr-enforced\r\n");
> > route(9);
> > break;
> > };
> >
> > if (!uri==myself) {
> > log(1, "LOG: Not myself\n");
> > # mark routing logic in request
> > append_hf("P-hint: outbound\r\n");
> > route(9);
> > break;
> > };
> >
> > # if the request is for other domain use UsrLoc
> > # (in case, it does not work, use the following command
> > # with proper names and addresses in it)
> > if (uri==myself) {
> >
> > if (method=="REGISTER") {
> >
> > # Uncomment this if you want to use digest authentication
> > if (!www_authorize("sipdemo.routerboy.com",
> > "subscriber")) {
> > www_challenge("sipdemo.routerboy.com",
"0");
> > break;
> > };
> >
> > save("location");
> > break;
> > };
> >
> >
> > lookup("aliases");
> > log(1, "LOG: Loaded aliases\n");
> > if (lookup("location")) {
> > log(1, "LOG: Match location\n");
> > append_hf("P-hint: usrloc applied\r\n");
> > route(9);
> > break;
> > };
> > if (uri=~"^sip:25[0-9][0-9]@" || uri=~"^sip:8601@" ||
> > uri=~"^sip:41038425[0-9][0-9]@" || uri=~"^sip:4105443521@" ||
> > uri=~"^sip:4106474391@") {
> > # Attempts to call Toad
> > route(2);
> > route(9);
> > break;
> > };
> > if (uri=~"^sip:[0-9]{10}@" || uri=~"^1[0-9]{10}@") {
> > # Attempts to call PSTN
> > route(1);
> > route(9);
> > break;
> > };
> >
> > # native SIP destinations are handled using our USRLOC
DB
> > if (!lookup("location")) {
> > sl_send_reply("404", "Not Found");
> > break;
> > };
> > };
> > }
> >
> > route[1]
> > {
> > # if 10 digits add a 1
> > if (uri=~"^sip:[0-9]{10}@") {
> > prefix("1");
> > };
> > # send to Core for PSTN
> > rewritehostport("xxx.163.xxx.7:7021");
> > }
> >
> > route[2]
> > {
> > # rewrites to send to toad asterisk and make compatiable for
PSTN
> > Failover
> > if (uri=~"^sip:25[0-9][0-9]@") {
> > strip(2);
> > prefix("41038425");
> > };
> > if (uri=~"^sip:8601@") {
> > strip(4);
> > prefix("4106474391");
> > };
> >
> > # Send to Toad * PBX
> > rewritehost("asterisk.toad.net");
> > }
> >
> >
> > route[9]
> > {
> > # Specify what we want to do on failure
> > #if (!search("P-hint: usrloc applied")) {
> > # t_on_failure("1");
> > #};
> > # Send Call
> > log(1, "LOG: route9, t_relay\n");
> > t_relay();
> > }
> >
> > failure_route[1] {
> > log(1, "LOG: Call in failure_route1\n");
> > # for some reason, the original forwarding attempt
> > # failed, try at another UR25I
> > append_branch("sip:162.33.xxx.xxx:5060");
> > # if this new attempt fails too, try another failure_route
> > if (uri=~"^sip:[0-9]{10}@") {
> > prefix("1");
> > };
> > t_relay();
> > }
> >
> > ----- Original Message -----
> > From: "Jan Janak" <jan at iptel.org>
> > To: "Glenn Dalgliesh" <ser at techhat.com>
> > Cc: <serdev at lists.iptel.org>
> > Sent: Friday, January 23, 2004 4:46 PM
> > Subject: Re: [Serdev] Lastest CVS mysql authentication problems
> >
> >
> > > In the devel version a differen database URI is used, it should be
> > > mysql://ser:heslo@dbhost/ser instead of sql://ser:heslo@dbhost/ser
> > >
> > > (sql: -> mysql:).
> > >
> > > Jan
> > >
> > > On 23-01 16:47, Glenn Dalgliesh wrote:
> > > > I downloaded and compiled lastest CVS and using my config from 8.12
> > authentications fails. I recreated the database table using the
ser_mysql
> > script but the only way I seem to be able to register a sip device is to
> > remove the authentication lines. Has their been any change in this area?
> > > >
> > > > The main goal is to get nathelper, authentication, and aliases
working
> > in a version.
> > > >
> > > > Thanks
> > >
> > > > _______________________________________________
> > > > Serdev mailing list
> > > > serdev at lists.iptel.org
> > > > http://lists.iptel.org/mailman/listinfo/serdev
> > >
> > >
> >
> > _______________________________________________
> > Serdev mailing list
> > serdev at lists.iptel.org
> > http://lists.iptel.org/mailman/listinfo/serdev
>
More information about the Serdev
mailing list