Module: sip-router
Branch: master
Commit: 8cba441b17c75cd078a499c24268c8a60c6b1771
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=8cba441…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Tue May 28 15:48:22 2013 +0200
misc_radius: updated readme
- from a patch by Victor V. Kustov
---
modules/misc_radius/README | 51 +++++++++++++++++++------
modules/misc_radius/doc/misc_radius_admin.xml | 34 +++++++++++++++-
2 files changed, 70 insertions(+), 15 deletions(-)
diff --git a/modules/misc_radius/README b/modules/misc_radius/README
index 50d6008..ed2a47c 100644
--- a/modules/misc_radius/README
+++ b/modules/misc_radius/README
@@ -59,11 +59,12 @@ Daniel-Constantin Mierla
1.10. uri_extra parameter usage
1.11. use_sip_uri_host parameter usage
1.12. common_response parameter usage
- 1.13. radius_load_caller_avps() usage
- 1.14. radius_load_callee_avps() usage
- 1.15. radius_is_user_in() usage
- 1.16. radius_does_uri_exist() usage
- 1.17. radius_does_uri_user_exist() usage
+ 1.13. radius response with common_response value 1
+ 1.14. radius_load_caller_avps() usage
+ 1.15. radius_load_callee_avps() usage
+ 1.16. radius_is_user_in() usage
+ 1.17. radius_does_uri_exist() usage
+ 1.18. radius_does_uri_user_exist() usage
Chapter 1. Admin Guide
@@ -293,13 +294,39 @@ modparam("misc_radius", "use_sip_uri_host", 1)
3.11. common_response (integer)
Set it to 1 if you need common radius response attributes to be added
- as AVPs.
+ as AVPs in radius_load_caller_avps and radius_load_callee_avps with
+ name as radius attribute name and value as radius attribute value.
Default value is "0".
Example 1.12. common_response parameter usage
...
-modparam("misc_radius", "common_response", 21)
+modparam("misc_radius", "common_response", 1)
+...
+radius_load_caller_avps($fU);
+...
+
+ Example 1.13. radius response with common_response value 1
+...
+ Sending Access-Accept of id 60 to 192.168.25.32 port 59736
+ Session-Timeout = 4261674
+ next-hop-ip = "SIP/00111222333444@cisco-out"
+ SIP-AVP = "email:sr-users@lists.sip-router.org session-timeout#161 next-hop-
+ip:h323/0001111@myvoip-gate.kamailio.org"
+ session-protocol = "SIP"
+...
+
+$avp(Session-Timeout) has integer value 4261674
+$avp(next-hop-ip) has string value "SIP/005555777888@cisco-out"
+$avp(session-protocol) has string value "SIP"
+$avp(SIP-AVP) has string value "email:sr-users@lists.sip-router.org session-tim
+eout#161 next-hop-ip:h323/0001111@myvoip-gate.kamailio.org"
+
+...
+ When recieving negative response, check appropriate avp's:
+ $avp(Reply-Message) = "Not enough money on deposit '-89.83'.
Rejected"
+ $avp(Filter-Id) = "neg_deposit"
+...
4. Functions
@@ -317,7 +344,7 @@ modparam("misc_radius", "common_response", 21)
This function can be used from REQUEST_ROUTE, FAILURE_ROUTE.
- Example 1.13. radius_load_caller_avps() usage
+ Example 1.14. radius_load_caller_avps() usage
...
radius_load_caller_avps("$fU@$fd"); # take caller from From URI
...
@@ -332,7 +359,7 @@ radius_load_caller_avps("$au@$ar"); # take caller from
Authorization
This function can be used from REQUEST_ROUTE, FAILURE_ROUTE.
- Example 1.14. radius_load_callee_avps() usage
+ Example 1.15. radius_load_callee_avps() usage
...
radius_load_callee_avps("$rU@$rd"); # take callee from Request-URI
...
@@ -347,7 +374,7 @@ radius_load_callee_avps("$rU@$rd"); # take callee from
Request-URI
This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
BRANCH_ROUTE, and LOCAL_ROUTE.
- Example 1.15. radius_is_user_in() usage
+ Example 1.16. radius_is_user_in() usage
...
radius_is_user_in("$rU@$rd", "1"); # take user from Request-URI
...
@@ -362,7 +389,7 @@ radius_is_user_in("$au@$ar", "group_x");# take
user from credentials
This function can be used from REQUEST_ROUTE and LOCAL_ROUTE.
- Example 1.16. radius_does_uri_exist() usage
+ Example 1.17. radius_does_uri_exist() usage
...
if (radius_does_uri_exist()) ... # check Request-URI
...
@@ -379,7 +406,7 @@ if (radius_does_uri_exist("$avp(i:99)")) ... # check URI
in $avp(i:99)
This function can be used from REQUEST_ROUTE and LOCAL_ROUTE.
- Example 1.17. radius_does_uri_user_exist() usage
+ Example 1.18. radius_does_uri_user_exist() usage
...
if (radius_does_uri_user_exist()) ... # check Request-URI userpart
...
diff --git a/modules/misc_radius/doc/misc_radius_admin.xml
b/modules/misc_radius/doc/misc_radius_admin.xml
index aff0973..950d8d4 100644
--- a/modules/misc_radius/doc/misc_radius_admin.xml
+++ b/modules/misc_radius/doc/misc_radius_admin.xml
@@ -307,7 +307,9 @@ modparam("misc_radius", "use_sip_uri_host", 1)
<title><varname>common_response</varname> (integer)</title>
<para>
Set it to 1 if you need common radius response attributes to
- be added as AVPs.
+ be added as AVPs in <function
moreinfo="none">radius_load_caller_avps</function>
+ and <function
moreinfo="none">radius_load_callee_avps</function>
+ with name as radius attribute name and value as radius attribute value.
</para>
<para>
Default value is <quote>0</quote>.
@@ -316,9 +318,35 @@ modparam("misc_radius", "use_sip_uri_host", 1)
<title><varname>common_response</varname> parameter
usage</title>
<programlisting format="linespecific">
...
-modparam("misc_radius", "common_response", 21)
+modparam("misc_radius", "common_response", 1)
+...
+radius_load_caller_avps($fU);
+...
</programlisting>
- </example>
+ </example>
+ <example>
+ <title>radius response with <varname>common_response</varname> value
1</title>
+ <programlisting format="linespecific">
+...
+ Sending Access-Accept of id 60 to 192.168.25.32 port 59736
+ Session-Timeout = 4261674
+ next-hop-ip = "SIP/00111222333444@cisco-out"
+ SIP-AVP = "email:sr-users@lists.sip-router.org session-timeout#161
next-hop-ip:h323/0001111@myvoip-gate.kamailio.org"
+ session-protocol = "SIP"
+...
+
+$avp(Session-Timeout) has integer value 4261674
+$avp(next-hop-ip) has string value "SIP/005555777888@cisco-out"
+$avp(session-protocol) has string value "SIP"
+$avp(SIP-AVP) has string value "email:sr-users@lists.sip-router.org
session-timeout#161 next-hop-ip:h323/0001111@myvoip-gate.kamailio.org"
+
+...
+ When recieving negative response, check appropriate avp's:
+ $avp(Reply-Message) = "Not enough money on deposit '-89.83'.
Rejected"
+ $avp(Filter-Id) = "neg_deposit"
+...
+</programlisting>
+ </example>
</section>
</section>