[Serusers] Problem with REGISTER in cvs version.

Luis Vazquez luis at teledata.com.uy
Tue May 4 19:14:59 CEST 2004


hi all,
This is my first message, even I have been reading and learning from this great list for a while.

I used the stable branch of SER for 6 months without problems, now I'm playing with the NAT an rtp proxy stuff so I upgraded to the cvs branch.

I downloaded, compiled and installed cvs (2004-04-27) with mysql support. 
After solving some compile problems (fixed in a patch by janakj in the cvs two hours after my first checkout :( I got it running but there is a problem I don't know how to solve.

I'm trying to register and call a SIP phone from behind NAT. I get it to register correctly (with the Contact field fixed) but when I try to call it, the 
lookup("location")
fails and I get a 
"480 Temporarily Unavailable" from ser.

The network schema I'm using is (for testing):

                     192.168.10.*             200.59.203.*
[Phone Gstream] .188 ------------>.1 [NAT].75 -----------------
                                                   |          | 
					          .76        .77
                                                 [SER]    [SIP UA (Asterisk)]

I added a gstream1 user to SER and the register block in ser.cfg is:

......
    # -- nathelper --
    if (nat_uac_test("1")) {
	if (method == "REGISTER" || !search("^Record-Route:")) {
	    log(2,"LOG: Registro desde una IP privada, re-escribiendo contacto...\n");
	    # Rewrite contact with source IP of signalling
	    fix_nated_contact();
	    if (method == "INVITE") {
		.............
	    };
	    force_rport(); # Add rport parameter to topmost Via
	    setflag(6);  # Mark as NATed
	};
    };

.............

    if (uri==myself) {
	if (method=="REGISTER") {
	    # No auth by now
	    log(2,"Saving url location\n");
	    save("location");
	    break;
	};
.....

The ngrep SIP log for the register sequence is:
U 200.59.203.75:61503 -> 200.59.203.76:5060
  REGISTER sip:200.59.203.76 SIP/2.0..Via: SIP/2.0/UDP 192.168.10.188:5062;branch=z9hG4bK975f3a4817e63645
  ..From: "Grandstream 1" <sip:gstream1 at 200.59.203.76>;tag=f001e96a008a26a5..To: <sip:gstream1 at 200.59.203
  .76>..Contact: <sip:gstream1 at 192.168.10.188:5062>..Call-ID: 0776eb9b4143e102 at 192.168.10.188..CSeq: 102 
  REGISTER..Expires: 3600..User-Agent: Grandstream BT100 1.0.4.55..Max-Forwards: 70..Allow: INVITE,ACK,CA
  NCEL,BYE,NOTIFY,REFER,OPTIONS,INFO,SUBSCRIBE..Content-Length: 0....                                    
#
U 200.59.203.76:5060 -> 200.59.203.75:61503
  SIP/2.0 200 OK..Via: SIP/2.0/UDP 192.168.10.188:5062;branch=z9hG4bK975f3a4817e63645;rport=61503;receive
  d=200.59.203.75..From: "Grandstream 1" <sip:gstream1 at 200.59.203.76>;tag=f001e96a008a26a5..To: <sip:gstr
  eam1 at 200.59.203.76>;tag=b27e1a1d33761e85846fc98f5f3a7e58.ce3d..Call-ID: 0776eb9b4143e102 at 192.168.10.188
  ..CSeq: 102 REGISTER..Contact: <sip:gstream1 at 200.59.203.75:61503<>;q=0;expires=3600..Server: Sip EXpres
  s router (0.8.13-dev-28 (i386/linux))..Content-Length: 0.... 

Everything seems Ok, but here begins the problems.

If I go to the command line and type:
# serctl ul show gstream1
I get:
404 Username gstream1 at ipcontact.com.uy in table location not found

But if I type:
# serctl ul show 
Among many other lines I get:
.....
...Record(0x402f46e0)...
domain: 'location'
aor   : 'gstream1 at 200.59.203.76'
~~~Contact(0x402f47c0)~~~
domain : 'location'
aor    : 'gstream1 at 200.59.203.76'
Contact: 'sip:gstream1 at 200.59.203.75:61503'
Expires: 3083
q      : 0
Call-ID: '0776eb9b4143e102 at 192.168.10.188'
CSeq   : 102
replic : 0
State  : CS_SYNC
Flags  : 1
next   : (nil)
prev   : (nil)
~~~/Contact~~~~
.../Record...
.............

It seems to my like ser is not matching the domain part properly.
On the other side, the record in the mysql location table is:

username             | domain | contact                        | expires             | q      | ....
gstream1 at 200.59.203.76 |    | sip:gstream1 at 200.59.203.75:61503 | 2004-05-04 17:20:32 | -1082130.38|...

As you see 'domain' field is empty. Could be this the problem? 

Anyway If I register from Kphone (user luis) running in the same machine as SER, 'domain' is empty again
luis at ipcontact.com.uy |    |sip:luis at 200.59.203.76:5062;transport=udp|2004-05-04 16:57:46|1148846.12|...
and
# serctl url show luis 
fails too, however I'am able to call this user  "luis at ipcontact.com.uy" but not 
"gstream1 at ipcontact.com.uy". 
The problem here seems to be gstream1 is registered using the ser server's IP number and not the domain "ipcontact.com.uy", but shouldn't be this handled automagicaly by SER.
I don't have any hint to the serctl ul "misterio" (if fails even if I pass the domain or the ip after
the user name?)

One diference I see with the 0.8.12 stable version I'm using in "production" is after a REGISTER
only the username part of the uri is recorded in the 'username' field of table location!! 
Column 'domain' is empty int this case too, but serctl works. 
May be this is some king of buggy 'feature' in the cvs? Any hint?

Oh, just in case, this is the failed INVITE sequence:

U 200.59.203.77:5060 -> 200.59.203.76:5060
  INVITE sip:gstream1 at ipcontact.com.uy SIP/2.0..Via: SIP/2.0/UDP 200.59.203.77:5060;branch=z9hG4bK186cfac
  a..From: "SIP Planet(1083694723.15)" <sip:192 at ipcontact.com.uy>;tag=as16156ce5..To: <sip:gstream1 at ipcon
  tact.com.uy>..Contact: <sip:192 at 200.59.203.77>..Call-ID: 653214bf775a279776bc5c2360100a13 at 200.59.203.77
  ..CSeq: 102 INVITE..User-Agent: Asterisk PBX..Date: Tue, 04 May 2004 18:18:45 GMT..Allow: INVITE, ACK, 
  CANCEL, OPTIONS, BYE, REFER..UniqueID: 1083694725.16..Content-Type: application/sdp..Content-Length: 21
  1....v=0..o=root 16321 16321 IN IP4 200.59.203.77..s=session..c=IN IP4 200.59.203.77..t=0 0..m=audio 12
  692 RTP/AVP 0 3 97..a=rtpmap:0 PCMU/8000..a=rtpmap:3 GSM/8000..a=rtpmap:97 iLBC/8000..a=silenceSupp:off
 
U 200.59.203.76:5060 -> 200.59.203.77:5060
  SIP/2.0 480 Temporarily Unavailable..Via: SIP/2.0/UDP 200.59.203.77:5060;branch=z9hG4bK186cfaca..From: 
  "SIP Planet(1083694723.15)" <sip:192 at ipcontact.com.uy>;tag=as16156ce5..To: <sip:gstream1 at ipcontact.com.
  uy>;tag=b27e1a1d33761e85846fc98f5f3a7e58.251a..Call-ID: 653214bf775a279776bc5c2360100a13 at 200.59.203.77.
  .CSeq: 102 INVITE..Server: Sip EXpress router (0.8.13-dev-28 (i386/linux))..Content-Length: 0

U 200.59.203.77:5060 -> 200.59.203.76:5060
  ACK sip:gstream1 at ipcontact.com.uy SIP/2.0..Via: SIP/2.0/UDP 200.59.203.77:5060;branch=z9hG4bK186cfaca..
  From: "SIP Planet(1083694723.15)" <sip:192 at ipcontact.com.uy>;tag=as16156ce5..To: <sip:gstream1 at ipcontac
  t.com.uy>;tag=b27e1a1d33761e85846fc98f5f3a7e58.251a..Contact: <sip:192 at 200.59.203.77>..Call-ID: 653214b
  f775a279776bc5c2360100a13 at 200.59.203.77..CSeq: 102 ACK..User-Agent: Asterisk PBX..Content-Length: 0....

Thank you very much in advance.

Best regards
Luis












More information about the sr-users mailing list