<div dir="ltr">**UPDATE**<div><br></div><div>I looked into my sip traces and found the NAT problem, Freeswitch sends a UPDATE request to set the P-Asserted-Identity to &quot;Outbound Call&quot;, the problem was my OpenSIPS was not set to t_on_reply to go to my reply route that fixes nat, so it never did the  fix_nated_contact() therefore all sequential requests used the bad contact from the reply of the update, on the other hand my asterisk box never sent that UPDATE therefore is used the &quot;contact&quot; from the initial INVITE which was fixed by OpenSIPS, I configured OpenSIPS to process the correct reply route for the UPDATE and problem was solved.<br><br>I&#39;m still looking for a answer to my first question.</div><div><br></div><div>thank you</div><div>S. Rosenberg</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 28, 2016 at 1:32 PM, Schneur Rosenberg <span dir="ltr">&lt;<a href="mailto:thesipguy@gmail.com" target="_blank">thesipguy@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi, I&#39;m pretty new to Freeswitch, I built a complete solution using OpenSIPS/Asterisk and I&#39;m in the process of replacing Asterisk with Freeswitch.<div><br></div>My current system is built that OpenSIPS act as a registrar and as a load balancer, the rest is done on a cluster of Asterisk machines, which as I said before is being rewritten to Freeswitch, in Freeswitch I&#39;m using xml_curl for my dialplan and call routing, I&#39;m using Intralanman project to handle the sip users.<br><br>With Asterisk I had OpensSIPS as a trunk and I know that everything coming from that trunk, is either a DID or a authenticated outgoing call, Asterisk and OpenSIPS shared the user table, Asterisk recognized the sip user name from the FROM field and used all the variables etc from its own sip user table as if the user has registered directly to itself, I had some issues with blind transfers but I was able to do some manipulations and DB queries to handle it fine.<br><br>I tried doing the same with Freeswitch, I let the ACL allow the ip from Freeswitch, but Freeswitch would not use the variables from the user like Asterisk did, for example accountcode, user_context etc, I was able to partially fix that by having my web server do a db query and then using the &quot;set&quot; application set all the variables, but I&#39;m not sure if its the proper solution, does anyone have a better solution? will setting my OpenSIPS as a gateway instead of merely allowing it in with ACL work better? right now I&#39;m using the application &quot;execute_extension&quot; to send it to the proper context that I&#39;ve pulled from the DB, I dont like the hack and if there is a better solution I would like to know.<br><br>One more major problem that I have is NAT related, when I place a outgoing call for example from a phone which is behind a NAT (all of our customers phones are behind NAT) the call connects and audio works 2 ways, but when the called party hangs up, the carrier sends the BYE to Freeswitch, freeswitch then sends it to my OpenSIPS which is supposed to send it to my clients phone, but Freeswich writes the RURI with the natted address, the RURI is BYE <a href="http://sip:101@192.168.0.11:5062" target="_blank">sip:101@192.168.0.11:5062</a> SIP/2.0. and my OpenSIPS does not know what to do with it and ignores it, my Asterisk replaced the RURI with the received address in the VIA, so same RURI would be BYE <a href="http://sip:101@64.69.47.175:5062" target="_blank">sip:101@64.69.47.175:5062</a> SIP/2.0. which worked fine, same problem happens with all subsequent requests  if user does not hang up, I need a solution for this major issue.<div><br></div><div>thank you</div><div>S. Rosenberg<br><div><br></div></div></div>
</blockquote></div><br></div>