diff options
author | Mark Michelson <mmichelson@digium.com> | 2015-03-27 20:46:55 +0000 |
---|---|---|
committer | Mark Michelson <mmichelson@digium.com> | 2015-03-27 20:46:55 +0000 |
commit | 0b62e416541066c53088013fc99a0775f9b318e3 (patch) | |
tree | 94c712348790ee066a10e152c904f40b1d8cb320 /res/res_pjsip_registrar.c | |
parent | a18da4eaf20223b0d20754dc51f769da53909fdb (diff) |
Add stateful PJSIP response API call, and use it for out-of-dialog responses.
Asterisk had an issue where retransmissions of MESSAGE requests resulted in
Asterisk processing the retransmission as if it were a new MESSAGE request.
This patch fixes the issue by creating a transaction in PJSIP on the incoming
request. This way, if a retransmission arrives, the PJSIP transaction layer
will resend the response and Asterisk will not ever see the retransmission.
ASTERISK-24920 #close
Reported by Mark Michelson
Review: https://reviewboard.asterisk.org/r/4532/
........
Merged revisions 433619 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433620 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_pjsip_registrar.c')
-rw-r--r-- | res/res_pjsip_registrar.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/res/res_pjsip_registrar.c b/res/res_pjsip_registrar.c index 7fe2b77d9..944a6055e 100644 --- a/res/res_pjsip_registrar.c +++ b/res/res_pjsip_registrar.c @@ -418,7 +418,6 @@ static int rx_task(void *data) pjsip_contact_hdr *contact_hdr = NULL; struct registrar_contact_details details = { 0, }; pjsip_tx_data *tdata; - pjsip_response_addr addr; const char *aor_name = ast_sorcery_object_get_id(task_data->aor); RAII_VAR(struct ast_str *, path_str, NULL, ast_free); struct ast_sip_contact *response_contact; @@ -603,11 +602,7 @@ static int rx_task(void *data) pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*)expires_hdr); } - if (pjsip_get_response_addr(tdata->pool, task_data->rdata, &addr) == PJ_SUCCESS) { - ast_sip_send_response(&addr, tdata, task_data->endpoint); - } else { - pjsip_tx_data_dec_ref(tdata); - } + ast_sip_send_stateful_response(task_data->rdata, tdata, task_data->endpoint); return PJ_TRUE; } |