<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <font face="monospace">Hi Sasmita,<br>
      <br>
      Yes, give it a try by using the serialize_branches() and
      next_branches() functions<br>
      <br>
      Regards,</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>
    <br>
    <div class="moz-cite-prefix">On 5/5/26 10:32, Sasmita Panda via
      Users wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CALf-Q460N41B+xFmr_NCE3ZvzQmLfRuwEoniPkCOJu4EaTx9Vg@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div>Hi All , </div>
        <div><br>
        </div>
        <div>With opensips 3.4 , if I have 2 registered contacts in the
          database and I want to perform serial forking during lookup,
          even if both contacts have the same q value. </div>
        <div>Then how will I do this?</div>
        <div><br>
        </div>
        <div>serialize_branches(1, 1); </div>
        <div>Will this work?</div>
        <div><b><i><br>
            </i></b></div>
        <div>        # Serial forking: serialize branches one at a time
          regardless of q-value.<br>
                  # keep_order=1 (2nd arg) is REQUIRED when contacts
          have equal q-values</div>
        <div><br>
        </div>
        <div>This is what I found while searching for a solution.Do let
          me know , if I am in the right track or not . </div>
        <div><b><i><br>
            </i></b></div>
        <div><b><i>Thanks & Regards</i></b></div>
        <div>
          <div dir="ltr" class="gmail_signature"
            data-smartmail="gmail_signature">
            <div dir="ltr">
              <div dir="ltr">
                <div><i>Sasmita Panda</i></div>
                <div><i>Senior Network Testing and Software Engineer</i></div>
                <div><i>3CLogic , <a class="moz-txt-link-freetext" href="ph:07827611765">ph:07827611765</a></i></div>
              </div>
            </div>
          </div>
        </div>
        <br>
      </div>
      <br>
      <div class="gmail_quote gmail_quote_container">
        <div dir="ltr" class="gmail_attr">On Wed, Apr 22, 2026 at
          3:17 PM Sasmita Panda <<a href="mailto:spanda@3clogic.com"
            moz-do-not-send="true" class="moz-txt-link-freetext">spanda@3clogic.com</a>>
          wrote:<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 dir="ltr">
            <div>you mean the global parameter of registrar module .</div>
            <div>modparam("registrar", "max_contacts", 1)</div>
            <div><br>
            </div>
            <div>This will keep 1 AOR per contact. AOR is address of
              record which is the combination of user@IP (<a
                href="mailto:user@20.0.0.1" target="_blank"
                moz-do-not-send="true" class="moz-txt-link-freetext">user@20.0.0.1</a>).
              In my case for every registration the IP address changes
              with every registration. </div>
            <div>So, OpenSIPS is considering this a different AOR and is
              saving multiple contacts. </div>
            <div>
              <div dir="ltr" class="gmail_signature">
                <div dir="ltr">
                  <div>
                    <div dir="ltr"><b><i><br>
                        </i></b></div>
                    <div dir="ltr"><b><i><br>
                        </i></b></div>
                    <div dir="ltr"><b><i>Thanks & Regards</i></b>
                      <div><i>Sasmita Panda</i></div>
                      <div><i>Senior Network Testing and Software
                          Engineer</i></div>
                      <div><i>3CLogic , <a class="moz-txt-link-freetext" href="ph:07827611765">ph:07827611765</a></i></div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
            <br>
          </div>
          <br>
          <div class="gmail_quote">
            <div dir="ltr" class="gmail_attr">On Wed, Apr 22, 2026 at
              1:12 PM Richard Robson <<a
                href="mailto:richard@rikrobson.co.uk" target="_blank"
                moz-do-not-send="true" class="moz-txt-link-freetext">richard@rikrobson.co.uk</a>>
              wrote:<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>
                <p>Have you tried to limit the number with
                  max_contacts() parameter ? if you set the value to 1
                  it should only keep one AOR per contact. If that
                  doesn't do what you want you are going to have to set
                  up some logic to do a lookup foir a previous
                  registration and manage the contacts that way,
                  probably with a is_contact_registered function.<br>
                  <br>
                  there are plenty of optoins in the register module</p>
                <p><a
href="https://opensips.org/docs/modules/3.6.x/registrar.html"
                    target="_blank" moz-do-not-send="true"
                    class="moz-txt-link-freetext">https://opensips.org/docs/modules/3.6.x/registrar.html</a></p>
                <p><br>
                </p>
                <p>Richard</p>
                <div>On 22/04/2026 08:24, Sasmita Panda via Users wrote:<br>
                </div>
                <blockquote type="cite">
                  <div dir="ltr">
                    <div>Hi , </div>
                    <div><br>
                    </div>
                    <div>I am using opensips 3.4 .</div>
                    <div><br>
                    </div>
                    <div>While saving the contact I have called the save
                      unction as below . </div>
                    <div>               </div>
                    <div>      
                       if(!save("location","max-contacts=1,force-registration,path-lazy"))<br>
                                                sl_reply_error();</div>
                    <div><br>
                    </div>
                    <div>My requirement was to save a single contact for
                      a username. If there will be multiple
                      registration then over ride the older one with the
                      latest one . </div>
                    <div><br>
                    </div>
                    <div>After this, I can see my calls getting forked
                      between 2 contacts . I can see that the IP
                      addresses of both contacts are different, but the
                      username part is the same. </div>
                    <div>     <a href="http://user@10.0.0.1:45670"
                        target="_blank" moz-do-not-send="true">user@10.0.0.1:45670</a></div>
                    <div>     <a href="http://user@10.0.0.2:58095"
                        target="_blank" moz-do-not-send="true">user@10.0.0.2:58095</a></div>
                    <div><br>
                    </div>
                    <div>This means the system saves both contacts for
                      the user. Consequently, during lookup, it finds 2
                      contacts and simultaneously forks the call to both
                      destinations. </div>
                    <div><br>
                    </div>
                    <div>In my case, the request comes from the ALB,
                      which has a dynamic IP. Also the call id can be
                      different. If I open multiple browser tabs and
                      register the same user from both tabs, the
                      registration will originate with different IPs and
                      call IDs. </div>
                    <div><br>
                    </div>
                    <div>How I will save single contact in this case ? </div>
                    <div><br>
                    </div>
                    <div><br>
                    </div>
                    <div>
                      <div dir="ltr" class="gmail_signature">
                        <div dir="ltr">
                          <div>
                            <div dir="ltr"><b><i>Thanks & Regards</i></b>
                              <div><i>Sasmita Panda</i></div>
                              <div><i>Senior Network Testing and
                                  Software Engineer</i></div>
                              <div><i>3CLogic , <a class="moz-txt-link-freetext" href="ph:07827611765">ph:07827611765</a></i></div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </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>
              </div>
              _______________________________________________<br>
              Users mailing list<br>
              <a href="mailto:Users@lists.opensips.org" target="_blank"
                moz-do-not-send="true" class="moz-txt-link-freetext">Users@lists.opensips.org</a><br>
              <a
href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"
                rel="noreferrer" target="_blank" moz-do-not-send="true"
                class="moz-txt-link-freetext">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
            </blockquote>
          </div>
        </blockquote>
      </div>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
      <pre wrap="" class="moz-quote-pre">_______________________________________________
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>