res_pjsip_session: Fix in-dialog authentication.
authorRichard Mudgett <rmudgett@digium.com>
Tue, 26 May 2015 18:56:42 +0000 (13:56 -0500)
committerRichard Mudgett <rmudgett@digium.com>
Mon, 1 Jun 2015 15:50:35 +0000 (10:50 -0500)
commit5cdcae5240be4f284b108187bfbcdb0e42121341
tree4d3c794a078fa2875028effea86a024026245671
parent9f1939ee2730c90b5cd2f43d8e0bc3780addb606
res_pjsip_session: Fix in-dialog authentication.

When the remote peer requires authentication for in-dialog requests then
re-INVITEs to the peer cause the call to be disconnected and other
in-dialog requests to the peer like MESSAGE just don't go through.

* Made session_inv_on_tsx_state_changed() handle in-dialog authentication
for re-INVITEs and other methods.  Initial INVITEs cannot be handled here
because the INVITE transaction must be restarted earlier.

* Pulled needed code from res/res_pjsip/pjsip_outbound_auth.c in
preparation for removing the file.  The generic outbound authentication
code did not work as well as anticipated.

* Created outbound_invite_auth() to only handle initial outbound INVITEs.
Re-INVITEs cannot be handled here.  The re-INVITE transaction is still in
progress and the PJSIP library cannot handle the overlapping INVITE
transactions.  Other method types should not be handled here as this code
only works on outgoing calls and we need to handle incoming and outgoing
calls.

ASTERISK-25131 #close
Reported by: Richard Mudgett

Change-Id: I12bdd7ddccc819b4ce4b091e826d1e26334601b0
res/res_pjsip_session.c