<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
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
cite="mid:6FFC6465A51B5B4C80DD111E16112FD1C7C8F8@mbx022-w1-ca-4.exch022.domain.local"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<style type="text/css" id="owaParaStyle"></style>
<div style="direction: ltr;font-family: Tahoma;color:
#000000;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">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 style="color: rgb(33, 63, 77); font-family:
Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI
Emoji', 'Segoe UI Symbol'; font-size: 18px; font-weight:
bold; line-height: 28.0000019073486px; background-color:
rgb(230, 241, 246);">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>
<br>
<blockquote
cite="mid:6FFC6465A51B5B4C80DD111E16112FD1C7C8F8@mbx022-w1-ca-4.exch022.domain.local"
type="cite">
<div style="direction: ltr;font-family: Tahoma;color:
#000000;font-size: 10pt;">
<div>
<p class="commit-title" style="box-sizing: border-box; color:
rgb(33, 63, 77); margin-right: 0px; margin-bottom: 8px;
margin-left: 0px; font-size: 18px; font-weight: bold;
text-shadow: rgba(255, 255, 255, 0.498039) 0px 1px;
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" style="box-sizing: border-box;
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="box-sizing: border-box; overflow: visible; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin-top: 10px; margin-bottom: 10px; font-stretch: normal; line-height: 1.45; max-width: 100%; color: rgb(89, 96, 99); white-space: pre-wrap; text-shadow: rgba(255, 255, 255, 0.498039) 0px 1px; 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>
<blockquote
cite="mid:6FFC6465A51B5B4C80DD111E16112FD1C7C8F8@mbx022-w1-ca-4.exch022.domain.local"
type="cite">
<div style="direction: ltr;font-family: Tahoma;color:
#000000;font-size: 10pt;">
<div><br>
</div>
<br>
<div>
<p class="commit-title" style="box-sizing: border-box; color:
rgb(33, 63, 77); margin-right: 0px; margin-bottom: 8px;
margin-left: 0px; font-size: 18px; font-weight: bold;
text-shadow: rgba(255, 255, 255, 0.498039) 0px 1px;
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="box-sizing: border-box;
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; box-sizing: border-box; overflow: visible; margin-top: 10px; margin-bottom: 10px; font-stretch: normal; max-width: 100%; white-space: pre-wrap; text-shadow: rgba(255, 255, 255, 0.498039) 0px 1px; 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; box-sizing: border-box; overflow: visible; margin-top: 10px; margin-bottom: 10px; font-stretch: normal; max-width: 100%; white-space: pre-wrap; text-shadow: rgba(255, 255, 255, 0.498039) 0px 1px; word-wrap: break-word;">this commit adds the usrloc <span style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 13.3333330154419px; line-height: normal; white-space: normal;">xavp_contact to the returned structure.</span></pre>
<pre style="box-sizing: border-box; overflow: visible; margin-top: 10px; margin-bottom: 10px; font-stretch: normal; max-width: 100%; text-shadow: rgba(255, 255, 255, 0.498039) 0px 1px; 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>
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">http://twitter.com/#!/miconda</a> - <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">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">http://www.kamailioworld.com</a></pre>
</body>
</html>