<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" id="owaParaStyle"></style>
</head>
<body style="word-wrap:break-word" fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Hi,
<div><br>
</div>
<div>waiting on implementation comments, if accepted, will document before merge</div>
<div><br>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div id="divRpF343388" style="direction: ltr;"><font face="Tahoma" size="2" color="#000000"><b>From:</b> sr-dev [sr-dev-bounces@lists.sip-router.org] on behalf of Olle E. Johansson [oej@edvina.net]<br>
<b>Sent:</b> Thursday, February 19, 2015 5:18 AM<br>
<b>To:</b> Kamailio (SER) - Development Mailing List<br>
<b>Subject:</b> Re: [sr-dev] registrar - additional features<br>
</font><br>
</div>
<div></div>
<div>I haven't seen any updates to the doc files - or did I miss them?
<div><br>
</div>
<div>/O</div>
<div><br>
<div>
<div>On 19 Feb 2015, at 14:08, Luis Azedo <<a href="mailto:luis@2600hz.com" target="_blank">luis@2600hz.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">
<div bgcolor="#FFFFFF" style="font-family:Helvetica; font-size:14px; font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px">
<div style="direction:ltr; font-family:Tahoma; font-size:10pt">Hi,
<div><br>
</div>
<div>made this commit to the pull request.</div>
<div>i think it answers all questions, comments appreciated.</div>
<div><br>
</div>
<div><br>
</div>
<div>
<p class="commit-title" style="color:rgb(33,63,77); margin:0px 0px 8px; font-size:18px; font-weight:bold; font-family:Helvetica,arial,freesans,clean,sans-serif,'Segoe UI Emoji','Segoe UI Symbol'">
registrar - match changes</p>
<div class="commit-desc" style="margin:-5px 0px 10px; color:rgb(51,51,51); font-family:Helvetica,arial,freesans,clean,sans-serif,'Segoe UI Emoji','Segoe UI Symbol'; font-size:13px; line-height:20.2222232818604px">
<pre style="overflow:visible; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; margin-top:10px; margin-bottom:10px; line-height:1.45; max-width:100%; color:rgb(89,96,99); white-space:pre-wrap; word-wrap:break-word">add param match_flags bit mask
1  callid
2  received
3  contact

add param match_return_flags - bit mask
1 add contact xavp
   in registered adds or sets into the transaction
   in reg_fetch_contacts adds to plc structure

changes to registered
check the match_flags bit mask value
and tries to find correspondent field in xavp_cfg
matches with the fields found

also looks for match_flags, match_return_flags in xavp_cfg to override the params

preserves existing behaviour
removes reg_callid_avp</pre>
<pre style="overflow:visible; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; margin-top:10px; margin-bottom:10px; line-height:1.45; max-width:100%; color:rgb(89,96,99); white-space:pre-wrap; word-wrap:break-word"><br></pre>
</div>
<div style="font-family:'Times New Roman'; font-size:16px">
<hr tabindex="-1">
<div id="divRpF670947" style="direction:ltr"><font face="Tahoma" size="2"><b>From:</b><span class="Apple-converted-space"> </span>sr-dev [<a href="mailto:sr-dev-bounces@lists.sip-router.org" target="_blank">sr-dev-bounces@lists.sip-router.org</a>] on behalf
 of Luis Azedo [<a href="mailto:luis@2600hz.com" target="_blank">luis@2600hz.com</a>]<br>
<b>Sent:</b><span class="Apple-converted-space"> </span>Wednesday, February 18, 2015 4:44 AM<br>
<b>To:</b><span class="Apple-converted-space"> </span><a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>; Kamailio (SER) - Development Mailing List<br>
<b>Subject:</b><span class="Apple-converted-space"> </span>Re: [sr-dev] registrar - additional features<br>
</font><br>
</div>
<div></div>
<div>
<div style="direction:ltr; font-family:Tahoma; font-size:10pt">Hi Daniel,
<div><br>
</div>
<div>thank you for the contribution.</div>
<div><br>
</div>
<div>see inline</div>
<div><br>
<div style="font-family:'Times New Roman'; font-size:16px">
<hr tabindex="-1">
<div id="divRpF574814" style="direction:ltr"><font face="Tahoma" size="2"><b>From:</b><span class="Apple-converted-space"> </span>sr-dev [<a href="mailto:sr-dev-bounces@lists.sip-router.org" target="_blank">sr-dev-bounces@lists.sip-router.org</a>] on behalf
 of Daniel-Constantin Mierla [<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>]<br>
<b>Sent:</b><span class="Apple-converted-space"> </span>Wednesday, February 18, 2015 3:51 AM<br>
<b>To:</b><span class="Apple-converted-space"> </span>Kamailio (SER) - Development Mailing List<br>
<b>Subject:</b><span class="Apple-converted-space"> </span>Re: [sr-dev] registrar - additional features<br>
</font><br>
</div>
<div></div>
<div>Hello,<br>
<br>
some comments inline.<br>
<br>
<div class="moz-cite-prefix">On 17/02/15 23:25, Luis Azedo wrote:<br>
</div>
<blockquote type="cite">
<div style="direction:ltr; font-family:Tahoma; font-size:10pt">Hi,
<div><br>
</div>
<div>please consider the addition of these features to master branch.</div>
<div><br>
</div>
<div>you can view the full PR in <a class="moz-txt-link-freetext" href="https://github.com/kamailio/kamailio/pull/91" target="_blank">https://github.com/kamailio/kamailio/pull/91</a></div>
<div><br>
</div>
<div>the purpose of these additional features is to provide better information to configuration script to help in complex routing decisions and adding custom headers based on rich information. </div>
<div><br>
</div>
<div><span>registrar - add user xavp on successful registered call</span></div>
<div><br>
</div>
<div>this commit adds the contact xavp when we call registered()</div>
<div>it acts like lookup without rewriting uri or appending branches</div>
<div>it acts like lookup_to_dest without appending branches</div>
<div><br>
</div>
<div>benefits, used in conjuction with usrloc param xavp_contact</div>
<div>prior to this commit, we would have to use sqlops to make a select directly into location_attrs, but not all sb engines support raw query or we would need to call lookup causing the unnecessary and unwanted set of the ruri.</div>
<div><br>
</div>
<div>modparam("usrloc", "xavp_contact", "ulattrs")</div>
<div>..</div>
<div>if(registered("location", "$fu") ) {</div>
<div>   $xavp(ulattrs=>my extended information about the contact)</div>
<div>}</div>
<div><br>
</div>
<div>before</div>
<div><span style="font-size:13.3333330154419px">if( registered("location", "$fu") ) {</span></div>
<div><span style="font-size:13.3333330154419px">##    lookup_to_dset(</span><span style="font-size:13.3333330154419px">"location", "$fu") ## not available</span></div>
<div><span style="font-size:13.3333330154419px">    lookup("location", "$fu")</span></div>
<div style="font-size:13.3333330154419px">   $xavp(ulattrs=>my extended information about the contact)</div>
</div>
</blockquote>
<br>
will this add the xavp only for first valid contact found in location table? Or for all contacts (e.g., when a user is registered with many phones)?<br>
<br>
A : it will add the xavp for the first contact found since registered function exits on first match.<br>
<br>
<blockquote type="cite">
<div style="direction:ltr; font-family:Tahoma; font-size:10pt">
<div>
<p class="commit-title" style="color:rgb(33,63,77); margin-right:0px; margin-bottom:8px; margin-left:0px; font-size:18px; font-weight:bold; font-family:Helvetica,arial,freesans,clean,sans-serif,'Segoe UI Emoji','Segoe UI Symbol'">
registrar - add optional avp params for usrloc comparison</p>
<div class="commit-desc">
<pre style="overflow:visible; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; margin-top:10px; margin-bottom:10px; line-height:1.45; max-width:100%; color:rgb(89,96,99); white-space:pre-wrap; word-wrap:break-word">reg_received_avp - match with received field
reg_contact_avp - match with contact field</pre>
</div>
</div>
<div><br>
</div>
<div>this commit adds 2 optional params to be used on the registered function</div>
<div><br>
</div>
<div>prior to this commit, the only restriction available when calling registered was by using a call-id.</div>
<div>the 2 params added allow the match to be more restrictive</div>
<div>. by received column</div>
<div>. by contact column</div>
</div>
</blockquote>
<br>
I see that the match on call-id was added by Henning back in 2008, haven't used it.<br>
<br>
My concern here is about adding too many avps parameters which can endup in loops across the list of avps to see if they are defined or not.<br>
<br>
I am thinking of having a different implementation that is better in terms of performances and flexibility, like:<br>
- extend the registered parameters to take one more as flags - here will be a bitmask of what matching rules to be applied (e.g., 1 - callid matching, 2 - received matching, 4 - contact matching)<br>
- add the values for matching as part of xavp_cfg avp (e.g., say xavp_cfg is set to 'reg', then will be $xavp(reg=>match_callid) = "..."; $xavp(reg=>match_received) = "..." ...)<br>
<br>
Practically the search for the values to be match will be done only if the appropriate flag is set.<br>
<br>
The avp for matching call id should be removed.<br>
<br>
In the future, adding another matching rule will be adding a new flag and an inner attribute/value for xavp_cfg.<br>
<br>
What do you think?<br>
<br>
A : i like this approach. trying that.<br>
<blockquote type="cite">
<div style="direction:ltr; font-family:Tahoma; font-size:10pt">
<div><br>
</div>
<br>
<div>
<p class="commit-title" style="color:rgb(33,63,77); margin-right:0px; margin-bottom:8px; margin-left:0px; font-size:18px; font-weight:bold; font-family:Helvetica,arial,freesans,clean,sans-serif,'Segoe UI Emoji','Segoe UI Symbol'">
registrar - add xavp to reg_fetch_contacts</p>
<div class="commit-desc" style="margin:-5px 0px 10px">
<pre style="color:rgb(89,96,99); font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; font-size:13px; line-height:1.45; overflow:visible; margin-top:10px; margin-bottom:10px; max-width:100%; white-space:pre-wrap; word-wrap:break-word">modparams("usrloc", "xavp_contact", "ulattrs");

</pre>
<pre style="color:rgb(89,96,99); font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; font-size:13px; line-height:1.45; overflow:visible; margin-top:10px; margin-bottom:10px; max-width:100%; white-space:pre-wrap; word-wrap:break-word">this commit adds the usrloc <span style="font-family:Tahoma; font-size:13.3333330154419px; line-height:normal; white-space:normal">xavp_contact to the returned structure.</span></pre>
<pre style="overflow:visible; margin-top:10px; margin-bottom:10px; max-width:100%; word-wrap:break-word">reg_fetch_contacts("location", "$fu", "caller");
xlog("L_INFO", "$fu xavp = $ulc(caller=>received)");
xlog("L_INFO", "$fu xavp = $ulc(caller=>ulattrs=>MyExtendedInfoOnUser)");</pre>
</div>
</div>
</div>
</blockquote>
<br>
I think this can be done also conditionally -- I would add a new parameter to reg_fetch_contacts where we can specify this behaviour as a flag.<br>
<br>
A : instead of a parameter, we could add a parameter "return_xavp_on_match" (or better naming) that would control the addition of the xavp in registered and reg_fetch_contacts.</div>
<div>      in reg_fetch_contacts the xavp is returned for each contact (not like in registered). </div>
<div>      i added it since we are already doing it in the lookup and lookup_to_dset.<br>
<br>
Thanks for these contributions and let's see if others have other ideas or commends on my proposal to get to a solution that is fair from performance/feature ratio point of view.<br>
<br>
Cheers,<br>
Daniel<br>
<pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a class="moz-txt-link-freetext" href="http://twitter.com/#!/miconda" target="_blank">http://twitter.com/#!/miconda</a> - <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda" target="_blank">http://www.linkedin.com/in/miconda</a>
Kamailio World Conference, May 27-29, 2015
Berlin, Germany - <a class="moz-txt-link-freetext" href="http://www.kamailioworld.com/" target="_blank">http://www.kamailioworld.com</a></pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
_______________________________________________<br>
sr-dev mailing list<br>
<a href="mailto:sr-dev@lists.sip-router.org" target="_blank">sr-dev@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev</a><br>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
</div>
</body>
</html>