<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <font face="monospace">Hi,<br>
      <br>
      Who's generating the 407 reply? OpenSIPS or FS ?<br>
      <br>
      Regards,<br>
    </font>
    <pre class="moz-signature" cols="72">Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  <a class="moz-txt-link-freetext" href="https://www.opensips-solutions.com">https://www.opensips-solutions.com</a>
  <a class="moz-txt-link-freetext" href="https://www.siphub.com">https://www.siphub.com</a></pre>
    <div class="moz-cite-prefix">On 15.03.2024 13:03, Dragan, Calin via
      Users wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:BN8PR04MB5779A7B6308F1D401726ED2EF3282@BN8PR04MB5779.namprd04.prod.outlook.com">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <meta name="Generator"
        content="Microsoft Word 15 (filtered medium)">
      <style>@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}@font-face
        {font-family:Aptos;}p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Aptos",sans-serif;
        mso-ligatures:standardcontextual;}a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#467886;
        text-decoration:underline;}span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Aptos",sans-serif;
        color:windowtext;}.MsoChpDefault
        {mso-style-type:export-only;
        font-size:11.0pt;}div.WordSection1
        {page:WordSection1;}</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal">Hi,<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">I’m trying to use Freeswitch as a media
          server with Opensips as a load balancer, I need something very
          basic for a POC. (I configured the load balancer and
          dispatcher based on old information found here:
          <a
href="https://developer.signalwire.com/freeswitch/FreeSWITCH-Explained/Enterprise-Deployment/Enterprise-deployment-OpenSIPS_13173169/#freeswitch-configuration"
            moz-do-not-send="true" class="moz-txt-link-freetext">
https://developer.signalwire.com/freeswitch/FreeSWITCH-Explained/Enterprise-Deployment/Enterprise-deployment-OpenSIPS_13173169/#freeswitch-configuration</a>,
          here:
          <a
href="https://developer.signalwire.com/freeswitch/FreeSWITCH-Explained/Auxiliary-Knowledge-and-Utilities/OpenSIPS-configuration-for-2-or-more-FreeSWITCH-installs_13173462/"
            moz-do-not-send="true" class="moz-txt-link-freetext">
https://developer.signalwire.com/freeswitch/FreeSWITCH-Explained/Auxiliary-Knowledge-and-Utilities/OpenSIPS-configuration-for-2-or-more-FreeSWITCH-installs_13173462/</a>
          and here:
          <a
href="https://www.opensips.org/Documentation/Tutorials-OpenSIPSFreeSwitchIntegration"
            moz-do-not-send="true" class="moz-txt-link-freetext">
https://www.opensips.org/Documentation/Tutorials-OpenSIPSFreeSwitchIntegration</a>)<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">I’m adding the X-Auth-IP header to the
          requests like this (this is based on the config that ships
          with the 3.4.x release in the docker image, so I guessed that
          this is where I should add the header):<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">route[relay] {<o:p></o:p></p>
        <p class="MsoNormal">               # for INVITEs enable some
          additional helper routes<o:p></o:p></p>
        <p class="MsoNormal">               if (is_method("INVITE")) {<o:p></o:p></p>
        <p class="MsoNormal">                              
           remove_hf("X-Auth-IP");<o:p></o:p></p>
        <p class="MsoNormal">                              
          append_hf("X-Auth-IP: $si\r\n");<o:p></o:p></p>
        <p class="MsoNormal">                              
          append_to_reply("X-Auth-IP: $si\r\n");<o:p></o:p></p>
        <p class="MsoNormal">                              
          xlog("L_INFO", "$ci|log|X-Auth-IP: $si\n");<o:p></o:p></p>
        <p class="MsoNormal">                              
          xlog("L_INFO", "SIP Message: $mb");<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">                             
          t_on_failure("missed_call");<o:p></o:p></p>
        <p class="MsoNormal">                             
          t_on_branch("per_branch_ops");<o:p></o:p></p>
        <p class="MsoNormal">                             
          t_on_reply("handle_nat");<o:p></o:p></p>
        <p class="MsoNormal">               }<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">               if (!t_relay()) {<o:p></o:p></p>
        <p class="MsoNormal">                             
          send_reply(500,"Internal Error");<o:p></o:p></p>
        <p class="MsoNormal">               }<o:p></o:p></p>
        <p class="MsoNormal">               exit;<o:p></o:p></p>
        <p class="MsoNormal">}<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">On the freeswitch side I added the IP set
          by opensips in the list of allowed addresses.<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Now, with or without authentication enabled
          on the Freeswitch side (i.e. regardless of what I set in the
          “auth-calls” param, or if I enable the accept-blind-auth), or
          even whether the Freeswitch is running or not, when I try to
          place a call from/to some registerd addresses, I get the “407
          Proxy authentication required” response.<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Could you please give me some hints on what
          I might be doing wrong, or direct me to a contemporary
          tutorial?<o:p></o:p></p>
      </div>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>