[Freeswitch-svn] [commit] r4213 - freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua

Freeswitch SVN mikej at freeswitch.org
Mon Feb 12 18:14:37 EST 2007


Author: mikej
Date: Mon Feb 12 18:14:36 2007
New Revision: 4213

Modified:
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c

Log:
ignore CANCEL of incoming requests after we send a final response.  Patch by me and Kai Vehmanen.

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c	Mon Feb 12 18:14:36 2007
@@ -2210,16 +2210,15 @@
   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;
 }



More information about the Freeswitch-svn mailing list