On 9/6/06, Legostayev Denis <[EMAIL PROTECTED]> wrote:
What about auxiliary audio - it seems to work fine, but there still problems
with respond to re-INVITE:

Hmph. I'm afraid your original patch is the best approach.

I was afraid it would mess with media line matching. Let's see if
anyone complains. ;)

Here is a patch against previous one, the changes are also committed
into darcs repo at http://sofia-sip.org/repos/sofia-sip/

--
Pekka.Pessi mail at nokia.com
Wed Sep  6 17:10:17 EEST 2006  [EMAIL PROTECTED]
  * soa_static.c: fixed problem of a new offer not including active codec.
  
  test_soa.c: added test for dropping codecs from new offer.
  
  Based on patch by Legostayev Denis.
diff -rN -u -udp old-sofia-sip/libsofia-sip-ua/soa/soa_static.c new-sofia-sip/libsofia-sip-ua/soa/soa_static.c
--- old-sofia-sip/libsofia-sip-ua/soa/soa_static.c	2006-09-06 17:11:20.000000000 +0300
+++ new-sofia-sip/libsofia-sip-ua/soa/soa_static.c	2006-09-06 17:11:20.000000000 +0300
@@ -999,8 +999,7 @@ static int offer_answer_step(soa_session
     if (ss->ss_local_user_version == user_version &&
 	ss->ss_local_remote_version == remote_version)
       break;
-    if (ss->ss_local_user_version != user_version ||
-	soa_sdp_upgrade_is_needed(local, remote)) {
+    if (1) {
       if (local != local0)
 	*local0 = *local, local = local0;
       SU_DEBUG_7(("soa_static(%p, %s): %s\n", ss, by,
@@ -1062,10 +1061,9 @@ static int offer_answer_step(soa_session
     break;
   }
 
-  /* Step E: Upgrade codecs */
+  /* Step E: Upgrade codecs by answer. */
   switch (action) {
   case process_answer:
-  case generate_answer:
     /* Upgrade local SDP based on remote SDP */
     if (ss->ss_local_remote_version == remote_version)
       break;
@@ -1080,6 +1078,7 @@ static int offer_answer_step(soa_session
     }
     break;
   case generate_offer:
+  case generate_answer:
   default:
     break;
   }
diff -rN -u -udp old-sofia-sip/libsofia-sip-ua/soa/test_soa.c new-sofia-sip/libsofia-sip-ua/soa/test_soa.c
--- old-sofia-sip/libsofia-sip-ua/soa/test_soa.c	2006-09-06 17:11:20.000000000 +0300
+++ new-sofia-sip/libsofia-sip-ua/soa/test_soa.c	2006-09-06 17:11:20.000000000 +0300
@@ -1015,6 +1015,90 @@ int test_codec_selection(struct context 
   TEST_1(m = m->m_next); TEST_1(!m->m_rejected);
   TEST_1(!m->m_next);
 
+  /* ---------------------------------------------------------------------- */
+  /* A drops GSM support */
+
+  TEST_1(soa_set_params(a,
+			SOATAG_USER_SDP_STR(
+    "v=0\r\n"
+    "o=left 219498671 2 IN IP4 127.0.0.2\r\n"
+    "c=IN IP4 127.0.0.2\r\n"
+    "m=audio 5008 RTP/AVP 0 8 96 127\r\n"
+    "a=rtpmap:96 G729/8000\n"
+    "a=rtpmap:127 CN/8000\n"
+    "m=video 5010 RTP/AVP 31 34\r\n"
+    "m=audio 6008 RTP/SAVP 3\n"
+    ),
+			TAG_END()));
+
+  /* B adds GSM to SRTP */
+  TEST_1(soa_set_params(b,
+			SOATAG_USER_SDP_STR(
+    "v=0\r\n"
+    "o=left 219498671 2 IN IP4 127.0.0.2\r\n"
+    "c=IN IP4 127.0.0.2\r\n"
+    "m=audio 5004 RTP/AVP 96 3 97 111\r\n"
+    "a=rtpmap:96 G7231/8000\n"
+    "a=rtpmap:97 G729/8000\n"
+    "a=rtpmap:111 telephone-event/8000\n"
+    "a=fmtp:111 0-15\n"
+    "m=audio 6004 RTP/SAVP 96 3\n"
+    "a=rtpmap:96 G729/8000\n"
+    "m=video 5006 RTP/AVP 34\n"
+    ),
+			TAG_END()));
+
+  n = soa_generate_offer(a, 1, test_completed); TEST(n, 0);
+  n = soa_get_local_sdp(a, &a_sdp, &offer, &offerlen); TEST(n, 1);
+  TEST_1(offer != NULL && offer != NONE);
+  TEST_1(m = a_sdp->sdp_media); TEST_1(!m->m_rejected);
+  TEST_1(m = m->m_next); TEST_1(!m->m_rejected);
+  TEST_1(m = m->m_next); TEST_1(!m->m_rejected);
+  TEST_1(!m->m_next);
+  n = soa_set_remote_sdp(b, 0, offer, offerlen); TEST(n, 1);
+  n = soa_generate_answer(b, test_completed); TEST(n, 0);
+  /* Answer from B now accepts video */
+  n = soa_get_local_sdp(b, &b_sdp, &answer, &answerlen); TEST(n, 1);
+  TEST_1(answer != NULL && answer != NONE);
+  n = soa_set_remote_sdp(a, 0, answer, -1); TEST(n, 1);
+  n = soa_process_answer(a, test_completed); TEST(n, 0);
+  n = soa_get_local_sdp(a, &a_sdp, &offer, &offerlen); TEST(n, 1);
+
+  TEST_1(soa_is_complete(b));
+  TEST(soa_activate(b, NULL), 0);
+
+  TEST_1(soa_is_complete(a));
+  TEST(soa_activate(a, NULL), 0);
+
+  TEST(soa_is_audio_active(a), SOA_ACTIVE_SENDRECV);
+  TEST(soa_is_remote_audio_active(a), SOA_ACTIVE_SENDRECV);
+  TEST(soa_is_video_active(a), SOA_ACTIVE_SENDRECV);
+  TEST(soa_is_remote_video_active(a), SOA_ACTIVE_SENDRECV);
+
+  TEST_1(m = a_sdp->sdp_media); TEST_1(!m->m_rejected);
+  TEST_1(rm = m->m_rtpmaps); TEST(rm->rm_pt, 96);
+  TEST_S(rm->rm_encoding, "G729");
+  TEST_1(rm = rm->rm_next); TEST(rm->rm_pt, 127);
+  TEST_S(rm->rm_encoding, "CN");
+  TEST_1(m = m->m_next); TEST_1(!m->m_rejected);
+  TEST_1(rm = m->m_rtpmaps); TEST(rm->rm_pt, 34);
+  TEST_S(rm->rm_encoding, "H263");
+  TEST_1(m = m->m_next); TEST_1(!m->m_rejected);
+  TEST_1(!m->m_next);
+
+  TEST_1(m = b_sdp->sdp_media); TEST_1(!m->m_rejected);
+  TEST_1(rm = m->m_rtpmaps); TEST(rm->rm_pt, 96);
+  TEST_S(rm->rm_encoding, "G729");
+  TEST_1(rm = rm->rm_next); TEST(rm->rm_pt, 111);
+  TEST_S(rm->rm_encoding, "telephone-event");
+  TEST_1(m = m->m_next); TEST_1(!m->m_rejected);
+  TEST_1(rm = m->m_rtpmaps); TEST(rm->rm_pt, 34);
+  TEST_S(rm->rm_encoding, "H263");
+  TEST_1(m = m->m_next); TEST_1(!m->m_rejected);
+  TEST_1(!m->m_next);
+
+  /* ---------------------------------------------------------------------- */
+
   TEST_VOID(soa_terminate(a, NULL));
   TEST_VOID(soa_terminate(b, NULL));
   

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