[Freeswitch-svn] [commit] r13960 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/nua
FreeSWITCH SVN
mikej at freeswitch.org
Thu Jun 25 11:46:15 PDT 2009
Author: mikej
Date: Thu Jun 25 13:46:14 2009
New Revision: 13960
Log:
Thu Jun 25 12:25:56 CDT 2009 Pekka Pessi <first.last at nokia.com>
* check_session.c: check correct non-support for 100rel
Thu Jun 25 12:26:46 CDT 2009 Pekka Pessi <first.last at nokia.com>
* nua_session.c: if 100rel is not supported by nua, do not Require it in response
Thu Jun 25 12:33:45 CDT 2009 Pekka Pessi <first.last at nokia.com>
* check_session.c: cleaned test for SFSIP-125
Fixes SFSIP-125
Modified:
freeswitch/trunk/libs/sofia-sip/.update
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/check_session.c
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c
Modified: freeswitch/trunk/libs/sofia-sip/.update
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/.update (original)
+++ freeswitch/trunk/libs/sofia-sip/.update Thu Jun 25 13:46:14 2009
@@ -1 +1 @@
-Thu Jun 25 13:43:44 CDT 2009
+Thu Jun 25 13:44:49 CDT 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 Thu Jun 25 13:46:14 2009
@@ -1408,6 +1408,95 @@
}
END_TEST
+START_TEST(call_2_4_3)
+{
+ struct message *response;
+
+ S2_CASE("2.4.3", "Call without 100rel",
+ "NUA receives INVITE with Required: 100rel, "
+ "rejects it with 420");
+
+ nua_set_params(s2->nua,
+ SIPTAG_SUPPORTED(SIP_NONE),
+ SIPTAG_SUPPORTED_STR("timer"),
+ TAG_END());
+ fail_unless_event(nua_r_set_params, 200);
+
+ soa_generate_offer(soa, 1, NULL);
+ request_with_sdp(dialog, SIP_METHOD_INVITE, NULL,
+ SIPTAG_REQUIRE_STR("100rel"),
+ TAG_END());
+
+ response = s2_sip_wait_for_response(420, SIP_METHOD_INVITE);
+ fail_if(!response);
+ fail_if(s2_sip_request_to(dialog, SIP_METHOD_ACK, NULL, TAG_END()));
+}
+END_TEST
+
+START_TEST(call_2_4_4)
+{
+ nua_handle_t *nh;
+ struct event *invite;
+ struct message *response;
+
+ S2_CASE("2.4.3", "Call without 100rel",
+ "NUA receives INVITE with Supported: 100rel, "
+ "proceeds normally");
+
+ nua_set_params(s2->nua,
+ SIPTAG_SUPPORTED(SIP_NONE),
+ SIPTAG_SUPPORTED_STR("timer"),
+ TAG_END());
+ fail_unless_event(nua_r_set_params, 200);
+
+ soa_generate_offer(soa, 1, NULL);
+ request_with_sdp(dialog, SIP_METHOD_INVITE, NULL,
+ SIPTAG_SUPPORTED_STR("100rel"),
+ TAG_END());
+
+ invite = s2_wait_for_event(nua_i_invite, 100); fail_unless(invite != NULL);
+ fail_unless(s2_check_callstate(nua_callstate_received));
+
+ nh = invite->nh; fail_if(!nh);
+
+ s2_free_event(invite);
+
+ response = s2_sip_wait_for_response(100, SIP_METHOD_INVITE);
+ fail_if(!response);
+
+ nua_respond(nh, SIP_183_SESSION_PROGRESS,
+ SOATAG_USER_SDP_STR("m=audio 5004 RTP/AVP 0 8"),
+ TAG_END());
+ fail_unless(s2_check_callstate(nua_callstate_early));
+
+ response = s2_sip_wait_for_response(183, SIP_METHOD_INVITE);
+ fail_if(!response);
+ fail_if(response->sip->sip_require);
+ s2_sip_update_dialog(dialog, response);
+ process_answer(response);
+ s2_sip_free_message(response);
+
+ nua_respond(nh, SIP_200_OK, TAG_END());
+
+ fail_unless(s2_check_callstate(nua_callstate_completed));
+
+ response = s2_sip_wait_for_response(200, SIP_METHOD_INVITE);
+ fail_if(!response);
+ s2_sip_update_dialog(dialog, response);
+ s2_sip_free_message(response);
+
+ fail_if(s2_sip_request_to(dialog, SIP_METHOD_ACK, NULL, TAG_END()));
+
+ fail_unless_event(nua_i_ack, 200);
+ fail_unless(s2_check_callstate(nua_callstate_ready));
+
+ bye_to_nua(nh, TAG_END());
+
+ nua_handle_destroy(nh);
+}
+END_TEST
+
+
TCase *invite_100rel_tcase(int threading)
{
TCase *tc = tcase_create("2.4 - INVITE with 100rel");
@@ -1415,6 +1504,8 @@
{
tcase_add_test(tc, call_2_4_1);
tcase_add_test(tc, call_2_4_2);
+ tcase_add_test(tc, call_2_4_3);
+ tcase_add_test(tc, call_2_4_4);
}
return tc;
}
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 Thu Jun 25 13:46:14 2009
@@ -2409,6 +2409,8 @@
if (require == NULL && supported == NULL)
return 0;
+ if (!sip_has_feature(NH_PGET(nh, supported), "100rel"))
+ return 0;
if (sip_has_feature(require, "100rel"))
return 1;
if (!sip_has_feature(supported, "100rel"))
More information about the Freeswitch-svn
mailing list