[SR-Users] UACREG - answering to 401 on invite
Daniel Tryba
d.tryba at pocos.nl
Tue Sep 26 16:03:23 CEST 2017
On Tue, Sep 26, 2017 at 09:36:19AM -0400, Jean CĂ©rien wrote:
> I've inserted the following block on the failure route:
> if (t_check_status("401|407")) {
> xlog("L_INFO","failure_route(ROUTEFAIL) @@ call to
> uac_auth()\n");
> uac_auth();
> t_relay();
> exit;
> }
Unlike when calling uac_reg_request_to, you'll have to fill the
auth_*_avp pvs yourself. So in the example you have to fill $avp(auser)
and $avp(apass).
modparam("uac","auth_username_avp","$avp(auser)")
modparam("uac","auth_password_avp","$avp(apass)")
modparam("uac","auth_realm_avp","$avp(arealm)")
...
if(t_check_status("401|407")) {
$avp(auser) = "test";
$avp(apass) = "test";
uac_auth();
t_relay();
exit;
}
So next problem is how to get those credentials. You already know the
user making the call. So either have a custom query to a custom table
(sqlops/avpops) to retrieve the external user/pass for current user, or
try to store that information with the subscriber data (saw some
suggestions for this a while back on the list).
More information about the sr-users
mailing list