[Sofia-sip-devel] some more issues......

2006-05-26 Thread Luca Colantonio
hi,I installed Fedora core 5 and restarted the sofia sip installation process again.after having installed various gstreamer packegs (the devel ones, needed by sofsip_cli) here is what it says to me:[EMAIL PROTECTED]

 sofsip-cli]# sofsip_cli sip:[EMAIL PROTECTED]** Message: This program is linked against GStreamer 0.10.3** (sofsip_cli:20958): DEBUG: priv_verify_required_elements:191
** Message: Verifying GST element "alawenc" -> OK
** Message: Verifying GST element "alawdec" -> OK** Message: Verifying GST element "dynudpsink" -> OK** Message: Verifying GST element "udpsrc" -> OK** (sofsip_cli:20958): DEBUG: ssc_media_class_init:124
** (sofsip_cli:20958): DEBUG: ssc_media_gst_class_init:138** (sofsip_cli:20958): DEBUG: ssc_media_init:167** Message: Selecting media implementation: gstreamer** (sofsip_cli:20958): DEBUG: priv_static_capabilities_gst
sofsip> UA: unknown event 23: 200 OK   ::tag_null: 0sofsip> UA: nua_r_getparams: 200 OK   sip::from: 
sip:[EMAIL PROTECTED]   sip::from_str: "
sip:[EMAIL PROTECTED]"   nua::retry_count: 3   nua::max_subscriptions: 20   nua::enableInvite: true   nua::autoAlert: true   nua::early_media: false   nua::autoAnswer: false   nua::autoACK: true
   nua::invite_timer: 120   nua::session_timer: 0   nua::min_se: 120   nua::session_refresher: 0   nua::update_refresh: false   nua::enableMessage: true   nua::enableMessenger: false   nua::callee_caps: false
   nua::media_features: false   nua::service_route_enable: true   nua::path_enable: true   nua::substate: 2   sip::supported: timer, 100rel   sip::supported_str: "timer, 100rel"   sip::allow: INVITE, ACK, BYE, CANCEL, OPTIONS, PRACK, MESSAGE, SUBSCRIBE, NOTIFY, REFER, UPDATE
   sip::allow_str: "INVITE, ACK, BYE, CANCEL, OPTIONS, PRACK, MESSAGE, SUBSCRIBE, NOTIFY, REFER, UPDATE"   sip::user_agent: sofia-sip/1.11.8   sip::user_agent_str: "sofia-sip/1.11.8"   nua::outbound: "natify"
   nua::keepalive: 12   nua::media_enable: true   nua::registrar:    nta::contact:    nta::udp_mtu: 1300   nta::sip_t1: 500
   nta::sip_t2: 4000   nta::sip_t4: 5000   nta::sip_t1x64: 32000   nta::debug_drop_prob: 0   nta::default_proxy:    nta::aliases:    nta::sipflags: 2   soa::caps_sdp: v=0
o=- 7835482480909229261 8743008824963640866 IN IP4 163.162.45.195s=-c=IN IP4 myipt=0 0m=audio 0 RTP/AVP 0
a=rtpmap:0 PCMU/8000   soa::caps_sdp_str: "v=0
o=- 7835482480909229261 8743008824963640866 IN IP4 163.162.45.195s=-c=IN IP4 myipt=0 0m=audio 0 RTP/AVP 0
a=rtpmap:0 PCMU/8000"   soa::user_sdp: v=0m=audio 0 RTP/AVP 0
a=rtpmap:0 PCMU/8000   soa::user_sdp_str: "v=0m=audio 0 RTP/AVP 0a=rtpmap:0 PCMU/8000"   soa::local_sdp_str:    soa::af: 3   soa::srtp_enable: false   soa::srtp_confidentiality: false
   soa::srtp_integrity: false   ::tag_null: 0sofsip> tport_stun_bind_cb: stun_errortport_stun_bind_cb: stun_errordoes anyone know what it means?I haven't understood why it searchs for a stun server since I didn't specified it via the --stun option.
the other strange thing is that the media port is set to zero!!best regardsluca



Re: [Sofia-sip-devel] some more issues......

2006-05-26 Thread H. L.
I see the same log, but which looks ok. After registration, it crashed if I originate a call, and it cannot accept the incoming call. I'm wonding if you see the same thing.
On 5/26/06, Luca Colantonio <[EMAIL PROTECTED]> wrote:

hi,I installed Fedora core 5 and restarted the sofia sip installation process again.after having installed various gstreamer packegs (the devel ones, needed by sofsip_cli) here is what it says to me:
[EMAIL PROTECTED] sofsip-cli]# sofsip_cli sip:[EMAIL PROTECTED]** Message: This program is linked against GStreamer 0.10.3
** (sofsip_cli:20958): DEBUG: priv_verify_required_elements:191 ** Message: Verifying GST element "alawenc" -> OK ** Message: Verifying GST element "alawdec" -> OK** Message: Verifying GST element "dynudpsink" -> OK
** Message: Verifying GST element "udpsrc" -> OK** (sofsip_cli:20958): DEBUG: ssc_media_class_init:124 ** (sofsip_cli:20958): DEBUG: ssc_media_gst_class_init:138** (sofsip_cli:20958): DEBUG: ssc_media_init:167
** Message: Selecting media implementation: gstreamer** (sofsip_cli:20958): DEBUG: priv_static_capabilities_gst sofsip> UA: unknown event 23: 200 OK   ::tag_null: 0sofsip> UA: nua_r_getparams: 200 OK
   sip::from: sip:[EMAIL PROTECTED]   sip::from_str: "
 sip:[EMAIL PROTECTED]"   nua::retry_count: 3   nua::max_subscriptions: 20   nua::enableInvite: true   nua::autoAlert: true   nua::early_media: false   nua::autoAnswer: false   nua::autoACK: true 
   nua::invite_timer: 120   nua::session_timer: 0   nua::min_se: 120   nua::session_refresher: 0   nua::update_refresh: false   nua::enableMessage: true   nua::enableMessenger: false   nua::callee_caps: false 
   nua::media_features: false   nua::service_route_enable: true   nua::path_enable: true   nua::substate: 2   sip::supported: timer, 100rel   sip::supported_str: "timer, 100rel"   sip::allow: INVITE, ACK, BYE, CANCEL, OPTIONS, PRACK, MESSAGE, SUBSCRIBE, NOTIFY, REFER, UPDATE 
   sip::allow_str: "INVITE, ACK, BYE, CANCEL, OPTIONS, PRACK, MESSAGE, SUBSCRIBE, NOTIFY, REFER, UPDATE"   sip::user_agent: sofia-sip/1.11.8   sip::user_agent_str: "sofia-sip/1.11.8"   nua::outbound: "natify" 
   nua::keepalive: 12   nua::media_enable: true   nua::registrar:    nta::contact:    nta::udp_mtu: 1300   nta::sip_t1: 500 
   nta::sip_t2: 4000   nta::sip_t4: 5000   nta::sip_t1x64: 32000   nta::debug_drop_prob: 0   nta::default_proxy:    nta::aliases:    nta::sipflags: 2   soa::caps_sdp: v=0 
o=- 7835482480909229261 8743008824963640866 IN IP4 163.162.45.195s=-c=IN IP4 myipt=0 0m=audio 0 RTP/AVP 0 
a=rtpmap:0 PCMU/8000   soa::caps_sdp_str: "v=0o=- 7835482480909229261 8743008824963640866 IN IP4 163.162.45.195
s=-c=IN IP4 myipt=0 0m=audio 0 RTP/AVP 0 a=rtpmap:0 PCMU/8000"   soa::user_sdp: v=0m=audio 0 RTP/AVP 0 a=rtpmap:0 PCMU/8000   soa::user_sdp_str: "v=0m=audio 0 RTP/AVP 0
a=rtpmap:0 PCMU/8000"   soa::local_sdp_str:    soa::af: 3   soa::srtp_enable: false   soa::srtp_confidentiality: false    soa::srtp_integrity: false   ::tag_null: 0sofsip> tport_stun_bind_cb: stun_error
tport_stun_bind_cb: stun_errordoes anyone know what it means?I haven't understood why it searchs for a stun server since I didn't specified it via the --stun option. the other strange thing is that the media port is set to zero!!
best regards 
luca


Re: [Sofia-sip-devel] some more issues......

2006-05-26 Thread Kai Vehmanen

On Fri, 26 May 2006, Luca Colantonio wrote:


I installed Fedora core 5 and restarted the sofia sip installation process
again.
after having installed various gstreamer packegs (the devel ones, needed by
sofsip_cli) here is what it says to me:


Ok, let's see...


[EMAIL PROTECTED] sofsip-cli]# sofsip_cli sip:[EMAIL PROTECTED]

[...]

** Message: This program is linked against GStreamer 0.10.3


Ok, this looks good.


** Message: Selecting media implementation: gstreamer


The plain gstreamer media implementation is chosen.


sofsip> tport_stun_bind_cb: stun_error
tport_stun_bind_cb: stun_error

[...]

does anyone know what it means?
I haven't understood why it searchs for a stun server since I didn't
specified it via the --stun option.


You can ignore these. Sofsip-cli will do a DNS SRV lookup to find a STUN 
server for your domain. In this case it didn't find one.


You should now be able to make calls "i sip:[EMAIL PROTECTED]"


the other strange thing is that the media port is set to zero!!
best regards


That's just the static capabilities (reported if someone sends you a SIP 
OPTIONS request). So port zero is correct here.


--
 under work: Sofia-SIP at http://sofia-sip.sf.net


---
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


[Sofia-sip-devel] some more issues with SDP negotiation

2006-09-05 Thread Legostayev Denis

Hello!

In order of experimenting with SOFIA-SIP i have found some more problems
with SDP negotiation:

1. If remote peer modifying a session, SDP answer does not always contain
appropriate with offer codec.
2. Using SOA_RTP_SELECT_SINGLE brings to removing "telephone-event"
from rtp payloads in SDP answer.

There tport log with cisco ATA-186 (outgoing call from SOFIA-SIP application
to ATA-186, then ATA-186 decide switch to upspeed mode in order to receive
fax):

send 825 bytes to udp/[192.168.138.60]:5060 at 07:41:06.244585:
  INVITE sip:[EMAIL PROTECTED] SIP/2.0
  Via: SIP/2.0/UDP 192.168.138.65;rport;branch=z9hG4bKcQ6rvQgmrHjDg
  Max-Forwards: 70
  From: ;tag=cZ83ZvjKe5a9a
  To: 
  Call-ID: 553cfe7e-98b5-1200-c88d-85c13a5d7ed1
  CSeq: 30766410 INVITE
  Contact: 
  User-Agent: TAU-32.IP v1.1 with sofia-sip/1.12.1
  Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, PRACK, MESSAGE, SUBSCRIBE,
NOTIFY, REFER, UPDATE
  Supported: timer, 100rel
  Content-Type: application/sdp
  Content-Disposition: session
  Content-Length: 260

  v=0
  o=- 8063427506184445420 8596425879938756690 IN IP4 192.168.138.65
  s=-
  c=IN IP4 192.168.138.65
  t=0 0
  m=audio 23000 RTP/AVP 4 8 0 101
  a=rtpmap:4 G723/8000
  a=rtpmap:8 PCMA/8000
  a=rtpmap:0 PCMU/8000
  a=rtpmap:101 telephone-event/8000
  a=fmtp:101 0-15

...

recv 730 bytes from udp/[192.168.138.60]:5060 at 07:41:15.605089:
  SIP/2.0 200 OK
  Via: SIP/2.0/UDP 192.168.138.65;rport=5060;branch=z9hG4bKcQ6rvQgmrHjDg
  Record-Route: 
  From: ;tag=cZ83ZvjKe5a9a
  To: ;tag=895631890
  Call-ID: 553cfe7e-98b5-1200-c88d-85c13a5d7ed1
  CSeq: 30766410 INVITE
  Contact: 
  Server: Cisco ATA 186  v3.1.0 atasip (040211A)
  Allow: ACK, BYE, CANCEL, INVITE, NOTIFY, OPTIONS, REFER, REGISTER
  Content-Type: application/sdp
  Content-Length: 197

  v=0
  o=4000 3260 3260 IN IP4 192.168.138.70
  s=ATA186 Call
  c=IN IP4 192.168.138.70
  t=0 0
  m=audio 16384 RTP/AVP 4 101
  a=rtpmap:4 G723/8000/1
  a=rtpmap:101 telephone-event/8000
  a=fmtp:101 0-15

...

recv 829 bytes from udp/[192.168.138.60]:5060 at 07:41:17.539201:
  INVITE sip:[EMAIL PROTECTED] SIP/2.0
  Via: SIP/2.0/UDP
192.168.138.60:5060;rport;branch=z9hG4bKb64c330c7e5efbac.3
  Via: SIP/2.0/UDP 192.168.138.70:5060
  From: sip:[EMAIL PROTECTED];tag=895631890
  To: sip:[EMAIL PROTECTED];tag=cZ83ZvjKe5a9a
  Call-ID: 553cfe7e-98b5-1200-c88d-85c13a5d7ed1
  CSeq: 1 INVITE
  Contact: 
  User-Agent: Cisco ATA 186  v3.1.0 atasip (040211A)
  Expires: 10
  Allow: ACK, BYE, CANCEL, INVITE, NOTIFY, OPTIONS, REFER, REGISTER
  Record-Route: 
  Content-Type: application/sdp
  Content-Length: 223

  v=0
  o=4000 3454 3454 IN IP4 192.168.138.70
  s=ATA186 Call
  c=IN IP4 192.168.138.70
  t=0 0
  m=audio 16384 RTP/AVP 0 8 101
  a=rtpmap:0 PCMU/8000/1
  a=rtpmap:8 PCMA/8000/1
  a=rtpmap:101 telephone-event/8000
  a=fmtp:101 0-15

...

send 779 bytes to udp/[192.168.138.60]:5060 at 07:41:17.547193:
  SIP/2.0 200 OK
  Via: SIP/2.0/UDP
192.168.138.60:5060;rport=5060;branch=z9hG4bKb64c330c7e5efbac.3
  Via: SIP/2.0/UDP 192.168.138.70:5060
  Record-Route: 
  From: sip:[EMAIL PROTECTED];tag=895631890
  To: sip:[EMAIL PROTECTED];tag=cZ83ZvjKe5a9a
  Call-ID: 553cfe7e-98b5-1200-c88d-85c13a5d7ed1
  CSeq: 1 INVITE
  Contact: 
  User-Agent: TAU-32.IP v1.1 with sofia-sip/1.12.1
  Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, PRACK, MESSAGE, SUBSCRIBE,
NOTIFY, REFER, UPDATE
  Supported: timer, 100rel
  Content-Type: application/sdp
  Content-Disposition: session
  Content-Length: 156

  v=0
  o=- 8063427506184445420 8596425879938756691 IN IP4 192.168.138.65
  s=-
  c=IN IP4 192.168.138.65
  t=0 0
  m=audio 23000 RTP/AVP 4
  a=rtpmap:4 G723/8000

...

To solve this, i have suggest some changes in soa_static.c:

*** soa_static.c2006-07-27 22:14:37.0 +0700
--- soa_static.c.new2006-09-05 18:26:27.286170880 +0700
***
*** 497,502 
--- 497,503 
 {
   sdp_media_t *sm;
   sdp_media_t const *rm;
+   sdp_rtpmap_t *next;

   for (sm = session->sdp_media, rm = remote->sdp_media;
sm && rm;
***
*** 515,522 
   if (common_codecs == 0)
   ;
   else if (ss->ss_rtp_select == SOA_RTP_SELECT_SINGLE) {
!   if (sm->m_rtpmaps)
! sm->m_rtpmaps->rm_next = NULL;
   }
   else if (ss->ss_rtp_select == SOA_RTP_SELECT_COMMON) {
   soa_sdp_select_rtpmap(&sm->m_rtpmaps, rm->m_rtpmaps);
--- 516,528 
   if (common_codecs == 0)
   ;
   else if (ss->ss_rtp_select == SOA_RTP_SELECT_SINGLE) {
!   for (next=sm->m_rtpmaps; next; next=next->rm_next)
! if (!str0cmp("telephone-event", next->rm_encoding)) {
!   next->rm_next = NULL;
!   break;
! }
!   if (sm->m_rtpmaps && sm->m_rtpmaps != next)
! sm->m_rtpmaps->rm_next = next;
   }
   else if (ss->ss_rtp_select == SOA_RTP_SELECT_COMMON) {
   soa_sdp_select_rtpmap(&sm->m_rtpmaps, rm->m_rtpmaps);
***
*** 539,545 
   sdp_media_t *m, **m

Re: [Sofia-sip-devel] some more issues with SDP negotiation

2006-09-05 Thread Pekka Pessi
Hi,

On 9/5/06, Legostayev Denis <[EMAIL PROTECTED]> wrote:
> In order of experimenting with SOFIA-SIP i have found some more problems
> with SDP negotiation:
>
> 1. If remote peer modifying a session, SDP answer does not always contain
> appropriate with offer codec.

Uh-oh. Thanks for the patch.

> 2. Using SOA_RTP_SELECT_SINGLE brings to removing "telephone-event"
> from rtp payloads in SDP answer.

I think there are also other codecs that could be selected along with
single codec, like CN codec. Perhaps a list of codecs, specified by
yet an another tag.

Pekka

-- 
Pekka.Pessi mail at nokia.com

-
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


Re: [Sofia-sip-devel] some more issues with SDP negotiation

2006-09-05 Thread Pekka Pessi

On 9/5/06, Pekka Pessi <[EMAIL PROTECTED]> wrote:

On 9/5/06, Legostayev Denis <[EMAIL PROTECTED]> wrote:
> 2. Using SOA_RTP_SELECT_SINGLE brings to removing "telephone-event"
> from rtp payloads in SDP answer.



I think there are also other codecs that could be selected along with
single codec, like CN codec. Perhaps a list of codecs, specified by
yet an another tag.


I added SOATAG_AUDIO_AUX() for that purpose.

Denis, could you test the attached patch (against 1.12.1)?

--
Pekka.Pessi mail at nokia.com


soa-codec.darcs
Description: Binary data
Wed Sep  6 00:07:17 EEST 2006  [EMAIL PROTECTED]
  * test_soa.c: testing codec negotiation when new codecs are added to previously rejected media.
Wed Sep  6 00:05:40 EEST 2006  [EMAIL PROTECTED]
  * test_soa.c: testing SOATAG_AUDIO_AUX().
Wed Sep  6 00:04:54 EEST 2006  [EMAIL PROTECTED]
  * soa_static.c: added new tag SOATAG_AUDIO_AUX() for listing auxiliary codecs.
  
  Auxiliary codecs are now included in m=line even if there is no matching
  codec at remote end. They are also ignored when selecting common codecs.
Wed Sep  6 00:03:10 EEST 2006  [EMAIL PROTECTED]
  * soa_tag.h, soa_tag.c: added SOATAG_AUDIO_AUX().
Tue Sep  5 21:50:18 EEST 2006  [EMAIL PROTECTED]
  * soa_static.c: always upgrade answer if offer has changed.
  
  sdp.c: fixed sdp_media_cmp() - now include m_mode in comparison.
  
  Based on bug report and initial patch submitted by Legostayev Denis.
--- old-sofia-sip/libsofia-sip-ua/soa/soa_static.c	2006-09-06 00:23:22.0 +0300
+++ new-sofia-sip/libsofia-sip-ua/soa/soa_static.c	2006-09-06 00:23:22.0 +0300
@@ -1,7 +1,7 @@
 /*
  * This file is part of the Sofia-SIP package
  *
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2006 Nokia Corporation.
  *
  * Contact: Pekka Pessi <[EMAIL PROTECTED]>
  *
@@ -62,6 +62,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include "sofia-sip/soa.h"
 #include 
@@ -70,7 +72,6 @@
 #define NONE ((void *)-1)
 #define XXX assert(!"implemented")
 
-#define str0cmp(a, b) strcmp(a ? a : "", b ? b : "")
 #if !HAVE_STRCASESTR
 char *strcasestr(const char *haystack, const char *needle);
 #endif
@@ -78,6 +79,7 @@
 typedef struct soa_static_session
 {
   soa_session_t sss_session[1];
+  char *sss_audio_aux;
 }
 soa_static_session_t;
 
@@ -148,25 +150,66 @@
 
 static int soa_static_set_params(soa_session_t *ss, tagi_t const *tags)
 {
-  return soa_base_set_params(ss, tags);
+  soa_static_session_t *sss = (soa_static_session_t *)ss;
+  char const *audio_aux = sss->sss_audio_aux;
+  int n, m;
+
+  n = tl_gets(tags,
+	  SOATAG_AUDIO_AUX_REF(audio_aux),
+	  TAG_END());
+  if (n < 0)
+return n;
+
+  if (str0casecmp(audio_aux, sss->sss_audio_aux)) {
+char *s = su_strdup(ss->ss_home, audio_aux), *tbf = sss->sss_audio_aux;
+if (s == NULL && audio_aux != NULL)
+  return -1;
+sss->sss_audio_aux = s;
+if (tbf)
+  su_free(ss->ss_home, tbf);
+  }
+
+  m = soa_base_set_params(ss, tags);
+  if (m < 0)
+return m;
+
+  return n + m;
 }
 
 static int soa_static_get_params(soa_session_t const *ss, tagi_t *tags)
 {
-  
-  return soa_base_get_params(ss, tags);
+  soa_static_session_t *sss = (soa_static_session_t *)ss;
+
+  int n, m;
+
+  n = tl_tgets(tags,
+	   SOATAG_AUDIO_AUX(sss->sss_audio_aux),
+	   TAG_END());
+  if (n < 0)
+return n;
+
+  m = soa_base_get_params(ss, tags);
+  if (m < 0)
+return m;
+
+  return n + m;
 }
 
 static tagi_t *soa_static_get_paramlist(soa_session_t const *ss,
 	tag_type_t tag, tag_value_t value, 
 	...)
 {
+  soa_static_session_t *sss = (soa_static_session_t *)ss;
+
   ta_list ta;
   tagi_t *tl;
 
   ta_start(ta, tag, value);
 
-  tl = soa_base_get_paramlist(ss, TAG_NEXT(ta_args(ta)));
+  tl = soa_base_get_paramlist(ss,
+			  TAG_IF(sss->sss_audio_aux,
+ SOATAG_AUDIO_AUX(sss->sss_audio_aux)),
+			  TAG_NEXT(ta_args(ta)));
 
   ta_end(ta);
 
@@ -273,6 +316,37 @@
   return rm != NULL;
 }
 
+/** Check if codec is in auxiliary list */
+int soa_sdp_is_auxiliary_codec(sdp_rtpmap_t const *rm, char const *auxiliary)
+{
+  char const *codec;
+  size_t clen, alen;
+  char const *match;
+
+  if (!rm || !rm->rm_encoding || !auxiliary)
+return 0;
+
+  codec = rm->rm_encoding;
+
+  clen = strlen(codec), alen = strlen(auxiliary);
+
+  if (clen > alen)
+return 0;
+
+  for (match = auxiliary;
+   (match = strcasestr(match, codec));
+   match = match + 1) {
+if (IS_ALPHANUM(match[clen]) || match[clen] == '-')
+  continue;
+if (match != auxiliary &&
+	(IS_ALPHANUM(match[-1]) || match[-1] == '-'))
+  continue;
+return 1;
+  }
+
+  return 0;
+}
+
 
 /** Find first matching media in table. */
 sdp_media_t *soa_sdp_matching(soa_session_t *ss, 
@@ -283,6 +357,14 @@
   int i, j = -1;
   sdp_media_t *m;
   sdp_rtpmap_t const *rm;
+  soa_static_session_t *sss = (soa_static_session_t *)ss;
+  char const *auxiliary;
+
+  auxiliary = with->m_type == sdp_media_audio ? sss->sss_audio_aux

Re: [Sofia-sip-devel] some more issues with SDP negotiation

2006-09-06 Thread Legostayev Denis
>> I think there are also other codecs that could be selected along with
>> single codec, like CN codec. Perhaps a list of codecs, specified by
>> yet an another tag.
>
> I added SOATAG_AUDIO_AUX() for that purpose.
>
> Denis, could you test the attached patch (against 1.12.1)?

What about auxiliary audio - it seems to work fine, but there still problems
with respond to re-INVITE:

send 825 bytes to udp/[192.168.138.60]:5060 at 04:49:40.885611:
   INVITE sip:[EMAIL PROTECTED] SIP/2.0
   Via: SIP/2.0/UDP 192.168.138.65;rport;branch=z9hG4bK7F4QU3rUmXmUK
   Max-Forwards: 70
   From: ;tag=7a93c1ZSmerrg
   To: 
   Call-ID: 62afc021-989d-1200-f481-8d6be3d4a18d
   CSeq: 30761267 INVITE
   Contact: 
   User-Agent: TAU-32.IP v1.1 with sofia-sip/1.12.1
   Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, PRACK, MESSAGE, SUBSCRIBE,
NOTIFY, REFER, UPDATE
   Supported: timer, 100rel
   Content-Type: application/sdp
   Content-Disposition: session
   Content-Length: 260

   v=0
   o=- 4055417593070913274 8147886360907374363 IN IP4 192.168.138.65
   s=-
   c=IN IP4 192.168.138.65
   t=0 0
   m=audio 23000 RTP/AVP 4 8 0 101
   a=rtpmap:4 G723/8000
   a=rtpmap:8 PCMA/8000
   a=rtpmap:0 PCMU/8000
   a=rtpmap:101 telephone-event/8000
   a=fmtp:101 0-15
...
recv 732 bytes from udp/[192.168.138.60]:5060 at 04:49:50.232295:
   SIP/2.0 200 OK
   Via: SIP/2.0/UDP 192.168.138.65;rport=5060;branch=z9hG4bK7F4QU3rUmXmUK
   Record-Route: 
   From: ;tag=7a93c1ZSmerrg
   To: ;tag=202699017
   Call-ID: 62afc021-989d-1200-f481-8d6be3d4a18d
   CSeq: 30761267 INVITE
   Contact: 
   Server: Cisco ATA 186  v3.1.0 atasip (040211A)
   Allow: ACK, BYE, CANCEL, INVITE, NOTIFY, OPTIONS, REFER, REGISTER
   Content-Type: application/sdp
   Content-Length: 199

   v=0
   o=4000 15814 15814 IN IP4 192.168.138.70
   s=ATA186 Call
   c=IN IP4 192.168.138.70
   t=0 0
   m=audio 16384 RTP/AVP 4 101
   a=rtpmap:4 G723/8000/1
   a=rtpmap:101 telephone-event/8000
   a=fmtp:101 0-15
...
recv 831 bytes from udp/[192.168.138.60]:5060 at 04:49:52.185998:
   INVITE sip:[EMAIL PROTECTED] SIP/2.0
   Via: SIP/2.0/UDP
192.168.138.60:5060;rport;branch=z9hG4bK38aa6edee6d55bac.3
   Via: SIP/2.0/UDP 192.168.138.70:5060
   From: sip:[EMAIL PROTECTED];tag=202699017
   To: sip:[EMAIL PROTECTED];tag=7a93c1ZSmerrg
   Call-ID: 62afc021-989d-1200-f481-8d6be3d4a18d
   CSeq: 1 INVITE
   Contact: 
   User-Agent: Cisco ATA 186  v3.1.0 atasip (040211A)
   Expires: 10
   Allow: ACK, BYE, CANCEL, INVITE, NOTIFY, OPTIONS, REFER, REGISTER
   Record-Route: 
   Content-Type: application/sdp
   Content-Length: 225

   v=0
   o=4000 16010 16010 IN IP4 192.168.138.70
   s=ATA186 Call
   c=IN IP4 192.168.138.70
   t=0 0
   m=audio 16384 RTP/AVP 0 8 101
   a=rtpmap:0 PCMU/8000/1
   a=rtpmap:8 PCMA/8000/1
   a=rtpmap:101 telephone-event/8000
   a=fmtp:101 0-15
...
send 811 bytes to udp/[192.168.138.60]:5060 at 04:49:52.194398:
   SIP/2.0 200 OK
   Via: SIP/2.0/UDP
192.168.138.60:5060;rport=5060;branch=z9hG4bK38aa6edee6d55bac.3
   Via: SIP/2.0/UDP 192.168.138.70:5060
   Record-Route: 
   From: sip:[EMAIL PROTECTED];tag=202699017
   To: sip:[EMAIL PROTECTED];tag=7a93c1ZSmerrg
   Call-ID: 62afc021-989d-1200-f481-8d6be3d4a18d
   CSeq: 1 INVITE
   Contact: 
   User-Agent: TAU-32.IP v1.1 with sofia-sip/1.12.1
   Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, PRACK, MESSAGE, SUBSCRIBE,
NOTIFY, REFER, UPDATE
   Supported: timer, 100rel
   Content-Type: application/sdp
   Content-Disposition: session
   Content-Length: 188

   v=0
   o=- 4055417593070913274 8147886360907374365 IN IP4 192.168.138.65
   s=-
   c=IN IP4 192.168.138.65
   t=0 0
   m=audio 23000 RTP/AVP 101
   a=rtpmap:101 telephone-event/8000
   a=fmtp:101 0-15
...

The majority problem is that the answer on offer in second round is based on
the last negotiated SDP, but not user supplied
(soa_base_set_params does not increment ss_user_version number in most
cases, which is compared in offer_answer_step).

Unfortunately i have not good idea how to solve this.

In my previous patch soa_sdp_upgrade was called in case if remote version
have been changed:

  /* Step B: upgrade local SDP (add m= lines to it)  */

  case generate_answer:
/* Upgrade local SDP based on remote SDP */
if (ss->ss_local_user_version == user_version &&
   ss->ss_local_remote_version == remote_version)
  break;
if (ss->ss_local_user_version != user_version ||
+ss->ss_local_remote_version != remote_version ||
   soa_sdp_upgrade_is_needed(local, remote)) {
  if (local != local0)
   *local0 = *local, local = local0;
  SU_DEBUG_7(("soa_static(%p, %s): %s\n", ss, by,
"upgrade with remote description"));
  soa_sdp_upgrade(ss, tmphome, local, user, remote);
}
...

but that is of course is not good decision.

May be there should be more precision test to increment ss_user_version or
may be it always should be incremented when user pass SDP to SOA?

In last case i think there should not be a problems: if the user want to use
last negotiated sessi

Re: [Sofia-sip-devel] some more issues with SDP negotiation

2006-09-06 Thread Pekka Pessi

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.0 +0300
+++ new-sofia-sip/libsofia-sip-ua/soa/soa_static.c	2006-09-06 17:11:20.0 +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.0 +0300
+++ new-sofia-sip/libsofia-sip-ua/soa/test_soa.c	2006-09-06 17:11:20.0 +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