[SR-Users] Dispatcher attributes

Joel Serrano joel at textplus.com
Thu Jan 10 04:12:55 CET 2019


Hi Jason,

When you access the XAVP you are getting all the parameters defined. You
can make use of the transformations [1] to select an individual value of an
attribute.

In your example, it would be something along:

$(xavp(ds_attrs=>attrs){param.value,attr1})

Where you are making use of transformations, specifically the "param.value"
[2] to select the value of attribute "attr1".

[1] https://www.kamailio.org/wiki/cookbooks/5.2.x/transformations
[2]
https://www.kamailio.org/wiki/cookbooks/5.2.x/transformations#paramvalue_name_delimiter

Hope it helps!

Joel.


On Wed, Jan 9, 2019 at 6:56 PM Joel Serrano <joel at textplus.com> wrote:

> Hi Jason,
>
> We are doing that and it works. I’ll send you a snippet when I get home..
>
>
>
> On Wed, Jan 9, 2019 at 13:32 Jason.Park <Jason.Park at target.com> wrote:
>
>> Hi.
>>
>>
>>
>> When using the attributes feature of the dispatcher module, is it
>> possible to directly access/address an individual attribute directly?
>>
>>
>>
>> For example, if I use the following dispatcher text file:
>>
>> --
>>
>> # line format
>>
>> # setid(int) destination(sip uri) flags(int,opt) priority(int,opt)
>> attributes(str,opt)
>>
>> 1234 sip:10.10.10.10:5060;transport=tcp 0 0 attr1=red;attr2=blue
>>
>> --
>>
>>
>>
>> And this config snippet, I was hoping to be able to access the attribute
>> with a variable.
>>
>> --
>>
>> modparam("dispatcher", "attrs_pvname", "$vxavp(ds_attrs)")
>>
>> if(ds_is_from_list(1234,1)) {
>>
>>                 x_log(“L_NOTICE”,”attr1: $xavp(ds_attrs=>attr1)\n”);
>>
>> }
>>
>> --
>>
>>
>>
>> Jason Park | Lead Engineer | Voice Services | ¤ Target
>> <http://www.target.com/> | TNC | 816-273-8336
>>
>>
>> _______________________________________________
>> Kamailio (SER) - Users Mailing List
>> sr-users at lists.kamailio.org
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20190109/39719fc4/attachment.html>


More information about the sr-users mailing list