Klaus,
Thanks for your continued help.
How? Does it change the Contact header?
Yes, the proxy changes the Contact header.
So the SIP server is the registrar?
Correct.
The contact usually is the IP address of the client. So, if you the SIP
server routes based on the contact header, it should send the INVITE
directly to the client not to the proxy. Somehow this all does not fit
together.
Clarification : Both clients A and B have the proxy as an outbound
proxy. Clients register to the SIP server through the proxy. The SIP
server routes the INVITE (INVITE from A that was proxied to SIP server)
to the proxy with the R-URI being constructed based on the contents of
the Contact header (IP only no port info). This is what I meant by
saying the SIP server routes INVITE based on registered Contact (R-URI
of INVITE is based on Contact header of client B's REGISTER message).
It depends on how is the registrar - proxy or the SIP server.
The workaround also depends on the respective buggy behavior of the sip
server (if there is one at all).
I think it is not possible to further debug this problem without a
complete trace of the scenario:
ngrep -W byline -t -d any -P "" port 5060
Attached to the email is a sip trace captured at the proxy showing
- Registration of client B
- INVITE messages originated by client A trying to call client B
- The sip trace has been edited to remove "duplicate" messages arising
from authentication
- Towards the end, the sip trace shows 4 INVITE messages from proxy to
Client B. However none of these messages reach client B because proxy
is sending to port 5060, while client B is reachable at Nated port
55000. This port information is not specified in the R-URI of INVITE
by SIP server.
- Eventually a timeout will occur (not shown in log for sake of brevity)
- Both clients A,B are behind same NAT (public ip x.x.x.226)
What needs to be done at the proxy to ensure INVITE is forwarded to the
correct port (55000 in this case) instead of the default port 5060 ?
Once again thanks for your help.
Regards,
Vikram.
interface: any
filter: (ip) and ( port 7160 )
#
U 2011/01/20 10:21:23.413328 64.219.188.226:55000 -> 64.219.188.229:7160
REGISTER sip:SIP_Server_IP:5060 SIP/2.0
Via: SIP/2.0/UDP
192.168.1.2:7160;rport;branch=z9hG4bKPj-FSwD5USvw4lmKGE3WwYElfQzJMInGur
Route: <sip:64.219.188.229:7160;lr>
Max-Forwards: 70
From: "ClientB" <sip:ClientB@SIP_Server_IP>;tag=XSZNZduKIDDETvbfarRDlPZmQrGDd9X9
To: "ClientB" <sip:ClientB@SIP_Server_IP>
Call-ID: Ij6RSDWqbNiOj2zBp4.1.Bx6XRyiYk1z
CSeq: 49366 REGISTER
Contact: "ClientB" <sip:ClientB@192.168.1.2:7160>
Expires: 300
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, SUBSCRIBE, NOTIFY, REFER,
MESSAGE, OPTIONS
Content-Length: 0
#
U 2011/01/20 10:21:23.414514 64.219.188.229:7160 -> SIP_Server_IP:5060
REGISTER sip:SIP_Server_IP:5060 SIP/2.0
Via: SIP/2.0/UDP 64.219.188.229:7160;branch=z9hG4bKb495.8144d513.0
Via: SIP/2.0/UDP
192.168.1.2:7160;received=64.219.188.226;rport=55000;branch=z9hG4bKPj-FSwD5USvw4lmKGE3WwYElfQzJMInGur
Route: <sip:64.219.188.229:7160;lr>
Max-Forwards: 69
From: "ClientB" <sip:ClientB@SIP_Server_IP>;tag=XSZNZduKIDDETvbfarRDlPZmQrGDd9X9
To: "ClientB" <sip:ClientB@SIP_Server_IP>
Call-ID: Ij6RSDWqbNiOj2zBp4.1.Bx6XRyiYk1z
CSeq: 49366 REGISTER
Contact: "ClientB" <sip:ClientB@64.219.188.226:55000> <---
***CONTACT HAS BEEN CHANGED BY PROXY***
Expires: 300
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, SUBSCRIBE, NOTIFY, REFER,
MESSAGE, OPTIONS
Content-Length: 0
P-hint: outbound
#
U 2011/01/20 10:21:23.478284 SIP_Server_IP:5060 -> 64.219.188.229:7160
SIP/2.0 200 OK
CSeq: 8788 REGISTER
Via: SIP/2.0/UDP 64.219.188.229:7160;branch=z9hG4bK2b7e.46086b17.0
Via: SIP/2.0/UDP
192.168.1.2:7160;branch=z9hG4bKPjve-SmgIoXdUU711aE1OAxS1LGmNY3rgn
From: "ClientB" <sip:ClientB@SIP_Server_IP>;tag=kRUY7xtRmeNC11G45ZU63Jc0Fvfxr-95
Call-ID: ELxAXihJOBqDrpWkKcb3U0QpnD6GwlIS
To: "ClientB" <sip:ClientB@SIP_Server_IP>;tag=200120112222
Contact: "ClientB" <sip:ClientB@64.219.188.226:55000>;expires=600
Expires: 600
Content-Length: 0
#
U 2011/01/20 10:21:23.479021 64.219.188.229:7160 -> 64.219.188.226:55000
SIP/2.0 200 OK
CSeq: 8788 REGISTER
Via: SIP/2.0/UDP
192.168.1.2:7160;branch=z9hG4bKPjve-SmgIoXdUU711aE1OAxS1LGmNY3rgn
From: "ClientB" <sip:ClientB@SIP_Server_IP>;tag=kRUY7xtRmeNC11G45ZU63Jc0Fvfxr-95
Call-ID: ELxAXihJOBqDrpWkKcb3U0QpnD6GwlIS
To: "ClientB" <sip:ClientB@SIP_Server_IP>;tag=200120112222
Contact: "ClientB" <sip:ClientB@64.219.188.226:55000>;expires=600
Expires: 600
Content-Length: 0
#
U 2011/01/20 10:21:30.381315 64.219.188.226:55002 -> 64.219.188.229:7160
INVITE sip:5500ClientB@SIP_Server_IP:5060 SIP/2.0
Via: SIP/2.0/UDP
192.168.1.3:7160;rport;branch=z9hG4bKPjhLlO4oeqJs05Qr99ojTqv8GfXuGA9.Se
Max-Forwards: 70
From: "ClientA" <sip:ClientA@SIP_Server_IP>;tag=FpymJ88fPnpB90-lDqvWt.VFkK9fMfM1
To: sip:5500ClientB@SIP_Server_IP
Contact: "ClientA" <sip:ClientA@192.168.1.3:7160>
Call-ID: iiOmM.6qbL.Xt5RSi-Ja9h6eOFb3-XDl
CSeq: 25561 INVITE
Route: <sip:64.219.188.229:7160;lr>
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, SUBSCRIBE, NOTIFY, REFER,
MESSAGE, OPTIONS
Supported: replaces, 100rel, timer, norefersub
Session-Expires: 1800
Min-SE: 90
Proxy-Authorization: Digest username="ClientA", realm="VoipSwitch",
nonce="129554042920221002001202903403",
uri="sip:5500ClientB@SIP_Server_IP:5060",
response="46b1a48ac14998a1502aa9905be65e89"
Content-Type: application/sdp
Content-Length: 398
v=0
o=- 3504529231 3504529231 IN IP4 192.168.1.3
s=clientx
c=IN IP4 192.168.1.3
t=0 0
a=X-nat:0
m=audio 14336 RTP/AVP 114 18 109 0 8 101
a=rtcp:14337 IN IP4 192.168.1.3
a=rtpmap:114 AMR/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:109 iLBC/8000
a=fmtp:109 mode=30
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=sendrecv
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
#
U 2011/01/20 10:21:30.384493 64.219.188.229:7160 -> 64.219.188.226:55002
SIP/2.0 100 trying -- your call is important to us
Via: SIP/2.0/UDP
192.168.1.3:7160;rport=55002;branch=z9hG4bKPjhLlO4oeqJs05Qr99ojTqv8GfXuGA9.Se;received=64.219.188.226
From: "ClientA" <sip:ClientA@SIP_Server_IP>;tag=FpymJ88fPnpB90-lDqvWt.VFkK9fMfM1
To: sip:5500ClientB@SIP_Server_IP
Call-ID: iiOmM.6qbL.Xt5RSi-Ja9h6eOFb3-XDl
CSeq: 25561 INVITE
Server: kamailio (3.0.1 (i386/linux))
Content-Length: 0
#
U 2011/01/20 10:21:30.384675 64.219.188.229:7160 -> SIP_Server_IP:5060
INVITE sip:5500ClientB@SIP_Server_IP:5060 SIP/2.0
Record-Route: <sip:64.219.188.229:7160;lr=on;nat=yes>
Via: SIP/2.0/UDP 64.219.188.229:7160;branch=z9hG4bKcac5.77bec976.0
Via: SIP/2.0/UDP
192.168.1.3:7160;received=64.219.188.226;rport=55002;branch=z9hG4bKPjhLlO4oeqJs05Qr99ojTqv8GfXuGA9.Se
Max-Forwards: 69
From: "ClientA" <sip:ClientA@SIP_Server_IP>;tag=FpymJ88fPnpB90-lDqvWt.VFkK9fMfM1
To: sip:5500ClientB@SIP_Server_IP
Contact: "ClientA" <sip:ClientA@64.219.188.226:55002>
Call-ID: iiOmM.6qbL.Xt5RSi-Ja9h6eOFb3-XDl
CSeq: 25561 INVITE
Route: <sip:64.219.188.229:7160;lr>
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, SUBSCRIBE, NOTIFY, REFER,
MESSAGE, OPTIONS
Supported: replaces, 100rel, timer, norefersub
Session-Expires: 1800
Min-SE: 90
Proxy-Authorization: Digest username="ClientA", realm="VoipSwitch",
nonce="129554042920221002001202903403",
uri="sip:5500ClientB@SIP_Server_IP:5060",
response="46b1a48ac14998a1502aa9905be65e89"
Content-Type: application/sdp
Content-Length: 400
P-hint: outbound
v=0
o=- 3504529231 3504529231 IN IP4 192.168.1.3
s=clientx
c=IN IP4 64.219.188.229
t=0 0
a=X-nat:0
m=audio 35938 RTP/AVP 114 18 109 0 8 101
a=rtcp:35939
a=rtpmap:114 AMR/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:109 iLBC/8000
a=fmtp:109 mode=30
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=sendrecv
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=nortpproxy:yes
#
U 2011/01/20 10:21:30.493250 SIP_Server_IP:5060 -> 64.219.188.229:7160
SIP/2.0 100 Trying
CSeq: 25561 INVITE
Via: SIP/2.0/UDP 64.219.188.229:7160;branch=z9hG4bKcac5.77bec976.0
Via: SIP/2.0/UDP
192.168.1.3:7160;branch=z9hG4bKPjhLlO4oeqJs05Qr99ojTqv8GfXuGA9.Se
From: "ClientA" <sip:ClientA@SIP_Server_IP>;tag=FpymJ88fPnpB90-lDqvWt.VFkK9fMfM1
Call-ID: iiOmM.6qbL.Xt5RSi-Ja9h6eOFb3-XDl
To: sip:5500ClientB@SIP_Server_IP;tag=20012011222932367221106321
Contact: <sip:SIP_Server_IP:5060;transport=udp>
Content-Length: 0
Record-Route: <sip:64.219.188.229:7160;lr=on;nat=yes>
#
U 2011/01/20 10:21:30.498248 SIP_Server_IP:5060 -> 64.219.188.229:7160
INVITE sip:ClientB@64.219.188.226 SIP/2.0
CSeq: 1 INVITE
Via: SIP/2.0/UDP SIP_Server_IP:5060;branch=z9hG4bK200120112229203236722235
From: "ClientA" <sip:ClientA@SIP_Server_IP:5060>;tag=2001201122293236722235
Call-ID: 4447222350Ij6RSDWqbNiOj2zBp4.1.Bx6XRyiYk1z@SIP_Server_IP
To: <sip:ClientB@64.219.188.226>
Contact: <sip:SIP_Server_IP:5060;transport=udp>
Content-Type: application/sdp
Content-Length: 248
v=0
o=VoipSwitch 6322 7322 IN IP4 SIP_Server_IP
s=VoipSIP
i=Audio Session
c=IN IP4 SIP_Server_IP
t=0 0
m=audio 6322 RTP/AVP 18 101
a=rtpmap:18 G729/8000/1
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv
#
U 2011/01/20 10:21:30.500151 64.219.188.229:7160 -> SIP_Server_IP:5060
SIP/2.0 100 trying -- your call is important to us
CSeq: 1 INVITE
Via: SIP/2.0/UDP
SIP_Server_IP:5060;branch=z9hG4bK200120112229203236722235;rport=5060
From: "ClientA" <sip:ClientA@SIP_Server_IP:5060>;tag=2001201122293236722235
Call-ID: 4447222350Ij6RSDWqbNiOj2zBp4.1.Bx6XRyiYk1z@SIP_Server_IP
To: <sip:ClientB@64.219.188.226>
Server: kamailio (3.0.1 (i386/linux))
Content-Length: 0
#
U 2011/01/20 10:21:30.500319 64.219.188.229:7160 -> 64.219.188.226:5060
INVITE sip:ClientB@64.219.188.226 SIP/2.0
Max-Forwards: 10
Record-Route: <sip:64.219.188.229:7160;lr=on;nat=yes>
CSeq: 1 INVITE
Via: SIP/2.0/UDP 64.219.188.229:7160;branch=z9hG4bK2081.a449f9c3.0
Via: SIP/2.0/UDP
SIP_Server_IP:5060;rport=5060;branch=z9hG4bK200120112229203236722235
From: "ClientA" <sip:ClientA@SIP_Server_IP:5060>;tag=2001201122293236722235
Call-ID: 4447222350Ij6RSDWqbNiOj2zBp4.1.Bx6XRyiYk1z@SIP_Server_IP
To: <sip:ClientB@64.219.188.226>
Contact: <sip:SIP_Server_IP:5060;transport=udp>
Content-Type: application/sdp
Content-Length: 268
P-hint: outbound
v=0
o=VoipSwitch 6322 7322 IN IP4 SIP_Server_IP
s=VoipSIP
i=Audio Session
c=IN IP4 64.219.188.229
t=0 0
m=audio 39976 RTP/AVP 18 101
a=rtpmap:18 G729/8000/1
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv
a=nortpproxy:yes
#
U 2011/01/20 10:21:30.972039 64.219.188.229:7160 -> 64.219.188.226:5060
INVITE sip:ClientB@64.219.188.226 SIP/2.0
Max-Forwards: 10
Record-Route: <sip:64.219.188.229:7160;lr=on;nat=yes>
CSeq: 1 INVITE
Via: SIP/2.0/UDP 64.219.188.229:7160;branch=z9hG4bK2081.a449f9c3.0
Via: SIP/2.0/UDP
SIP_Server_IP:5060;rport=5060;branch=z9hG4bK200120112229203236722235
From: "ClientA" <sip:ClientA@SIP_Server_IP:5060>;tag=2001201122293236722235
Call-ID: 4447222350Ij6RSDWqbNiOj2zBp4.1.Bx6XRyiYk1z@SIP_Server_IP
To: <sip:ClientB@64.219.188.226>
Contact: <sip:SIP_Server_IP:5060;transport=udp>
Content-Type: application/sdp
Content-Length: 268
P-hint: outbound
v=0
o=VoipSwitch 6322 7322 IN IP4 SIP_Server_IP
s=VoipSIP
i=Audio Session
c=IN IP4 64.219.188.229
t=0 0
m=audio 39976 RTP/AVP 18 101
a=rtpmap:18 G729/8000/1
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv
a=nortpproxy:yes
#
U 2011/01/20 10:21:31.972084 64.219.188.229:7160 -> 64.219.188.226:5060
INVITE sip:ClientB@64.219.188.226 SIP/2.0
Max-Forwards: 10
Record-Route: <sip:64.219.188.229:7160;lr=on;nat=yes>
CSeq: 1 INVITE
Via: SIP/2.0/UDP 64.219.188.229:7160;branch=z9hG4bK2081.a449f9c3.0
Via: SIP/2.0/UDP
SIP_Server_IP:5060;rport=5060;branch=z9hG4bK200120112229203236722235
From: "ClientA" <sip:ClientA@SIP_Server_IP:5060>;tag=2001201122293236722235
Call-ID: 4447222350Ij6RSDWqbNiOj2zBp4.1.Bx6XRyiYk1z@SIP_Server_IP
To: <sip:ClientB@64.219.188.226>
Contact: <sip:SIP_Server_IP:5060;transport=udp>
Content-Type: application/sdp
Content-Length: 268
P-hint: outbound
v=0
o=VoipSwitch 6322 7322 IN IP4 SIP_Server_IP
s=VoipSIP
i=Audio Session
c=IN IP4 64.219.188.229
t=0 0
m=audio 39976 RTP/AVP 18 101
a=rtpmap:18 G729/8000/1
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv
a=nortpproxy:yes
#
U 2011/01/20 10:21:33.973141 64.219.188.229:7160 -> 64.219.188.226:5060
INVITE sip:ClientB@64.219.188.226 SIP/2.0
Max-Forwards: 10
Record-Route: <sip:64.219.188.229:7160;lr=on;nat=yes>
CSeq: 1 INVITE
Via: SIP/2.0/UDP 64.219.188.229:7160;branch=z9hG4bK2081.a449f9c3.0
Via: SIP/2.0/UDP
SIP_Server_IP:5060;rport=5060;branch=z9hG4bK200120112229203236722235
From: "ClientA" <sip:ClientA@SIP_Server_IP:5060>;tag=2001201122293236722235
Call-ID: 4447222350Ij6RSDWqbNiOj2zBp4.1.Bx6XRyiYk1z@SIP_Server_IP
To: <sip:ClientB@64.219.188.226>
Contact: <sip:SIP_Server_IP:5060;transport=udp>
Content-Type: application/sdp
Content-Length: 268
P-hint: outbound
v=0
o=VoipSwitch 6322 7322 IN IP4 SIP_Server_IP
s=VoipSIP
i=Audio Session
c=IN IP4 64.219.188.229
t=0 0
m=audio 39976 RTP/AVP 18 101
a=rtpmap:18 G729/8000/1
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv
a=nortpproxy:yes
_______________________________________________
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