This Question is Answered

2 "helpful" answers available (1 pts)
7 Replies Last post: Jun 25, 2009 7:18 PM by joegen  
Click to view Get_The_Fish's profile   20 posts since
Apr 25, 2009

Apr 25, 2009 11:48 AM

Contact address not re-written to WAN IP on SIP OK response to re-invite?

Hello all,


I must first start by saying that this is an excellent project. I've been using it for a little over 12 hours now and I am very impressed!

I do believe that I might have found a bug, however (or at least a quirk :)). It appears that on a nat'd UA, OSBC is not re-writing the contact address on a 200 repliy to a re-invite.

The symptom: after 10-15 minutes, outbound calls are dropped. This is reliably replicated and 100% consistent.

My scenario is as follows:

Asterisk -> (LAN Interface) OSBC (WAN interface) -> router -> ITSP

I have the OSBC box multi-homed, one interface on the LAN, the other on the WAN. There is no firewall and no NAT translation between either interface. I have the OSBC machine set to B2BUA mode. My ITSP does not support registration, and uses IP addressing only (no DNS supported in either the SIP TO or FROM addresses). We are using SIP trunking and SIP UA's (Polycom 501 and 301, 501 used in this scenario). Asterisk is version 1.4.23.1 on CentOS 5.2, OSBC was built from CVS 4/23/2009 on CentOS 5.3 with package updates as of 4/23/2009 (no extras or non-default repos, base install CLI only no options installed) with iptables and selinux disabled, no other firewall software installed on either Asterisk or OSBC.

Call flow in this scenario: UA (Polycom 501) -> Asterisk -> (LAN Interface) OSBC (WAN Interface) -> ITSP (Sansay softswitch) -> PSTN


The root issue:

I am seeing in the initial INVITE that on OSBC's OK response the contact IP is re-written to that of the WAN IP address. However, after about 10-15 minutes on a call, my ITSP is sending a re-INVITE. OSBC the relays re-invite to asterisk, and upon receiving the 200 from asterisk it ACKs the 200 to Asterisk, and sends a 200 response to the ITSP. I do not, however, receive an ACK from the provider. OSBC will then send a BYE, as expected when it does not receive the ACK from the ITSP leg of the call.

I believe that the ITSP's failure to respond to the ACK is due to the LAN IP in the contact address, if I am reading this correctly, according to a conversation here: [http://markmail.org/thread/3hfxk3h2gw4zka5m]. The provider does not exhibit this behavior when Asterisk is using the WAN IP in the contact field. Is it possible that the provider is sending the ACK to the contact address?

The reason that I think that this is a bug is that on the initial invite OSBC re-writes the contact field to that of the WAN interface of the OSBC machine. On the re-invite OSBC does not re-write the contact field, and the contact field contains the LAN IP of the UA (Asterisk).


Any suggestions on how I can work around this? Is this in fact a bug that needs to be fixed? Please let me know. If I can confirm with certainty that this is the root cause of this issue there are options that we have in ensuring that it's addressed that are equitable to everyone and the community will benefit.

I have attached a text file that has the pcap output from the WAN side of the OSBC box, filtered for UDP 5060. I see the same thing when sniffing directly on the switch and the WAN router. Please let me know if there is anyting that you need or if this is at all unclear.

Thanks in advance for your help, OSBC is an amazing platform!

Click to view joegen's profile   539 posts since
Apr 28, 2007
1. Apr 28, 2009 7:13 PM in response to: Get_The_Fish
Re: Contact address not re-written to WAN IP on SIP OK response to re-invite?
Hi,

This is a known bug in recent builds. I have recently uploaded a fix for this in CVS. Please upgrade your installation and retest. Let me know if the problem persists.
Click to view joegen's profile   539 posts since
Apr 28, 2007
3. Apr 30, 2009 11:27 PM in response to: Get_The_Fish
Re: Contact address not re-written to WAN IP on SIP OK response to re-invite?
Hi Sorry for the late reply. Ye please, send the log. You can either attach it here if your network info can be published or you can send me a private email at joegen@opensipstack.org
Click to view joegen's profile   539 posts since
Apr 28, 2007
4. May 1, 2009 1:13 AM in response to: joegen
Re: Contact address not re-written to WAN IP on SIP OK response to re-invite?

Ouch! I am able to replicate this bug. I have commited a fix in CVS. Please upgrade OpenSIPStack and OpenSBC once more. Thanks for the bug report!
Click to view dyer's profile   5 posts since
May 30, 2009
6. Jun 23, 2009 10:23 AM in response to: Get_The_Fish
Re: Contact address not re-written to WAN IP on SIP OK response to re-invite?
Hello,

I found what OSBC has similar problem with OPTIONS messages.

I'm using OpenSBC Version 1.1.5-103 and similar scheme with Asterisk.

SIP message on WAN interface of SBC:

OPTIONS sip:<SIP-USER>@<SBC-WAN-IP>:5060 SIP/2.0
From: "asterisk" <sip:asterisk@<SIP-DOMAIN>>;tag=as0f7e9d34
To: <sip:<SIP-USER>@<SBC-WAN-IP>:5060>
Via: SIP/2.0/UDP <SBC-LAN-IP>:5060;branch=z9hG4bK0affd6986b5ede1192ecf1defbfaffe3;uas-addr=<SBC-WAN-IP>;rport
Via: SIP/2.0/UDP <ASTERISK-LAN-IP>:5060;branch=z9hG4bK57cb9ae3;rport;rport=5060;received=<ASTERISK-LAN-IP>
CSeq: 102 OPTIONS
Call-ID: 6b2f3aaf68e03b744132ed2a0a55c043@<SIP-DOMAIN>
Contact: <sip:asterisk@<ASTERISK-LAN-IP>>
Date: Tue, 22 Jun 2009 13:54:11 GMT
User-Agent: asterisk
Max-Forwards: 70
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Content-Length: 0

I suppose that <ASTERISK-LAN-IP> in Via and Contact headers it is't so good for "topology hiding" tasks of SBC.

Thanks.

Click to view joegen's profile   539 posts since
Apr 28, 2007
7. Jun 25, 2009 7:18 PM in response to: dyer
Re: Contact address not re-written to WAN IP on SIP OK response to re-invite?

OPTIONS would be forwarded by OpenSBC becaase it will act as a proxy for none-invite mid dialog requests.