From aed0a007c128947e004e9963a84b69a68465d3d9 Mon Sep 17 00:00:00 2001 From: Liong Sauw Ming Date: Wed, 21 Aug 2013 09:32:24 +0000 Subject: Re #817: Fix replying to re-INVITE after it was cancelled (thanks to Saúl Ibarra Corretgé for the patch) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4583 74dad513-b988-da41-8d7b-12977e46ad98 --- pjsip/include/pjsip-ua/sip_inv.h | 4 ++++ pjsip/src/pjsip-ua/sip_inv.c | 13 ++----------- 2 files changed, 6 insertions(+), 11 deletions(-) (limited to 'pjsip') diff --git a/pjsip/include/pjsip-ua/sip_inv.h b/pjsip/include/pjsip-ua/sip_inv.h index 4e5f820e..5782cf92 100644 --- a/pjsip/include/pjsip-ua/sip_inv.h +++ b/pjsip/include/pjsip-ua/sip_inv.h @@ -172,6 +172,10 @@ typedef struct pjsip_inv_callback * #pjsip_inv_set_sdp_answer() and the re-INVITE will be answered * automatically. * + * Remarks: Application may need to monitor on_tsx_state_changed() + * callback to check whether the re-INVITE is already answered + * automatically with 487 due to being cancelled. + * * @param inv The invite session. * @param offer Remote offer. * @param rdata The received re-INVITE request. diff --git a/pjsip/src/pjsip-ua/sip_inv.c b/pjsip/src/pjsip-ua/sip_inv.c index 8c63f760..e73049bf 100644 --- a/pjsip/src/pjsip-ua/sip_inv.c +++ b/pjsip/src/pjsip-ua/sip_inv.c @@ -4271,18 +4271,9 @@ static void inv_on_state_confirmed( pjsip_inv_session *inv, pjsip_event *e) { /* - * Handle strandled incoming CANCEL. + * Handle strandled incoming CANCEL or CANCEL for re-INVITE */ - pjsip_rx_data *rdata = e->body.tsx_state.src.rdata; - pjsip_tx_data *tdata; - pj_status_t status; - - status = pjsip_dlg_create_response(dlg, rdata, 200, NULL, &tdata); - if (status != PJ_SUCCESS) return; - - status = pjsip_dlg_send_response(dlg, tsx, tdata); - if (status != PJ_SUCCESS) return; - + inv_respond_incoming_cancel(inv, tsx, e); } else if (tsx->method.id == PJSIP_INVITE_METHOD && tsx->role == PJSIP_ROLE_UAS) -- cgit v1.2.3