[SR-Users] Dispatcher: ds_is_from_list does not longer populate grp_avp

DanB danb.lists at gmail.com
Wed Aug 15 13:02:52 CEST 2012


Daniel,

Nice catch! All smooth now.

Thanks and enjoy your free time ;).

DanB

On 08/15/2012 01:00 PM, Daniel-Constantin Mierla wrote:
> Another mismatch of sources and docs, the parameter is expected to be
> 'setid_pvname' instead of 'setid_pvar'. I'll update docs.
>
> Cheers,
> Daniel
>
> On 8/15/12 12:56 PM, DanB wrote:
>> Daniel,
>>
>> Since we are still in "connected" state, one more (hopefully last)
>> question on this subject:
>>
>> If I set the "setid_pvar" the configuration does not longer pass
>> checking (just upgraded to latest nightly 3.3.1):
>> """
>> root at PrxyDev:/etc/sbalancer# kamailio -c -f kamailio.cfg
>> loading modules under
>> /usr/lib/kamailio/modules_k/:/usr/lib/kamailio/modules/:/usr/local/lib/kamailio/modules/
>>
>>  0(3190) ERROR: <core> [modparam.c:151]: set_mod_param_regex:
>> parameter <setid_pvar> not found in module <dispatcher>
>>  0(3190) : <core> [cfg.y:3594]: parse error in config file
>> /usr/local/src/sipean2/trunk/SDev/SBalancer/Kamailio/etc/kamailio/kamailio.cfg,
>> line 73, column 51: Can't set module parameter
>> ERROR: bad config file (1 errors)
>> root at PrxyDev:/etc/sbalancer# kamailio -V
>> version: kamailio 3.3.1 (i386/linux)
>> flags: STATS: Off, USE_IPV6, USE_TCP, USE_TLS, TLS_HOOKS,
>> USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM,
>> SHM_MMAP, PKG_MALLOC, 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 4MB
>> poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
>> id: unknown
>> compiled on 03:07:36 Aug 15 2012 with gcc 4.4.5
>> """
>>
>> I define the parameter in the following way:
>> """
>> modparam("dispatcher", "setid_pvar", "$var(setid)")
>> """
>>
>> Am I missing something again?
>>
>>
>> Thanks,
>> DanB
>>
>> On 08/15/2012 12:52 PM, Daniel-Constantin Mierla wrote:
>>> Hello,
>>>
>>> right, the readme was mistaken. Probably grp_avp was used initially but
>>> changed later because it messes up when ds_is_from_list() and
>>> ds_select_*() are used for same requests.
>>>
>>> I committed an update to the readme.
>>>
>>> Cheers,
>>> Daniel
>>>
>>> On 8/15/12 12:40 PM, DanB wrote:
>>>> Daniel,
>>>>
>>>> My bad, I was reading through the lines :(.
>>>>
>>>> I now understand that setid_pvar is different than group pvar. I got
>>>> the false understanding based on documentation saying:
>>>> """
>>>> Parameter groupid is optional, when it is missing, then the matching
>>>> will be done against all addresses in all groups. Upon a match, the
>>>> 'grp_avp' will be set to groupid of matching address.
>>>> """
>>>>
>>>> All clear now, thanks!!!
>>>>
>>>> DanB
>>>>
>>>> On 08/15/2012 11:41 AM, Daniel-Constantin Mierla wrote:
>>>>> Hello,
>>>>>
>>>>> there was no change in dispatcher module related to this function
>>>>> since
>>>>> 3.3.0. The value of the group id is set to the variable specified
>>>>> by the
>>>>> parameter setid_pvar:
>>>>>
>>>>> http://kamailio.org/docs/modules/stable/modules_k/dispatcher.html#id2495800
>>>>>
>>>>>
>>>>>
>>>>> Very likely you are using the wrong variable which you set as grp_avp
>>>>> parameter, based your config snippets.
>>>>>
>>>>> Cheers,
>>>>> Daniel
>>>>>
>>>>> On 8/15/12 11:30 AM, DanB wrote:
>>>>>> Hey Guys,
>>>>>>
>>>>>> Something I noticed after upgrading Kamailio from 3.3.0 to 3.3.1.
>>>>>>
>>>>>> Having the following code:
>>>>>> """
>>>>>> if ds_is_from_list() {
>>>>>>   xlog("Request coming from SCloud");
>>>>>>   xlog("Checking grp_internal, having: $avp(s:dsgrp)");
>>>>>> }
>>>>>> """
>>>>>>
>>>>>> will produce the following output to syslog (dsgrp null instead of
>>>>>> group id):
>>>>>> """
>>>>>> Aug 15 11:24:28 PrxyDev /usr/sbin/kamailio[2818]: ERROR: <script>:
>>>>>> Request coming from SCloud
>>>>>> Aug 15 11:24:28 PrxyDev /usr/sbin/kamailio[2818]: ERROR: <script>:
>>>>>> Checking grp_internal, having: <null>
>>>>>> """
>>>>>> I have in dispatcher set:
>>>>>> modparam("dispatcher", "grp_avp", "$avp(dsgrp)")
>>>>>> and I am loading the rules from file.
>>>>>>
>>>>>> I should mention that this block was working fine before upgrade.
>>>>>>
>>>>>> Am I doing something wrong?
>>>>>>
>>>>>> Thanks in advance!
>>>>>> DanB
>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing
>>>>>> list
>>>>>> sr-users at lists.sip-router.org
>>>>>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>>>>
>>>>
>>>
>>
>




More information about the sr-users mailing list