diff options
author | Mark Michelson <mmichelson@digium.com> | 2015-03-27 20:30:18 +0000 |
---|---|---|
committer | Mark Michelson <mmichelson@digium.com> | 2015-03-27 20:30:18 +0000 |
commit | 85feac857c659c8ddff3af67099f0b0bd34fb2b2 (patch) | |
tree | b825a9916fe72408833484ed5ceb305e1772c2a7 /res/res_pjsip_messaging.c | |
parent | dc2cf21144b81800329bad4596ded07ed0882ed7 (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/
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@433619 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_pjsip_messaging.c')
-rw-r--r-- | res/res_pjsip_messaging.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/res/res_pjsip_messaging.c b/res/res_pjsip_messaging.c index f3ae5e674..5caf89374 100644 --- a/res/res_pjsip_messaging.c +++ b/res/res_pjsip_messaging.c @@ -610,7 +610,6 @@ static pj_status_t send_response(pjsip_rx_data *rdata, enum pjsip_status_code co { pjsip_tx_data *tdata; pj_status_t status; - pjsip_response_addr res_addr; status = ast_sip_create_response(rdata, code, NULL, &tdata); if (status != PJ_SUCCESS) { @@ -623,15 +622,8 @@ static pj_status_t send_response(pjsip_rx_data *rdata, enum pjsip_status_code co } else { struct ast_sip_endpoint *endpoint; - /* Get where to send response. */ - status = pjsip_get_response_addr(tdata->pool, rdata, &res_addr); - if (status != PJ_SUCCESS) { - ast_log(LOG_ERROR, "Unable to get response address (%d)\n", status); - return status; - } - endpoint = ast_pjsip_rdata_get_endpoint(rdata); - status = ast_sip_send_response(&res_addr, tdata, endpoint); + status = ast_sip_send_stateful_response(rdata, tdata, endpoint); ao2_cleanup(endpoint); } |