[SR-Users] Major problem with setup NAT + MULTIDOMAIN

Rumen Mihailov zealas1662 at gmail.com
Mon Jan 28 22:52:17 CET 2013


Hi guys,

I've baning my head for the last 6 7 days with something that have to
be universally simple but obviously for me it is not, so please do
help.

I have the following setup.

xx.xx.xx.xx (real IP 1:1 NAT) -> 10.2.47.201

Kamailio listens on 10.2.47.201
I have setup a domain xxx.itradebg.com and I've made the appropriate
records in the DNS.
I have inserted the domain xxx.itradebg.com in the domain table in the
database and kamctl domain show shows the correct thing.

Now when I try to register 999 at xxx.itradebg.com I get Request timed out

I have this in my config:
        if (is_method("REGISTER") || from_uri==myself)
        {
                if (!auth_check("$fd", "sip", "1")) {
                        auth_challenge("$fd", "0");
                        exit;
                }
        }
        if (from_uri!=myself && uri!=myself)
        {

                if(lookup_domain("$fd", "@from.uri.host")){
                        xlog("LOCAL DOMAIN -> REGISTER");
                        exit;
                }
                else{
                        xlog("L_WARN","FROM NOT LOCAL");
                        sl_send_reply("403","Sorry mate not relaying");
                        exit;
                }
        }

By the time of writing this I realised that this should be all
rewritten to this only, as the second check is useless:

        if (is_method("REGISTER") || from_uri==myself)
        {
                if (!auth_check("$fd", "sip", "1")) {
                        auth_challenge("$fd", "0");
                        exit;
                }
        }

However I get 401 Unauthorized. The previous setup was giving me 408 -
Request Timed out...

I am pretty sure I have the passwords correct.

What I cannot understand is why authentication fails ?!

Also, how do I set kamailio to print debug output ?
debug=9
log_stderror=no

This is what I have in the .conf file. /var/log/messages seems to only
have what I have printed with xlog... (think)

I am really out of ideas... perhaps I need some sleep.

Anyway any input is helpful guys.

Thanks,
Rumen
http://itradebg.com



More information about the sr-users mailing list