[Serusers] rtpproxy and one to many aliases.

Jev jev at ecad.org
Tue Oct 5 20:15:41 CEST 2004


Hi All,

Running ser (cvs branch 0_8_14) with rtpproxy (cvs HEAD), all works very 
well. One to one aliases work fine.


Example;
122 alias points at 136
Call completes perfect

124 alias points at 133 and 150
Both phones ring, but when one is answered no audio either way.


Below is ngrep output of a call made from 8667 to the alias '124' that 
maps to 133 and 150.

When 133 returns OK with SDP it sends m=audio 10000 RTP/AVP 8 101
ser sends the Ok onto the caller (8667) with m=audio 36574 RTP/AVP 8 101.

The callers UA (8667) then trys to establish rtp with rtpproxy at 
10.0.0.5 on port 36554, put that port is closed and the host kicks back 
a ICMP destination un-reachable.

When doing the same call with a one to one alias mapping the behavior is 
similar, except of course rtp gets sent to rtpproxy successfully.

Any ideas?

Ngrep Output: (Ser config included at bottom!)

input: 124_alias.trace

U 10.11.0.2:5060 -> 10.0.0.5:5060
INVITE sip:124 at example.com SIP/2.0.
Via: SIP/2.0/UDP 
192.168.0.101:5060;rport;branch=z9hG4bKA1853905ABF042AEBF996C125FBC616C.
From: Jev <sip:8667 at example.com>;tag=740000064.
To: <sip:124 at example.com>.
Contact: <sip:8667 at 192.168.0.101:5060>.
Call-ID: 3CA8A87B-DC0D-44E5-9EE2-A5F9BC2B39A4 at 192.168.0.101.
CSeq: 16207 INVITE.
Max-Forwards: 70.
Content-Type: application/sdp.
User-Agent: X-Lite release 1103m.
Content-Length: 293.
.
v=0.
o=8667 7996728 7996858 IN IP4 192.168.0.101.
s=X-Lite.
c=IN IP4 192.168.0.101.
t=0 0.
m=audio 8000 RTP/AVP 0 8 3 98 97 101.
a=rtpmap:0 pcmu/8000.
a=rtpmap:8 pcma/8000.
a=rtpmap:3 gsm/8000.
a=rtpmap:98 iLBC/8000.
a=rtpmap:97 speex/8000.
a=rtpmap:101 telephone-event/8000.
a=fmtp:101 0-15.


U 10.0.0.5:5060 -> 10.11.0.2:5060
SIP/2.0 100 trying -- your call is important to us.
Via: SIP/2.0/UDP 
192.168.0.101:5060;rport=5060;branch=z9hG4bKA1853905ABF042AEBF996C125FBC616C;received=10.11.0.2.
From: Jev <sip:8667 at example.com>;tag=740000064.
To: <sip:124 at example.com>.
Call-ID: 3CA8A87B-DC0D-44E5-9EE2-A5F9BC2B39A4 at 192.168.0.101.
CSeq: 16207 INVITE.
Server: Sip EXpress router (0.8.14-1 (i386/freebsd)).
Content-Length: 0.
Warning: 392 10.0.0.5:5060 "Noisy feedback tells:  pid=72790 
req_src_ip=10.11.0.2 req_src_port=5060 in_uri=sip:124 at example.com 
out_uri=sip:133 at example.com via_cnt==1".
.


U 10.0.0.5:5060 -> 10.0.2.20:5060
INVITE sip:133 at 10.0.2.20:5060;user=phone;transport=udp SIP/2.0.
Record-Route: <sip:133 at 10.0.0.5;ftag=740000064;lr>.
Record-Route: <sip:124 at 10.0.0.5;ftag=740000064;lr>.
Via: SIP/2.0/UDP 10.0.0.5;branch=z9hG4bK7536.a7550df7.0.
Via: SIP/2.0/UDP 10.0.0.5;rport=5060;branch=z9hG4bK7536.97550df7.0.
Via: SIP/2.0/UDP 
192.168.0.101:5060;received=10.11.0.2;rport=5060;branch=z9hG4bKA1853905ABF042AEBF996C125FBC616C.
From: Jev <sip:8667 at example.com>;tag=740000064.
To: <sip:124 at example.com>.
Contact: <sip:8667 at 10.0.0.5:5060>.
Call-ID: 3CA8A87B-DC0D-44E5-9EE2-A5F9BC2B39A4 at 192.168.0.101.
CSeq: 16207 INVITE.
Max-Forwards: 68.
Content-Type: application/sdp.
User-Agent: X-Lite release 1103m.
Content-Length: 307.
P-hint: natted UAC fixed.
P-hint: natted UAC fixed.
.
v=0.
o=8667 7996728 7996858 IN IP4 192.168.0.101.
s=X-Lite.
c=IN IP4 10.0.0.5.
t=0 0.
m=audio 36572 RTP/AVP 0 8 3 98 97 101.
a=rtpmap:0 pcmu/8000.
a=rtpmap:8 pcma/8000.
a=rtpmap:3 gsm/8000.
a=rtpmap:98 iLBC/8000.
a=rtpmap:97 speex/8000.
a=rtpmap:101 telephone-event/8000.
a=fmtp:101 0-15.
a=nortpproxy:yes.


U 10.0.0.5:5060 -> 10.0.0.56:5060
INVITE sip:150 at 10.0.0.56:5060;user=phone;transport=udp SIP/2.0.
Record-Route: <sip:150 at 10.0.0.5;ftag=740000064;lr>.
Record-Route: <sip:124 at 10.0.0.5;ftag=740000064;lr>.
Via: SIP/2.0/UDP 10.0.0.5;branch=z9hG4bK7536.b7550df7.0.
Via: SIP/2.0/UDP 10.0.0.5;rport=5060;branch=z9hG4bK7536.97550df7.1.
Via: SIP/2.0/UDP 
192.168.0.101:5060;received=10.11.0.2;rport=5060;branch=z9hG4bKA1853905ABF042AEBF996C125FBC616C.
From: Jev <sip:8667 at example.com>;tag=740000064.
To: <sip:124 at example.com>.
Contact: <sip:8667 at 10.0.0.5:5060>.
Call-ID: 3CA8A87B-DC0D-44E5-9EE2-A5F9BC2B39A4 at 192.168.0.101.
CSeq: 16207 INVITE.
Max-Forwards: 68.
Content-Type: application/sdp.
User-Agent: X-Lite release 1103m.
Content-Length: 307.
P-hint: natted UAC fixed.
P-hint: natted UAC fixed.
.
v=0.
o=8667 7996728 7996858 IN IP4 192.168.0.101.
s=X-Lite.
c=IN IP4 10.0.0.5.
t=0 0.
m=audio 36572 RTP/AVP 0 8 3 98 97 101.
a=rtpmap:0 pcmu/8000.
a=rtpmap:8 pcma/8000.
a=rtpmap:3 gsm/8000.
a=rtpmap:98 iLBC/8000.
a=rtpmap:97 speex/8000.
a=rtpmap:101 telephone-event/8000.
a=fmtp:101 0-15.
a=nortpproxy:yes.


U 10.0.0.56:5060 -> 10.0.0.5:5060
SIP/2.0 100 Trying.
Via: SIP/2.0/UDP 10.0.0.5;branch=z9hG4bK7536.b7550df7.0.
Via: SIP/2.0/UDP 10.0.0.5;rport=5060;branch=z9hG4bK7536.97550df7.1.
Via: SIP/2.0/UDP 
192.168.0.101:5060;received=10.11.0.2;rport=5060;branch=z9hG4bKA1853905ABF042AEBF996C125FBC616C.
From: Jev <sip:8667 at example.com>;tag=740000064.
To: <sip:124 at example.com>;tag=528477322.
Call-ID: 3CA8A87B-DC0D-44E5-9EE2-A5F9BC2B39A4 at 192.168.0.101.
CSeq: 16207 INVITE.
Server: Cisco ATA 186  v2.16.2 ata18x (030909a).
Content-Length: 0.
.


U 10.0.2.20:5060 -> 10.0.0.5:5060
SIP/2.0 100 Trying.
Via: SIP/2.0/UDP 10.0.0.5;branch=z9hG4bK7536.a7550df7.0.
Via: SIP/2.0/UDP 10.0.0.5;rport=5060;branch=z9hG4bK7536.97550df7.0.
Via: SIP/2.0/UDP 
192.168.0.101:5060;received=10.11.0.2;rport=5060;branch=z9hG4bKA1853905ABF042AEBF996C125FBC616C.
From: Jev <sip:8667 at example.com>;tag=740000064.
To: <sip:124 at example.com>;tag=2246090340.
Call-ID: 3CA8A87B-DC0D-44E5-9EE2-A5F9BC2B39A4 at 192.168.0.101.
CSeq: 16207 INVITE.
Server: Cisco ATA 186  v2.16.2 ata18x (030909a).
Content-Length: 0.
.


U 10.0.0.56:5060 -> 10.0.0.5:5060
SIP/2.0 180 Ringing.
Via: SIP/2.0/UDP 10.0.0.5;branch=z9hG4bK7536.b7550df7.0.
Via: SIP/2.0/UDP 10.0.0.5;rport=5060;branch=z9hG4bK7536.97550df7.1.
Via: SIP/2.0/UDP 
192.168.0.101:5060;received=10.11.0.2;rport=5060;branch=z9hG4bKA1853905ABF042AEBF996C125FBC616C.
From: Jev <sip:8667 at example.com>;tag=740000064.
To: <sip:124 at example.com>;tag=528477322.
Call-ID: 3CA8A87B-DC0D-44E5-9EE2-A5F9BC2B39A4 at 192.168.0.101.
CSeq: 16207 INVITE.
Server: Cisco ATA 186  v2.16.2 ata18x (030909a).
Content-Length: 0.
.


U 10.0.0.5:5060 -> 10.11.0.2:5060
SIP/2.0 180 Ringing.
Via: SIP/2.0/UDP 
192.168.0.101:5060;received=10.11.0.2;rport=5060;branch=z9hG4bKA1853905ABF042AEBF996C125FBC616C.
From: Jev <sip:8667 at example.com>;tag=740000064.
To: <sip:124 at example.com>;tag=528477322.
Call-ID: 3CA8A87B-DC0D-44E5-9EE2-A5F9BC2B39A4 at 192.168.0.101.
CSeq: 16207 INVITE.
Server: Cisco ATA 186  v2.16.2 ata18x (030909a).
Content-Length: 0.
.


U 10.0.2.20:5060 -> 10.0.0.5:5060
SIP/2.0 180 Ringing.
Via: SIP/2.0/UDP 10.0.0.5;branch=z9hG4bK7536.a7550df7.0.
Via: SIP/2.0/UDP 10.0.0.5;rport=5060;branch=z9hG4bK7536.97550df7.0.
Via: SIP/2.0/UDP 
192.168.0.101:5060;received=10.11.0.2;rport=5060;branch=z9hG4bKA1853905ABF042AEBF996C125FBC616C.
From: Jev <sip:8667 at example.com>;tag=740000064.
To: <sip:124 at example.com>;tag=2246090340.
Call-ID: 3CA8A87B-DC0D-44E5-9EE2-A5F9BC2B39A4 at 192.168.0.101.
CSeq: 16207 INVITE.
Server: Cisco ATA 186  v2.16.2 ata18x (030909a).
Content-Length: 0.
.


U 10.0.0.5:5060 -> 10.11.0.2:5060
SIP/2.0 180 Ringing.
Via: SIP/2.0/UDP 
192.168.0.101:5060;received=10.11.0.2;rport=5060;branch=z9hG4bKA1853905ABF042AEBF996C125FBC616C.
From: Jev <sip:8667 at example.com>;tag=740000064.
To: <sip:124 at example.com>;tag=2246090340.
Call-ID: 3CA8A87B-DC0D-44E5-9EE2-A5F9BC2B39A4 at 192.168.0.101.
CSeq: 16207 INVITE.
Server: Cisco ATA 186  v2.16.2 ata18x (030909a).
Content-Length: 0.
.


U 10.0.2.20:5060 -> 10.0.0.5:5060
SIP/2.0 200 OK.
Via: SIP/2.0/UDP 10.0.0.5;branch=z9hG4bK7536.a7550df7.0.
Via: SIP/2.0/UDP 10.0.0.5;rport=5060;branch=z9hG4bK7536.97550df7.0.
Via: SIP/2.0/UDP 
192.168.0.101:5060;received=10.11.0.2;rport=5060;branch=z9hG4bKA1853905ABF042AEBF996C125FBC616C.
Record-Route: <sip:133 at 10.0.0.5;ftag=740000064;lr>.
Record-Route: <sip:124 at 10.0.0.5;ftag=740000064;lr>.
From: Jev <sip:8667 at example.com>;tag=740000064.
To: <sip:124 at example.com>;tag=2246090340.
Call-ID: 3CA8A87B-DC0D-44E5-9EE2-A5F9BC2B39A4 at 192.168.0.101.
CSeq: 16207 INVITE.
Contact: <sip:133 at 10.0.2.20:5060;user=phone;transport=udp>.
Server: Cisco ATA 186  v2.16.2 ata18x (030909a).
Content-Length: 190.
Content-Type: application/sdp.
.
v=0.
o=133 606079 606079 IN IP4 10.0.2.20.
s=ATA186 Call.
c=IN IP4 10.0.2.20.
t=0 0.
m=audio 10000 RTP/AVP 8 101.
a=rtpmap:8 PCMA/8000/1.
a=rtpmap:101 telephone-event/8000.
a=fmtp:101 0-15.


U 10.0.0.5:5060 -> 10.11.0.2:5060
SIP/2.0 200 OK.
Via: SIP/2.0/UDP 
192.168.0.101:5060;received=10.11.0.2;rport=5060;branch=z9hG4bKA1853905ABF042AEBF996C125FBC616C.
Record-Route: <sip:133 at 10.0.0.5;ftag=740000064;lr>.
Record-Route: <sip:124 at 10.0.0.5;ftag=740000064;lr>.
From: Jev <sip:8667 at example.com>;tag=740000064.
To: <sip:124 at example.com>;tag=2246090340.
Call-ID: 3CA8A87B-DC0D-44E5-9EE2-A5F9BC2B39A4 at 192.168.0.101.
CSeq: 16207 INVITE.
Contact: <sip:133 at 10.0.0.5:5060;user=phone;transport=udp>.
Server: Cisco ATA 186  v2.16.2 ata18x (030909a).
Content-Length: 207.
Content-Type: application/sdp.
P-hint: response forced to rtp proxy.
P-hint: response forced to rtp proxy.
.
v=0.
o=133 606079 606079 IN IP4 10.0.2.20.
s=ATA186 Call.
c=IN IP4 10.0.0.5.
t=0 0.
m=audio 36574 RTP/AVP 8 101.
a=rtpmap:8 PCMA/8000/1.
a=rtpmap:101 telephone-event/8000.
a=fmtp:101 0-15.
a=nortpproxy:yes.


U 10.0.0.5:5060 -> 10.0.0.56:5060
CANCEL sip:150 at 10.0.0.56:5060;user=phone;transport=udp SIP/2.0.
Max-Forwards: 10.
Record-Route: <sip:150 at 10.0.0.5;ftag=740000064;lr>.
Via: SIP/2.0/UDP 10.0.0.5;branch=z9hG4bK7536.b7550df7.0.
Via: SIP/2.0/UDP 10.0.0.5;branch=z9hG4bK7536.97550df7.1.
From: Jev <sip:8667 at example.com>;tag=740000064.
Call-ID: 3CA8A87B-DC0D-44E5-9EE2-A5F9BC2B39A4 at 192.168.0.101.
To: <sip:124 at example.com>.
CSeq: 16207 CANCEL.
User-Agent: Sip EXpress router(0.8.14-1 (i386/freebsd)).
Content-Length: 0.
.


U 10.0.0.5:5060 -> 10.0.0.56:5060
ACK sip:150 at 10.0.0.56:5060;user=phone;transport=udp SIP/2.0.
Max-Forwards: 10.
Record-Route: <sip:150 at 10.0.0.5;ftag=740000064;lr>.
Via: SIP/2.0/UDP 10.0.0.5;branch=0.
Via: SIP/2.0/UDP 10.0.0.5;branch=z9hG4bK7536.97550df7.1.
From: Jev <sip:8667 at example.com>;tag=740000064.
Call-ID: 3CA8A87B-DC0D-44E5-9EE2-A5F9BC2B39A4 at 192.168.0.101.
To: <sip:124 at example.com>;tag=5add5ee5ace44c94e4343bade0ae88f3-67c4.
CSeq: 16207 ACK.
User-Agent: Sip EXpress router(0.8.14-1 (i386/freebsd)).
Content-Length: 0.
.


U 10.0.0.56:5060 -> 10.0.0.5:5060
SIP/2.0 200 OK.
Via: SIP/2.0/UDP 10.0.0.5;branch=z9hG4bK7536.b7550df7.0.
Via: SIP/2.0/UDP 10.0.0.5;branch=z9hG4bK7536.97550df7.1.
From: Jev <sip:8667 at example.com>;tag=740000064.
To: <sip:124 at example.com>;tag=528477322.
Call-ID: 3CA8A87B-DC0D-44E5-9EE2-A5F9BC2B39A4 at 192.168.0.101.
CSeq: 16207 CANCEL.
Server: Cisco ATA 186  v2.16.2 ata18x (030909a).
Content-Length: 0.
.


U 10.0.0.56:5060 -> 10.0.0.5:5060
SIP/2.0 487 Request Cancelled.
Via: SIP/2.0/UDP 10.0.0.5;branch=z9hG4bK7536.b7550df7.0.
Via: SIP/2.0/UDP 10.0.0.5;rport=5060;branch=z9hG4bK7536.97550df7.1.
Via: SIP/2.0/UDP 
192.168.0.101:5060;received=10.11.0.2;rport=5060;branch=z9hG4bKA1853905ABF042AEBF996C125FBC616C.
From: Jev <sip:8667 at example.com>;tag=740000064.
To: <sip:124 at example.com>;tag=528477322.
Call-ID: 3CA8A87B-DC0D-44E5-9EE2-A5F9BC2B39A4 at 192.168.0.101.
CSeq: 16207 INVITE.
Server: Cisco ATA 186  v2.16.2 ata18x (030909a).
Content-Length: 0.
.


U 10.0.0.5:5060 -> 10.0.0.56:5060
ACK sip:150 at 10.0.0.56:5060;user=phone;transport=udp SIP/2.0.
Via: SIP/2.0/UDP 10.0.0.5;branch=z9hG4bK7536.b7550df7.0.
From: Jev <sip:8667 at example.com>;tag=740000064.
Call-ID: 3CA8A87B-DC0D-44E5-9EE2-A5F9BC2B39A4 at 192.168.0.101.
To: <sip:124 at example.com>;tag=528477322.
CSeq: 16207 ACK.
User-Agent: Sip EXpress router(0.8.14-1 (i386/freebsd)).
Content-Length: 0.
.


U 10.11.0.2:5060 -> 10.0.0.5:5060
ACK sip:133 at 10.0.0.5:5060;user=phone;transport=udp SIP/2.0.
Via: SIP/2.0/UDP 
192.168.0.101:5060;rport;branch=z9hG4bK0FFEC8D28D9040AEA1BA8156126EBC9D.
From: Jev <sip:8667 at example.com>;tag=740000064.
To: <sip:124 at example.com>;tag=2246090340.
Contact: <sip:8667 at 192.168.0.101:5060>.
Route: 
<sip:124 at 10.0.0.5;ftag=740000064;lr>,<sip:133 at 10.0.0.5;ftag=740000064;lr>.
Call-ID: 3CA8A87B-DC0D-44E5-9EE2-A5F9BC2B39A4 at 192.168.0.101.
CSeq: 16207 ACK.
Max-Forwards: 70.
Content-Length: 0.
.


U 10.0.0.5:5060 -> 10.0.2.20:5060
ACK sip:133 at 10.0.2.20:5060;user=phone;transport=udp SIP/2.0.
Record-Route: <sip:133 at 10.0.0.5;ftag=740000064;lr>.
Record-Route: <sip:133 at 10.0.0.5;ftag=740000064;lr>.
Via: SIP/2.0/UDP 10.0.0.5;branch=0.
Via: SIP/2.0/UDP 10.0.0.5;rport=5060;branch=0.
Via: SIP/2.0/UDP 
192.168.0.101:5060;received=10.11.0.2;rport=5060;branch=z9hG4bK0FFEC8D28D9040AEA1BA8156126EBC9D.
From: Jev <sip:8667 at example.com>;tag=740000064.
To: <sip:124 at example.com>;tag=2246090340.
Contact: <sip:8667 at 10.0.0.5:5060>.
Route: .
Call-ID: 3CA8A87B-DC0D-44E5-9EE2-A5F9BC2B39A4 at 192.168.0.101.
CSeq: 16207 ACK.
Max-Forwards: 68.
Content-Length: 0.
P-hint: natted UAC fixed.
.


U 10.0.0.5:5060 -> 10.0.0.56:5060
ACK sip:150 at 10.0.0.56:5060;user=phone;transport=udp SIP/2.0.
Max-Forwards: 10.
Record-Route: <sip:150 at 10.0.0.5;ftag=740000064;lr>.
Via: SIP/2.0/UDP 10.0.0.5;branch=0.
Via: SIP/2.0/UDP 10.0.0.5;branch=z9hG4bK7536.97550df7.1.
From: Jev <sip:8667 at example.com>;tag=740000064.
Call-ID: 3CA8A87B-DC0D-44E5-9EE2-A5F9BC2B39A4 at 192.168.0.101.
To: <sip:124 at example.com>;tag=5add5ee5ace44c94e4343bade0ae88f3-67c4.
CSeq: 16207 ACK.
User-Agent: Sip EXpress router(0.8.14-1 (i386/freebsd)).
Content-Length: 0.
.


U 10.0.0.5:5060 -> 10.0.0.56:5060
ACK sip:150 at 10.0.0.56:5060;user=phone;transport=udp SIP/2.0.
Max-Forwards: 10.
Record-Route: <sip:150 at 10.0.0.5;ftag=740000064;lr>.
Via: SIP/2.0/UDP 10.0.0.5;branch=0.
Via: SIP/2.0/UDP 10.0.0.5;branch=z9hG4bK7536.97550df7.1.
From: Jev <sip:8667 at example.com>;tag=740000064.
Call-ID: 3CA8A87B-DC0D-44E5-9EE2-A5F9BC2B39A4 at 192.168.0.101.
To: <sip:124 at example.com>;tag=5add5ee5ace44c94e4343bade0ae88f3-67c4.
CSeq: 16207 ACK.
User-Agent: Sip EXpress router(0.8.14-1 (i386/freebsd)).
Content-Length: 0.
.


U 10.0.0.5:5060 -> 10.11.0.2:5060
SIP/2.0 487 Request cancelled.
Via: SIP/2.0/UDP 
192.168.0.101:5060;received=10.11.0.2;rport=5060;branch=z9hG4bKA1853905ABF042AEBF996C125FBC616C.
From: Jev <sip:8667 at example.com>;tag=740000064.
To: <sip:124 at example.com>;tag=5add5ee5ace44c94e4343bade0ae88f3-67c4.
Call-ID: 3CA8A87B-DC0D-44E5-9EE2-A5F9BC2B39A4 at 192.168.0.101.
CSeq: 16207 INVITE.
Server: Sip EXpress router (0.8.14-1 (i386/freebsd)).
Content-Length: 0.
Warning: 392 10.0.0.5:5060 "Noisy feedback tells:  pid=72792 
req_src_ip=10.0.0.5 req_src_port=5060 in_uri=sip:150 at example.com 
out_uri=sip:150 at 10.0.0.56:5060;user=phone;transport=udp via_cnt==1".
.


U 10.11.0.2:5060 -> 10.0.0.5:5060
ACK sip:133 at 10.0.0.5:5060;user=phone;transport=udp SIP/2.0.
Via: SIP/2.0/UDP 
192.168.0.101:5060;rport;branch=z9hG4bK0FFEC8D28D9040AEA1BA8156126EBC9D.
From: Jev <sip:8667 at example.com>;tag=740000064.
To: <sip:124 at example.com>;tag=2246090340.
Contact: <sip:8667 at 192.168.0.101:5060>.
Route: 
<sip:124 at 10.0.0.5;ftag=740000064;lr>,<sip:133 at 10.0.0.5;ftag=740000064;lr>.
Call-ID: 3CA8A87B-DC0D-44E5-9EE2-A5F9BC2B39A4 at 192.168.0.101.
CSeq: 16207 ACK.
Max-Forwards: 70.
Content-Length: 0.
.


U 10.0.0.5:5060 -> 10.0.2.20:5060
ACK sip:133 at 10.0.2.20:5060;user=phone;transport=udp SIP/2.0.
Record-Route: <sip:133 at 10.0.0.5;ftag=740000064;lr>.
Record-Route: <sip:133 at 10.0.0.5;ftag=740000064;lr>.
Via: SIP/2.0/UDP 10.0.0.5;branch=0.
Via: SIP/2.0/UDP 10.0.0.5;rport=5060;branch=0.
Via: SIP/2.0/UDP 
192.168.0.101:5060;received=10.11.0.2;rport=5060;branch=z9hG4bK0FFEC8D28D9040AEA1BA8156126EBC9D.
From: Jev <sip:8667 at example.com>;tag=740000064.
To: <sip:124 at example.com>;tag=2246090340.
Contact: <sip:8667 at 10.0.0.5:5060>.
Route: .
Call-ID: 3CA8A87B-DC0D-44E5-9EE2-A5F9BC2B39A4 at 192.168.0.101.
CSeq: 16207 ACK.
Max-Forwards: 68.
Content-Length: 0.
P-hint: natted UAC fixed.
.


U 10.0.2.20:5060 -> 10.0.0.5:5060
BYE sip:133 at 10.0.0.5 SIP/2.0.
Route: <sip:124 at 10.0.0.5;ftag=740000064;lr>,<sip:8667 at 10.0.0.5>.
Via: SIP/2.0/UDP 10.0.2.20:5060.
From: sip:124 at example.com;tag=2246090340.
To: Jev <sip:8667 at example.com>;tag=740000064.
Call-ID: 3CA8A87B-DC0D-44E5-9EE2-A5F9BC2B39A4 at 192.168.0.101.
CSeq: 1 BYE.
User-Agent: Cisco ATA 186  v2.16.2 ata18x (030909a).
Content-Length: 0.
.


U 10.0.0.5:5060 -> 10.11.0.2:5060
BYE sip:8667 at 10.11.0.2:5060 SIP/2.0.
Record-Route: <sip:8667 at 10.0.0.5;ftag=2246090340;lr>.
Max-Forwards: 9 .
Record-Route: <sip:133 at 10.0.0.5;ftag=2246090340;lr>.
Via: SIP/2.0/UDP 10.0.0.5;branch=z9hG4bK3d5d.ecd70e15.0.
Via: SIP/2.0/UDP 10.0.0.5;branch=z9hG4bK3d5d.dcd70e15.0.
Via: SIP/2.0/UDP 10.0.2.20:5060.
From: sip:124 at example.com;tag=2246090340.
To: Jev <sip:8667 at example.com>;tag=740000064.
Call-ID: 3CA8A87B-DC0D-44E5-9EE2-A5F9BC2B39A4 at 192.168.0.101.
CSeq: 1 BYE.
User-Agent: Cisco ATA 186  v2.16.2 ata18x (030909a).
Content-Length: 0.
.


U 10.11.0.2:5060 -> 10.0.0.5:5060
SIP/2.0 200 Ok.
Via: SIP/2.0/UDP 10.0.0.5;branch=z9hG4bK3d5d.ecd70e15.0.
Via: SIP/2.0/UDP 10.0.0.5;branch=z9hG4bK3d5d.dcd70e15.0.
Via: SIP/2.0/UDP 10.0.2.20:5060.
From: <sip:124 at example.com;tag=2246090340>;tag=2246090340.
To: Jev <sip:8667 at example.com>;tag=740000064.
Contact: <sip:8667 at 192.168.0.101:5060>.
Call-ID: 3CA8A87B-DC0D-44E5-9EE2-A5F9BC2B39A4 at 192.168.0.101.
CSeq: 1 BYE.
Server: X-Lite release 1103m.
Content-Length: 0.
.


U 10.0.0.5:5060 -> 10.0.2.20:5060
SIP/2.0 200 Ok.
Via: SIP/2.0/UDP 10.0.2.20:5060.
From: <sip:124 at example.com;tag=2246090340>;tag=2246090340.
To: Jev <sip:8667 at example.com>;tag=740000064.
Contact: <sip:8667 at 192.168.0.101:5060>.
Call-ID: 3CA8A87B-DC0D-44E5-9EE2-A5F9BC2B39A4 at 192.168.0.101.
CSeq: 1 BYE.
Server: X-Lite release 1103m.
Content-Length: 0.
.


U 10.0.0.5:5060 -> 10.11.0.2:5060
SIP/2.0 487 Request cancelled.
Via: SIP/2.0/UDP 
192.168.0.101:5060;received=10.11.0.2;rport=5060;branch=z9hG4bKA1853905ABF042AEBF996C125FBC616C.
From: Jev <sip:8667 at example.com>;tag=740000064.
To: <sip:124 at example.com>;tag=5add5ee5ace44c94e4343bade0ae88f3-67c4.
Call-ID: 3CA8A87B-DC0D-44E5-9EE2-A5F9BC2B39A4 at 192.168.0.101.
CSeq: 16207 INVITE.
Server: Sip EXpress router (0.8.14-1 (i386/freebsd)).
Content-Length: 0.
Warning: 392 10.0.0.5:5060 "Noisy feedback tells:  pid=72792 
req_src_ip=10.0.0.5 req_src_port=5060 in_uri=sip:150 at example.com 
out_uri=sip:150 at 10.0.0.56:5060;user=phone;transport=udp via_cnt==1".
.


U 10.11.0.2:5060 -> 10.0.0.5:5060
ACK sip:133 at 10.0.0.5:5060;user=phone;transport=udp SIP/2.0.
Via: SIP/2.0/UDP 
192.168.0.101:5060;rport;branch=z9hG4bK0FFEC8D28D9040AEA1BA8156126EBC9D.
From: Jev <sip:8667 at example.com>;tag=740000064.
To: <sip:124 at example.com>;tag=2246090340.
Contact: <sip:8667 at 192.168.0.101:5060>.
Route: 
<sip:124 at 10.0.0.5;ftag=740000064;lr>,<sip:133 at 10.0.0.5;ftag=740000064;lr>.
Call-ID: 3CA8A87B-DC0D-44E5-9EE2-A5F9BC2B39A4 at 192.168.0.101.
CSeq: 16207 ACK.
Max-Forwards: 70.
Content-Length: 0.
.


U 10.0.0.5:5060 -> 10.0.2.20:5060
ACK sip:133 at 10.0.2.20:5060;user=phone;transport=udp SIP/2.0.
Record-Route: <sip:133 at 10.0.0.5;ftag=740000064;lr>.
Record-Route: <sip:133 at 10.0.0.5;ftag=740000064;lr>.
Via: SIP/2.0/UDP 10.0.0.5;branch=0.
Via: SIP/2.0/UDP 10.0.0.5;rport=5060;branch=0.
Via: SIP/2.0/UDP 
192.168.0.101:5060;received=10.11.0.2;rport=5060;branch=z9hG4bK0FFEC8D28D9040AEA1BA8156126EBC9D.
From: Jev <sip:8667 at example.com>;tag=740000064.
To: <sip:124 at example.com>;tag=2246090340.
Contact: <sip:8667 at 10.0.0.5:5060>.
Route: .
Call-ID: 3CA8A87B-DC0D-44E5-9EE2-A5F9BC2B39A4 at 192.168.0.101.
CSeq: 16207 ACK.
Max-Forwards: 68.
Content-Length: 0.
P-hint: natted UAC fixed.
.





Ser config:

#debug=3         # debug level (cmd line: -dddddddddd)
#fork=yes
#log_stderror=no	# (cmd line: -E)

/* Uncomment these lines to enter debugging mode
debug=7
fork=no
log_stderror=yes
*/

debug=9
log_stderror=no
check_via=no	# (cmd. line: -v)
dns=no           # (cmd. line: -r)
rev_dns=no      # (cmd. line: -R)
listen=10.0.0.5
port=5060
#children=4
fifo="/tmp/ser_fifo"

# ------------------ 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/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/xlog.so"
loadmodule "/usr/local/lib/ser/modules/nathelper.so"
loadmodule "/usr/local/lib/ser/modules/textops.so"
loadmodule "/usr/local/lib/ser/modules/acc.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"

# ----------------- setting module-specific parameters ---------------

# -- usrloc params --

modparam("usrloc", "db_mode",   2)

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

# -- rr params --
# add value to ;lr param to make some broken UAs happy
modparam("rr", "enable_full_lr", 0)


# nathelper parameters
modparam("registrar", "nat_flag", 10)
modparam("nathelper", "natping_interval", 10) #send udp ping every 10 
seconds
modparam("nathelper", "ping_nated_only", 1)

# -- acc parameters --
# Sip messages that have flag 1 will be pumped to the accounting module.
modparam("acc","db_flag", 9)
modparam("acc", "log_level", 1)
modparam("acc", "log_flag", 1)
modparam("acc", "db_missed_flag", 9)
modparam("acc", "log_fmt", "miocfst")
modparam("acc", "failed_transactions" ,1)

# -- tm parameters --
# Timer to give up on ringing, applies to all transactions
#modparam("tm","fr_inv_timer", 40)



# -------------------------  request routing logic -------------------

# main routing logic

route{

	xlog("L_DBG","---------------DEFAULT ROUTE start----------------");
	xlog("L_DBG","%rm from %fu to %tu");

	# 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
	record_route();	
	# loose-route processing
	if (loose_route()) {
		xlog("L_DBG","loose_route returned true %fu");
		t_relay();
		break;
	};
	
	# Flag all transactions for accounting.
	setflag(9);


	# Detect if our client is behind a NAT firewall, if so set flag 10.
	if (nat_uac_test("1")) {
		xlog("L_DBG","Nated client %fu");
		setflag(10); #Natted FLAG
		force_rport();
		fix_nated_contact();
#fix_nated_sdp("3");
		append_hf("P-hint: natted UAC fixed\r\n");
	} else {
		xlog("L_DBG","NON-Nated client %fu");
	};

	# If the request is not directed at us (ACKS,BYES) then relay
	if (!uri==myself) {
		xlog("L_DBG","uri not eq myself from %fu to %tu");
		if(!t_relay()){
			xlog("L_ERR","ERROR calling t_relay from %fu to %tu");
			sl_reply_error();
		} else {
			xlog("L_ERR","--- %rm t_relayd from %fu to %tu at end of default route");
		}
		break;
	}

	if (method=="REGISTER") {
	
		xlog("L_DBG","AUTH? %fu");
		# Uncomment this if you want to use digest authentication
		if (!www_authorize("", "subscriber")) {
			xlog("L_DBG","NOT AUTHed, challanging... %fu");
			www_challenge("", "0");
			break;
		};
		xlog("L_DBG","AUTHed, saving location... %fu");
		save("location");
		break;
	}; #End of REGISTER



	
	# native SIP destinations are handled using our USRLOC DB
	if (!lookup("location")) {
		xlog("L_DBG","%rm from %fu to %tu not found in location");
		if (!lookup("aliases")){
			xlog("L_DBG","%rm from %fu to %tu not found in aliases");



			# Set up our onreply call processing.
			t_on_reply("1");

			xlog("L_DBG","matching uri...");
	
			if (uri=~"^sip:999 at .*" || uri=~"^sip:911 at .*") {
				#put emergency services route here.
				route(3); #PSTN gateway
				break;
			}
			if (uri=~"^sip:9999 at .*" || uri=~"^sip:9911 at .*") {
				#put emergency services route here.
				strip(1);
				route(3); #PSTN gateway
				break;
			}
			if (uri=~"^sip:9[0-9]*@.*") {
				#9 prefix, strip prefix & shunt our call to the local access PSTN 
gateway
				strip(1);
				xlog("L_DBG","prefix 9 detected... entering route 3");
				route(3); #PSTN gateway
				break;
			}
				break;
			# Call routing logic end
			#acc_request("404 Not Found");
			sl_send_reply("404","User not found");
			break;
		};
	};

	if(method == "BYE" || method == "CANCEL")
		unforce_rtp_proxy();

	if (method == "INVITE") {
		t_on_reply("1");
		if (nat_uac_test("1")) {
			force_rtp_proxy();
		};
	};
	if(!t_relay()){
		xlog("L_ERR","Error while calling t_relay  %fu to %tu");
	}
}

# all incoming replies for t_onrepli-ed transactions enter here
onreply_route[1] {
	xlog("L_DBG","%rm onreply_route 1 from %fu to %tu");
	if (nat_uac_test("1")) {
		fix_nated_contact();
		force_rport();
		xlog("L_DBG","%rm nated UAC fix_nated_contact and force_rport called. 
from %fu to %tu");
	}
if (!(status=~"183" || status=~"200"))
		break;
		xlog("L_DBG","%rm onreply_route(1) Forcing rtpproxy. from %fu to %tu");
		force_rtp_proxy();
		append_hf("P-hint: response forced to rtp proxy\r\n");
}

#local PSTN
route[3]{
	t_on_reply("1");
	xlog("L_DBG", "%rm from %fu to %tu forwarding to PSTN gateway\n");
	rewritehostport("10.0.0.24:5060");
#	if ( (status=~"200" || status=~"183") ) {
		force_rtp_proxy();
#	}
	if(!t_relay()){
		xlog("L_ERR", "Relay to Cisco failed");
		break;
	};
}




More information about the sr-users mailing list