[Freeswitch-svn] [commit] r12397 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/nua

FreeSWITCH SVN mikej at freeswitch.org
Tue Mar 3 14:00:18 PST 2009


Author: mikej
Date: Tue Mar  3 16:00:18 2009
New Revision: 12397

Log:
Tue Mar  3 11:30:32 CST 2009  Pekka Pessi <first.last at nokia.com>
  * check_nua: added test case for CANCELed INVITE timing out



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

Modified: freeswitch/trunk/libs/sofia-sip/.update
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/.update	(original)
+++ freeswitch/trunk/libs/sofia-sip/.update	Tue Mar  3 16:00:18 2009
@@ -1 +1 @@
-Tue Mar  3 11:27:12 CST 2009
+Tue Mar  3 15:59:49 CST 2009

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/check_session.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/check_session.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/check_session.c	Tue Mar  3 16:00:18 2009
@@ -1005,6 +1005,53 @@
 }
 END_TEST
 
+
+START_TEST(cancel_2_2_8)
+{
+  nua_handle_t *nh;
+  struct message *invite, *cancel;
+  int timeout;
+
+  s2_case("2.2.8", "CANCEL and INVITE times out",
+	  "NUA is caller, NUA sends CANCEL after receiving 180 "
+	  "but UAS never responds.");
+
+  nh = nua_handle(nua, NULL, SIPTAG_TO(s2sip->aor), TAG_END());
+
+  nua_invite(nh, SOATAG_USER_SDP_STR("m=audio 5004 RTP/AVP 0 8"),
+	     TAG_END());
+  fail_unless(s2_check_callstate(nua_callstate_calling));
+
+  invite = s2_sip_wait_for_request(SIP_METHOD_INVITE);
+  process_offer(invite);
+  respond_with_sdp(
+    invite, dialog, SIP_180_RINGING,
+    SIPTAG_CONTENT_DISPOSITION_STR("session;handling=optional"),
+    TAG_END());
+  fail_unless(s2_check_event(nua_r_invite, 180));
+  fail_unless(s2_check_callstate(nua_callstate_proceeding));
+
+  nua_cancel(nh, TAG_END());
+  cancel = s2_sip_wait_for_request(SIP_METHOD_CANCEL);
+  s2_sip_free_message(cancel);
+  fail_if(!cancel);
+
+  /* Now, time out both CANCEL and INVITE */
+  for (timeout = 0; timeout < 34; timeout++) {
+    s2_nua_fast_forward(1, s2base->root);
+    cancel = s2_sip_next_request(SIP_METHOD_CANCEL);
+    if (cancel)
+      s2_sip_free_message(cancel);
+  }
+
+  fail_unless(s2_check_event(nua_r_cancel, 408));
+  fail_unless(s2_check_event(nua_r_invite, 408));
+  fail_unless(s2_check_callstate(nua_callstate_terminated));
+  nua_handle_destroy(nh);
+}
+END_TEST
+
+
 TCase *cancel_tcase(int threading)
 {
   TCase *tc = tcase_create("2.2 - CANCEL");
@@ -1017,6 +1064,7 @@
   if (XXX) tcase_add_test(tc, cancel_2_2_5);
   tcase_add_test(tc, cancel_2_2_6);
   tcase_add_test(tc, cancel_2_2_7);
+  tcase_add_test(tc, cancel_2_2_8);
 
   return tc;
 }



More information about the Freeswitch-svn mailing list