On 05/17/2010 06:30 PM, Ricardo Martinez wrote:
I'm sending the INVITE to the asterisk box.. the asterisk responds a "SIP/2.0 401 Unauthorized." From where do I get the user/pass to authenticate the user?
In your initial request route, arm a failure route and catch the 401 challenge:
route { ...
t_on_failure("FAILURE_HANDLE");
if(!t_relay()) sl_reply_error();
}
failure_route[FAILURE_HANDLE] {
if(t_is_cancelled()) exit;
if(t_check_status("401")) { uac_auth(); }
...
t_relay(); }
}