From 0b62e416541066c53088013fc99a0775f9b318e3 Mon Sep 17 00:00:00 2001 From: Mark Michelson Date: Fri, 27 Mar 2015 20:46:55 +0000 Subject: 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 --- res/res_pjsip_registrar.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'res/res_pjsip_registrar.c') 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; } -- cgit v1.2.3