Hi,

Thanks for the help, here's what I dug up:

The users are visible in Kamailio, output of kamcmd ul.dump:
(here 1.1.1.1 is the public ip of my Kamailio+Asterisk server and 2.2.2.2 is the public ip of my home network)

# kamcmd ul.dump
{
        Domain: location
        Size: 512
        AoRs: {
                AoR: 661@testers.com
                HashID: 371821163
                Contacts: {
                        Contact: {
                                Address: sip:661@192.168.0.106:5062;transport=udp
                                Expires: 3588
                                Q: -1.000000
                                Call-ID: 56c288b61a0baf63@192.168.0.106
                                CSeq: 20002
                                User-Agent: Grandstream GXP2000 1.2.5.3
                                Received: sip:2.2.2.2:5062
                                Path: [not set]
                                State: CS_SYNC
                                Flags: 0
                                CFlags: 64
                                Socket: udp:1.1.1.1:5060
                                Methods: 8159
                                Ruid: uloc-535276f9-1d83-2
                                Instance: [not set]
                                Reg-Id: 0
                                Last-Keepalive: 1397984187
                                Last-Modified: 1397984187
                        }
                }
                AoR: 660@testers.com
                HashID: 371820875
                Contacts: {
                        Contact: {
                                Address: sip:660@192.168.0.101:53928;rinstance=6ca94e284d15eb27;transport=TCP
                                Expires: 3224
                                Q: -1.000000
                                Call-ID: YzQ5YzZlMGI4NTVjNmE3Y2JlMWYzNGI0ODhlMDRmYmI.
                                CSeq: 12
                                User-Agent: Z 3.2.21357 r21367
                                Received: sip:2.2.2.2:1895;transport=TCP
                                Path: [not set]
                                State: CS_SYNC
                                Flags: 0
                                CFlags: 64
                                Socket: tcp:1.1.1.1:5060
                                Methods: 5087
                                Ruid: uloc-535276f9-1d9e-2
                                Instance: [not set]
                                Reg-Id: 0
                                Last-Keepalive: 1397983823
                                Last-Modified: 1397983823
                        }
                }
        }
        Stats: {
                Records: 2
                Max-Slots: 1
        }
}



Yes, the REGISTER message reaches Asterisk and it responds with 200 OK, here is the SIP trace:

T 2.2.2.2:1895 -> 1.1.1.1:5060 [AP]
REGISTER sip:testers.com;transport=TCP SIP/2.0.
Via: SIP/2.0/TCP 192.168.0.101:53928;branch=z9hG4bK-d8754z-efb8733fbbad4b7c-1---d8754z-.
Max-Forwards: 70.
Contact: <sip:660@192.168.0.101:53928;rinstance=2b8a38b85fa9eb69;transport=TCP>.
To: <sip:660@testers.com;transport=TCP>.
From: <sip:660@testers.com;transport=TCP>;tag=83057513.
Call-ID: OTdkNGY5ZDIxYzk5NjQ2NmNlNzU3MWMzZDIwZGQ0YTY..
CSeq: 1 REGISTER.
Expires: 3600.
Allow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, MESSAGE, OPTIONS, INFO, SUBSCRIBE.
Supported: replaces, norefersub, extended-refer, timer, X-cisco-serviceuri.
User-Agent: Z 3.2.21357 r21367.
Allow-Events: presence, kpml.
Content-Length: 0.
.


T 1.1.1.1:5060 -> 2.2.2.2:1895 [AP]
SIP/2.0 401 Unauthorized.
Via: SIP/2.0/TCP 192.168.0.101:53928;branch=z9hG4bK-d8754z-efb8733fbbad4b7c-1---d8754z-;rport=1895;received=2.2.2.2.
To: <sip:660@testers.com;transport=TCP>;tag=9bf08f91615a4a194285ad1308f058f3.c9e3.
From: <sip:660@testers.com;transport=TCP>;tag=83057513.
Call-ID: OTdkNGY5ZDIxYzk5NjQ2NmNlNzU3MWMzZDIwZGQ0YTY..
CSeq: 1 REGISTER.
WWW-Authenticate: Digest realm="testers.com", nonce="U1OO1VNTjalLQmkJEOAWOaLqbTEALvG7".
Content-Length: 0.
.


T 2.2.2.2:1895 -> 1.1.1.1:5060 [AP]
REGISTER sip:testers.com;transport=TCP SIP/2.0.
Via: SIP/2.0/TCP 192.168.0.101:53928;branch=z9hG4bK-d8754z-2433219a229ba04d-1---d8754z-.
Max-Forwards: 70.
Contact: <sip:660@192.168.0.101:53928;rinstance=2b8a38b85fa9eb69;transport=TCP>.
To: <sip:660@testers.com;transport=TCP>.
From: <sip:660@testers.com;transport=TCP>;tag=83057513.
Call-ID: OTdkNGY5ZDIxYzk5NjQ2NmNlNzU3MWMzZDIwZGQ0YTY..
CSeq: 2 REGISTER.
Expires: 3600.
Allow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, MESSAGE, OPTIONS, INFO, SUBSCRIBE.
Supported: replaces, norefersub, extended-refer, timer, X-cisco-serviceuri.
User-Agent: Z 3.2.21357 r21367.
Authorization: Digest username="660",realm="testers.com",nonce="U1OO1VNTjalLQmkJEOAWOaLqbTEALvG7",uri="sip:testers.com;transport=TCP",response="ca517e546b71ac50d94fe34032d36e7d",algorithm=MD5.
Allow-Events: presence, kpml.
Content-Length: 0.
.


T 1.1.1.1:5060 -> 2.2.2.2:1895 [AP]
SIP/2.0 200 OK.
Via: SIP/2.0/TCP 192.168.0.101:53928;branch=z9hG4bK-d8754z-2433219a229ba04d-1---d8754z-;rport=1895;received=2.2.2.2.
To: <sip:660@testers.com;transport=TCP>;tag=9bf08f91615a4a194285ad1308f058f3.9743.
From: <sip:660@testers.com;transport=TCP>;tag=83057513.
Call-ID: OTdkNGY5ZDIxYzk5NjQ2NmNlNzU3MWMzZDIwZGQ0YTY..
CSeq: 2 REGISTER.
Contact: <sip:660@192.168.0.101:53928;rinstance=2b8a38b85fa9eb69;transport=TCP>;expires=3600;received="sip:2.2.2.2:1895;transport=TCP".
Content-Length: 0.
.


U 1.1.1.1:5060 -> 127.0.0.1:5070
REGISTER sip:127.0.0.1:5070 SIP/2.0.
Via: SIP/2.0/UDP 1.1.1.1;branch=z9hG4bK9b6c.4c9fba53000000000000000000000000.0.
To: <sip:660@127.0.0.1>.
From: <sip:660@127.0.0.1>;tag=4a9c3f1c98b9f1c5704acfd1770d93d2-13ac.
CSeq: 10 REGISTER.
Call-ID: 7bffedd7-7580@1.1.1.1.
Max-Forwards: 70.
Content-Length: 0.
Contact: <sip:660@127.0.0.1:5060>.
Expires: 3600.
.


U 1.1.1.1:5070 -> 1.1.1.1:5060
SIP/2.0 200 OK.
Via: SIP/2.0/UDP 1.1.1.1;branch=z9hG4bK9b6c.4c9fba53000000000000000000000000.0;received=1.1.1.1.
From: <sip:660@127.0.0.1>;tag=4a9c3f1c98b9f1c5704acfd1770d93d2-13ac.
To: <sip:660@127.0.0.1>;tag=as149e59f0.
Call-ID: 7bffedd7-7580@1.1.1.1.
CSeq: 10 REGISTER.
Server: Asterisk PBX 11.8.1.
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH.
Supported: replaces, timer.
Expires: 3600.
Contact: <sip:660@127.0.0.1:5060>;expires=3600.
Date: Sun, 20 Apr 2014 09:04:41 GMT.
Content-Length: 0.
.


cheers,
Olli



2014-04-20 11:30 GMT+03:00 Mikko Lehto <mslehto@iki.fi>:
2014-04-19 (Sat) 20:46 UTC +0300  Olli Heiskanen <ohjelmistoarkkitehti@gmail.com>:

> Weird thing is the client looks registered but I'm not sure if it really is
> registered. If I'm not mistaken I should see the peers when I issue 'sip
> show peers' on asterisk cli. Instead I get this:

Hi Olli

Some pointers:
Can you see users on Kamailio usrloc?
Can you see REGISTER requests arriving to Asterisk?
Are there any errors on Asterisk when REGISTER request is handled?

You should add some xlog() to AUTH, REGISTRAR and REGFWD routes in Kamailio.

Also, maybe you could provide these outputs:
kamcmd ul.lookup location 660@testers.com
kamcmd ul.lookup location 661@testers.com
kamcmd ul.dump
ngrep -d any -W byline -q port 5060 or port 5070


Regards
--
Mikko Lehto

_______________________________________________
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