Attached patch with unit test to verify this.

The patch that corrects this problem is still not ok.

On the test unit if not send the 180 patch works, but not :(


2010/9/22 Paulo Pizarro <paulo.piza...@gmail.com>:
>  Attached a patch which fixes the problem of sending the answer SDP on
> the PRACK request.
>
> Now, all nua tests passed.
>
> 2010/9/22 Paulo Pizarro <paulo.piza...@gmail.com>:
>> 2010/9/21 Paulo Pizarro <paulo.piza...@gmail.com>:
>>> Dear all,
>>>
>>> The useragent "A" sent a INVITE without the SDP offer, the useragent
>>> "B" sent a 183 with the SDP offer and the useragent "A" sent a PRACK
>>> with a SDP answer. The O/A round is complete. After that, the
>>> useragent "B" answer the call (sent 200 to INVITE) and then "nua" sent
>>> a BYE (900 internal media error).
>>>
>>> A                                    B
>>>
>>> --------------INVITE------------>
>>>
>>> <---------183 (offer)-------------
>>> --------PRACK (answer)----->
>>> <---------200/PRACK----------
>>>
>>>
>>> <---------------180----------------
>>> --------------PRACK----------->
>>> <------------200/PRACK-------
>>>
>>>
>>> <-----------------200-------------
>>> ------------------ACK----------->
>>>
>>> When "nua" receives the SDP offer on the 183, it calls
>>> "soa_generate_answer" and sent the SDP answer on the PRACK of the 183.
>>> The  O/A round is complete.
>>>
>>> When "nua" receives the 200 from the INVITE, it calls
>>> "soa_generate_answer" again, but now it generates an error (900
>>> Internal media error) because there is no negotiation in progress.
>>>
>>> Attached log of call.
>>>
>>> Attached a patch to fixes this problem.
>>> With the latest git code, make check fails during check_nta:
>>>
>>> make[4]: Entrando no diretório
>>> `/home/pizarro/workspace/src/sofia-sip/sofia-sip-git/libsofia-sip-ua/nta'
>>>         COMPILE check_nta.o
>>>         COMPILE check_nta_api.o
>>>         COMPILE check_nta_client.o
>>>         LINK check_nta
>>> check_nta.o: In function `main':
>>> /home/pizarro/workspace/src/sofia-sip/sofia-sip-git/libsofia-sip-ua/nta/check_nta.c:116:
>>> undefined reference to `check_nta_server_3_0'
>>> collect2: ld returned 1 exit status
>>> make[4]: ** [check_nta] Erro 1
>>>
>>
>> I ran autogen.sh, configure, make and make check  again and now NTA check is 
>> ok.
>>
>>> I could not run the nua tests, I hope this patch does not break anything. :)
>>
>> I ran nua tests and the patch doesn't work.
>>
>> The following tests after applying the patch failed:
>>
>> check_session.c:1622:E:2.5 - Call with preconditions:call_2_5_1:0:
>> (after this point) Test timeout expired
>> check_session.c:1704:F:2.5 - Call with preconditions:call_2_5_2:0:
>> Assertion 's2_check_callstate(nua_callstate_completing)' failed
>> check_session.c:1781:E:2.5 - Call with preconditions:call_2_5_3:0:
>> (after this point) Test timeout expired
>> check_etsi.c:334:F:6.1 - ETSI CC OE - Call
>> Establishment:SIP_CC_OE_CE_TI_011_012:0: Failure
>> 's2_sip_check_request_timeout(SIP_METHOD_ACK, 3)' occured
>>
>> :(
>>
>>>
>>> Thanks in advance,
>>>
>>> Paulo Pizarro
>>>
>>
>
From 3f3ac2101490e4938b6c7024e2c70be4abcde7fa Mon Sep 17 00:00:00 2001
From: Paulo Pizarro <paulo.piza...@gmail.com>
Date: Wed, 22 Sep 2010 18:44:51 -0300
Subject: [PATCH] Added unit test: 2.4.6 - Call with 100rel and delayed offer


Signed-off-by: Paulo Pizarro <paulo.piza...@gmail.com>
---
 libsofia-sip-ua/nua/check_session.c |   53 +++++++++++++++++++++++++++++++++++
 1 files changed, 53 insertions(+), 0 deletions(-)

diff --git a/libsofia-sip-ua/nua/check_session.c b/libsofia-sip-ua/nua/check_session.c
index ed1f575..f025576 100644
--- a/libsofia-sip-ua/nua/check_session.c
+++ b/libsofia-sip-ua/nua/check_session.c
@@ -1570,6 +1570,58 @@ START_TEST(call_2_4_5)
 }
 END_TEST
 
+START_TEST(call_2_4_6)
+{
+  nua_handle_t *nh;
+  struct message *invite, *prack;
+  int with_sdp;
+
+  S2_CASE("2.4.6", "Call with 100rel and delayed offer",
+	  "NUA sends INVITE without SDP offer, "
+	  "receives 183 with SDP offer, sends PRACK with SDP answer, receives 200 for it, "
+	  "receives 180, sends PRACK, receives 200 for it, "
+          "receives 200, send ACK.");
+
+  nh = nua_handle(nua, NULL, SIPTAG_TO(s2sip->aor), TAG_END());
+
+  invite = invite_sent_by_nua(nh, SOATAG_DELAYED_OFFER_ENABLE(1),
+                                  SOATAG_USER_SDP_STR("m=audio 5008 RTP/AVP 8 0" CRLF
+                                                      "m=video 5010 RTP/AVP 34" CRLF),
+                                  TAG_END());
+
+  soa_generate_offer(soa, 1, NULL);
+
+  prack = respond_with_100rel(invite, dialog, with_sdp = 1,
+			      SIP_183_SESSION_PROGRESS,
+			      TAG_END());
+  process_answer(prack);
+  s2_sip_respond_to(prack, dialog, SIP_200_OK, TAG_END());
+  s2_sip_free_message(prack), prack = NULL;
+  fail_unless(s2_check_callstate(nua_callstate_proceeding));
+  fail_unless_event(nua_r_prack, 200);
+
+  prack = respond_with_100rel(invite, dialog, with_sdp = 0,
+			      SIP_180_RINGING,
+			      TAG_END());
+  s2_sip_respond_to(prack, dialog, SIP_200_OK, TAG_END());
+  s2_sip_free_message(prack), prack = NULL;
+  fail_unless(s2_check_callstate(nua_callstate_proceeding));
+  fail_unless_event(nua_r_prack, 200);
+
+  s2_sip_respond_to(invite, dialog, SIP_200_OK, TAG_END());
+  s2_sip_free_message(invite);
+  fail_unless_event(nua_r_invite, 200);
+
+  fail_unless(s2_check_callstate(nua_callstate_proceeding));
+  fail_unless(s2_check_callstate(nua_callstate_ready));
+  fail_unless(s2_sip_check_request(SIP_METHOD_ACK));
+
+  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");
@@ -1580,6 +1632,7 @@ TCase *invite_100rel_tcase(int threading)
     tcase_add_test(tc, call_2_4_3);
     tcase_add_test(tc, call_2_4_4);
     tcase_add_test(tc, call_2_4_5);
+    tcase_add_test(tc, call_2_4_6);
   }
   return tc;
 }
-- 
1.7.0.4

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel

Reply via email to