summaryrefslogtreecommitdiff
path: root/res/res_pjsip
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2015-04-27 16:13:22 -0500
committerMark Michelson <mmichelson@digium.com>2015-04-29 12:04:06 -0500
commit4f1db2070da56f0357c10fad729dd5e90644a042 (patch)
tree4cbe5efe05fea294b8f19f7c7d45f909a7e11770 /res/res_pjsip
parented5715eb3994d08fdf81001dabdb39b171a308ac (diff)
res_pjsip_outbound_registration: Don't fail on delayed processing.
Odd behaviors have been observed during outbound registrations. The most common problem witnessed has been one where a request with authentication credentials cannot be created after receiving a 401 response. Other behaviors include apparently processing an incorrect SIP response. Inspecting the code led to an apparent issue with regards to how we handle transactions in outbound registration code. When a response to a REGISTER arrives, we save a pointer to the transaction and then push a task onto the registration serializer. Between the time that we save the pointer and push the task, it's possible for the transaction to be destroyed due to a timeout. It's also possible for the address to be reused by the transaction layer for a new transaction. To allow for authentication of a REGISTER request to be authenticated after the transaction has timed out, we now hold a reference to the original REGISTER request instead of the transaction. The function for creating a request with authentication has been altered to take the original request instead of the transaction where the original request was sent. ASTERISK-25020 Reported by Mark Michelson Change-Id: I756c19ab05ada5d0503175db9676acf87c686d0a
Diffstat (limited to 'res/res_pjsip')
-rw-r--r--res/res_pjsip/pjsip_outbound_auth.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/res/res_pjsip/pjsip_outbound_auth.c b/res/res_pjsip/pjsip_outbound_auth.c
index 1f754227a..8b39b000d 100644
--- a/res/res_pjsip/pjsip_outbound_auth.c
+++ b/res/res_pjsip/pjsip_outbound_auth.c
@@ -63,7 +63,7 @@ static pj_bool_t outbound_auth(pjsip_rx_data *rdata)
return PJ_FALSE;
}
- if (ast_sip_create_request_with_auth(&endpoint->outbound_auths, rdata, tsx, &tdata)) {
+ if (ast_sip_create_request_with_auth(&endpoint->outbound_auths, rdata, tsx->last_tx, &tdata)) {
return PJ_FALSE;
}