[SR-Users] What is Attribute Value Pair (AVP) ?

Muhammad Shahzad shaheryarkh at gmail.com
Sun Oct 19 16:45:37 CEST 2014


The AVP stands for Attribute Value Pair. If you are familiar with any
programming language then it is like a variable, which can be assigned any
String or Integer value, you can later use that variable in your script
(kamailio.cfg) or pass it to any module function that accepts AVP in its
input arguments. e.g.

$avp(myuser) =
"someone";                                                       # AVP
declaration with simple string value assignment.
$avp(myuri) = "sip:" + $avp(myuser) + "@somedomain.com";  # AVP value
assignment may include other AVPs.
m_store($avp(myuri));
# The value of AVP will be passed to module function m_store.

There are several modules which allow you to declare an AVP in module
parameters section. You can then assign value to that AVP in your script,
and any function call after that assignment will allow module's internal
code to use that AVP value and/or store the result of function in that AVP.
e.g.

modparam("msilo", "extra_hdrs_avp", "$avp(myhdrs)")           # AVP
declaration
...
$avp(myhdrs) = "P-Network-Info: 3G/LTE\r\n";                         #
Assign value to AVP
m_store($tu);
# m_store, will check if you have assigned any value to declared AVP and
uses it.

Hope this helps.

Thank you.



On Sat, Oct 18, 2014 at 2:50 PM, Mahmoud Ramadan Ali <
cisco.and.more.blog at gmail.com> wrote:

> Hiiii everyone,
> Forgive me for such simple question but i'm newbie to Kamailio. i was
> reading about the dispatcher module
>
> http://www.kamailio.org/docs/modules/4.2.x/modules/dispatcher.html#dispatcher.p.db_url
> and i want someone to explain to me in a simple way what is AVP , for
> example the AVP in the *modparam("dispatcher", "grp_avp", "$avp(dsgrp)")*
> and what the "dsgrp" represents and how to configure the AVP values ...
> Kinda Regards
> Thanks in advance...
>
> _______________________________________________
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20141019/2e1fe97a/attachment.html>


More information about the sr-users mailing list