<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Thanks for the patch. One note about -- use tab based indentation
for patches to existing modules, to keep the code looking coherent.
I can apply the patch and reset the formatting this time, but have
in mind for the future.<br>
<br>
Otherwise, patch looks ok.<br>
<br>
Cheers,<br>
Daniel<br>
<br>
<div class="moz-cite-prefix">On 25/08/14 15:32, Alekzander
Spiridonov wrote:<br>
</div>
<blockquote
cite="mid:CA+=mPaoKVccurDY7of+-ZRR-xZsuE0bCcbXxEr0OgejOh8OB1g@mail.gmail.com"
type="cite">
<div dir="ltr">Patch for flag parsing attached.<br>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">2014-08-22 18:48 GMT+04:00 Alekzander
Spiridonov <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:alekz@li.ru" target="_blank">alekz@li.ru</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">
<div>
<div>Ok, so at the moment src supports the following
options:<br>
if (len>1 && (str1[1]=='p' ||
str1[1]=='P'))<br>
state |= DS_PROBING_DST;<br>
if(str1[0]=='i' || str1[0]=='I')<br>
state |= DS_INACTIVE_DST;<br>
else if(str1[0]=='t' || str1[0]=='T')<br>
state |= DS_TRYING_DST;<br>
else if(str1[0]=='d' || str1[0]=='D')<br>
state = DS_DISABLED_DST;<br>
else if(str1[0]=='p' || str1[0]=='P')<br>
state = DS_INACTIVE_DST|DS_PROBING_DST;<br>
<br>
</div>
I do believe that flag still should be single letter, so
I'd suggest removing the first "if" since we still have
the last "else if". What do you think about that?<br>
<br>
</div>
Also I'd add "A" option to this list.<br>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">2014-08-22 18:26 GMT+04:00
Daniel-Constantin Mierla <span dir="ltr"><<a
moz-do-not-send="true"
href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>></span>:
<div>
<div class="h5"><br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<div> <br>
<div>On 22/08/14 13:32, Alekzander Spiridonov
wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div>
<div>
<div>One more thing I've figured out:<br>
</div>
In dispatcher module guide there is a
way to mark dst as Active, though in
src w_ds_mark_dst1 has no such option.<br>
<br>
</div>
On the other hand, w_ds_mark_dst1 has an
option to mark dst as "admin disabled"
that is not documented in the guide.<br>
<br>
</div>
Could you clarify what is the expected
behavior so I could send a fix for that.<br>
</div>
</blockquote>
<br>
</div>
The purpose of that function is to be able to
set a destination in one of supported states:<br>
<br>
- completely disabled (admin disabled) -- I
guess is 'd' -- not used and no chance to
activate it automatically upon a successful
probing request (actually no probing will be
done)<br>
- inactive state - is not used currently, but if
in probing mode, it can be activated
automatically if a probe request is answered<br>
- active state - used currently<br>
<br>
The probing mode that comes as a flag, is
related to whether to send periodically (probe)
requests to check if targets are online.<br>
<br>
Trying wasn't coded by me (iirc :-) ), but I
think the purpose was to still keep the target
in active mode until a certain number of
failures occur and then make it inactive (or
disabled).<br>
<br>
If you find discrepancies in the code, let us
know -- of course, patches are more than
welcome!<br>
<br>
Cheers,<br>
Daniel
<div>
<div><br>
<br>
<blockquote type="cite">
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">2014-08-22
13:25 GMT+04:00 Alekzander Spiridonov
<span dir="ltr"><<a
moz-do-not-send="true"
href="mailto:alekz@li.ru"
target="_blank">alekz@li.ru</a>></span>:<br>
<blockquote class="gmail_quote"
style="margin:0 0 0
.8ex;border-left:1px #ccc
solid;padding-left:1ex">
<div dir="ltr">
<div>
<div>
<div>Hi Daniel,<br>
<br>
</div>
1. Yep, had the same concern,
but somehow missed the
app_lua. Fixed as you've
described.<br>
<br>
</div>
2. Done.<br>
<br>
</div>
New patch attached.<br>
</div>
<div class="gmail_extra"> <br>
<br>
<div class="gmail_quote">2014-08-21
20:19 GMT+04:00
Daniel-Constantin Mierla <span
dir="ltr"><<a
moz-do-not-send="true"
href="mailto:miconda@gmail.com"
target="_blank">miconda@gmail.com</a>></span>:
<div>
<div><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>
thanks for sending the
patch! Two remarks for
now:<br>
<br>
1) you changed the
inter-module API
prototype for
ds_select_dst_f,
respectively:<br>
<br>
typedef int
(*ds_select_dst_f)(struct
sip_msg *msg, int set,<br>
- int alg,
int mode);<br>
+ int alg,
unsigned int limit, int
mode);<br>
<br>
I think the reason for
that function is an
export to app_lua (and
maybe other embedded
languages). With this
change, things get
broken there. I would
do:<br>
<br>
- rename the function
ds_select_dst() to
ds_select_dst_limit()<br>
- add ds_select_dst() as
a wrapper function
calling the new
ds_select_dst_limit()<br>
<br>
The API stay unchanged,
and eventually one can
add a new member for
ds_select_dst_limit()
when needed<br>
<br>
Otherwise, the change of
ds_select_dst()
prototype should involve
reviewing other modules
and seeing if people are
happy with this change,
because it breaks
existing embedded
scripts.<br>
<br>
2) You need to document
the new functions
exported to kamailio
config, in
modules/dispatcher/doc/dispatcher_admin.xml<br>
<br>
Once the patch is
overall ok, I can commit
it to the repository.<br>
<br>
Cheers,<br>
Daniel
<div>
<div><br>
<br>
<div>On 21/08/14
17:40, Alekzander
Spiridonov wrote:<br>
</div>
</div>
</div>
<blockquote type="cite">
<div>
<div>
<div dir="ltr">
<div>
<div>Hi list,<br>
<br>
</div>
I'd like to
propose a
patch that
allows user to
limit the
number of
items that
appears in
dst_avp after
ds_select_dst
or
ds_select_domain
call.<br>
<br>
</div>
There are some
use cases when
one could have
couple of dst
sets and would
like to failover
from the first
to another
without checking
all items but
have just 3 or 4
of them dead in
a row.<br>
<br>
What do you
think about
that?<br
clear="all">
<br>
-- <br>
<div>
<div>Best
regards,<br>
Alekzander
Spiridonov</div>
<br>
</div>
</div>
<br>
<fieldset></fieldset>
<br>
</div>
</div>
<pre>_______________________________________________
sr-dev mailing list
<a moz-do-not-send="true" href="mailto:sr-dev@lists.sip-router.org" target="_blank">sr-dev@lists.sip-router.org</a>
<a moz-do-not-send="true" 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><span><font color="#888888">
</font></span></pre>
<span><font
color="#888888"> </font></span></blockquote>
<span><font
color="#888888"> <br>
<pre cols="72">--
Daniel-Constantin Mierla
<a moz-do-not-send="true" href="http://twitter.com/#%21/miconda" target="_blank">http://twitter.com/#!/miconda</a> - <a moz-do-not-send="true" href="http://www.linkedin.com/in/miconda" target="_blank">http://www.linkedin.com/in/miconda</a>
Next Kamailio Advanced Trainings 2014 - <a moz-do-not-send="true" href="http://www.asipto.com" target="_blank">http://www.asipto.com</a>
Sep 22-25, Berlin, Germany ::: Oct 15-17, San Francisco, USA</pre>
</font></span></div>
<br>
_______________________________________________<br>
sr-dev mailing list<br>
<a moz-do-not-send="true"
href="mailto:sr-dev@lists.sip-router.org" target="_blank">sr-dev@lists.sip-router.org</a><br>
<a moz-do-not-send="true"
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>
<br>
</blockquote>
</div>
</div>
</div>
<span><font color="#888888"><br>
<br clear="all">
<br>
-- <br>
<div>
<div>Best regards,<br>
Alekzander Spiridonov</div>
<br>
</div>
</font></span></div>
</blockquote>
</div>
<br>
<br clear="all">
<br>
-- <br>
<div>
<div>Best regards,<br>
Alekzander Spiridonov</div>
<br>
</div>
</div>
</blockquote>
<br>
<pre cols="72">--
Daniel-Constantin Mierla
<a moz-do-not-send="true" href="http://twitter.com/#%21/miconda" target="_blank">http://twitter.com/#!/miconda</a> - <a moz-do-not-send="true" href="http://www.linkedin.com/in/miconda" target="_blank">http://www.linkedin.com/in/miconda</a>
Next Kamailio Advanced Trainings 2014 - <a moz-do-not-send="true" href="http://www.asipto.com" target="_blank">http://www.asipto.com</a>
Sep 22-25, Berlin, Germany ::: Oct 15-17, San Francisco, USA</pre>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
<div>
<div class="h5"><br>
<br clear="all">
<br>
-- <br>
<div>
<div>Best regards,<br>
Alekzander Spiridonov</div>
<br>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br>
<br clear="all">
<br>
-- <br>
<div>
<div>Best regards,<br>
Alekzander Spiridonov</div>
<br>
</div>
</div>
</blockquote>
<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>
Next Kamailio Advanced Trainings 2014 - <a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a>
Sep 22-25, Berlin, Germany ::: Oct 15-17, San Francisco, USA</pre>
</body>
</html>