<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>You should not delete the record only from database via a db
      client There is a rpc command to delete it, which will take care
      of removing it from memory as well as from database (depending on
      the db_mode module parameter for usrloc).</p>
    <p>Cheers,<br>
      Daniel<br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 16/01/2017 14:46, Vik Killa wrote:<br>
    </div>
    <blockquote
cite="mid:CAC-LwPN-2Ohc2hVTLG2O27HOikkovYwr+faA9+HvRK9LPUwDeQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">The record we added via RPC was first creating a
        new contact (and inserting into the db), this was working fine.
        But we found that if we cleared the database, any "updates"
        would fail. Adding that parameter caused the record to get
        inserted if an update failed (re-register)
        <div><br>
        </div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Mon, Jan 16, 2017 at 3:28 AM,
          Daniel-Constantin Mierla <span dir="ltr"><<a
              moz-do-not-send="true" href="mailto:miconda@gmail.com"
              target="_blank">miconda@gmail.com</a>></span> wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div bgcolor="#FFFFFF" text="#000000">
              <p>The record you add via rpc is creating a new contact in
                memory or it's updating an existing one?</p>
              <p>Can you dump the record after you add it over rpc and
                send it over to mailing list to see what attributes it
                has?</p>
              <p>Cheers,<br>
                Daniel<br>
              </p>
              <div>
                <div class="h5"> <br>
                  <div class="m_3741450129631270574moz-cite-prefix">On
                    14/01/2017 16:25, Vik Killa wrote:<br>
                  </div>
                  <blockquote type="cite">
                    <div dir="ltr">resolution update -- 
                      <div>we found that setting </div>
                      <div>`modparam("usrloc", "db_check_update", 1)`</div>
                      <div><br>
                      </div>
                      <div>fix the issue by inserting missing rows on
                        re-reg</div>
                      <div><br>
                      </div>
                      <div>Thanks!</div>
                      <div><br>
                      </div>
                    </div>
                    <div class="gmail_extra"><br>
                      <div class="gmail_quote">On Fri, Jan 13, 2017 at
                        9:30 AM, Vik Killa <span dir="ltr"><<a
                            moz-do-not-send="true"
                            href="mailto:vipkilla@gmail.com"
                            target="_blank">vipkilla@gmail.com</a>></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 Daniel,
                            <div>RPC flush is not setting the flag, but
                              im not sure that is where the issue is, as
                              I stated, we are not setting any
                              memory-only flags with save()</div>
                            <div><br>
                            </div>
                            <div>But here is the flush function (<span
                                style="font-size:12.8px">FL_MEM not set)</span></div>
                            <div><br>
                            </div>
                            <div>
                              <div>static void ul_rpc_flush(rpc_t* rpc,
                                void* ctx)</div>
                              <div>{</div>
                              <div><span class="m_3741450129631270574m_-2334989271566156809gmail-Apple-tab-span" style="white-space:pre-wrap">  </span>synchronize_all_udomains(0,
                                1);</div>
                              <div><span class="m_3741450129631270574m_-2334989271566156809gmail-Apple-tab-span" style="white-space:pre-wrap">  </span>return;</div>
                              <div>}</div>
                            </div>
                            <div><br>
                            </div>
                            <div>Any ideas?<br>
                              Thanks,</div>
                            <div>/V</div>
                            <div><br>
                            </div>
                          </div>
                          <div class="m_3741450129631270574HOEnZb">
                            <div class="m_3741450129631270574h5">
                              <div class="gmail_extra"><br>
                                <div class="gmail_quote">On Fri, Jan 13,
                                  2017 at 9:24 AM, Vik Killa <span
                                    dir="ltr"><<a
                                      moz-do-not-send="true"
                                      href="mailto:vipkilla@gmail.com"
                                      target="_blank">vipkilla@gmail.com</a>></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,
                                      <div>We have tried using these
                                        flags:</div>
                                      <div><br>
                                      </div>
                                      <div>save("location")<br>
                                      </div>
                                      <div>save("location", "0x00")<br>
                                      </div>
                                      <div>save("location", "0x04")<br>
                                      </div>
                                      <div>
                                        <div><br>
                                        </div>
                                        <div>And still memory does not
                                          get flushed to DB.</div>
                                        <div>I will test the RPC
                                          command.</div>
                                        <div>Thanks,</div>
                                        <div>/V</div>
                                        <div><br>
                                        </div>
                                      </div>
                                    </div>
                                    <div
                                      class="m_3741450129631270574m_-2334989271566156809HOEnZb">
                                      <div
                                        class="m_3741450129631270574m_-2334989271566156809h5">
                                        <div class="gmail_extra"><br>
                                          <div class="gmail_quote">On
                                            Fri, Jan 13, 2017 at 9:12
                                            AM, Daniel-Constantin Mierla
                                            <span dir="ltr"><<a
                                                moz-do-not-send="true"
                                                href="mailto:miconda@gmail.com"
                                                target="_blank">miconda@gmail.com</a>></span>
                                            wrote:<br>
                                            <blockquote
                                              class="gmail_quote"
                                              style="margin:0 0 0
                                              .8ex;border-left:1px #ccc
                                              solid;padding-left:1ex">
                                              <div bgcolor="#FFFFFF"
                                                text="#000000">
                                                <p>Hello,</p>
                                                <p>that flag is used to
                                                  mark a contact for
                                                  storage only in
                                                  memory. The save()
                                                  function has a
                                                  parameter with flags
                                                  where this kind of
                                                  storage can be set.
                                                  Can you check the RPC
                                                  command is setting
                                                  this flag?<br>
                                                </p>
                                                Cheers,<br>
                                                Daniel
                                                <div>
                                                  <div
class="m_3741450129631270574m_-2334989271566156809m_5458445979838186763h5"><br>
                                                    <br>
                                                    <div
class="m_3741450129631270574m_-2334989271566156809m_5458445979838186763m_4350943624076961507moz-cite-prefix">On
                                                      13/01/2017 15:06,
                                                      Vik Killa wrote:<br>
                                                    </div>
                                                  </div>
                                                </div>
                                                <blockquote type="cite">
                                                  <div>
                                                    <div
class="m_3741450129631270574m_-2334989271566156809m_5458445979838186763h5">
                                                      <div dir="ltr">following
                                                        up here
                                                        <div>i found if
                                                          we comment out
                                                          a single line
                                                          of code,
                                                          kamcmd
                                                          ul.flush works</div>
                                                        <div><br>
                                                        </div>
                                                        <div>here is the
                                                          git diff</div>
                                                        <div><br>
                                                        </div>
                                                        <div><br>
                                                        </div>
                                                        <div><br>
                                                        </div>
                                                        <div>
                                                          <div>diff
                                                          --git
                                                          a/src/modules/usrloc/ucontact.<wbr>c
b/src/modules/usrloc/ucontact.<wbr>c</div>
                                                          <div>index
                                                          47f3c2f..633ca81
                                                          100644</div>
                                                          <div>---
                                                          a/src/modules/usrloc/ucontact.<wbr>c</div>
                                                          <div>+++
                                                          b/src/modules/usrloc/ucontact.<wbr>c</div>
                                                          <div>@@ -474,7
                                                          +474,7 @@ int
db_insert_ucontact(ucontact_t* _c)</div>
                                                          <div>       
                                                          int nr_cols;</div>
                                                          <div>        </div>
                                                          <div>       
                                                          if
                                                          (_c->flags
                                                          & FL_MEM)
                                                          {</div>
                                                          <div>-        
                                                                return
                                                          0;</div>
                                                          <div>+        
                                                                //return
                                                          0;</div>
                                                          <div>        }</div>
                                                          <div>       
                                                          if(unlikely(_c->ruid.len<=0))
                                                          {</div>
                                                          <div>         
                                                               
                                                          LM_ERR("invalid
                                                          ruid for aor:
                                                          %.*s\n",</div>
                                                        </div>
                                                        <div><br>
                                                        </div>
                                                        <div><br>
                                                        </div>
                                                        <div><br>
                                                        </div>
                                                        <div><br>
                                                        </div>
                                                        <div><br>
                                                        </div>
                                                        <div>I don't
                                                          quite
                                                          understand the
                                                          logic in that
                                                          code.</div>
                                                        <div>Does anyone
                                                          have an idea
                                                          of why `      
                                                           if
                                                          (_c->flags
                                                          & FL_MEM)
                                                          {`   returns?</div>
                                                        <div><br>
                                                        </div>
                                                        <div>Thanks,</div>
                                                        <div>/V</div>
                                                        <div><br>
                                                        </div>
                                                      </div>
                                                      <div
                                                        class="gmail_extra"><br>
                                                        <div
                                                          class="gmail_quote">On
                                                          Thu, Jan 12,
                                                          2017 at 4:34
                                                          PM, Vik Killa
                                                          <span
                                                          dir="ltr"><<a
moz-do-not-send="true" href="mailto:vipkilla@gmail.com" target="_blank">vipkilla@gmail.com</a>></span>
                                                          wrote:<br>
                                                          <blockquote
                                                          class="gmail_quote"
style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                                                          <div dir="ltr">Hello,
                                                          <div>we've
                                                          noticed that
                                                          the usrloc
                                                          module does
                                                          not "sync" all
                                                          the records
                                                          from memory
                                                          into the
                                                          database.</div>
                                                          <div>I use a
                                                          bash script to
                                                          generate
                                                          in-memory AoRs
                                                          (<a
                                                          moz-do-not-send="true"
href="http://paste.debian.net/plain/908521" target="_blank">http://paste.debian.net/plain<wbr>/908521</a>)</div>
                                                          <div>then i
                                                          perform</div>
                                                          <div>kamcmd
                                                          ul.flush </div>
                                                          <div>and no
                                                          records are
                                                          inserted.</div>
                                                          <div>We have
                                                          tried various
                                                          usrloc
                                                          parameters but
                                                          none seem to
                                                          work</div>
                                                          <div>Here is
                                                          our basic
                                                          setup</div>
                                                          <div><br>
                                                          </div>
                                                          <div>
                                                          <div># -----
                                                          usrloc params
                                                          -----</div>
                                                          <div>modparam("usrloc",
                                                          "db_url",
                                                          DBURL)</div>
                                                          <div>modparam("usrloc",
                                                          "db_mode", 2)</div>
                                                          <div>modparam("usrloc",
                                                          "use_domain",
                                                          1)</div>
                                                          <div>modparam("usrloc",
"timer_interval", 120)</div>
                                                          <div>modparam("usrloc",
                                                          "timer_procs",
                                                          4)</div>
                                                          <div><br>
                                                          </div>
                                                          </div>
                                                          <div>We are
                                                          using
                                                          postgresql.</div>
                                                          <div>are we
                                                          missing
                                                          something?<br>
                                                          <br>
                                                          </div>
                                                          <div>Thanks</div>
                                                          <span
class="m_3741450129631270574m_-2334989271566156809m_5458445979838186763m_4350943624076961507HOEnZb"><font
color="#888888">
                                                          <div>/V</div>
                                                          </font></span></div>
                                                          </blockquote>
                                                        </div>
                                                        <br>
                                                      </div>
                                                      <br>
                                                      <fieldset
class="m_3741450129631270574m_-2334989271566156809m_5458445979838186763m_4350943624076961507mimeAttachmentHeader"></fieldset>
                                                      <br>
                                                    </div>
                                                  </div>
                                                  <pre>______________________________<wbr>_________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a moz-do-not-send="true" class="m_3741450129631270574m_-2334989271566156809m_5458445979838186763m_4350943624076961507moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a>
<a moz-do-not-send="true" class="m_3741450129631270574m_-2334989271566156809m_5458445979838186763m_4350943624076961507moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cg<wbr>i-bin/mailman/listinfo/sr-user<wbr>s</a><span class="m_3741450129631270574m_-2334989271566156809m_5458445979838186763HOEnZb"><font color="#888888">
</font></span></pre><span class="m_3741450129631270574m_-2334989271566156809m_5458445979838186763HOEnZb"><font color="#888888">
    </font></span></blockquote><span class="m_3741450129631270574m_-2334989271566156809m_5458445979838186763HOEnZb"><font color="#888888">
    

    <pre class="m_3741450129631270574m_-2334989271566156809m_5458445979838186763m_4350943624076961507moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a moz-do-not-send="true" class="m_3741450129631270574m_-2334989271566156809m_5458445979838186763m_4350943624076961507moz-txt-link-abbreviated" href="http://www.twitter.com/miconda" target="_blank">www.twitter.com/miconda</a> -- <a moz-do-not-send="true" class="m_3741450129631270574m_-2334989271566156809m_5458445979838186763m_4350943624076961507moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda" target="_blank">www.linkedin.com/in/miconda</a>
Kamailio World Conference - May 8-10, 2017 - <a moz-do-not-send="true" class="m_3741450129631270574m_-2334989271566156809m_5458445979838186763m_4350943624076961507moz-txt-link-abbreviated" href="http://www.kamailioworld.com" target="_blank">www.kamailioworld.com</a></pre>
  </font></span></div>


______________________________<wbr>_________________

SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list

<a moz-do-not-send="true" href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a>

<a moz-do-not-send="true" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">http://lists.sip-router.org/cg<wbr>i-bin/mailman/listinfo/sr-user<wbr>s</a>


</blockquote></div>
</div>
</div></div></blockquote></div>
</div>
</div></div></blockquote></div>
</div>


<fieldset class="m_3741450129631270574mimeAttachmentHeader"></fieldset>
<pre>______________________________<wbr>_________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a moz-do-not-send="true" class="m_3741450129631270574moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a>
<a moz-do-not-send="true" class="m_3741450129631270574moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/<wbr>cgi-bin/mailman/listinfo/sr-<wbr>users</a>
</pre>

</blockquote>
<pre class="m_3741450129631270574moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a moz-do-not-send="true" class="m_3741450129631270574moz-txt-link-abbreviated" href="http://www.twitter.com/miconda" target="_blank">www.twitter.com/miconda</a> -- <a moz-do-not-send="true" class="m_3741450129631270574moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda" target="_blank">www.linkedin.com/in/miconda</a>
Kamailio World Conference - May 8-10, 2017 - <a moz-do-not-send="true" class="m_3741450129631270574moz-txt-link-abbreviated" href="http://www.kamailioworld.com" target="_blank">www.kamailioworld.com</a></pre></div></div></div>
______________________________<wbr>_________________

SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list

<a moz-do-not-send="true" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>

<a moz-do-not-send="true" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">http://lists.sip-router.org/<wbr>cgi-bin/mailman/listinfo/sr-<wbr>users</a>


</blockquote></div>
</div>


<fieldset class="mimeAttachmentHeader"></fieldset>
<pre wrap="">_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>

</blockquote>
<pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<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 World Conference - May 8-10, 2017 - <a class="moz-txt-link-abbreviated" href="http://www.kamailioworld.com">www.kamailioworld.com</a></pre></body></html>