Re: [Sofia-sip-devel] adding rinstance to NOTIFY request line in nua

2010-08-04 Thread Pekka Pessi
2010/7/22 Markus Bucher buch...@in.tum.de:
 Is the notify for a existing subscribe/notify session or is it for a
 blind notify?

 It's actually for both, though blind notifies have priority.
 The scenario is, that there is a security server between my application an
 the receiver of the notify (client).
 This server adds the rinstance to the contact-header of a register. I save
 this rinstance-tag and have to add it to the request line of all requests to
 the client (that are initiated by my application).
 If a packet is not in a dialog and does not have the rinstance tag, the
 packet will be droped by the server.

 I'm nor really able to try it, so I don't really know if subscribe/notify
 sessions are concerned, but blind notifies are definitely concerned.

NUTAG_URL() should work for blind NOTIFYs but not with the SUBSCRIBEd
NOTIFYs. The latter take the URL from the Contact (or Record-Route)
header. However, they are part of an existing dialog, so your security
servers should let them through. (You may need to respond to SUBSCRIBE
before sending NOTIFY, however.)

-- 
Pekka.Pessi mail at nokia.com

--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


Re: [Sofia-sip-devel] NTA authentication request problem

2010-08-04 Thread Pekka Pessi
2010/7/24 Mayur Mahajan mayurmahajan...@gmail.com:
  I have made a shorter version of my mail.
   When I send a request to the server through my NTA client, I get the
 response of the message(407 Unauthorized) in the callback. So, when the
 callback function gets the 407 message it invokes authorize_ua() method. The
 problem is I am not able to send the request which authorizes me.  Could you
 please help me in the following things :-

The 407 Unauthorized is sent by a proxy (as opposed to the 401
Unauthorized which is sent by UAS). The 407 carries Proxy-Authenticate
header (instead of WWW-Authenticate in 401) and the subsequent retry
should contain Proxy-Authorization header.

 nta_leg_destroy(context-c_leg), context-c_leg = NULL;

   if (context-c_leg)

This is an another problem...

-- 
Pekka.Pessi mail at nokia.com

--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


Re: [Sofia-sip-devel] Null Callid and To Tag

2010-08-04 Thread Pekka Pessi
2010/7/26 Vikas Bhat vikasbhat0...@gmail.com:
 Sofia stack is not able to detect empty/null CallID in INVITE request.
 similarly Sofia is not able to detect empty/NULL TO TAG.
 Ideally Sofia should reject the calls in above scenerios.

I think NTA is supposed to return a 400 response to a request received
from network if CallID header is missing.

On client side, it generates a CallID automatically, if application
has not provided one. Likewise, it generates a random To tag if
application has not provided one.

The To tag is always empty or missing in initial requests; do you
propose that a Sofia should automatically try to clear any call if a
response to an INVITE request contains empty/null To tag?

-- 
Pekka.Pessi mail at nokia.com

--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


Re: [Sofia-sip-devel] Threading - Root problem Newbie

2010-08-04 Thread Pekka Pessi
Hi Rohan,

2010/7/24 rohan kala rohankal...@gmail.com:
 1) I have initialized su_root_create() function in my main() function, now
 do I have to initialize it in callback function or every othe function to
 send request or incoming request etc.. Or I have to just put
 su_root_run(context-c_root) every time when I expect callback function.

The main loop is executed within the su_root_run() function (until one
of your callbacks call su_root_break(context-c_root)

 2) What's the role of su_root_threading() where should I initialize it?

If you create a su_root_t clone (e.g., nua_create() creates one), it
can be executed with the original thread and su_root_t main loop, or
by an separate thread. You can select the mode with
su_root_threading() call before the clone is created.

 3) Once I have created nta_outgoing_tcreate() function and  had sent request
 with it do I have to do nta_outgoing_destroy() before using
 nta_outgoing_tcreate() etc. Or threading can take care of it?

There can be multiple client transactions ongoing, you should call
nta_outgoing_destroy() after you get the final response (or, in case
of INVITE, after you send the ACK to 2XX response).

-- 
Pekka.Pessi mail at nokia.com

--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


Re: [Sofia-sip-devel] Contact header incorrect

2010-08-04 Thread Pekka Pessi
Hi,

2010/7/26 Nauman Sulaiman nauman762-h...@yahoo.co.uk:
 Hi, using Sofia 1.12.10. I have multiple sip accounts, with separate nua 
 handles for each nua_register etc. When i get a nua_i_invite and send a 
 response it seems to pick a contact randomly from sip accounts that i have
 for the contact header. I am switching on the sip_request field to determine
 the account the invite is for then i manually attach SIPTAG_CONTACT_STR  to 
 each nua_respond etc then all is ok.

 But is there a better way i should be doing this?

Unfortunately, no. SIPTAG_CONTACT() is best you can do at the moment.

-- 
Pekka.Pessi mail at nokia.com

--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


[Sofia-sip-devel] [ sofia-sip-Bugs-3034730 ] torture_url test fail to pass

2010-08-04 Thread SourceForge.net
Bugs item #3034730, was opened at 2010-07-26 18:02
Message generated for change (Comment added) made by ppessi
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=756076aid=3034730group_id=143636

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: build system
Group: None
Status: Pending
Resolution: Works For Me
Priority: 5
Private: No
Submitted By: Pacho Ramos (pacho2)
Assigned to: Nobody/Anonymous (nobody)
Summary: torture_url test fail to pass

Initial Comment:
This has been noticed downstream:
http://bugs.gentoo.org/show_bug.cgi?id=328733#c2

PASS: run_test_sdp
==
All 2 tests passed
==
make[4]: Leaving directory 
`/var/tmp/portage/net-libs/sofia-sip-1.12.10/work/sofia-sip-1.12.10/libsofia-sip-ua/sdp'
make[3]: Leaving directory 
`/var/tmp/portage/net-libs/sofia-sip-1.12.10/work/sofia-sip-1.12.10/libsofia-sip-ua/sdp'
make[2]: Leaving directory 
`/var/tmp/portage/net-libs/sofia-sip-1.12.10/work/sofia-sip-1.12.10/libsofia-sip-ua/sdp'
Making check in url
make[2]: Entering directory 
`/var/tmp/portage/net-libs/sofia-sip-1.12.10/work/sofia-sip-1.12.10/libsofia-sip-ua/url'
make  check-am
make[3]: Entering directory 
`/var/tmp/portage/net-libs/sofia-sip-1.12.10/work/sofia-sip-1.12.10/libsofia-sip-ua/url'
make  torture_url
make[4]: Entering directory 
`/var/tmp/portage/net-libs/sofia-sip-1.12.10/work/sofia-sip-1.12.10/libsofia-sip-ua/url'
if i686-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I. -I../.. 
-I../../libsofia-sip-ua/su/sofia-sip -I./../bnf -I../bnf -I./../ipt -I../ipt 
-I./../su -I../su   -Wall -O2 -march=native -pipe -fomit-frame-pointer 
-ggdb -MT torture_url.o -MD -MP -MF .deps/torture_url.Tpo -c -o torture_url.o 
torture_url.c; \
then mv -f .deps/torture_url.Tpo .deps/torture_url.Po; else rm -f 
.deps/torture_url.Tpo; exit 1; fi
/bin/sh ../../libtool --tag=CC --mode=link i686-pc-linux-gnu-gcc -Wall -O2 
-march=native -pipe -fomit-frame-pointer -ggdb  -Wl,-O1 -Wl,--as-needed -o 
torture_url  torture_url.o liburl.la ../bnf/libbnf.la ../ipt/libipt.la 
../su/libsu.la -lssl -lcrypto -lrt -lpthread 
i686-pc-linux-gnu-gcc -Wall -O2 -march=native -pipe -fomit-frame-pointer -ggdb 
-Wl,-O1 -Wl,--as-needed -o torture_url torture_url.o  ./.libs/liburl.a 
../bnf/.libs/libbnf.a ../ipt/.libs/libipt.a ../su/.libs/libsu.a -lssl -lcrypto 
-lrt -lpthread  
make[4]: Leaving directory 
`/var/tmp/portage/net-libs/sofia-sip-1.12.10/work/sofia-sip-1.12.10/libsofia-sip-ua/url'
make  check-TESTS
make[4]: Entering directory 
`/var/tmp/portage/net-libs/sofia-sip-1.12.10/work/sofia-sip-1.12.10/libsofia-sip-ua/url'
torture_url.c:279: torture_url test_sip() FAILED: 
url_query_as_header_string(home, url-url_headers) != \n\nCANNED MSG or NULL 
!= 

CANNED MSG
FAIL: torture_url
===
1 of 1 tests failed
===
make[4]: *** [check-TESTS] Error 1
make[4]: Leaving directory 
`/var/tmp/portage/net-libs/sofia-sip-1.12.10/work/sofia-sip-1.12.10/libsofia-sip-ua/url'
make[3]: *** [check-am] Error 2
make[3]: Leaving directory 
`/var/tmp/portage/net-libs/sofia-sip-1.12.10/work/sofia-sip-1.12.10/libsofia-sip-ua/url'
make[2]: *** [check] Error 2
make[2]: Leaving directory 
`/var/tmp/portage/net-libs/sofia-sip-1.12.10/work/sofia-sip-1.12.10/libsofia-sip-ua/url'
make[1]: *** [check-recursive] Error 1
make[1]: Leaving directory 
`/var/tmp/portage/net-libs/sofia-sip-1.12.10/work/sofia-sip-1.12.10/libsofia-sip-ua'
make: *** [check-recursive] Error 1

And there is a possible fix in http://bugs.gentoo.org/show_bug.cgi?id=328733#c6

Thanks a lot for solving this

--

Comment By: Pekka Pessi (ppessi)
Date: 2010-08-04 17:47

Message:
Which compiler is used there? Can you get gcc -v and cat /proc/cpuinfo from
those who are bitten by this bug?

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=756076aid=3034730group_id=143636

--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


Re: [Sofia-sip-devel] Does soa module support “Del ayed Offer” ?

2010-08-04 Thread Paulo Pizarro
Hi all,

I'm sending a patch implementing the tag SOATAG_DELAYED_OFFER_ENABLE
to enable delayed offer (without using the payload kludge).

Hope this helps!

Best regards,

Paulo Pizarro

2010/8/3 Pekka Pessi ppe...@gmail.com:
 2010/7/21 edson.gomes.leme edson.gomes.l...@uol.com.br:
 Hi Pekka Pessi;

 a) Does the Sofia-SIP soa module support “Delayed Offer” ?

 Yes..

 b) How can this call scenario be implemented with the soa module?

     SOFIA-SIP (soa)
      A (UAC) B (UAS)
     |   |
     |--  INVITE  --|
     |   |
     |---  100 Trying  -|
     |---  180 Ringing  |
     |   |
     |---  200 (offer)  |
     |--  ACK (answer)  |
     |   |

 You need nothing special (but the usual remote sdp tags in
 nua_i_invite are missing).

 c) How can this call scenario be implemented with the soa module?

        SOFIA-SIP (soa)
             A (UAC)                         B (UAS)
                |                               |
                |--  INVITE  --|
                |                               |
                |---  100 Trying  -|
                |---  180 Ringing  |
                |                               |
                |---  200 (offer)  |
                |--  ACK (answer)  |
                |                               |

 Currently, this requires a kludge, you have to include an empty
 payload (I think SIPTAG_PAYLOAD_STR() is ok) in nua_invite().

 --Pekka

 --
 Pekka.Pessi mail at nokia.com
 --
 The Palm PDK Hot Apps Program offers developers who use the
 Plug-In Development Kit to bring their C/C++ apps to Palm for a share
 of $1 Million in cash or HP Products. Visit us here for more details:
 http://p.sf.net/sfu/dev2dev-palm
 ___
 Sofia-sip-devel mailing list
 Sofia-sip-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel

From b6bee18e2b1610f8333495131ea3656a1115168e Mon Sep 17 00:00:00 2001
From: Paulo Pizarro paulo.piza...@gmail.com
Date: Wed, 4 Aug 2010 16:46:38 -0300
Subject: [PATCH] Created the tag SOATAG_DELAYED_OFFER_ENABLE to enable delayed offer (without using the payload kludge)


Signed-off-by: Paulo Pizarro paulo.piza...@gmail.com
---
 libsofia-sip-ua/nua/nua_session.c   |4 +-
 libsofia-sip-ua/soa/soa.c   |   33 ++-
 libsofia-sip-ua/soa/soa_tag.c   |   21 +
 libsofia-sip-ua/soa/sofia-sip/soa.h |2 +
 libsofia-sip-ua/soa/sofia-sip/soa_session.h |2 +
 libsofia-sip-ua/soa/sofia-sip/soa_tag.h |6 +
 libsofia-sip-ua/soa/test_soa.c  |   15 
 7 files changed, 75 insertions(+), 8 deletions(-)

diff --git a/libsofia-sip-ua/nua/nua_session.c b/libsofia-sip-ua/nua/nua_session.c
index ad3f97c..7b52aac 100644
--- a/libsofia-sip-ua/nua/nua_session.c
+++ b/libsofia-sip-ua/nua/nua_session.c
@@ -800,8 +800,8 @@ static int nua_invite_client_request(nua_client_request_t *cr,
   if (nh-nh_soa) {
 soa_init_offer_answer(nh-nh_soa);
 
-if (sip-sip_payload)
-  offer_sent = 0;		/* XXX - kludge */
+if (soa_is_delayed_offer(nh-nh_soa))
+  offer_sent = 0;
 else if (soa_generate_offer(nh-nh_soa, 0, NULL)  0)
   return -1;
 else
diff --git a/libsofia-sip-ua/soa/soa.c b/libsofia-sip-ua/soa/soa.c
index de79e0f..2c501fd 100644
--- a/libsofia-sip-ua/soa/soa.c
+++ b/libsofia-sip-ua/soa/soa.c
@@ -389,8 +389,9 @@ void soa_base_deinit(soa_session_t *ss)
  * SOATAG_RTP_SORT(),
  * SOATAG_RTP_MISMATCH(),
  * SOATAG_SRTP_ENABLE(),
- * SOATAG_SRTP_CONFIDENTIALITY(), and
- * SOATAG_SRTP_INTEGRITY().
+ * SOATAG_SRTP_CONFIDENTIALITY(),
+ * SOATAG_SRTP_INTEGRITY(), and
+ * SOATAG_DELAYED_OFFER_ENABLE().
  */
 int soa_set_params(soa_session_t *ss, tag_type_t tag, tag_value_t value, ...)
 {
@@ -434,8 +435,9 @@ int soa_set_params(soa_session_t *ss, tag_type_t tag, tag_value_t value, ...)
  * SOATAG_RTP_SORT(),
  * SOATAG_RTP_MISMATCH(),
  * SOATAG_SRTP_ENABLE(),
- * SOATAG_SRTP_CONFIDENTIALITY(), and
- * SOATAG_SRTP_INTEGRITY().
+ * SOATAG_SRTP_CONFIDENTIALITY(),
+ * SOATAG_SRTP_INTEGRITY(), and
+ * SOATAG_DELAYED_OFFER_ENABLE().
  */
 int soa_base_set_params(soa_session_t *ss, tagi_t const *tags)
 {
@@ -449,6 +451,7 @@ int soa_base_set_params(soa_session_t *ss, tagi_t const *tags)
   int rtp_select, rtp_sort;
   int rtp_mismatch;
   int srtp_enable, srtp_confidentiality, srtp_integrity;
+  int delayed_offer_enable;
 
   af = ss-ss_af;
 
@@ -463,6 +466,8 @@ int soa_base_set_params(soa_session_t *ss, tagi_t const *tags)