Thanks Daniel.<div><br></div><div>I  found your posting four years ago about saving one contact per user</div><div><br></div><div><a href="http://lists.kamailio.org/pipermail/devel/2008-October/016273.html">http://lists.kamailio.org/pipermail/devel/2008-October/016273.html</a></div>
<div> </div><div><br></div><div>and used save(&quot;location&quot;, &quot;0x04&quot;). However, I noticed a problem with this.</div><div>The contact is not storing in the memory. Whenever there is a Reregistration </div><div>
happening, the contact is briefly not available for routing.</div><div><br></div><div>Then I looked at the resgistrar code, I am befuddled. </div><div><br></div><div>-- code snippet:</div><div><br></div><div><div>/*! \brief</div>
<div> * Wrapper to save(location)</div><div> */</div><div>static int w_save(struct sip_msg* _m, char* _d, char* _cflags)</div><div>{</div><div>        return save(_m, (udomain_t*)_d, ((int)(unsigned long)_cflags));</div><div>
}</div></div><div><br></div><div>The string &quot;0x04&quot; looks like getting type-casted to long. </div><div><br></div><div>Krish Kura</div><div><br></div><div><br><div class="gmail_quote">On Thu, Mar 22, 2012 at 11:11 AM, Daniel-Constantin Mierla <span dir="ltr">&lt;<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>&gt;</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">
    Hello,<br>
    <br>
    if you don&#39;t use the other contacts, then might be simpler to just
    store one contact per AoR (which will be from last registration) --
    see save(...) second parameter flags.<br>
    <br>
    Don&#39;t remember by hart, but registrar or usrloc has a parameter to
    control whether to add or not additional branches from a location
    lookup - check the readmeas, but I am not sure the first result is
    the most recent, you would have to test it or check the sources.<br>
    <br>
    The last coming in my mind right now would be to program it in
    config via reg_fetch_contacts() and $ulc(...).<br>
    <br>
    Cheers,<br>
    Daniel<div><div class="h5"><br>
    <br>
    On 3/22/12 4:49 PM, Krishna Kurapati wrote:
    </div></div><blockquote type="cite"><div><div class="h5">Hi,
      <div><br>
      </div>
      <div>I am trying to relay the message to the Registered user.
        However, I would like to relay only to a recent contact.</div>
      <div>In case, there are multiple contact, I do not want to relay
        to older contacts.</div>
      <div><br>
      </div>
      <div>I am using t_relay() which is currently forking the request
        to all contacts.</div>
      <div><br>
      </div>
      <div>Any other way to accomplish my need?</div>
      <div><br>
      </div>
      <div>Thanks</div>
      <div>Krish Kura</div>
      <br>
      <fieldset></fieldset>
      <br>
      </div></div><pre>_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><span class="HOEnZb"><font color="#888888">
</font></span></pre><span class="HOEnZb"><font color="#888888">
    </font></span></blockquote><span class="HOEnZb"><font color="#888888">
    <br>
    <pre cols="72">-- 
Daniel-Constantin Mierla
Kamailio Advanced Training, April 23-26, 2012, Berlin, Germany
<a href="http://www.asipto.com/index.php/kamailio-advanced-training/" target="_blank">http://www.asipto.com/index.php/kamailio-advanced-training/</a></pre>
  </font></span></div>

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