Hi guys!
I try to use OpenSER with NATed-users and now I have some problem.
No I'll try to explain it.
I have the following network scheme:
mySIP-phone_behind_NAT --> NAT --> OpenSER --> OtherProxy --> other_SIP_phone
mySIP-phone_behind_NAT have some knowledges about external NAT_ip so it successfully
registered on OpenSER using nathelper module and location table have new record looks like:
user@mydomain
Contact:
user@NAT_ip:5060
Received: NAT_ip:NAT_port
Then mySIP-phone_behind_NAT send new INVITE with Contact=user@NAT_ip:5060
OpenSER fixup this Contact using fix_nated_contact()
and send INVITE to OtherProxy
with Contact=user@NAT_ip:NAT_port;nat=yes
Then 200OK and ACK successfully traversed via OpenSER and dialog esteblished.
Then other_SIP_phone sends BYE request using R-URI learned from previous
INVITE Contact-header=ser@NAT_ip:NAT_port;nat=yes
OpenSER rewrite this R-URI to user@NAT_ip:NAT_port and send it using t_relay(). The packet goes to NAT_ip:NAT_port
but mySIP-phone_behind_NAT sends "404 Not found" because it does not know anything about
user@NAT_ip:NAT_port --
it expected user@NAT_ip:5060 as sended in first INVITE.
So, my question is: is this my misconfiguration or incorrect logic understanding ?
I have some ideas how to fix this problem, for eaxample:
when I got INVITE from mySIP-phone_behind_NAT I must rewrite Contact to user@mydomain
(assuming that requests to mydomain goes to OpenSER always). Then if OpenSER got BYE from other_SIP_phone
it will lookup() and restore Contact and Received info. But I have
problem again: If I rewrite R-URI to Contact and t_relay() it -- packet
will be discarded by NAT because it does not anything about port 5060.
If I rewrite R-URI using Received info I will get problem discribed
early.
Feature request "Allow AVP in t_relay()" (published in Tracker) will solve this problem
Any suggestion?
--
CU,
Victor Gamov