From 4c606d6df486f2b275a522fbfc5067ebc6b3614f Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Wed, 10 Sep 2008 16:21:28 +0000 Subject: [PATCH] Wed Sep 10 09:39:03 EDT 2008 Pekka Pessi * check_session.c: added case 2.1.8, Call using NUTAG_PROXY(). git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9508 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- .../libsofia-sip-ua/nua/check_session.c | 45 +++++++++++++++++-- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/libs/sofia-sip/libsofia-sip-ua/nua/check_session.c b/libs/sofia-sip/libsofia-sip-ua/nua/check_session.c index 5c0dc62ae2..314e30083f 100644 --- a/libs/sofia-sip/libsofia-sip-ua/nua/check_session.c +++ b/libs/sofia-sip/libsofia-sip-ua/nua/check_session.c @@ -47,6 +47,9 @@ #include #include +/* define XXX as 1 in order to see all failing test cases */ +#define XXX (0) + /* ====================================================================== */ /* Call cases */ @@ -230,9 +233,7 @@ invite_by_nua(nua_handle_t *nh, ta_list ta; ta_start(ta, tag, value); - invite = invite_sent_by_nua( - nh, SOATAG_USER_SDP_STR("m=audio 5004 RTP/AVP 0 8"), - ta_tags(ta)); + invite = invite_sent_by_nua(nh, ta_tags(ta)); ta_end(ta); process_offer(invite); @@ -588,6 +589,43 @@ START_TEST(call_2_1_7) END_TEST +START_TEST(call_2_1_8) +{ + nua_handle_t *nh; + struct message *invite, *ack; + + s2_case("2.1.8", "Call using NUTAG_PROXY()", + "Test handle-specific NUTAG_PROXY()."); + + nh = nua_handle(nua, NULL, SIPTAG_TO(s2->local), TAG_END()); + + invite = invite_sent_by_nua( + nh, SOATAG_USER_SDP_STR("m=audio 5004 RTP/AVP 0 8"), + NUTAG_PROXY(s2->tcp.contact->m_url), TAG_END()); + + 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)); + + respond_with_sdp(invite, dialog, SIP_200_OK, TAG_END()); + s2_free_message(invite); + fail_unless(s2_check_event(nua_r_invite, 200)); + fail_unless(s2_check_callstate(nua_callstate_ready)); + ack = s2_wait_for_request(SIP_METHOD_ACK); + fail_unless(ack && tport_is_tcp(ack->tport)); + + bye_by_nua(nh, TAG_END()); + + nua_handle_destroy(nh); +} +END_TEST + + TCase *invite_tcase(void) { TCase *tc = tcase_create("2.1 - Basic INVITE"); @@ -600,6 +638,7 @@ TCase *invite_tcase(void) tcase_add_test(tc, call_2_1_5); tcase_add_test(tc, call_2_1_6); tcase_add_test(tc, call_2_1_7); + tcase_add_test(tc, call_2_1_8); } return tc; }