[sr-dev] git:master: modules/ims_auth: updated documentation
Richard Good
richard.good at smilecoms.com
Tue Jun 25 15:43:08 CEST 2013
Module: sip-router
Branch: master
Commit: 8f1904fd0a0b305b2c528df0d1d3c27d5eef0c7d
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=8f1904fd0a0b305b2c528df0d1d3c27d5eef0c7d
Author: Richard Good <richard.good at smilecoms.com>
Committer: Richard Good <richard.good at smilecoms.com>
Date: Tue Jun 25 15:41:42 2013 +0200
modules/ims_auth: updated documentation
- updated documentation to use route blocks after async diameter
---
modules/ims_auth/doc/ims_auth_admin.xml | 68 +++++++++++++++++++++++++++----
1 files changed, 60 insertions(+), 8 deletions(-)
diff --git a/modules/ims_auth/doc/ims_auth_admin.xml b/modules/ims_auth/doc/ims_auth_admin.xml
index 56eb972..3357cc9 100644
--- a/modules/ims_auth/doc/ims_auth_admin.xml
+++ b/modules/ims_auth/doc/ims_auth_admin.xml
@@ -274,8 +274,6 @@ modparam("ims_auth", "max_nonce_reuse", 1)
</example>
</section>
- </section>
-
<section>
<title><varname>add_authinfo_hdr</varname> (integer)</title>
@@ -404,8 +402,8 @@ modparam("ims_auth", "av_check_only_impu", 1)
<programlisting format="linespecific">
...
if (!www_authorize("kamailio.org", "subscriber")) {
- www_challenge("kamailio.org", "1");
-};
+ www_challenge(""REG_MAR_REPLY"", "kamailio.org", "1");
+};
...
</programlisting>
</example>
@@ -421,7 +419,7 @@ if (!www_authorize("kamailio.org", "subscriber")) {
</section>
<section>
- <title><function moreinfo="none">ims_www_challenge(realm,
+ <title><function moreinfo="none">ims_www_challenge(route_block, realm,
table)</function></title>
<para>Name alias: proxy_authorize(realm, table)</para>
@@ -442,6 +440,9 @@ if (!www_authorize("kamailio.org", "subscriber")) {
<itemizedlist>
<listitem>
+ <para>Route block to resume after async MAR Diameter reply.</para>
+ </listitem>
+ <listitem>
<para><emphasis>realm</emphasis> - Realm is a opaque string that the
user agent should present to the user so he can decide what username
and password to use. Usually this is domain of the host the server
@@ -472,15 +473,39 @@ if (!www_authorize("kamailio.org", "subscriber")) {
<programlisting format="linespecific">
...
if (!proxy_authorize("$fd", "subscriber)) {
- proxy_challenge("$fd", "1"); # Realm will be autogenerated
+ proxy_challenge(""REG_MAR_REPLY","$fd"); # Realm will be autogenerated
};
...
+ ...
+route[REG_MAR_REPLY]
+{
+ #this is async so to know status we have to check the reply avp
+ xlog("L_DBG","maa_return code is $avp(s:maa_return_code)\n");
+
+ switch ($avp(s:maa_return_code)){
+ case 1: #success
+ xlog("L_DBG", "MAR success - 401/407 response sent from module\n");
+ break;
+ case -1: #failure
+ xlog("L_ERR", "MAR failure - error response sent from module\n");
+ break;
+ case -2: #error
+ xlog("L_ERR", "MAR error - sending error response now\n");
+ t_reply("500", "MAR failed");
+ break;
+ default:
+ xlog("L_ERR", "Unknown return code from MAR, value is [$avp(s:uaa_return_code)]\n");
+ t_reply("500", "Unknown response code from MAR");
+ break;
+ }
+ exit;
+}
</programlisting>
</example>
</section>
<section>
- <title><function moreinfo="none">ims_proxy_challenge(realm,
+ <title><function moreinfo="none">ims_proxy_challenge(route_block, realm,
table)</function></title>
<para>Name alias: proxy_authorize(realm, table)</para>
@@ -501,6 +526,9 @@ if (!proxy_authorize("$fd", "subscriber)) {
<itemizedlist>
<listitem>
+ <para>Route block to resume after async MAR Diameter reply.</para>
+ </listitem>
+ <listitem>
<para><emphasis>realm</emphasis> - Realm is a opaque string that the
user agent should present to the user so he can decide what username
and password to use. Usually this is domain of the host the server
@@ -531,9 +559,33 @@ if (!proxy_authorize("$fd", "subscriber)) {
<programlisting format="linespecific">
...
if (!proxy_authorize("$fd", "subscriber)) {
- proxy_challenge("$fd", "1"); # Realm will be autogenerated
+ proxy_challenge("REG_MAR_REPLY","$fd", "1"); # Realm will be autogenerated
};
...
+route[REG_MAR_REPLY]
+{
+ #this is async so to know status we have to check the reply avp
+ xlog("L_DBG","maa_return code is $avp(s:maa_return_code)\n");
+
+ switch ($avp(s:maa_return_code)){
+ case 1: #success
+ xlog("L_DBG", "MAR success - 401/407 response sent from module\n");
+ break;
+ case -1: #failure
+ xlog("L_ERR", "MAR failure - error response sent from module\n");
+ break;
+ case -2: #error
+ xlog("L_ERR", "MAR error - sending error response now\n");
+ t_reply("500", "MAR failed");
+ break;
+ default:
+ xlog("L_ERR", "Unknown return code from MAR, value is [$avp(s:uaa_return_code)]\n");
+ t_reply("500", "Unknown response code from MAR");
+ break;
+ }
+ exit;
+}
+...
</programlisting>
</example>
</section>
More information about the sr-dev
mailing list