summaryrefslogtreecommitdiff
path: root/res/res_pjsip_outbound_authenticator_digest.c
diff options
context:
space:
mode:
Diffstat (limited to 'res/res_pjsip_outbound_authenticator_digest.c')
-rw-r--r--res/res_pjsip_outbound_authenticator_digest.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/res/res_pjsip_outbound_authenticator_digest.c b/res/res_pjsip_outbound_authenticator_digest.c
index 35e59f21a..aa35fbac0 100644
--- a/res/res_pjsip_outbound_authenticator_digest.c
+++ b/res/res_pjsip_outbound_authenticator_digest.c
@@ -101,14 +101,14 @@ cleanup:
return res;
}
-static int digest_create_request_with_auth(const struct ast_sip_auth_vector *auths, pjsip_rx_data *challenge,
- pjsip_transaction *tsx, pjsip_tx_data **new_request)
+static int digest_create_request_with_auth_from_old(const struct ast_sip_auth_vector *auths, pjsip_rx_data *challenge,
+ pjsip_tx_data *old_request, pjsip_tx_data **new_request)
{
pjsip_auth_clt_sess auth_sess;
pjsip_cseq_hdr *cseq;
if (pjsip_auth_clt_init(&auth_sess, ast_sip_get_pjsip_endpoint(),
- tsx->pool, 0) != PJ_SUCCESS) {
+ old_request->pool, 0) != PJ_SUCCESS) {
ast_log(LOG_WARNING, "Failed to initialize client authentication session\n");
return -1;
}
@@ -119,7 +119,7 @@ static int digest_create_request_with_auth(const struct ast_sip_auth_vector *aut
}
switch (pjsip_auth_clt_reinit_req(&auth_sess, challenge,
- tsx->last_tx, new_request)) {
+ old_request, new_request)) {
case PJ_SUCCESS:
/* PJSIP creates a new transaction for new_request (meaning it creates a new
* branch). However, it recycles the Call-ID, from-tag, and CSeq from the
@@ -150,6 +150,12 @@ static int digest_create_request_with_auth(const struct ast_sip_auth_vector *aut
return -1;
}
+static int digest_create_request_with_auth(const struct ast_sip_auth_vector *auths, pjsip_rx_data *challenge,
+ pjsip_transaction *tsx, pjsip_tx_data **new_request)
+{
+ return digest_create_request_with_auth_from_old(auths, challenge, tsx->last_tx, new_request);
+}
+
static struct ast_sip_outbound_authenticator digest_authenticator = {
.create_request_with_auth = digest_create_request_with_auth,
};