<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <font face="monospace">Denis,<br>
      <br>
      I do not see any unicode chars to be present in the received
      contact URIs. What you see in the dlg_list output looks like
      garbage to me - maybe the update was not properly done and the len
      of the contact is longer than the actual value, leading to to
      memory garbage to be printed (printing out of buffer).<br>
      <br>
      Do you use from script any functions that may change the contact,
      like fix_nated_contact() or so ?<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 24.02.2024 05:35, Denis Lyubimov
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAEdpvTuKV2MQqm9QemFOrrHYravLZJ7D+D5HedQMvQLdN3e9Sg@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">Hi,<br>
        <br>
        I will put here an example of what I get in caller_contact with
        re-INVITE.<br>
        <br>
        This is incoming INVITE:<br>
        ------------------------<br>
        INVITE <a href="mailto:sip%3A7654321@192.168.224.50"
          moz-do-not-send="true">sip:7654321@192.168.224.50</a>;transport=tcp
        SIP/2.0<br>
        Via: SIP/2.0/TCP
172.17.17.55:49677;rport;branch=z9hG4bKPj0c5e8cf59ad645119867f42d06c77a9f;alias<br>
        Max-Forwards: 70<br>
        From: <<a href="mailto:sip%3A1002@192.168.224.50"
          moz-do-not-send="true">sip:1002@192.168.224.50</a>>;tag=b8b13e3376954c7dbaff8da68ee1d44a<br>
        To: <<a href="mailto:sip%3A7654321@192.168.224.50"
          moz-do-not-send="true">sip:7654321@192.168.224.50</a>><br>
        Contact: <a class="moz-txt-link-rfc2396E" href="sip:1002@172.17.17.55:49677;transport=TCP;ob"><sip:1002@172.17.17.55:49677;transport=TCP;ob></a><br>
        Call-ID: 5e97161dba344eeeab00d40bc883e4e3<br>
        CSeq: 17799 INVITE<br>
        Route: <a class="moz-txt-link-rfc2396E" href="sip:4.4.4.2;transport=tcp;lr"><sip:4.4.4.2;transport=tcp;lr></a><br>
        ....<br>
        ------------------------<br>
        This is forwarded INVITE:<br>
        ------------------------<br>
        INVITE <a href="mailto:sip%3A7654321@192.168.224.50"
          moz-do-not-send="true">sip:7654321@192.168.224.50</a>;transport=tcp
        SIP/2.0<br>
        Record-Route:
<<a class="moz-txt-link-freetext" href="sip:192.168.224.91:5090;transport=tcp;r2=on;lr;ftag=b8b13e3376954c7dbaff8da">sip:192.168.224.91:5090;transport=tcp;r2=on;lr;ftag=b8b13e3376954c7dbaff8da</a><br>
        68ee1d44a;nat=yes;did=61f.b845fdd7><br>
        Record-Route:
<<a class="moz-txt-link-freetext" href="sip:4.4.4.2:5060;transport=tcp;r2=on;lr;ftag=b8b13e3376954c7dbaff8da68ee1d4">sip:4.4.4.2:5060;transport=tcp;r2=on;lr;ftag=b8b13e3376954c7dbaff8da68ee1d4</a><br>
        4a;nat=yes;did=61f.b845fdd7><br>
        Via: SIP/2.0/TCP
        192.168.224.91:5090;branch=z9hG4bK86c6.385ee382.0;i=a51f1803<br>
        Via: SIP/2.0/TCP
172.17.17.55:49677;received=4.4.4.1;rport=49677;branch=z9hG4bKPj0c5e8cf59<br>
        ad645119867f42d06c77a9f;alias<br>
        Max-Forwards: 69<br>
        From: <<a href="mailto:sip%3A1002@192.168.224.50"
          moz-do-not-send="true">sip:1002@192.168.224.50</a>>;tag=b8b13e3376954c7dbaff8da68ee1d44a<br>
        To: <<a href="mailto:sip%3A7654321@192.168.224.50"
          moz-do-not-send="true">sip:7654321@192.168.224.50</a>><br>
        Contact: <a class="moz-txt-link-rfc2396E" href="sip:1002@4.4.4.1:49677;transport=TCP;ob"><sip:1002@4.4.4.1:49677;transport=TCP;ob></a><br>
        Call-ID: 5e97161dba344eeeab00d40bc883e4e3<br>
        CSeq: 17799 INVITE<br>
        ...<br>
        ------------------------<br>
        dlg_list:<br>
        ------------------------<br>
        {<br>
            "Dialogs": [<br>
                {<br>
                    "ID": "61f.b845fdd7",<br>
                    "db_id": "16589275485323",<br>
                    "state": 4,<br>
                    "user_flags": "DISPATCHED_FLG",<br>
                    "timestart": 1708744350,<br>
                    "datestart": "2024-02-24 06:12:30",<br>
                    "timeout": 1708787549,<br>
                    "dateout": "2024-02-24 18:12:29",<br>
                    "callid": "5e97161dba344eeeab00d40bc883e4e3",<br>
                    "from_uri": "<a
          href="mailto:sip%3A1002@192.168.224.50" moz-do-not-send="true">sip:1002@192.168.224.50</a>",<br>
                    "to_uri": "<a
          href="mailto:sip%3A7654321@192.168.224.50"
          moz-do-not-send="true">sip:7654321@192.168.224.50</a>",<br>
                    "caller_tag": "b8b13e3376954c7dbaff8da68ee1d44a",<br>
                    "caller_contact":
        <a class="moz-txt-link-rfc2396E" href="sip:1002@4.4.4.1:49677;transport=TCP;ob">"sip:1002@4.4.4.1:49677;transport=TCP;ob"</a>,<br>
                    "callee_cseq": "0",<br>
                    ...<br>
        ------------------------<br>
        For now caller_contact has the value
        <a class="moz-txt-link-rfc2396E" href="sip:1002@4.4.4.1:49677;transport=TCP;ob">"sip:1002@4.4.4.1:49677;transport=TCP;ob"</a>.<br>
        <br>
        <br>
        Then i do re-INVITE from caller:<br>
        ------------------------<br>
        INVITE <a class="moz-txt-link-freetext" href="sip:192.168.224.50:5060;transport=tcp">sip:192.168.224.50:5060;transport=tcp</a> SIP/2.0<br>
        Via: SIP/2.0/TCP
172.17.17.55:49677;rport;branch=z9hG4bKPjdfcc1bcad866428c8d43d1fbcfeaba54;alias<br>
        Max-Forwards: 70<br>
        From: <<a href="mailto:sip%3A1002@192.168.224.50"
          moz-do-not-send="true">sip:1002@192.168.224.50</a>>;tag=b8b13e3376954c7dbaff8da68ee1d44a<br>
        To: <<a href="mailto:sip%3A7654321@192.168.224.50"
          moz-do-not-send="true">sip:7654321@192.168.224.50</a>>;tag=008162B2-5CFB-15D9-810C-32E0A8C0AA77-3<br>
        Contact: <a class="moz-txt-link-rfc2396E" href="sip:1002@172.17.17.55:49677;transport=TCP;ob"><sip:1002@172.17.17.55:49677;transport=TCP;ob></a><br>
        Call-ID: 5e97161dba344eeeab00d40bc883e4e3<br>
        CSeq: 17800 INVITE<br>
        ...<br>
        ------------------------<br>
        forwarded re-INVITE:<br>
        ------------------------<br>
        INVITE <a class="moz-txt-link-freetext" href="sip:192.168.224.50:5060;transport=tcp">sip:192.168.224.50:5060;transport=tcp</a> SIP/2.0<br>
        Via: SIP/2.0/TCP
        192.168.224.91:5090;branch=z9hG4bKbb97.f5810342.0;i=a51f1803<br>
        Via: SIP/2.0/TCP
172.17.17.55:49677;received=4.4.4.1;rport=49677;branch=z9hG4bKPjdfcc1bcad<br>
        866428c8d43d1fbcfeaba54;alias<br>
        Max-Forwards: 69<br>
        From: <<a href="mailto:sip%3A1002@192.168.224.50"
          moz-do-not-send="true">sip:1002@192.168.224.50</a>>;tag=b8b13e3376954c7dbaff8da68ee1d44a<br>
        To: <<a href="mailto:sip%3A7654321@192.168.224.50"
          moz-do-not-send="true">sip:7654321@192.168.224.50</a>>;tag=008162B2-5CFB-15D9-810C-32E0A8C0AA77-3<br>
        Contact: <a class="moz-txt-link-rfc2396E" href="sip:1002@4.4.4.1:49677;transport=TCP;ob"><sip:1002@4.4.4.1:49677;transport=TCP;ob></a><br>
        Call-ID: 5e97161dba344eeeab00d40bc883e4e3<br>
        CSeq: 17800 INVITE<br>
        ...<br>
        ------------------------<br>
        dlg_list:<br>
        ------------------------<br>
        {<br>
            "Dialogs": [<br>
                {<br>
                    "ID": "61f.b845fdd7",<br>
                    "db_id": "16589275485323",<br>
                    "state": 4,<br>
                    "user_flags": "DISPATCHED_FLG",<br>
                    "timestart": 1708744350,<br>
                    "datestart": "2024-02-24 06:12:30",<br>
                    "timeout": 1708787549,<br>
                    "dateout": "2024-02-24 18:12:29",<br>
                    "callid": "5e97161dba344eeeab00d40bc883e4e3",<br>
                    "from_uri": "<a
          href="mailto:sip%3A1002@192.168.224.50" moz-do-not-send="true">sip:1002@192.168.224.50</a>",<br>
                    "to_uri": "<a
          href="mailto:sip%3A7654321@192.168.224.50"
          moz-do-not-send="true">sip:7654321@192.168.224.50</a>",<br>
                    "caller_tag": "b8b13e3376954c7dbaff8da68ee1d44a",<br>
                    "caller_contact": "<a
          href="mailto:sip%3A1002@4.4.4.1" moz-do-not-send="true">sip:1002@4.4.4.1</a>\ufffd",<br>
                    "callee_cseq": "0",<br>
        ...<br>
        }<br>
        ------------------------<br>
        Now caller_contact has the value "<a
          href="mailto:sip%3A1002@4.4.4.1" moz-do-not-send="true">sip:1002@4.4.4.1</a>\ufffd".<br>
        <br>
        If i do re-INVITE from callee side:<br>
        ------------------------<br>
        INVITE <a class="moz-txt-link-freetext" href="sip:1002@4.4.4.1:49677;transport=TCP;ob">sip:1002@4.4.4.1:49677;transport=TCP;ob</a> SIP/2.0<br>
        From: <<a href="mailto:sip%3A7654321@192.168.224.50"
          moz-do-not-send="true">sip:7654321@192.168.224.50</a>>;tag=008162B2-5CFB-15D9-810C-32E0A8C0AA77-3<br>
        To: <<a href="mailto:sip%3A1002@192.168.224.50"
          moz-do-not-send="true">sip:1002@192.168.224.50</a>>;tag=b8b13e3376954c7dbaff8da68ee1d44a<br>
        Call-ID: 5e97161dba344eeeab00d40bc883e4e3<br>
        CSeq: 1 INVITE<br>
        Content-Length: 310<br>
        Content-Type: application/sdp<br>
        Via: SIP/2.0/TCP
        192.168.224.50:5060;branch=z9hG4bK008162BC-5CFB-15D9-810C-32E0A8C0AA77-7<br>
        Contact: <a class="moz-txt-link-rfc2396E" href="sip:192.168.224.50:5060;transport=tcp"><sip:192.168.224.50:5060;transport=tcp></a><br>
        ------------------------<br>
        forwarded re-INVITE:<br>
        ------------------------<br>
        INVITE <a class="moz-txt-link-freetext" href="sip:1002@4.4.4.1:49677;transport=TCP;ob">sip:1002@4.4.4.1:49677;transport=TCP;ob</a> SIP/2.0<br>
        From: <<a href="mailto:sip%3A7654321@192.168.224.50"
          moz-do-not-send="true">sip:7654321@192.168.224.50</a>>;tag=008162B2-5CFB-15D9-810C-32E0A8C0AA77-3<br>
        To: <<a href="mailto:sip%3A1002@192.168.224.50"
          moz-do-not-send="true">sip:1002@192.168.224.50</a>>;tag=b8b13e3376954c7dbaff8da68ee1d44a<br>
        Call-ID: 5e97161dba344eeeab00d40bc883e4e3<br>
        CSeq: 1 INVITE<br>
        Content-Length: 302<br>
        Content-Type: application/sdp<br>
        Via: SIP/2.0/TCP
        4.4.4.2:5060;branch=z9hG4bKd4ff.c838c3a3.0;i=881f1803<br>
        Via: SIP/2.0/TCP
192.168.224.50:5060;rport=36702;received=192.168.224.50;branch=z9hG4bK008162BC-5CFB-15D9-810C-32E0A8C0AA77-7<br>
        Contact: <a class="moz-txt-link-rfc2396E" href="sip:192.168.224.50:5060;transport=tcp"><sip:192.168.224.50:5060;transport=tcp></a><br>
        ------------------------<br>
        dlg_list<br>
        ------------------------<br>
        {<br>
            "Dialogs": [<br>
                {<br>
                    "ID": "61f.b845fdd7",<br>
                    "db_id": "16589275485323",<br>
                    "state": 4,<br>
                    "user_flags": "DISPATCHED_FLG",<br>
                    "timestart": 1708744350,<br>
                    "datestart": "2024-02-24 06:12:30",<br>
                    "timeout": 1708787549,<br>
                    "dateout": "2024-02-24 18:12:29",<br>
                    "callid": "5e97161dba344eeeab00d40bc883e4e3",<br>
                    "from_uri": "<a
          href="mailto:sip%3A1002@192.168.224.50" moz-do-not-send="true">sip:1002@192.168.224.50</a>",<br>
                    "to_uri": "<a
          href="mailto:sip%3A7654321@192.168.224.50"
          moz-do-not-send="true">sip:7654321@192.168.224.50</a>",<br>
                    "caller_tag": "b8b13e3376954c7dbaff8da68ee1d44a",<br>
                    "caller_contact":
        <a class="moz-txt-link-rfc2396E" href="sip:1002@4.4.4.1:49677;transport=TCP;ob">"sip:1002@4.4.4.1:49677;transport=TCP;ob"</a>,<br>
                    "callee_cseq": "2",<br>
        ...<br>
        ------------------------<br>
        caller_contact value in dlg_list starts to look like it should
        be: <a class="moz-txt-link-rfc2396E" href="sip:1002@4.4.4.1:49677;transport=TCP;ob">"sip:1002@4.4.4.1:49677;transport=TCP;ob"</a> .</div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">пт, 23 февр. 2024 г. в 14:59,
          Bogdan-Andrei Iancu <<a href="mailto:bogdan@opensips.org"
            moz-do-not-send="true" class="moz-txt-link-freetext">bogdan@opensips.org</a>>:<br>
        </div>
        <blockquote class="gmail_quote"
style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
          <div> <font face="monospace">Hi Denis,<br>
              <br>
              Could post the actual Contact hdr as received (network
              level like pcap or trace) by OpenSIPS from both caller and
              callee parties ?<br>
              <br>
              Regards<br>
            </font>
            <pre cols="72">Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  <a href="https://www.opensips-solutions.com" target="_blank"
            moz-do-not-send="true" class="moz-txt-link-freetext">https://www.opensips-solutions.com</a>
  <a href="https://www.siphub.com" target="_blank"
            moz-do-not-send="true" class="moz-txt-link-freetext">https://www.siphub.com</a></pre>
            <div>On 22.02.2024 07:34, Denis Lyubimov wrote:<br>
            </div>
            <blockquote type="cite">
              <div dir="ltr">
                <div>Hi all,<br>
                  <br>
                  My network scheme is <br>
                  softphone <-nat-external network-nat-> opensips
                  <-local network-> sip servers <-local
                  network-> softphone<br>
                  No b2b or topology_hiding modules are used.<br>
                </div>
                <div>Opensips versions I tried: 3.4.4-1 and 3.4.3-1.</div>
                <div><br>
                  I make a call from a phone behind nat to sip server
                  via opensips, so I use the fix_contact function from
                  nat_traversal/fix_nated_contact from nathelper for
                  each request.<br>
                  On the first invite I get "caller_contact": <a
                    moz-do-not-send="true">"sip:1002@3.3.3.1:49682;transport=TCP;ob"</a>
                  in "opensips-cli -x mi dlg_list".<br>
                  If caller side makes re-invite, then i see this
                  "caller_contact": "\u0001" for nat_traversal, <br>
                  and this "caller_contact": "<a
                    href="mailto:sip%3A1002@3.3.3.1" target="_blank"
                    moz-do-not-send="true">sip:1002@3.3.3.1</a>\ufffd"
                  with nathelper in dlg_list.<br>
                  In that case dlg_send_sequential mi dialog function
                  cannot be used cause caller contact cannot be read.<br>
                  <br>
                  Also if i make a re-invite from the caller side then
                  the caller_contact field in dlg_list starts looking
                  normal.<br>
                  <br>
                  Am I doing something wrong with fixing the nated
                  contact field?<br>
                  <br>
                </div>
              </div>
              <br>
              <fieldset></fieldset>
              <pre>_______________________________________________
Users mailing list
<a href="mailto:Users@lists.opensips.org" target="_blank"
              moz-do-not-send="true" class="moz-txt-link-freetext">Users@lists.opensips.org</a>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"
              target="_blank" moz-do-not-send="true"
              class="moz-txt-link-freetext">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
            </blockquote>
            <br>
          </div>
        </blockquote>
      </div>
    </blockquote>
    <br>
  </body>
</html>