<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>$fsn gives the socket name, probably $fsa can be added (as
      shortcut) for getting the advertised address. Otherwise, if you
      use 5.6.x, see the $lsock(...) variable, it should offer what you
      need.</p>
    <p><br>
    </p>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 24.06.22 10:53, Tor Petterson wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:DB7PR05MB52441EC819EA7601BDA4056CF4B49@DB7PR05MB5244.eurprd05.prod.outlook.com">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <style type="text/css" style="display:none;">P {margin-top:0;margin-bottom:0;}</style>
      <div style="font-family: Calibri, Arial, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
        $fs gives me the address of the socket. Is there a way to find
        the advertised address?<br>
      </div>
      <hr style="display:inline-block;width:98%" tabindex="-1">
      <div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt"
          face="Calibri, sans-serif" color="#000000"><b>From:</b>
          sr-users <a class="moz-txt-link-rfc2396E" href="mailto:sr-users-bounces@lists.kamailio.org"><sr-users-bounces@lists.kamailio.org></a> on behalf
          of Daniel-Constantin Mierla <a class="moz-txt-link-rfc2396E" href="mailto:miconda@gmail.com"><miconda@gmail.com></a><br>
          <b>Sent:</b> Tuesday, June 21, 2022 13:18<br>
          <b>To:</b> Kamailio (SER) - Users Mailing List
          <a class="moz-txt-link-rfc2396E" href="mailto:sr-users@lists.kamailio.org"><sr-users@lists.kamailio.org></a><br>
          <b>Subject:</b> Re: [SR-Users] Finding advertised address of
          socket</font>
        <div> </div>
      </div>
      <div>
        <table style="border:0; display:table; width:100%;
          table-layout:fixed; border-collapse:seperate; float:none"
          width="100%" cellspacing="0" cellpadding="0" border="0"
          align="left">
          <tbody>
            <tr>
              <td cellpadding="7px 2px 7px 2px" style="padding:7px 2px
                7px 2px; background-color:#A6A6A6" width="1px"
                valign="middle" bgcolor="#A6A6A6">
                <br>
              </td>
              <td cellpadding="7px 5px 7px 15px" color="#212121"
                style="width:100%; background-color:#EAEAEA; padding:7px
                5px 7px 15px; font-family:wf_segoe-ui_normal,Segoe
                UI,Segoe WP,Tahoma,Arial,sans-serif; font-size:12px;
                font-weight:normal; color:#212121; text-align:left;
                word-wrap:break-word" width="100%" valign="middle"
                bgcolor="#EAEAEA">
                <div>You don't often get email from <a class="moz-txt-link-abbreviated" href="mailto:miconda@gmail.com">miconda@gmail.com</a>. <a
                    href="https://aka.ms/LearnAboutSenderIdentification"
                    moz-do-not-send="true">
                    Learn why this is important</a></div>
              </td>
              <td cellpadding="7px 5px 7px 5px" color="#212121"
                style="width:75px; background-color:#EAEAEA; padding:7px
                5px 7px 5px; font-family:wf_segoe-ui_normal,Segoe
                UI,Segoe WP,Tahoma,Arial,sans-serif; font-size:12px;
                font-weight:normal; color:#212121; text-align:left;
                word-wrap:break-word" width="75px" valign="middle"
                bgcolor="#EAEAEA" align="left">
                <br>
              </td>
            </tr>
          </tbody>
        </table>
        <div>
        </div>
      </div>
    </blockquote>
    <p><br>
    </p>
    <p>It is indeed important not to get often emails from me, that
      means Kamailio just works :-) !</p>
    <p><br>
    </p>
    <p>Cheers,<br>
      Daniel</p>
    <p><br>
    </p>
    <blockquote type="cite"
cite="mid:DB7PR05MB52441EC819EA7601BDA4056CF4B49@DB7PR05MB5244.eurprd05.prod.outlook.com">
      <div>
        <div>
          <p>If dispatcher sets a socket for sending out, you can get
            its address with $fs.</p>
          <p><br>
          </p>
          <p>Also, there is a mode parameter for dispatcher that allows
            you to specify you want the socket value from attributes to
            be set as string in a field of an xavp -- right now I have
            now quick option to check it myself and point to it, just
            look at the dispatcher readme.<br>
          </p>
          <p><br>
          </p>
          <p>Cheers,<br>
            Daniel</p>
          <p><br>
          </p>
          <div class="x_moz-cite-prefix">On 21.06.22 12:14, Tor
            Petterson wrote:<br>
          </div>
          <blockquote type="cite">
            <style type="text/css" style="display:none">p
        {margin-top:0;
        margin-bottom:0}</style>
            <div style="font-family:Calibri,Arial,Helvetica,sans-serif;
              font-size:12pt; color:rgb(0,0,0)">
              I guess I didn't explain myself well enough.</div>
            <div style="font-family:Calibri,Arial,Helvetica,sans-serif;
              font-size:12pt; color:rgb(0,0,0)">
              I would like to find the socket address programatically
              from the kamailio.cfg script.</div>
            <div style="font-family:Calibri,Arial,Helvetica,sans-serif;
              font-size:12pt; color:rgb(0,0,0)">
              so after I do this:</div>
            <div style="font-family:Calibri,Arial,Helvetica,sans-serif;
              font-size:12pt; color:rgb(0,0,0)">
                      if (ds_select_domain($var(dispgroup), "4")) {<br>
                             
              xavp_params_explode($xavp(dsdst=>attrs), "dstattr");</div>
            <div style="font-family:Calibri,Arial,Helvetica,sans-serif;
              font-size:12pt; color:rgb(0,0,0)">
              <br>
            </div>
            <div style="font-family:Calibri,Arial,Helvetica,sans-serif;
              font-size:12pt; color:rgb(0,0,0)">
              is there a way to get the IP address of the selected
              socket?<br>
            </div>
            <hr tabindex="-1" style="display:inline-block; width:98%">
            <div id="x_divRplyFwdMsg" dir="ltr"><font
                style="font-size:11pt" face="Calibri, sans-serif"
                color="#000000"><b>From:</b> sr-users
                <a class="x_moz-txt-link-rfc2396E"
                  href="mailto:sr-users-bounces@lists.kamailio.org"
                  moz-do-not-send="true">
                  <sr-users-bounces@lists.kamailio.org></a> on
                behalf of Mathias WOLFF <a
                  class="x_moz-txt-link-rfc2396E"
                  href="mailto:mathias@celea.org" moz-do-not-send="true">
                  <mathias@celea.org></a><br>
                <b>Sent:</b> Tuesday, June 21, 2022 11:58<br>
                <b>To:</b> Kamailio \(SER\) - Users Mailing List <a
                  class="x_moz-txt-link-rfc2396E"
                  href="mailto:sr-users@lists.kamailio.org"
                  moz-do-not-send="true">
                  <sr-users@lists.kamailio.org></a><br>
                <b>Subject:</b> Re: [SR-Users] Finding advertised
                address of socket</font>
              <div> </div>
            </div>
            <div>
              <div style="font-family:Arial; font-size:14px">Hello,</div>
              <div style="font-family:Arial; font-size:14px">Yes, you
                can add it in the configuration file, it is the
                <span>'socket' -> used to set the sending socket for
                  the gateway. It is used for sending the SIP traffic as
                  well as OPTIONS keepalives.</span>
                <div><br>
                </div>
                <span></span>Regards<br>
              </div>
              <div style="font-family:Arial; font-size:14px"><br>
              </div>
              <div class="x_x_protonmail_signature_block"
                style="font-family:Arial; font-size:14px">
                <div class="x_x_protonmail_signature_block-user">
                  <div>.....................................................................<br>
                  </div>
                  <div>Mathias WOLFF<br>
                  </div>
                  <div>Tel : +33 9.72.13.22.62<br>
                  </div>
                  <div>Gsm : +33 6.79.59.43.32<br>
                  </div>
                  <div>.....................................................................<br>
                  </div>
                  <div>
                    <div><b>CONFIDENTIALITE.</b><br>
                    </div>
                    <div>Cet email (y compris les éventuelles pièces
                      jointes) peut contenir des informations
                      confidentielles. Il ne peut être utilisé que pour
                      la finalité pour laquelle il a été envoyé. Au cas
                      où il ne vous serait pas destiné, merci de le
                      supprimer et d'en avertir l'expéditeur.<br>
                    </div>
                    <div><b>CONFIDENTIALITY.</b><br>
                    </div>
                    <div>This email (including any attachments) may
                      contain confidential information. It may not be
                      used other than for the purpose for which it has
                      been sent. If you are not the intendedrecipient,
                      please delete it and notify the sender.<br>
                    </div>
                  </div>
                  <div><br>
                  </div>
                </div>
                <div style="font-family:Arial; font-size:14px"><br>
                </div>
                <div class="x_x_protonmail_signature_block-proton">Envoyé
                  avec la messagerie sécurisée
                  <a target="_blank"
href="https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fproton.me%2F&data=05%7C01%7Ctor.petterson%40enreach.com%7Ca9bdf0aa7c914a1bb36008da5377f22e%7C33733f45cfce4d1e9d174adfad5af331%7C0%7C0%7C637914072320647703%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=subNKhnEcjgOtD5bA%2F1uUJMiwazLI4xBFWMFOlp5rmk%3D&reserved=0"
                    originalsrc="https://proton.me/"
shash="SZn1OCfNJFYqBXSs2nJfBFPVUlpKsdTSYf2kAzLGVO11UNw9YlosMeE/rbBRlfIy0w132/oXh/4VtYh2qcXt/JDWTx/pIxir7tCJG33Ff/2gnK08eMh5xu1gt6qnHIwf49dVfeWLj5YG94QTcY2RBBgFRBP+1jJ8RPCusUjC1yM="
                    rel="noopener noreferrer" moz-do-not-send="true">
                    Proton Mail</a>. </div>
              </div>
              <div style="font-family:Arial; font-size:14px"><br>
              </div>
              <div class="x_x_protonmail_quote">------- Original Message
                -------<br>
                Le mardi 21 juin 2022 à 11:53, Tor Petterson <a
                  class="x_moz-txt-link-rfc2396E"
                  href="mailto:tor.petterson@enreach.com"
                  moz-do-not-send="true">
                  <tor.petterson@enreach.com></a> a écrit :<br>
                <br>
                <blockquote class="x_x_protonmail_quote" type="cite">
                  <div class="x_x_elementToProof"
                    style="font-family:Calibri,Arial,Helvetica,sans-serif;
                    font-size:12pt; color:rgb(0,0,0)">
                    Hi
                    <div><br>
                    </div>
                    <div>I have a setup where Kamailio is connected to
                      several telephony providers using different IP
                      addresses to communicate with them.</div>
                    <div>So I have a socket per provider.<br>
                    </div>
                    <div>I am using the dispatcher module to route calls
                      to the different providers.</div>
                    <div>My question is if there is a way to get the
                      advertised address of the socket chosen by
                      dispatcher?</div>
                    <div>I have a socket pointer in the XAVP, but I
                      can't figure out if it is possible to get the
                      advertised address from it somehow.</div>
                    <div><br>
                    </div>
                    <div>Thanks in advance.</div>
                    Tor<br>
                  </div>
                </blockquote>
                <br>
              </div>
            </div>
            <br>
            <fieldset class="x_moz-mime-attachment-header"></fieldset>
            <pre class="x_moz-quote-pre">__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
  * <a class="x_moz-txt-link-abbreviated moz-txt-link-freetext" href="mailto:sr-users@lists.kamailio.org" moz-do-not-send="true">sr-users@lists.kamailio.org</a>
Important: keep the mailing list in the recipients, do not reply only to the sender!
Edit mailing list options or unsubscribe:
  * <a class="x_moz-txt-link-freetext" href="https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.kamailio.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fsr-users&data=05%7C01%7Ctor.petterson%40enreach.com%7Ca9bdf0aa7c914a1bb36008da5377f22e%7C33733f45cfce4d1e9d174adfad5af331%7C0%7C0%7C637914072320647703%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=PQd%2BUQysjsANnTAJOA0zJaqx62pGlIUYo7ghQe4mYdc%3D&reserved=0" originalsrc="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" shash="WOgth4BWkSHOV/n7nBHKN3Nl70aSGNzfklOVvZrOnGEuzyl9eTvOtZFLxnfn5oxcd5uoIZncC6tdpFu+det7/+tvfLnglIGzGxPCH9MCYHh4Uijx+9eZOsD8PR2hO6w+TOD5QKtYwpyVTGUOdQx42cwbcoFBQjZXgtltWFo7A5w=" moz-do-not-send="true">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
          </blockquote>
          <pre class="x_moz-signature" cols="72">-- 
Daniel-Constantin Mierla -- <a class="x_moz-txt-link-abbreviated" href="https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.asipto.com%2F&data=05%7C01%7Ctor.petterson%40enreach.com%7Ca9bdf0aa7c914a1bb36008da5377f22e%7C33733f45cfce4d1e9d174adfad5af331%7C0%7C0%7C637914072320647703%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=Js5VGv01flw12CJCfVrjDH046B7xOnSqAc8ZC6uC8vA%3D&reserved=0" originalsrc="http://www.asipto.com/" shash="KG9vbnXN3yL/274L45WjImLR8JP8htl1ZHYuVakl40U0/LD7nMaGlk3jgAQ3A+5V2ZBc278aZS44EFWs+jHSKkkNsAe+HdmcZJW+LAWnUUp7u9jvHqq2AGSooD73ww+qejFJEp8woSJtxMlQue77Ch+0cW7N8AsrhJE09WbYwnc=" moz-do-not-send="true">www.asipto.com</a>
<a class="x_moz-txt-link-abbreviated" href="https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.twitter.com%2Fmiconda&data=05%7C01%7Ctor.petterson%40enreach.com%7Ca9bdf0aa7c914a1bb36008da5377f22e%7C33733f45cfce4d1e9d174adfad5af331%7C0%7C0%7C637914072320647703%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=sxW4nuTePoV%2F0IoKTw8sSrHAVIRUlAkzthXR9FBDtA4%3D&reserved=0" originalsrc="http://www.twitter.com/miconda" shash="jMuJ9UPv9XlXQ8wJOGnjACpLF6wBOW3naoAqczlQrJ82LqcIwpDmGbU2KwnFL09VI5uRni+P5ndS24r03eZMtlXOlIGjpWRbqjgyN4PFnNoSkTkqspSVsUoE+cr6yJbt81eSjZIHkwJbvNjiFGI7f7h17pTrT3AAwFO3qX0Vt50=" moz-do-not-send="true">www.twitter.com/miconda</a> -- <a class="x_moz-txt-link-abbreviated" href="https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.linkedin.com%2Fin%2Fmiconda&data=05%7C01%7Ctor.petterson%40enreach.com%7Ca9bdf0aa7c914a1bb36008da5377f22e%7C33733f45cfce4d1e9d174adfad5af331%7C0%7C0%7C637914072320647703%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=HKYJndO%2FV0YyneNfoVj%2BnMBFLLvzWyzRVG5PlmHBioc%3D&reserved=0" originalsrc="http://www.linkedin.com/in/miconda" shash="rCSstPF6vskI+p7S1k/iznTeWC0fGJO1PMbpOqldNhgYcqY85BTTtIQ1zvzUM/Zw9aBuOjMSi+7LheJom1I75HJE1VhIdI4NPKCmlBcqH8gTo61Nr2gA5YgZxA47TNXMCBisWP1oHWkiCrwzuW2KfojueQWqdJ1Im9n+mz6xn50=" moz-do-not-send="true">www.linkedin.com/in/miconda</a>
Kamailio Advanced Training - Online: June 20-23, 2022
  * <a class="x_moz-txt-link-freetext" href="https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.asipto.com%2Fsw%2Fkamailio-advanced-training-online%2F&data=05%7C01%7Ctor.petterson%40enreach.com%7Ca9bdf0aa7c914a1bb36008da5377f22e%7C33733f45cfce4d1e9d174adfad5af331%7C0%7C0%7C637914072320647703%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=m2ic%2BcPwxnObl8sYckw%2Bd5f%2BNjmqTDLMP2DS4t5jhZA%3D&reserved=0" originalsrc="https://www.asipto.com/sw/kamailio-advanced-training-online/" shash="du3w9JWaVMEVFa+nhdzGcanQJ/g52jNvfAZ/XMFEjXq3ea57sYuqbMTpcjYR8lGt99AL/rhcuG36b6PRgR+VNEsfFIiY8iS5evyaLx8IoI+IqD4hbCW+a5b1NIaIZ66iCX6C1YzV+SJN+WXHnuLBiPhl+Z2ZjdTkCdDRC3aTezc=" moz-do-not-send="true">https://www.asipto.com/sw/kamailio-advanced-training-online/</a></pre>
        </div>
      </div>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla -- <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a>
Kamailio Advanced Training - Online: June 20-23, 2022
  * <a class="moz-txt-link-freetext" href="https://www.asipto.com/sw/kamailio-advanced-training-online/">https://www.asipto.com/sw/kamailio-advanced-training-online/</a></pre>
  </body>
</html>