Attached below is I believe a more complete version of the patch that kv
just committed to darcs.  There is a second piece to this problem.
nua_server_request_is_pending is incorrectly not true after some 1xx
responses.  I believe the correct fix for this may be:

Index: nua_session.c
===================================================================
--- nua_session.c       (revision 4213)
+++ nua_session.c       (working copy)
@@ -1962,7 +1962,6 @@
   }
 
   if (reliable && sr->sr_status < 200) {
-    sr->sr_response.msg = NULL, sr->sr_response.sip = NULL;
     if (nta_reliable_mreply(sr->sr_irq, process_prack, nh, msg) ==
NULL)
       return -1;
     return 0;
@@ -1972,7 +1971,7 @@
     if (session_timer_is_supported(nh))
       use_session_timer(ss, 1, 1, msg, sip);
 
-  return nua_base_server_respond(sr, tags);  
+  return nua_server_respond(sr, tags);  
 }
 
 /** Check if the response should be sent reliably.



Mike


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Freeswitch SVN
Sent: Monday, February 12, 2007 6:15 PM
To: [EMAIL PROTECTED]
Subject: [Freeswitch-trunk] [commit] r4213
-freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua

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;
 }

_______________________________________________
Freeswitch-trunk mailing list
[EMAIL PROTECTED]
http://lists.freeswitch.org/mailman/listinfo/freeswitch-trunk
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-trunk
http://www.freeswitch.org

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel

Reply via email to