Re: [SR-Users] Dispatcher weight dont work

2015-01-30 Thread Will Ferrer
Hi Yuriy

Sounds great. I am glad to hear you got a good working solution.

I hope you have a great weekend.

All the best.

Will

On Thu, Jan 29, 2015 at 2:52 AM, Yuriy Gorlichenko 
wrote:

> Will, thanks for your answer. I already implemented my own lgorithm
> without using dispatcher module. It works better for me. Now I try to
> implement it with REDIS for faster results.
>
> 2015-01-29 1:35 GMT+03:00 Will Ferrer :
>
>> Hi Yuri
>>
>> I shared your issue with my business partner who works on the configs
>> with me. I had remembered he had some similar issue he pinged me about some
>> time back.
>>
>> His response to your issue follows:
>>
>> Looks like he is missing flags 8 and the trailing ; after weight in
>> attrs.
>> CREATE TABLE `dispatcher` (
>> `id`   `setid` `destination` `flags` `priority` `attrs`  `description`
>> 1 1 sip:10.0.0.1 8 1 weight=50;
>> 2 1 sip:10.0.0.2 8 2 weight=50;
>>
>> To see if it changes is being used by Kamailio run:
>> kamcmd dispatcher.list
>>
>> BODY: weight=50  <-- this is the raw attrs
>> WEIGHT: 50 <-- this show that the attribute has been processed.
>>
>> {
>> NRSETS: 1
>> RECORDS: {
>> SET: {
>> ID: 1
>> TARGETS: {
>> DEST: {
>> URI: sip:10.0.0.1
>> FLAGS: AP
>> PRIORITY: 1
>> ATTRS: {
>> BODY: weight=50
>> DUID:
>> MAXLOAD: 0
>> WEIGHT: 50
>> }
>> }
>> DEST: {
>> URI: sip:10.0.0.2
>> FLAGS: AP
>> PRIORITY: 1
>> ATTRS: {
>> BODY: weight=50
>> DUID:
>> MAXLOAD: 0
>> WEIGHT: 50
>> }
>> }
>> }
>> }
>> }
>> }
>>
>> I hope that helps.
>>
>> All the best.
>>
>> Will
>>
>> On Tue, Jan 27, 2015 at 3:12 AM, Yuriy Gorlichenko 
>> wrote:
>>
>>> Hello I use dipatcher  algorithm 8 that works with weight. I added  2
>>> Asterisks and try to call its with my kam.We use 4.3 version.
>>>
>>> Tthis config select needed dst from database with my scenario.
>>>
>>> if(!ds_select_dst("$var(setid)", "8"))
>>>
>>> $var(setid)- is variable for setting setid that i get from database with
>>> my own scenario. IT does not matter.
>>>
>>> When running asterisk with weight 90 - all calls goes through it. When I
>>> starting asterisk with weight 10 -calls going through asterisk 90. When I
>>> shut down asterisk with weight 90 -calls goes through asterisk 10? but when
>>> i start asterisk weight 90 all calls goes through sterisk 10 until I shut
>>> down it.
>>>
>>> root@Kamailio:~# kamailio -v
>>> version: kamailio 4.3.0-dev3 (x86_64/linux) 8cdbe7
>>> flags: STATS: Off, USE_TCP, USE_TLS, TLS_HOOKS, USE_RAW_SOCKS,
>>> DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC,
>>> F_MALLOC, DBG_F_MALLOC, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE,
>>> USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES
>>> ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16,
>>> MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
>>> poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
>>> id: 8cdbe7
>>> compiled on 01:17:56 Jan 21 2015 with gcc 4.8.2
>>>
>>>
>>> id setid   destination  flags priority attrs
>>> 1   2   sip:34.25.123.45:506000  0 weight=10
>>>
>>>
>>>
>>> 2   2   sip:10.0.1.6:506000  0weight=90
>>>
>>> modparam("dispatcher", "db_url",DBURL)
>>> modparam("dispatcher", "table_name", "dispatcher")
>>> modparam("dispatcher", "setid_col", "setid")
>>> modparam("dispatcher", "destination_col", "destination")
>>> modparam("dispatcher", "force_dst", 1)
>>> modparam("dispatcher", "flags", 3)
>>> modparam("dispatcher", "dst_avp", "$avp(i:271)")
>>> modparam("dispatcher", "grp_avp", "$avp(i:272)")
>>> modparam("dispatcher", "cnt_avp", "$avp(i:273)")
>>> modparam("dispatcher", "ds_ping_from", "sip:proxy@10.0.1.1")
>>> modparam("dispatcher", "ds_ping_interval",15)
>>> modparam("dispatcher", "ds_probing_mode", 1)
>>> modparam("dispatcher", "ds_ping_reply_codes",
>>> "class=2;code=403;code=404;code=484;class=3")
>>> modparam("tm", "reparse_on_dns_failover", 0)
>>>
>>>
>>> Thanks
>>>
>>> ___

Re: [SR-Users] Dispatcher weight dont work

2015-01-29 Thread Yuriy Gorlichenko
Will, thanks for your answer. I already implemented my own lgorithm without
using dispatcher module. It works better for me. Now I try to implement it
with REDIS for faster results.

2015-01-29 1:35 GMT+03:00 Will Ferrer :

> Hi Yuri
>
> I shared your issue with my business partner who works on the configs with
> me. I had remembered he had some similar issue he pinged me about some time
> back.
>
> His response to your issue follows:
>
> Looks like he is missing flags 8 and the trailing ; after weight in attrs.
> CREATE TABLE `dispatcher` (
> `id`   `setid` `destination` `flags` `priority` `attrs`  `description`
> 1 1 sip:10.0.0.1 8 1 weight=50;
> 2 1 sip:10.0.0.2 8 2 weight=50;
>
> To see if it changes is being used by Kamailio run:
> kamcmd dispatcher.list
>
> BODY: weight=50  <-- this is the raw attrs
> WEIGHT: 50 <-- this show that the attribute has been processed.
>
> {
> NRSETS: 1
> RECORDS: {
> SET: {
> ID: 1
> TARGETS: {
> DEST: {
> URI: sip:10.0.0.1
> FLAGS: AP
> PRIORITY: 1
> ATTRS: {
> BODY: weight=50
> DUID:
> MAXLOAD: 0
> WEIGHT: 50
> }
> }
> DEST: {
> URI: sip:10.0.0.2
> FLAGS: AP
> PRIORITY: 1
> ATTRS: {
> BODY: weight=50
> DUID:
> MAXLOAD: 0
> WEIGHT: 50
> }
> }
> }
> }
> }
> }
>
> I hope that helps.
>
> All the best.
>
> Will
>
> On Tue, Jan 27, 2015 at 3:12 AM, Yuriy Gorlichenko 
> wrote:
>
>> Hello I use dipatcher  algorithm 8 that works with weight. I added  2
>> Asterisks and try to call its with my kam.We use 4.3 version.
>>
>> Tthis config select needed dst from database with my scenario.
>>
>> if(!ds_select_dst("$var(setid)", "8"))
>>
>> $var(setid)- is variable for setting setid that i get from database with
>> my own scenario. IT does not matter.
>>
>> When running asterisk with weight 90 - all calls goes through it. When I
>> starting asterisk with weight 10 -calls going through asterisk 90. When I
>> shut down asterisk with weight 90 -calls goes through asterisk 10? but when
>> i start asterisk weight 90 all calls goes through sterisk 10 until I shut
>> down it.
>>
>> root@Kamailio:~# kamailio -v
>> version: kamailio 4.3.0-dev3 (x86_64/linux) 8cdbe7
>> flags: STATS: Off, USE_TCP, USE_TLS, TLS_HOOKS, USE_RAW_SOCKS,
>> DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC,
>> F_MALLOC, DBG_F_MALLOC, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE,
>> USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES
>> ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16,
>> MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
>> poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
>> id: 8cdbe7
>> compiled on 01:17:56 Jan 21 2015 with gcc 4.8.2
>>
>>
>> id setid   destination  flags priority attrs
>> 1   2   sip:34.25.123.45:506000  0 weight=10
>>
>>
>>
>> 2   2   sip:10.0.1.6:506000  0weight=90
>>
>> modparam("dispatcher", "db_url",DBURL)
>> modparam("dispatcher", "table_name", "dispatcher")
>> modparam("dispatcher", "setid_col", "setid")
>> modparam("dispatcher", "destination_col", "destination")
>> modparam("dispatcher", "force_dst", 1)
>> modparam("dispatcher", "flags", 3)
>> modparam("dispatcher", "dst_avp", "$avp(i:271)")
>> modparam("dispatcher", "grp_avp", "$avp(i:272)")
>> modparam("dispatcher", "cnt_avp", "$avp(i:273)")
>> modparam("dispatcher", "ds_ping_from", "sip:proxy@10.0.1.1")
>> modparam("dispatcher", "ds_ping_interval",15)
>> modparam("dispatcher", "ds_probing_mode", 1)
>> modparam("dispatcher", "ds_ping_reply_codes",
>> "class=2;code=403;code=404;code=484;class=3")
>> modparam("tm", "reparse_on_dns_failover", 0)
>>
>>
>> Thanks
>>
>> ___
>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
>> sr-users@lists.sip-router.org
>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>
>>
>
> ___
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-use

Re: [SR-Users] Dispatcher weight dont work

2015-01-28 Thread Will Ferrer
Hi Yuri

I shared your issue with my business partner who works on the configs with
me. I had remembered he had some similar issue he pinged me about some time
back.

His response to your issue follows:

Looks like he is missing flags 8 and the trailing ; after weight in attrs.
CREATE TABLE `dispatcher` (
`id`   `setid` `destination` `flags` `priority` `attrs`  `description`
1 1 sip:10.0.0.1 8 1 weight=50;
2 1 sip:10.0.0.2 8 2 weight=50;

To see if it changes is being used by Kamailio run:
kamcmd dispatcher.list

BODY: weight=50  <-- this is the raw attrs
WEIGHT: 50 <-- this show that the attribute has been processed.

{
NRSETS: 1
RECORDS: {
SET: {
ID: 1
TARGETS: {
DEST: {
URI: sip:10.0.0.1
FLAGS: AP
PRIORITY: 1
ATTRS: {
BODY: weight=50
DUID:
MAXLOAD: 0
WEIGHT: 50
}
}
DEST: {
URI: sip:10.0.0.2
FLAGS: AP
PRIORITY: 1
ATTRS: {
BODY: weight=50
DUID:
MAXLOAD: 0
WEIGHT: 50
}
}
}
}
}
}

I hope that helps.

All the best.

Will

On Tue, Jan 27, 2015 at 3:12 AM, Yuriy Gorlichenko 
wrote:

> Hello I use dipatcher  algorithm 8 that works with weight. I added  2
> Asterisks and try to call its with my kam.We use 4.3 version.
>
> Tthis config select needed dst from database with my scenario.
>
> if(!ds_select_dst("$var(setid)", "8"))
>
> $var(setid)- is variable for setting setid that i get from database with
> my own scenario. IT does not matter.
>
> When running asterisk with weight 90 - all calls goes through it. When I
> starting asterisk with weight 10 -calls going through asterisk 90. When I
> shut down asterisk with weight 90 -calls goes through asterisk 10? but when
> i start asterisk weight 90 all calls goes through sterisk 10 until I shut
> down it.
>
> root@Kamailio:~# kamailio -v
> version: kamailio 4.3.0-dev3 (x86_64/linux) 8cdbe7
> flags: STATS: Off, USE_TCP, USE_TLS, TLS_HOOKS, USE_RAW_SOCKS,
> DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC,
> F_MALLOC, DBG_F_MALLOC, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE,
> USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES
> ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16,
> MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
> poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
> id: 8cdbe7
> compiled on 01:17:56 Jan 21 2015 with gcc 4.8.2
>
>
> id setid   destination  flags priority attrs
> 1   2   sip:34.25.123.45:506000  0 weight=10
>
>
>
> 2   2   sip:10.0.1.6:506000  0weight=90
>
> modparam("dispatcher", "db_url",DBURL)
> modparam("dispatcher", "table_name", "dispatcher")
> modparam("dispatcher", "setid_col", "setid")
> modparam("dispatcher", "destination_col", "destination")
> modparam("dispatcher", "force_dst", 1)
> modparam("dispatcher", "flags", 3)
> modparam("dispatcher", "dst_avp", "$avp(i:271)")
> modparam("dispatcher", "grp_avp", "$avp(i:272)")
> modparam("dispatcher", "cnt_avp", "$avp(i:273)")
> modparam("dispatcher", "ds_ping_from", "sip:proxy@10.0.1.1")
> modparam("dispatcher", "ds_ping_interval",15)
> modparam("dispatcher", "ds_probing_mode", 1)
> modparam("dispatcher", "ds_ping_reply_codes",
> "class=2;code=403;code=404;code=484;class=3")
> modparam("tm", "reparse_on_dns_failover", 0)
>
>
> Thanks
>
> ___
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users@lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
>
___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] dispatcher weight dont work

2015-01-08 Thread Daniel-Constantin Mierla
I see that you have setid 2 with two addresses, one with weight 10 and
one with weight 50. In total you give the weight 60. The module is
filling up to weight 100 using the last address returned from database,
so you can end up having first address with weight 10 and the second
with weight 90.

This algorithm ensures that in 100 routed calls, 10 are routed to the
first address and 90 to the second address. The order itself is
randomized at load time. For example, you can have first 3 calls routed
to address2, then 2 call to address1, then 8 calls to address2, then 8
calls to address1, then up to 100 routed to address2, after that is
repeating the same routing selection.

For set id 1 you have one address with weight 50, then practically in
memory it results in this address being with weight 100 (being the only
one in the setid), which is like routing always to it.

Given the above details, can you present more about what you observed
and what you would have expected to happen?

Cheers,
Daniel

PS. Just to be fully aware of: 4.3 is master branch and it is considered
unstable for production. But using it is encouraged, we fix the issues
to it with and helps getting it to stable state. At least in the regard
of dispacher and weight distribution, 4.3 and 4.2 are the same.


On 08/01/15 14:45, Yuriy Gorlichenko wrote:
> We use 4.3 version. 
>
> if(!ds_select_dst("$var(setid)", "9"))
>
> $var(setid)- is variable for setting setid that i get from database
> with my own scenario. IT does not matter. You may change it to
> something like 1,2, or anthing else.
> So as you see setid 2 have 2 servers. I have an issue with this config
>
> id setid   destination  flags priority attrs
> 12   sip:34.25.123.45:50600    0   
>
>   0   weight=10   
> 21   sip:10.0.1.6:50600    0 0
> weight=50 
> 32   sip:10.0.1.6:50600    0 0
> weight=50 
>
>
> 2015-01-08 13:36 GMT+03:00 Daniel-Constantin Mierla  >:
>
> Hello,
>
> what version are you using? Can you paste here the records you
> have for the destination set (you can replace the ip addresses, I
> am interested in attributes) and the ds_select_dst() or
> ds_select_domain() lines from your config?
>
> Cheers,
> Daniel
>
>
> On 08/01/15 04:07, Yuriy Gorlichenko wrote:
>> Hello I use dipatcher  algorithm that works with weight. I added
>>  2 Asterisks and try to call its with my kam, but this still
>> works like 4 algorithm. Weight does not work.
>> How I must configure dispatchr for working with weight?
>> My configuration now is
>>
>> modparam("dispatcher", "db_url",DBURL)
>> modparam("dispatcher", "table_name", "dispatcher")
>> modparam("dispatcher", "setid_col", "setid")
>> modparam("dispatcher", "destination_col", "destination")
>> modparam("dispatcher", "force_dst", 1)
>> modparam("dispatcher", "flags", 3)
>> modparam("dispatcher", "dst_avp", "$avp(i:271)")
>> modparam("dispatcher", "grp_avp", "$avp(i:272)")
>> modparam("dispatcher", "cnt_avp", "$avp(i:273)")
>> modparam("dispatcher", "ds_ping_from", "sip:proxy@10.0.1.1
>> ")
>> modparam("dispatcher", "ds_ping_interval",15)
>> modparam("dispatcher", "ds_probing_mode", 1)
>> modparam("dispatcher", "ds_ping_reply_codes",
>> "class=2;code=403;code=404;code=484;class=3")
>> modparam("tm", "reparse_on_dns_failover", 0)
>>
>>
>> ___
>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
>> sr-users@lists.sip-router.org 
>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
> -- 
> Daniel-Constantin Mierla
> http://twitter.com/#!/miconda  - 
> http://www.linkedin.com/in/miconda
>
>
> ___
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing
> list
> sr-users@lists.sip-router.org 
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
>

-- 
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] dispatcher weight dont work

2015-01-08 Thread Yuriy Gorlichenko
We use 4.3 version.

if(!ds_select_dst("$var(setid)", "9"))

$var(setid)- is variable for setting setid that i get from database with my
own scenario. IT does not matter. You may change it to something like 1,2,
or anthing else.
So as you see setid 2 have 2 servers. I have an issue with this config

id setid   destination  flags priority attrs
1   2   sip:34.25.123.45:506000  0 weight=10
2   1   sip:10.0.1.6:506000  0weight=503   2   sip:10.0.1.6:506000
0weight=50

2015-01-08 13:36 GMT+03:00 Daniel-Constantin Mierla :

>  Hello,
>
> what version are you using? Can you paste here the records you have for
> the destination set (you can replace the ip addresses, I am interested in
> attributes) and the ds_select_dst() or ds_select_domain() lines from your
> config?
>
> Cheers,
> Daniel
>
>
> On 08/01/15 04:07, Yuriy Gorlichenko wrote:
>
> Hello I use dipatcher  algorithm that works with weight. I added  2
> Asterisks and try to call its with my kam, but this still works like 4
> algorithm. Weight does not work.
> How I must configure dispatchr for working with weight?
> My configuration now is
>
> modparam("dispatcher", "db_url",DBURL)
> modparam("dispatcher", "table_name", "dispatcher")
> modparam("dispatcher", "setid_col", "setid")
> modparam("dispatcher", "destination_col", "destination")
> modparam("dispatcher", "force_dst", 1)
> modparam("dispatcher", "flags", 3)
> modparam("dispatcher", "dst_avp", "$avp(i:271)")
> modparam("dispatcher", "grp_avp", "$avp(i:272)")
> modparam("dispatcher", "cnt_avp", "$avp(i:273)")
> modparam("dispatcher", "ds_ping_from", "sip:proxy@10.0.1.1")
> modparam("dispatcher", "ds_ping_interval",15)
> modparam("dispatcher", "ds_probing_mode", 1)
> modparam("dispatcher", "ds_ping_reply_codes",
> "class=2;code=403;code=404;code=484;class=3")
> modparam("tm", "reparse_on_dns_failover", 0)
>
>
> ___
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing 
> listsr-us...@lists.sip-router.orghttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
>
> --
> Daniel-Constantin Mierlahttp://twitter.com/#!/miconda - 
> http://www.linkedin.com/in/miconda
>
>
> ___
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users@lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
>
___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] dispatcher weight dont work

2015-01-08 Thread Daniel-Constantin Mierla
Hello,

what version are you using? Can you paste here the records you have for
the destination set (you can replace the ip addresses, I am interested
in attributes) and the ds_select_dst() or ds_select_domain() lines from
your config?

Cheers,
Daniel

On 08/01/15 04:07, Yuriy Gorlichenko wrote:
> Hello I use dipatcher  algorithm that works with weight. I added  2
> Asterisks and try to call its with my kam, but this still works like 4
> algorithm. Weight does not work.
> How I must configure dispatchr for working with weight?
> My configuration now is
>
> modparam("dispatcher", "db_url",DBURL)
> modparam("dispatcher", "table_name", "dispatcher")
> modparam("dispatcher", "setid_col", "setid")
> modparam("dispatcher", "destination_col", "destination")
> modparam("dispatcher", "force_dst", 1)
> modparam("dispatcher", "flags", 3)
> modparam("dispatcher", "dst_avp", "$avp(i:271)")
> modparam("dispatcher", "grp_avp", "$avp(i:272)")
> modparam("dispatcher", "cnt_avp", "$avp(i:273)")
> modparam("dispatcher", "ds_ping_from", "sip:proxy@10.0.1.1
> ")
> modparam("dispatcher", "ds_ping_interval",15)
> modparam("dispatcher", "ds_probing_mode", 1)
> modparam("dispatcher", "ds_ping_reply_codes",
> "class=2;code=403;code=404;code=484;class=3")
> modparam("tm", "reparse_on_dns_failover", 0)
>
>
> ___
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users@lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users