Skip to content

Commit

Permalink
uac: docs - listed uac_auth_mode() function
Browse files Browse the repository at this point in the history
  • Loading branch information
miconda committed Mar 11, 2021
1 parent afe84de commit be4e184
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions src/modules/uac/doc/uac_admin.xml
Expand Up @@ -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>
Expand Down

0 comments on commit be4e184

Please sign in to comment.