Module: kamailio
Branch: master
Commit: be4e1843c54e70206688c1f2d1f5483165baef8f
URL:
https://github.com/kamailio/kamailio/commit/be4e1843c54e70206688c1f2d1f5483…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2021-03-11T18:39:16+01:00
uac: docs - listed uac_auth_mode() function
---
Modified: src/modules/uac/doc/uac_admin.xml
---
Diff:
https://github.com/kamailio/kamailio/commit/be4e1843c54e70206688c1f2d1f5483…
Patch:
https://github.com/kamailio/kamailio/commit/be4e1843c54e70206688c1f2d1f5483…
---
diff --git a/src/modules/uac/doc/uac_admin.xml b/src/modules/uac/doc/uac_admin.xml
index a738c84b81..c8271974a3 100644
--- a/src/modules/uac/doc/uac_admin.xml
+++ b/src/modules/uac/doc/uac_admin.xml
@@ -884,6 +884,57 @@ failure_route[TRUNKAUTH] {
exit;
}
}
+...
+ </programlisting>
+ </example>
+ </section>
+ <section id="uac.f.uac_auth_mode">
+ <title>
+ <function moreinfo="none">uac_auth_mode(vmode)</function>
+ </title>
+ <para>
+ This function can be called only from failure route and will
+ build the authentication response header and insert it into the
+ request without sending anything.
+ </para>
+ <para>
+ If mode is set to 1, then the password has to be provided in HA1 format.
+ The parameter can be a static integer or a variable holding an integer value.
+ </para>
+ <para>
+ This function can be used from FAILURE_ROUTE.
+ </para>
+ <example>
+ <title><function>uac_auth_mode</function> usage</title>
+ <programlisting format="linespecific">
+...
+modparam("uac","auth_username_avp","$avp(auser)")
+modparam("uac","auth_password_avp","$avp(apass)")
+modparam("uac","auth_realm_avp","$avp(arealm)")
+
+request_route {
+ ...
+ if(is_method("INVITE")) {
+ t_on_failure("TRUNKAUTH");
+ }
+ ...
+}
+
+failure_route[TRUNKAUTH] {
+
+ if (t_is_canceled()) {
+ exit;
+ }
+ if(t_check_status("401|407")) {
+ $avp(auser) = "test";
+ $avp(apass) = "test";
+ # $avp(apass) = "36d0a02793542b4961e8348347236dbf";
+ if (uac_auth_mode("1")) {
+ t_relay();
+ }
+ exit;
+ }
+}
...
</programlisting>
</example>