diff options
author | Matt Jordan <mjordan@digium.com> | 2015-04-24 12:24:02 -0500 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2015-04-24 12:24:02 -0500 |
commit | 3646ce0cb59d595d6e4f2a3ef30185085ab5f692 (patch) | |
tree | f6c4e1d2ce18ff73a275865a3c00ab5cfa7faa0b /res | |
parent | 1ec829a74b4d4322a20399ea6bd59f521fe21aa5 (diff) | |
parent | bd61c9300cb143b44b326bbe4c5340307d18c2cd (diff) |
Merge "res_pjsip_outbound_authenticator: Increase CSeq on authed requests."
Diffstat (limited to 'res')
-rw-r--r-- | res/res_pjsip_outbound_authenticator_digest.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/res/res_pjsip_outbound_authenticator_digest.c b/res/res_pjsip_outbound_authenticator_digest.c index 64238a868..35e59f21a 100644 --- a/res/res_pjsip_outbound_authenticator_digest.c +++ b/res/res_pjsip_outbound_authenticator_digest.c @@ -105,6 +105,7 @@ static int digest_create_request_with_auth(const struct ast_sip_auth_vector *aut pjsip_transaction *tsx, 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) { @@ -120,6 +121,15 @@ 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)) { 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 + * original request. Some SIP implementations will not process the new request + * since the CSeq is the same as the original request. Incrementing it here + * fixes the interop issue + */ + cseq = pjsip_msg_find_hdr((*new_request)->msg, PJSIP_H_CSEQ, NULL); + ast_assert(cseq != NULL); + ++cseq->cseq; return 0; case PJSIP_ENOCREDENTIAL: ast_log(LOG_WARNING, "Unable to create request with auth." |