Trying to implement a way to authenticate outgoing INVITEs to endpoints that need/want to. uac_auth in the initial failure route works fine when there is only 1 registered user to send the INVITE to. But with at least 2 locations are available and 1 accepts the INVITE without authentication, the 401 of the location that wants authentication isn't processed in the failure route until a timeout is triggered (t_set_fr). At that point the 401 is processed and a response generated with Authentication header. But since t_set_fr invite timeout was exceeded it is immediatly destroyed due to a CANCEL having been generated to the location(s).
t=0: t_set_fr(10000); INVITE to A anb B A responds 100 Trying,180 Ringing B responds 401 Unauthorized
t=10s: T_code=180, new_code=408 failure route status: 401 uac_auth() INVITE with Authorization is build to B CANCEL to A INVITE to B is never send
Is this expected behaviour? Obviously I didn't expect this.