Discussion:
[SR-Users] What is Attribute Value Pair (AVP) ?
Mahmoud Ramadan Ali
2014-10-18 00:05:31 UTC
Permalink
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...
Mahmoud Ramadan Ali
2014-10-18 12:50:20 UTC
Permalink
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...
Muhammad Shahzad
2014-10-19 14:45:37 UTC
Permalink
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 <
Post by Mahmoud Ramadan Ali
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
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Loading...