From 3e4e15924fe5813026e2a689388bf031190c7e3d Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Mon, 12 Feb 2007 23:14:36 +0000 Subject: [PATCH] ignore CANCEL of incoming requests after we send a final response. Patch by me and Kai Vehmanen. git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4213 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c b/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c index 9d2a5be360..5f39cf4a44 100644 --- a/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c +++ b/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c @@ -2210,16 +2210,15 @@ int process_cancel(nua_server_request_t *sr, nua_session_usage_t *ss = nua_dialog_usage_private(sr->sr_usage); msg_t *cancel = nta_incoming_getrequest_ackcancel(irq); - assert(nta_incoming_status(irq) < 200); - assert(nua_server_request_is_pending(sr)); - assert(ss); assert(ss == nua_session_usage_get(nh->nh_ds)); (void)ss; + if (nta_incoming_status(irq) < 200 && nua_server_request_is_pending(sr) && + ss && (ss == nua_session_usage_get(nh->nh_ds))) { + nua_stack_event(nh->nh_nua, nh, cancel, nua_i_cancel, SIP_200_OK, NULL); - nua_stack_event(nh->nh_nua, nh, cancel, nua_i_cancel, SIP_200_OK, NULL); + SR_STATUS1(sr, SIP_487_REQUEST_TERMINATED); - SR_STATUS1(sr, SIP_487_REQUEST_TERMINATED); - - nua_server_respond(sr, NULL); - nua_server_report(sr); + nua_server_respond(sr, NULL); + nua_server_report(sr); + } return 0; }