[Users] Re: [Serusers] no login to openser

Ronald Wiplinger ronald at elmit.com
Mon Oct 17 19:59:14 CEST 2005


Daniel-Constantin Mierla wrote:

>
>>>>
>>>>
>>>> I found a part of my problem, but I cannot explain it.
>>>> The phone (hard phone as well as a softphone) have been set to 
>>>> connect to port 5062, but I see the registration still on 5060, 
>>>> where Asterisk is running (on the same machine). The user 800000 
>>>> has no account on Asterisk, therefore the login fails there.
>>>>
>>>> Any idea where this could come from?
>>>
>>>
>>> maybe there is a special field to set for registrar address in 
>>> phone's configuration, or the phone is broken. What kind of phones 
>>> have you tried?
>>>
>>
>> That was exactly my first thought too. I use a noname SIP phone, and 
>> than I used firefly. The exaclty same behaviour.
>
> never used firefly.
>
>>
>> Is there any command line utility to test that?
>
> if you want tot test if the registration works, then you can use 
> sipsak, from http://sipsak.org, it is a tiny command line utility. 
> Otherwise, you can try some free sip soft phones: kphone, minisip, 
> xten xlite.
>

I tried Xlite and it is exactly the same, ... I set the sip registration 
port to 5062 and it still registers in Asterisk, ...
I tried to use instead of the domain name the IP address, but it is the 
same.
I thought already on the possibility that the DNS SRV entry redirects 
all to 5060, but that would not be anymore true, when I used the IP 
address, ....



 grep -v ^[#,$] openser.cfg

check_via=no    # (cmd. line: -v)
dns=no          # (cmd. line: -r)
rev_dns=no      # (cmd. line: -R)
port=5062
fifo="/tmp/openser_fifo"
fifo_mode=0666


loadmodule "/usr/local/lib/openser/modules/mysql.so"
loadmodule "/usr/local/lib/openser/modules/sl.so"
loadmodule "/usr/local/lib/openser/modules/tm.so"
loadmodule "/usr/local/lib/openser/modules/rr.so"
loadmodule "/usr/local/lib/openser/modules/maxfwd.so"
loadmodule "/usr/local/lib/openser/modules/usrloc.so"
loadmodule "/usr/local/lib/openser/modules/registrar.so"
loadmodule "/usr/local/lib/openser/modules/textops.so"
loadmodule "/usr/local/lib/openser/modules/auth.so"
loadmodule "/usr/local/lib/openser/modules/auth_db.so"

modparam("usrloc", "db_mode",   0)
modparam("usrloc", "db_mode", 2)
modparam("auth_db", "calculate_ha1", yes)
modparam("rr", "enable_full_lr", 1)


route{

        # 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");
                return;
        };
        if (msg:len >=  2048 ) {
                sl_send_reply("513", "Message too big");
                return;
        };

        # 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
        if (loose_route()) {
                # mark routing logic in request
                append_hf("P-hint: rr-enforced\r\n");
                route(1);
                return;
        };

        if (!uri==myself) {
                # mark routing logic in request
                append_hf("P-hint: outbound\r\n");
                route(1);
                return;
        };

        # 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") {

                        if (!www_authorize("vpbx.mydomain.com", 
"subscriber")) {
                                www_challenge("vpbx.mydomain.com", "0");
                                return;
                        };

                        save("location");
                        return;
                };

                lookup("aliases");
                if (!uri==myself) {
                        append_hf("P-hint: outbound alias\r\n");
                        route(1);
                        return;
                };

                # native SIP destinations are handled using our USRLOC DB
                if (!lookup("location")) {
                        sl_send_reply("404", "Not Found");
                        return;
                };
        };
        append_hf("P-hint: usrloc applied\r\n");
        route(1);
}

route[1]
{
        # send it out now; use stateful forwarding as it works reliably
        # even for UDP2TCP
        if (!t_relay()) {
                sl_reply_error();
        };
}






More information about the sr-users mailing list