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!
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!
Attachments:
Tags:
nat,
asterisk,
contact,
re-writing,
re-invite








