<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <tt>Hi Igor,<br>
      <br>
      What contact matching algorithm do you use ?<br>
         
<a class="moz-txt-link-freetext" href="http://www.opensips.org/html/docs/modules/1.10.x/usrloc.html#matching-mode">http://www.opensips.org/html/docs/modules/1.10.x/usrloc.html#matching-mode</a><br>
      <br>
      Regards,<br>
    </tt>
    <pre class="moz-signature" cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
    <div class="moz-cite-prefix">On 21.07.2015 22:28, Игорь Павлов
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAB4NPKy2NOJ4f4T7_tvou_BaHYr3Ag=VwbT8aNVZKQ4OCtRhkg@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hi all. We have a problem with USRLOC, we are using
        write-back scheme with 90 seconds timer_interval. In location
        table presents expired contacts like this:
        <div><br>
        </div>
        <div>
          <table style="border-collapse:collapse;width:842pt"
            width="1123" cellpadding="0" cellspacing="0" border="0">
            <colgroup><col style="width:58pt" width="77"> <col
                style="width:163pt" width="217"> <col
                style="width:80pt" width="107"> <col style="width:48pt"
                width="64"> <col style="width:278pt" width="371"> <col
                style="width:107pt" width="143"> <col
                style="width:108pt" width="144"> </colgroup><tbody>
              <tr style="height:15pt" height="20">
                <td style="height:15pt;width:58pt" height="20"
                  width="77">username</td>
                <td style="width:163pt" width="217">contact</td>
                <td style="width:80pt" width="107">expires</td>
                <td style="width:48pt" width="64">q</td>
                <td style="width:278pt" width="371">callid</td>
                <td style="width:107pt" width="143">user_agent</td>
                <td style="width:108pt" width="144">socket</td>
              </tr>
              <tr style="height:15pt" height="20">
                <td style="height:15pt" height="20" align="right">10271225 </td>
                <td> <a moz-do-not-send="true"
                    href="http://sip:10271225@192.168.0.100:5060">sip:10271225@192.168.0.100:5060</a></td>
                <td class="" align="right">17.07.2015 17:44</td>
                <td>-1.00</td>
                <td><a moz-do-not-send="true"
                    href="mailto:000AD87F-8E28-E511-95FA-ED5AA7718DC4@79.120.58.194">000AD87F-8E28-E511-95FA-ED5AA7718DC4@79.120.58.194</a></td>
                <td>SIPPER for PhonerLite</td>
                <td>udp:<a moz-do-not-send="true"
                    href="http://192.168.0.5:5060">192.168.0.5:5060</a></td>
              </tr>
              <tr style="height:15pt" height="20">
                <td style="height:15pt" height="20" align="right">10271225 </td>
                <td><a moz-do-not-send="true"
                    href="http://sip:10271225@192.168.0.100:5060">sip:10271225@192.168.0.100:5060</a></td>
                <td class="" align="right">16.07.2015 15:39</td>
                <td>-1.00</td>
                <td><a moz-do-not-send="true"
                    href="mailto:0018FF86-8E28-E511-B071-73FCC3C39125@79.120.58.194">0018FF86-8E28-E511-B071-73FCC3C39125@79.120.58.194</a></td>
                <td>SIPPER for PhonerLite</td>
                <td>udp:<a moz-do-not-send="true"
                    href="http://192.168.0.5:5060">192.168.0.5:5060</a></td>
              </tr>
              <tr style="height:15pt" height="20">
                <td style="height:15pt" height="20" align="right">10271225 </td>
                <td><a moz-do-not-send="true"
                    href="http://sip:10271225@192.168.0.100:5060">sip:10271225@192.168.0.100:5060</a></td>
                <td class="" align="right">18.07.2015 16:01</td>
                <td>-1.00</td>
                <td><a moz-do-not-send="true"
                    href="mailto:805B93D6-8E2B-E511-B232-C3E27EBE0AEC@79.120.58.194">805B93D6-8E2B-E511-B232-C3E27EBE0AEC@79.120.58.194</a></td>
                <td>SIPPER for PhonerLite</td>
                <td>udp:<a moz-do-not-send="true"
                    href="http://192.168.0.5:5060">192.168.0.5:5060</a></td>
              </tr>
              <tr style="height:15pt" height="20">
                <td style="height:15pt" height="20" align="right">10271225 </td>
                <td><a moz-do-not-send="true"
                    href="http://sip:10271225@192.168.0.100:5060">sip:10271225@192.168.0.100:5060</a></td>
                <td class="" align="right">21.07.2015 10:00</td>
                <td>-1.00</td>
                <td><a moz-do-not-send="true"
                    href="mailto:80612236-8A2C-E511-B771-23AC57084C2D@79.120.58.194">80612236-8A2C-E511-B771-23AC57084C2D@79.120.58.194</a></td>
                <td>SIPPER for PhonerLite</td>
                <td>udp:<a moz-do-not-send="true"
                    href="http://192.168.0.5:5060">192.168.0.5:5060</a></td>
              </tr>
              <tr style="height:15pt" height="20">
                <td style="height:15pt" height="20" align="right">10271225 </td>
                <td><a moz-do-not-send="true"
                    href="http://sip:10271225@192.168.0.100:5060">sip:10271225@192.168.0.100:5060</a></td>
                <td class="" align="right">17.07.2015 9:55</td>
                <td>-1.00</td>
                <td><a moz-do-not-send="true"
                    href="mailto:807832C3-8E28-E511-AFE6-E49E9283A1CD@79.120.58.194">807832C3-8E28-E511-AFE6-E49E9283A1CD@79.120.58.194</a></td>
                <td>SIPPER for PhonerLite</td>
                <td>udp:<a moz-do-not-send="true"
                    href="http://192.168.0.5:5060">192.168.0.5:5060</a></td>
              </tr>
            </tbody>
          </table>
          <div><br>
          </div>
          <div>At same time, in syslog, I can see this:</div>
          <div><br>
          </div>
          <div>
            <div>
              <div>Jul 21 18:59:36 [37186]:
                CRITICAL:db_mysql:wrapper_single_mysql_stmt_execute:
                driver error (1062): Duplicate entry
                '10271225-domain-sip:1027</div>
              <div><a class="moz-txt-link-abbreviated" href="mailto:1225@192.168.0.100:5060-00705664-8">1225@192.168.0.100:5060-00705664-8</a>' for key
                'account_contact_idx'</div>
              <div>Jul 21 18:59:36 [37186]:
                ERROR:usrloc:db_update_ucontact: updating database
                failed</div>
              <div>Jul 21 18:59:36 [37186]: ERROR:usrloc:wb_timer:
                updating contact in db failed</div>
              <div>Jul 21 19:01:07 [37186]:
                CRITICAL:db_mysql:wrapper_single_mysql_stmt_execute:
                driver error (1062): Duplicate entry
                '10271225-domain-sip:1027</div>
              <div><a class="moz-txt-link-abbreviated" href="mailto:1225@192.168.0.100:5060-00705664-8">1225@192.168.0.100:5060-00705664-8</a>' for key
                'account_contact_idx'</div>
              <div>Jul 21 19:01:07 [37186]:
                ERROR:usrloc:db_update_ucontact: updating database
                failed</div>
              <div>Jul 21 19:01:07 [37186]: ERROR:usrloc:wb_timer:
                updating contact in db failed</div>
            </div>
            <div><br>
            </div>
            <div><br>
            </div>
            <div>
              <div class="gmail_signature">
                <div dir="ltr">____________
                  <div>Best regards,</div>
                  <div>Igor Pavlov</div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <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>