<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.16.0">
</HEAD>
<BODY>
I've solved the issue. When call was not answered and the flow enters failure route, it pushes call forward avp values to uri and does append_branch(). But at this time, OpenSER sees request coming from OpenSER IP itself so fix_nated_contact rewrites contact to OpenSER IP address and hence pstn gateway sends bye to uri with OpenSER IP address instead of caller's IP address. I could solve this by using putting t_onbranch in failure route, creating branch_route and doing fix_nated_contact there. After doing these changes, OpenSER sends invite with nated caller's public IP in contact header therefore pstn gateway sends bye to caller properly.<BR>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<BR>
Thanks,<BR>
Ruchir
</TD>
</TR>
</TABLE>
<BR>
-----Original Message-----<BR>
<B>From</B>: Ruchir Brahmbhatt &lt;<A HREF="mailto:Ruchir%20Brahmbhatt%20%3cruchir.brahmbhatt@ecosmob.com%3e">ruchir.brahmbhatt@ecosmob.com</A>&gt;<BR>
<B>Reply-To</B>: <A HREF="mailto:ruchir.brahmbhatt@ecosmob.com">ruchir.brahmbhatt@ecosmob.com</A><BR>
<B>To</B>: Openser users mailing list &lt;<A HREF="mailto:Openser%20users%20mailing%20list%20%3cusers@lists.openser.org%3e">users@lists.openser.org</A>&gt;<BR>
<B>Subject</B>: Re: BYE not relaying properly<BR>
<B>Date</B>: Wed, 28 May 2008 18:33:01 +0530<BR>
<BR>
By comparing the SIP messages I found that in case of client behind NAT, it sends invite to pstn gateway with OpenSER IP address in contact header and probably thats why bye is sent to OpenSER so it keeps looping in OpenSER and not relaying to the user agent. Any idea why this could happen?<BR>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<BR>
Thanks,<BR>
Ruchir
</TD>
</TR>
</TABLE>
<BR>
-----Original Message-----<BR>
<B>From</B>: Ruchir Brahmbhatt &lt;<A HREF="mailto:Ruchir%20Brahmbhatt%20%3cruchir.brahmbhatt@ecosmob.com%3e">ruchir.brahmbhatt@ecosmob.com</A>&gt;<BR>
<B>Reply-To</B>: <A HREF="mailto:ruchir.brahmbhatt@ecosmob.com">ruchir.brahmbhatt@ecosmob.com</A><BR>
<B>To</B>: Openser users mailing list &lt;<A HREF="mailto:Openser%20users%20mailing%20list%20%3cusers@lists.openser.org%3e">users@lists.openser.org</A>&gt;<BR>
<B>Bcc</B>: Krunal Patel &lt;<A HREF="mailto:Krunal%20Patel%20%3ckrunal.patel@ecosmob.com%3e">krunal.patel@ecosmob.com</A>&gt;<BR>
<B>Subject</B>: BYE not relaying properly<BR>
<B>Date</B>: Wed, 28 May 2008 00:15:34 +0530<BR>
<BR>
Hi All,<BR>
<BR>
I have OpenSER 1.2.3(previously it was 1.2.1 but installed latest version to make sure that it is not an OpenSER bug) configured and running for following features: 
<UL>
    <LI>Registrar 
    <LI>Proxy 
    <LI>Media proxy for NAT traversal 
    <LI>LCR module for PSTN termination 
    <LI>SEMS for voicemail 
    <LI>Multi-leg accounting with Radiator radius 
    <LI>Call forwarding using user_preferences
</UL>
I'm having one really strange issue. My OpenSER is configured to listen on particular IP address say 1.2.3.4. I've added alias for the domain name say voip.domain.com.<BR>
User agent register to OpenSER using voip.domain.com as a proxy. They can call each other &amp; pstn. I'm using Media Proxy for handling media in case of clients behind NAT. Audio &amp; signaling seems to be working fine in case of internal and pstn calling. <BR>
<BR>
I have configured call forwarding unconditional, no answer &amp; busy. In case of unconditional call forwarding, audio and signaling works fine. But when I test call forwarding on no answer or busy, audio is proper but signaling doesn't work properly. Specially BYE. Here is my setup: 
<UL>
    <LI>3 users configured; 1000, 2000 &amp; 3000. 
    <LI>2000 has no answer forwarding to pstn number. 
    <LI>3000 has busy forwarding to 2000
</UL>
If 1000 calls 2000 and 2000 doesn't pickup the phone in 30 seconds(configured using fr_inv_timer param of tm module), the pstn number is pushed in request uri and request is sent to gateway for pstn termination.<BR>
Audio works fine. If caller(1000) hangs up, the callee is hung up properly. However if callee (pstn number) hangs up the call, the caller doesn't receive the BYE message and hence stays connected. Media Proxy session is closed properly but in OpenSER, BYE request is not sent to caller but keeps looping in OpenSER instead. <BR>
I have several doubts about this issue. One thing is that the pstn gateway is sending BYE to OpenSER IP address instead of domain name. I know this kind of problem can occur if we haven't configured alias parameter properly. Reference: <A HREF="http://www.openser.org/mos/view/-OpenSER-Installation-Notes/">http://www.openser.org/mos/view/-OpenSER-Installation-Notes/</A> (Section 4. Troubleshooting)<BR>
I have added ip and domain in domain table as well but still no change.<BR>
<BR>
I've been facing this issue since several days and still not able to solve. I've done many OpenSER setups but having such issue for the first time. I've compared the OpenSER config file to my older setups but it seems proper. <BR>
Can anyone please guide me in correct direction?<BR>
<BR>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<BR>
Thanks,<BR>
Ruchir
</TD>
</TR>
</TABLE>
</BODY>
</HTML>