[OpenSIPS-Users] Dispatcher algorithm 9

Răzvan Crainea razvan at opensips.org
Sun Sep 6 06:32:12 EST 2020


I think the problem is that the update_stat() does not accept variables 
as parameters - are you using OpenSIPS 2.4?

Best regards,

Răzvan Crainea
OpenSIPS Core Developer
http://www.opensips-solutions.com

On 9/4/20 7:42 PM, Social Boh wrote:
> No luck:
> 
> if (is_method("BYE")) {
> do_accounting("db","cdr|failed");
>                                          if (isflagset("NAT")) {
>                                             rtpengine_delete();
>                                             }
>                                             if (ds_is_in_list($si, $sp)) {
> xlog("L_NOTICE", "BYE comes from Gateway");
> update_stat("load_sip:$si", -1);
>                                             } else {
> xlog("L_NOTICE", "BYE comes from user");
> update_stat("load_sip:$dd", -1);
>                                             }
>                  }
> 
> During a Call the user hang up but the statistics no change. For each 
> call grows one unit and always using the same Gateway
> 
> Thank you
> 
> Regards
> 
> ---
> I'm SoCIaL, MayBe
> 
> On 4/09/20 2:44, Răzvan Crainea wrote:
>> Depending on the BYE's direction, the `$dd` variable may point to the 
>> gateway or to the caller. If the BYE comes from the gateway, you 
>> should decrease the statistic based on $si, not $dd.
>>
>> Best regards,
>>
>> Răzvan Crainea
>> OpenSIPS Core Developer
>> http://www.opensips-solutions.com
>>
>> On 9/3/20 7:10 PM, Social Boh wrote:
>>> Hello,
>>>
>>> I'm trying to using DISPATCHER module with algorithm 9 together with 
>>> STATISTICS module:
>>>
>>> My configuration:
>>>
>>> #### STATISTIC module
>>> loadmodule "statistics.so"
>>> modparam("statistics", "stat_groups", "load_sip")
>>>
>>> #### DISPATCHER module
>>> loadmodule "dispatcher.so"
>>> modparam("dispatcher", 
>>> "db_url","mysql://opensips:password@localhost/opensips")
>>> modparam("dispatcher", "algo_route", "disproute")
>>> modparam("dispatcher", "ds_ping_method", "OPTIONS")
>>> modparam("dispatcher", "ds_ping_from", "sip:proxy at 1.2.3.4")
>>> modparam("dispatcher", "ds_ping_interval", 30)
>>> modparam("dispatcher", "ds_probing_threshhold", 2)
>>> modparam("dispatcher", "ds_probing_mode", 1)
>>> modparam("dispatcher", "dst_avp", "$avp(271)")
>>> modparam("dispatcher", "pvar_algo_pattern", "$stat(load_%u)")
>>>
>>> script:
>>>
>>> on the BYE block:
>>>
>>> update_stat("load_sip:$dd", -1)
>>>
>>> On the DISPATCHER route:
>>>
>>> route[DISP] {
>>>                     if(!ds_select_dst(1,9)) {
>>>                             send_reply(404, "No destination");
>>>                             exit;
>>>                     }
>>>          xlog("L_NOTICE", "script: Call to $ru via $du\n");
>>>          update_stat("load_sip:$dd", +1);
>>>          t_on_failure("DISPATCHER_FAILURE");
>>>          t_relay();
>>>          exit;
>>> }
>>>
>>> The problem is the when the call terminate, the load stay on 1. If I 
>>> make 6 calls and hangup:
>>>
>>> {
>>>                              "URI": "sip:5.6.7.8:5060",
>>>                              "state": "Active",
>>>                              "first_hit_counter": 6
>>>                          },
>>>
>>> The calls never go to second Gateway and never change the load.
>>>
>>> Any help is really appreciate.
>>>
>>> Regards
>>>
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> 
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users



More information about the Users mailing list