Re: [Sofia-sip-devel] DNS Resolving for iPhone

2009-03-26 Thread Andrew Rechenberg Lists
I'd be interested in that patch.  I'd post it to the list for
posterity's sake, but I leave that up to you.

You can send it to me directly as well.

Thanks,
Andy.

 -Original Message-
 From: Inca Rose [mailto:incar...@gmail.com]
 Sent: Wednesday, March 25, 2009 12:09 PM
 To: sofia-sip-devel Mailing List
 Subject: [Sofia-sip-devel] DNS Resolving for iPhone
 
 Hi;
 I just wrote some code to make the reolver code  works on the iPhone.
 The iPhone is missing a resolv.conf like file, but it has a plist
files
 with all the information needed.
 I wrote a patch ( much like the one for win32 ) to add the DNS servers
 to the system.
 The patch is on the function
 static sres_config_t *sres_parse_resolv_conf(sres_resolver_t *res,
char
 const **options)
 
 and it just check for a define HAVE_IPHONE_OS, if the define is true
it
 call
 a function to fill in the name servers.
 
 The patch includes an obj-c file laso to deal with Foundation classes.
 I dont know how to submit the patch if anyone is interested.
 
 So, I patch config.h for HAVE_IPHONE_OS
 I patch the above function and add a new file ( an obj-c m file ) to
 deal with Foundation classes ( read and parse plist files ).
 
 
 Regards
 Inca R
 
 


 --
 ___
 Sofia-sip-devel mailing list
 Sofia-sip-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel

Confidentiality Notice: This e-mail message including attachments, if any, is 
intended only for the person or entity to which it is addressed and may contain 
confidential and/or privileged material. Any unauthorized review, use, 
disclosure or distribution is prohibited. If you are not the intended 
recipient, please contact the sender by reply e-mail and destroy all copies of 
the original message. If you are the intended recipient, but do not wish to 
receive communications through this medium, please so advise the sender 
immediately.

--
___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


Re: [Sofia-sip-devel] DNS and iPhone

2009-03-24 Thread Andrew Rechenberg Lists
Check in /var/run/resolv.conf on the iPhone.  I believe that's where the
DNS server IPs live.

 -Original Message-
 From: Inca Rose [mailto:incar...@gmail.com]
 Sent: Tuesday, March 24, 2009 10:07 AM
 To: sofia-sip-devel Mailing List
 Subject: [Sofia-sip-devel] DNS and iPhone
 
 Hi;
 The DNS module works with /etc/resolv.conf or any other file that
 complies with resolv.conf format.
 in iPhone this file doent exist but there is another file with a
 different format.
 
 Is there any way to populate the DNS server addresses and the other
 requiered data via API ?
 At the current state the stack cannot resolve any host.
 
 If there is any way I can problematically feed the DNS client with the
 server addresses pls let me know.
 Or if someone knows where is resolve.conf in iPhone will also help ;)
 
 Thanks
 Inca R
 


 --
 Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM)
are
 powering Web 2.0 with engaging, cross-platform capabilities. Quickly
and
 easily build your RIAs with Flex Builder, the Eclipse(TM)based
 development
 software that enables intelligent coding and step-through debugging.
 Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
 ___
 Sofia-sip-devel mailing list
 Sofia-sip-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel

Confidentiality Notice: This e-mail message including attachments, if any, is 
intended only for the person or entity to which it is addressed and may contain 
confidential and/or privileged material. Any unauthorized review, use, 
disclosure or distribution is prohibited. If you are not the intended 
recipient, please contact the sender by reply e-mail and destroy all copies of 
the original message. If you are the intended recipient, but do not wish to 
receive communications through this medium, please so advise the sender 
immediately.

--
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


Re: [Sofia-sip-devel] Issues with the new tport TLS code in 1.12.10

2009-02-12 Thread Andrew Rechenberg Lists
 
 On Wed, 2009-02-11 at 09:01 -0600, Andrew Rechenberg Lists wrote:
 tport_listen(0x1029630): tport_setname(pf=2, tls/(null)):
Address
   family not supported by protocol family
 Interesting.  Can you provide a log with TPORT_DEBUG set to 9?

Here are a working and non-working TPORT_LOG=9 (1.12.9 works,
1.12.10/darcs HEAD doesn't).  Not much more there than what I posted
initially (at least from my layperson's point of view :) ).

Non-working:
http://dpaste.com/hold/119739/

nua: nua_create: entering
su_socket_port_init(0x1027160, 0x1e2ec0) called
su_pthread_port_init(0x1027160, 0x1e2ec0) called
nua: nua_stack_init: entering
nua: nua_stack_set_params: entering
soa_create(default, 0x1023f20, 0x1027fd0) called
soa_set_params(static::0x10282b0, ...) called
soa_set_params(static::0x10282b0, ...) called
nta_agent_create: initialized hash tables
nta_agent_create: initialized transports
nta_agent_create: initialized random identifiers
nta_agent_create: initialized timer
nta_agent_create: initialized resolver
tport_create(): 0x1029270
nta: master transport created
tport_bind_server(0x1029270) to tls/192.168.43.1:5061/sips
tport_bind_server(0x1029270): calling tport_listen for tls
tport_alloc_primary(0x1029270): new primary tport 0x1029550
tport_tls_init_master(0x1029550): tls key =
/Users/djflux/Library/Application Support/iPhone
Simulator/User/Applications/48543AB8-2FCB-447A-BCEE-D4B9BD5B6895/.sip/au
th/agent.pem
tport_listen(0x1029270): tport_setname(pf=2 tls/(null)): Address family
not supported by protocol family
nta: bind(192.168.43.1:5061;transport=tls): Address family not supported
by protocol family
nua: initializing SIP stack failed
nua: nua_stack_deinit: entering
sres_sofia_update(0x1029010, -1, -1)
sres_sofia_update(0x0, -1, -1)
tport_destroy(0x1029270)
su_kqueue_port_deinit(0x1027160) called



Working:
http://dpaste.com/hold/119742/

nua: nua_create: entering
su_socket_port_init(0x1027150, 0x1e2e80) called
su_pthread_port_init(0x1027150, 0x1e2e80) called
nua: nua_stack_init: entering
nua: nua_stack_set_params: entering
soa_create(default, 0x100cf60, 0x1028330) called
soa_set_params(static::0x1028560, ...) called
soa_set_params(static::0x1028560, ...) called
nta_agent_create: initialized hash tables
nta_agent_create: initialized transports
nta_agent_create: initialized random identifiers
nta_agent_create: initialized timer
nta_agent_create: initialized resolver
tport_create(): 0x1029690
nta: master transport created
tport_bind_server(0x1029690) to tls/192.168.43.1:5061/sips
tport_bind_server(0x1029690): calling tport_listen for tls
tport_alloc_primary(0x1029690): new primary tport 0x1029970
tport_tls_init_master(0x1029970): tls key =
/Users/djflux/Library/Application Support/iPhone
Simulator/User/Applications/3C9FA442-6976-443A-B1CB-C3E3EA3BA31A/.sip/au
th/agent.pem
tport_listen(0x1029970): listening at tls/192.168.43.1:5061/sips
nta: bound to (192.168.43.1:5061;transport=tls)
nta: agent_init_via: SIP/2.0/tls 192.168.43.1 (sips)
nta: Via fields initialized
nta: Contact header created
nua_register: Adding contact URL '192.168.43.1' to list.
nua: nua_set_params: entering
nua(0x0): sent signal r_set_params
nua: nua_get_params: entering
nua(0x0): sent signal r_get_params
nua(0x0): recv signal r_set_params
nua: nua_stack_set_params: entering
soa_set_params(static::0x1028560, ...) called
nua(0x0): event r_set_params 200 OK
nua(0x0): recv signal r_get_params
nua: nua_stack_get_params: entering
soa_get_paramlist(static::0x1028560, ...) called
nua(0x0): event r_get_params 200 OK




 
   Do I need to change something in my code to get TLS working with
  1.12.10
 If you didn't add/remove tags, then everything should (will?) behave
 exactly the same way.
 
 
  Thought my nua_create code would be handy for reference:
 
  NUTAG_URL(sips:192.168.43.1:5061;transport=tls;epid=010101010101),
 I think the transport=tls is redundant, unless it is another MS
thing...

For some reason Microsoft Office Communications Server expects that bit
to be there :(

Confidentiality Notice: This e-mail message including attachments, if any, is 
intended only for the person or entity to which it is addressed and may contain 
confidential and/or privileged material. Any unauthorized review, use, 
disclosure or distribution is prohibited. If you are not the intended 
recipient, please contact the sender by reply e-mail and destroy all copies of 
the original message. If you are the intended recipient, but do not wish to 
receive communications through this medium, please so advise the sender 
immediately.

--
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications

Re: [Sofia-sip-devel] Issues with the new tport TLS code in 1.12.10

2009-02-12 Thread Andrew Rechenberg Lists
  Here are a working and non-working TPORT_LOG=9 (1.12.9 works,
  1.12.10/darcs HEAD doesn't).  Not much more there than what I posted
  initially (at least from my layperson's point of view :) ).
 Indeed.  The silence is rather distrubing.
 
  tport_listen(0x1029270): tport_setname(pf=2 tls/(null)): Address
  family not supported by protocol family
 Come to think of it, I saw this message a few days ago.  After a darcs
 pull, it went away.  Are you using a fresh tree?
 
 The tls code doesn't touch the addrinfo structure during
initialization,
 so I am starting to think that something else is amiss.


I was using darcs as of 20090209 at 15:10 UTC (10:10 am ET).

Another user on the mailing said that he was having the same problem on
the iPhone simulator, but the same code ran just fine on the real
device.  I'm not currently setup to run my code on my real iPhone so I
have just been running it on the simulator.  Odd.

I'll pull the current darcs and try again.


Confidentiality Notice: This e-mail message including attachments, if any, is 
intended only for the person or entity to which it is addressed and may contain 
confidential and/or privileged material. Any unauthorized review, use, 
disclosure or distribution is prohibited. If you are not the intended 
recipient, please contact the sender by reply e-mail and destroy all copies of 
the original message. If you are the intended recipient, but do not wish to 
receive communications through this medium, please so advise the sender 
immediately.

--
___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


Re: [Sofia-sip-devel] Issues with the new tport TLS code in 1.12.10

2009-02-12 Thread Andrew Rechenberg Lists
 
   Here are a working and non-working TPORT_LOG=9 (1.12.9 works,
   1.12.10/darcs HEAD doesn't).  Not much more there than what I
posted
   initially (at least from my layperson's point of view :) ).
  Indeed.  The silence is rather distrubing.
 
   tport_listen(0x1029270): tport_setname(pf=2 tls/(null)): Address
   family not supported by protocol family
  Come to think of it, I saw this message a few days ago.  After a
darcs
  pull, it went away.  Are you using a fresh tree?
 
  The tls code doesn't touch the addrinfo structure during
 initialization,
  so I am starting to think that something else is amiss.
 
 
 I was using darcs as of 20090209 at 15:10 UTC (10:10 am ET).
 
 Another user on the mailing said that he was having the same problem
on
 the iPhone simulator, but the same code ran just fine on the real
 device.  I'm not currently setup to run my code on my real iPhone so I
 have just been running it on the simulator.  Odd.
 
 I'll pull the current darcs and try again.
 

No love.  Same issue with current darcs.  Guess I'll keep working with
my 1.12.9 library to keep the ball rolling in my app and work on getting
1.12.10/darcs working when I have some spare time.

Any ideas are welcome.

Thanks,
Andy.

Confidentiality Notice: This e-mail message including attachments, if any, is 
intended only for the person or entity to which it is addressed and may contain 
confidential and/or privileged material. Any unauthorized review, use, 
disclosure or distribution is prohibited. If you are not the intended 
recipient, please contact the sender by reply e-mail and destroy all copies of 
the original message. If you are the intended recipient, but do not wish to 
receive communications through this medium, please so advise the sender 
immediately.

--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


Re: [Sofia-sip-devel] Issues with the new tport TLS code in 1.12.10

2009-02-11 Thread Andrew Rechenberg Lists
 Good day,
 
 I'm trying to setup my NTLM patches for Sofia 1.12.10/darcs:HEAD and
I'm
 having issues testing the code in my application and it seems the
 changes to the tport TLS code are causing my issues.
 
 When my application uses nua_create() on 1.12.9 I bind to the IP:port
 just fine on my interface - here's the log:
 
   tport_listen(0x10299b0): listening at tls/192.168.43.1:5069/sips
 
 The same application code in 1.12.10 results in the following in the
 console log:
 
   tport_listen(0x1029630): tport_setname(pf=2, tls/(null)): Address
 family not supported by protocol family
 
 Looks like su_inet_ntop isn't working in my case.  The su_family is
528
 which defaults to su_seterrorno(EAFNOSUPPORT).
 
 I'm using my own self-signed certs for agent.pem, etc.
 
 Do I need to change something in my code to get TLS working with
1.12.10
 with the new tport TLS code?  Any I doing something wrong with my
 nua_create/NUTAGs?
 
 Thanks,
 Andy.
 

Thought my nua_create code would be handy for reference:

nua_create(root,
   priv_callback
   fluxsip,
 
NUTAG_URL(sips:192.168.43.1:5061;transport=tls;epid=010101010101),
   SIPTAG_SUPPORTED_STR(gruu-1, adhoclist),
   TAG_END());

The epid=010101010101 bit is used by Microsoft Office Communications
Server.
 
Thanks again,
Andy.

PS Jarod, I hope you don't mind I'm CCing you since you submitted the
TLS patches.

Confidentiality Notice: This e-mail message including attachments, if any, is 
intended only for the person or entity to which it is addressed and may contain 
confidential and/or privileged material. Any unauthorized review, use, 
disclosure or distribution is prohibited. If you are not the intended 
recipient, please contact the sender by reply e-mail and destroy all copies of 
the original message. If you are the intended recipient, but do not wish to 
receive communications through this medium, please so advise the sender 
immediately.

--
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


Re: [Sofia-sip-devel] : Multiple ethernet interface support?

2009-02-06 Thread Andrew Rechenberg Lists
 
 Thanks! nua_create() with NUTAG_URL(sip:192.168.15.115) certainly
 resolved that scenario, but presents me with another challenge.
 
 I want to receive SIP traffic on both of my Ethernet interfaces, eth0
 (172.16.xx.xx) and eth1(192.168.xx.xx). I was using
 NUATAG_URL(0.0.0.0) in my nua_create() believing that one instance
of
 Sofia could receive SIP traffic from any of my network interfaces,
which
 I think it valid. However, my previous transmit problem arose. Do you
 believe I need to create multiple instances of Sofia to have the best
of
 both worlds? Ie. nua_create(NUTAG_URL(172.16.xx.xx)) and
 nua_create(NUTAG_URL(192.168.xx.xx))? Will that work with Sofia?
 

You could probably leave the NUATAG_URL(0.0.0.0) and add a separate
Via header for each of your SIP transactions with SIPTAG_VIA_STR().  I
believe that would make the outgoing messages come back on the proper
interface.

Take this recommendation with a grain of salt as I'm just learning Sofia
as well :)

Confidentiality Notice: This e-mail message including attachments, if any, is 
intended only for the person or entity to which it is addressed and may contain 
confidential and/or privileged material. Any unauthorized review, use, 
disclosure or distribution is prohibited. If you are not the intended 
recipient, please contact the sender by reply e-mail and destroy all copies of 
the original message. If you are the intended recipient, but do not wish to 
receive communications through this medium, please so advise the sender 
immediately.

--
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


Re: [Sofia-sip-devel] Multiple WWW-Authenticate headers and comparing au_scheme

2009-02-05 Thread Andrew Rechenberg Lists

  Any word on the sub_alloc() question I posted on Friday?
 
 It looks like you have not allocated enough memory for gssapi
response..
 

I'm still having an issue with sub_alloc called from msg_header_format()
but the problem only occurs when I use the ipt base64_e function.  If I
use my own base64 function based on the one in libpurple util.c, then
everything works and my authentication works as expected.

If I enable Guard Malloc I get a bad access in base64_e when trying to
encode the authentication response.  

Any ideas?

Confidentiality Notice: This e-mail message including attachments, if any, is 
intended only for the person or entity to which it is addressed and may contain 
confidential and/or privileged material. Any unauthorized review, use, 
disclosure or distribution is prohibited. If you are not the intended 
recipient, please contact the sender by reply e-mail and destroy all copies of 
the original message. If you are the intended recipient, but do not wish to 
receive communications through this medium, please so advise the sender 
immediately.

--
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


Re: [Sofia-sip-devel] Multiple WWW-Authenticate headers andcomparing au_scheme

2009-02-05 Thread Andrew Rechenberg Lists

 
   Any word on the sub_alloc() question I posted on Friday?
 
  It looks like you have not allocated enough memory for gssapi
 response..
 


You are correct and I'm answering my own question once again :)

 
 I'm still having an issue with sub_alloc called from
msg_header_format()
 but the problem only occurs when I use the ipt base64_e function.  If
I
 use my own base64 function based on the one in libpurple util.c, then
 everything works and my authentication works as expected.
 
 If I enable Guard Malloc I get a bad access in base64_e when trying to
 encode the authentication response.
 
 Any ideas?
 

I wasn't allocating the memory properly and Guard Malloc showed me.
Once I calloc(1, 256) for the gssapi response everything started working
with the ipt base64_e().

I'll get this going eventually :)

Thanks,
Andy.

Confidentiality Notice: This e-mail message including attachments, if any, is 
intended only for the person or entity to which it is addressed and may contain 
confidential and/or privileged material. Any unauthorized review, use, 
disclosure or distribution is prohibited. If you are not the intended 
recipient, please contact the sender by reply e-mail and destroy all copies of 
the original message. If you are the intended recipient, but do not wish to 
receive communications through this medium, please so advise the sender 
immediately.

--
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


Re: [Sofia-sip-devel] Multiple ethernet interface support?

2009-02-05 Thread Andrew Rechenberg Lists
I'm not exactly sure how Sofia chooses which interface to use in the header, 
but you can specify that Sofia only binds to a specific IP when you call 
nua_create() with NUTAG_URL(sip:192.168.15.115).

PS Sorry about top-posting.  Outlook doesn't add the  to replies when I 
convert to plain text.

HTH,
Andy.



From: Rostowsky, David [mailto:drostow...@airbiquity.com] 
Sent: Thursday, February 05, 2009 1:20 PM
To: sofia-sip-devel@lists.sourceforge.net
Subject: [Sofia-sip-devel] Multiple ethernet interface support?

Hi,

How does Sofia SIP handle multiple Ethernet interface support? I’m having a 
problem where my linux box has eth0=172.16.1.1, and eth1=192.168.15.115. When 
Sofia sends an INVITE out to the destination 192.168.15.13, my expectation was 
that the source IP address should be 192.168.15.115. However, Ethereal captures 
show the source IP address is actually 172.16.1.1. The INVITE is actually being 
sent out eth1 as I have physically unplugged 172.16.1.1. How does Sofia’s SIP 
socket determine to use eth0’s source IP address? It should be using eth1 as 
the source IP address.  

This is obviously causing the receiver of the INVITE issues as the 100-Trying, 
etc are being sent to 172.16.1.1 which of course never reaches my linux box 
since that cable is unplugged.

Thanks in advance!
-Dave R.

PS: As an aside, I wrote a simple UDP SIP socket socket program that sent my 
own INVITE out to 192.168.15.13, and the source IP address in Ethereal is 
correctly shown as eth1’s (192.168.15.115). Therefore, I know this probably has 
nothing to do with Linux OS routing tables, networking, etc.  Its more to my 
lack of understanding on Sofia. ☺




The information contained in this message, including attachments, may contain 
privileged and/or confidential information that is intended to be delivered 
only to the person(s) identified above. If you are not the intended 
recipient(s), or the person responsible for delivering this message to the 
intended recipient(s), Airbiquity Inc. requests that you immediately notify the 
sender and asks that you do not read the message or its attachments and that 
you delete them without copying or sending them to anyone else. Any review, 
reliance or distribution by others not intended as recipients or forwarding 
without express permission is strictly prohibited. Replies to this message may 
be received by other Airbiquity personnel in addition to the intended 
recipient(s).

Confidentiality Notice: This e-mail message including attachments, if any, is 
intended only for the person or entity to which it is addressed and may contain 
confidential and/or privileged material. Any unauthorized review, use, 
disclosure or distribution is prohibited. If you are not the intended 
recipient, please contact the sender by reply e-mail and destroy all copies of 
the original message. If you are the intended recipient, but do not wish to 
receive communications through this medium, please so advise the sender 
immediately.
--
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


Re: [Sofia-sip-devel] Authentication-Info, Allow-Events, and Contact header parsing

2009-02-04 Thread Andrew Rechenberg Lists
 
 Good day,
 
 My Sofia-based application is talking to a Microsoft OCS 2007 server
and
 I believe, in true MS fashion, that certain headers are not quite in
 adherence to the RFCs.  Could it be that Sofia is not parsing those
 headers as a result of them not being standard?
 
 Here is an example of a 200 OK response from a REGISTER sent to my OCS
 server:
 
 http://dpaste.com/hold/114883/
 
 
SIP/2.0 200 OK
ms-keep-alive: UAS; tcp=no; hop-hop=yes; end-end=no; timeout=300
Authentication-Info: NTLM
rspauth=01002DBA2B7889FDE4C9,
 srand=E8CDC093, snum=1, opaque=F06AE926, qop=auth,
 targetname=OCS1.flux.local, realm=SIP Communications Service
From: DJ
 Fluxsip:djf...@flux.local;epid=010101010101;tag=0D4Zj86tFD0mr
To:

sip:djf...@flux.local;transport=tls;tag=87F67DD92A1B2E9E2A4517BE91E19A
 17
Call-ID: f5a19ca6-69bf-122c-e294-6901e212fe01
CSeq: 110558877 REGISTER
Via: SIP/2.0/TLS

192.168.43.1:5069;branch=z9hG4bK22y3g859yN2QB;received=192.168.43.1;ms-r
 eceived-port=52342;ms-received-cid=2500
Contact:

sip:192.168.43.1:52342;transport=tls;ms-opaque=d3470f2e1d;ms-received-c

id=2500;expires=7200;+sip.instance=urn:uuid:c8c355ae-02d5-5079-a68c-7

6b90ab4cb8d;gruu=sip:djf...@flux.local;opaque=user:epid:rlXDyNUCeVCmj
 Ha5CrTLjQAA;gruu
Expires: 7200
Allow-Events:

vnd-microsoft-provisioning,vnd-microsoft-roaming-contacts,vnd-microsoft-

roaming-ACL,presence,presence.wpending,vnd-microsoft-roaming-self,vnd-mi
 crosoft-provisioning-v2
Supported: adhoclist
Server: RTC/3.0
Supported: com.microsoft.msrtc.presence
Content-Length: 0
 
 Looking in my debugger, I would think
 sip-sip_authentication_info-ai_params should show all of the
 parameters in the Authentication-Info header.  Instead it only shows:
 
   NTLM rspauth=01002DBA2B7889FDE4C9
 
 and nothing else (no srand, snum, etc).
 
 The Allow-Events information in sip-sip_allow_events seems to only
 contain the first entry (in my case I only see
 vnd-microsoft-provisioning in the debugger).
 sip-sip_allow_events-k_next is NULL.
 
 Also, the sip-sip_contact information only has pieces of the full
 contact line listed above.
 
 BTW, these values I am looking at are in the callback function for my
 Sofia events.
 
 Is there any way I can retrieve the entirety of any of these headers
 before or after they are parsed?  Or can I add some code to Sofia to
 parse the additional information in the Contact header?  Is this
 additional header information buried somewhere is another structure
and
 I'm missing it?
 
 In particular I need to keep track of the gruu=* information in the
 Contact header, and some additional information in the
 Authentication-Info, and Allow-Events headers.
 

Once again, answering my own question here for posterity's sake.

Looks like the unparsed data is located in sip-sip_*-*_common-h_data
for all parsed SIP headers.  For example, the unparsed
Authentication-Info is located in
sip-sip_authentication_info-ai_common-h_data

I found that out after looking at the tests in sip/torture_sip.c

Thanks again for the great code.

Regards,
Andy.

Confidentiality Notice: This e-mail message including attachments, if any, is 
intended only for the person or entity to which it is addressed and may contain 
confidential and/or privileged material. Any unauthorized review, use, 
disclosure or distribution is prohibited. If you are not the intended 
recipient, please contact the sender by reply e-mail and destroy all copies of 
the original message. If you are the intended recipient, but do not wish to 
receive communications through this medium, please so advise the sender 
immediately.

--
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


[Sofia-sip-devel] NTLM patch questions

2009-02-04 Thread Andrew Rechenberg Lists
Good day,

I have the NTLM code in Sofia working about 95% now (with regard to
authenticating to a Microsoft Office Communications Server 2007) but I
have some questions as to the proper places to put things before I
submit a patch (multiple patches (?)).

In its current incarnation the NTLM code relies on a couple of extra
dependencies - zlib and iconv are the only ones as far as I can
remember.  Zlib is used for one function call to generate an NTLM
signature used to sign the SIP requests.  Iconv is used to convert
usernames, passwords, and domains to UTF-16LE.

All of the NTLM code is just ported from the SIPE project (SIP for
Exchange plugin for the Pidgin IM client - http://sipe.sourceforge.net/,
http://repo.or.cz/w/siplcs.git).  Thanks to Gabriel Burt for him writing
the initial code and for help troubleshooting the port.

I'm not sure what your stance is on adding more dependencies to Sofia,
but they would only be added if the user wanted to compile the library
with NTLM support.  I tried to keep the additions to a minimum.

I have added some fields to the auth_challenge_t and auth_response_t
structs however those structs are defined in auth_digest.h.  Should I
move my bits to auth_ntlm.h and create auth_ntlm_challenge_t and
auth_ntlm_response_t structs or leave them where they are?  If I create
new structs will that interfere with any other bits of the iptsec code
that will require additional modifications?

I have added most of the NTLM code (auc_ntlm_challenge(),
auc_ntlm_authorization(), auc_ntlm_info(), auth_ntlm_client_s,
auth_ntlm_client_t, etc) to auth_client.c but I see that there is also
an auth_client_ntlm.c.  Should the additional code be moved to
auth_client_ntlm.c?

Let me know what is preferred and I'll setup some patches against the
current darcs tree.

Thanks,
Andy.

Confidentiality Notice: This e-mail message including attachments, if any, is 
intended only for the person or entity to which it is addressed and may contain 
confidential and/or privileged material. Any unauthorized review, use, 
disclosure or distribution is prohibited. If you are not the intended 
recipient, please contact the sender by reply e-mail and destroy all copies of 
the original message. If you are the intended recipient, but do not wish to 
receive communications through this medium, please so advise the sender 
immediately.

--
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


[Sofia-sip-devel] Authentication-Info, Allow-Events, and Contact header parsing

2009-02-03 Thread Andrew Rechenberg Lists
Good day,

My Sofia-based application is talking to a Microsoft OCS 2007 server and
I believe, in true MS fashion, that certain headers are not quite in
adherence to the RFCs.  Could it be that Sofia is not parsing those
headers as a result of them not being standard?

Here is an example of a 200 OK response from a REGISTER sent to my OCS
server:

http://dpaste.com/hold/114883/


   SIP/2.0 200 OK
   ms-keep-alive: UAS; tcp=no; hop-hop=yes; end-end=no; timeout=300
   Authentication-Info: NTLM rspauth=01002DBA2B7889FDE4C9,
srand=E8CDC093, snum=1, opaque=F06AE926, qop=auth,
targetname=OCS1.flux.local, realm=SIP Communications Service
   From: DJ
Fluxsip:djf...@flux.local;epid=010101010101;tag=0D4Zj86tFD0mr
   To:
sip:djf...@flux.local;transport=tls;tag=87F67DD92A1B2E9E2A4517BE91E19A
17
   Call-ID: f5a19ca6-69bf-122c-e294-6901e212fe01
   CSeq: 110558877 REGISTER
   Via: SIP/2.0/TLS
192.168.43.1:5069;branch=z9hG4bK22y3g859yN2QB;received=192.168.43.1;ms-r
eceived-port=52342;ms-received-cid=2500
   Contact:
sip:192.168.43.1:52342;transport=tls;ms-opaque=d3470f2e1d;ms-received-c
id=2500;expires=7200;+sip.instance=urn:uuid:c8c355ae-02d5-5079-a68c-7
6b90ab4cb8d;gruu=sip:djf...@flux.local;opaque=user:epid:rlXDyNUCeVCmj
Ha5CrTLjQAA;gruu
   Expires: 7200
   Allow-Events:
vnd-microsoft-provisioning,vnd-microsoft-roaming-contacts,vnd-microsoft-
roaming-ACL,presence,presence.wpending,vnd-microsoft-roaming-self,vnd-mi
crosoft-provisioning-v2
   Supported: adhoclist
   Server: RTC/3.0
   Supported: com.microsoft.msrtc.presence
   Content-Length: 0

Looking in my debugger, I would think
sip-sip_authentication_info-ai_params should show all of the
parameters in the Authentication-Info header.  Instead it only shows:

  NTLM rspauth=01002DBA2B7889FDE4C9

and nothing else (no srand, snum, etc).

The Allow-Events information in sip-sip_allow_events seems to only
contain the first entry (in my case I only see
vnd-microsoft-provisioning in the debugger).
sip-sip_allow_events-k_next is NULL.

Also, the sip-sip_contact information only has pieces of the full
contact line listed above.

BTW, these values I am looking at are in the callback function for my
Sofia events.  

Is there any way I can retrieve the entirety of any of these headers
before or after they are parsed?  Or can I add some code to Sofia to
parse the additional information in the Contact header?  Is this
additional header information buried somewhere is another structure and
I'm missing it?

In particular I need to keep track of the gruu=* information in the
Contact header, and some additional information in the
Authentication-Info, and Allow-Events headers.

If you need more information from my debugger, please let me know.

Thanks,
Andy.

Confidentiality Notice: This e-mail message including attachments, if any, is 
intended only for the person or entity to which it is addressed and may contain 
confidential and/or privileged material. Any unauthorized review, use, 
disclosure or distribution is prohibited. If you are not the intended 
recipient, please contact the sender by reply e-mail and destroy all copies of 
the original message. If you are the intended recipient, but do not wish to 
receive communications through this medium, please so advise the sender 
immediately.

--
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


[Sofia-sip-devel] Question on adding code to NTA for MS OCS SRV resolution

2009-01-29 Thread Andrew Rechenberg Lists
Good day,

I'd like to add some code to Sofia so that it has the ability to lookup
SRV records for Microsoft Office Communications Servers.  Of course MS
doesn't use the standard for SIP TLS (_sips._tcp.example.com) by
default.  They created their own DNS records.

Here are the SRV records for a MS OCS 2007 internal server:

  _sipinternaltls._tcp.example.com.  3600 IN SRV 0 0 5061
myocs.example.com.

For an externally facing Edge server (MS term):

  _sipfederationtls._tcp.example.com. 3600 IN SRV 0 0 5061
myedge.example.com.
  _sip._tls.example.com.  3600 IN SRV 0 0 443 myedge.example.com.

Yes, that's a _tls, not _tcp :)

I'm wondering how I should add this code to Sofia.  I think I should be
adding it to nta.c in const sip_dnstports[] and possibly in
tports_sips[].

Anywhere else I need to add code?  Any suggestions on what I should add?
Can I add things like:

{ tls-ms-i, 5061, _sipinternaltls._tcp., SIPS+D2T }

Or should I just add another tls entry with the _sipinternaltls
portion?


I played around with sip-dig.c and got it working with some small
additions, but I'm not sure if it was the proper way of getting it to
work.  Here's a diff of what I did to sip-dig.c:

--- sip-dig.c.ms2009-01-29 13:10:52.0 -0500
+++ sip-dig.c   2009-01-29 13:23:19.0 -0500
@@ -254,6 +254,8 @@
   prepare_transport(dig, tls-sctp);
 else if (strcmp(argv[1], --tls-udp) == 0)
   prepare_transport(dig, tls-udp);
+else if (strcmp(argv[1], --tls-ms) == 0)
+  prepare_transport(dig, tls-ms);
 else if (strcmp(argv[1], --no-sctp) == 0)
   o_sctp = 0, o_tls_sctp = 0;
 else if (strcmp(argv[1], --help) == 0)
@@ -427,6 +429,11 @@
 tports[j].service = SIPS+D2S;
 tports[j].srv = _sips._sctp.;
   }
+  else if (strcasecmp(tport, tls-ms) == 0) {
+tports[j].name = tls-ms;
+tports[j].service = SIPS+D2T;
+tports[j].srv = _sipinternaltls._tcp.;
+  }  
   else {
 fprintf(stderr, %s: unknown transport \%s\\n, name, tport);
 return -1;

Thanks for your help,
Andy.

Confidentiality Notice: This e-mail message including attachments, if any, is 
intended only for the person or entity to which it is addressed and may contain 
confidential and/or privileged material. Any unauthorized review, use, 
disclosure or distribution is prohibited. If you are not the intended 
recipient, please contact the sender by reply e-mail and destroy all copies of 
the original message. If you are the intended recipient, but do not wish to 
receive communications through this medium, please so advise the sender 
immediately.

--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


[Sofia-sip-devel] Send SIP request to another host without DNS resolution

2009-01-29 Thread Andrew Rechenberg Lists
Good day,

I have a Sofia-based application in a test environment, but I don't have
any SRV records setup.  Up until now when I created my TO and FROM
SIPTAG's I've been using IP addresses.  Since my NTLM authentication
code is now working the IP addresses won't do.  

I'd like to create my TO and FROM in my REGISTER requests as such:

SIPTAG_TO_STR(sip:u...@sipdomain.local;transport=tls)
SIPTAG_FROM_STR(sip:u...@sipdomain.local;epid=010101010101)

But then specify my SIP registrar and, for now, not have NTA do DNS SRV
resolution on sipdomain.local (refer to my other mail about adding code
to handle non-standard SRV records like _sipinternaltls._tcp).

Is there a SIPTAG or other TAG macro that allows me to explicitly tell
the stack to which SIP servername/IP to send the REGISTER?

Thanks again for all the help,
Andy.


Confidentiality Notice: This e-mail message including attachments, if any, is 
intended only for the person or entity to which it is addressed and may contain 
confidential and/or privileged material. Any unauthorized review, use, 
disclosure or distribution is prohibited. If you are not the intended 
recipient, please contact the sender by reply e-mail and destroy all copies of 
the original message. If you are the intended recipient, but do not wish to 
receive communications through this medium, please so advise the sender 
immediately.

--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


Re: [Sofia-sip-devel] Send SIP request to another host without DNSresolution

2009-01-29 Thread Andrew Rechenberg Lists
 
 I have a Sofia-based application in a test environment, but I don't
have
 any SRV records setup.  Up until now when I created my TO and FROM
 SIPTAG's I've been using IP addresses.  Since my NTLM authentication
 code is now working the IP addresses won't do.
 
 I'd like to create my TO and FROM in my REGISTER requests as such:
 
 SIPTAG_TO_STR(sip:u...@sipdomain.local;transport=tls)
 SIPTAG_FROM_STR(sip:u...@sipdomain.local;epid=010101010101)
 
 But then specify my SIP registrar and, for now, not have NTA do DNS
SRV
 resolution on sipdomain.local (refer to my other mail about adding
code
 to handle non-standard SRV records like _sipinternaltls._tcp).
 
 Is there a SIPTAG or other TAG macro that allows me to explicitly tell
 the stack to which SIP servername/IP to send the REGISTER?
 

Answering my own question here.  I used:

nua_set_params(nua,
NUTAG_PROXY(sip:myserver.local:5061;transport=tls), TAG_END());



Confidentiality Notice: This e-mail message including attachments, if any, is 
intended only for the person or entity to which it is addressed and may contain 
confidential and/or privileged material. Any unauthorized review, use, 
disclosure or distribution is prohibited. If you are not the intended 
recipient, please contact the sender by reply e-mail and destroy all copies of 
the original message. If you are the intended recipient, but do not wish to 
receive communications through this medium, please so advise the sender 
immediately.

--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


[Sofia-sip-devel] Multiple WWW-Authenticate headers and comparing au_scheme

2009-01-19 Thread Andrew Rechenberg Lists
Good day,

I've created a test SIP UA with Sofia and I'm attempting to register
with a Microsoft Office Communications Server 2007 server and I'm having
some issues doing some checks with the au_scheme.

I've set a breakpoint in my event callback function and when I receive a
401 Unauthorized response from the OCS server I can see that the
au_scheme is a const char * set to NTLM however when I step through my
code and run the following check it fails:

if (sip-sip_www_authenticate-au_scheme == NTLM) {
  do something ...
}

I've also tried a NULL terminated comparison (NTLM\0) and just == N
and neither of those work either.  

Am I missing something simple?

Also, I'm trying to do NTLM authentication according to
http://download.microsoft.com/download/1/6/F/16F4E321-AA6B-4FA3-8AD3-E94
C895A3C97/%5BMS-SIPAE%5D.PDF but OCS2007 can be configured to use either
NTLM or Kerberos for its authentication scheme therefore there are 2
WWW-Authenticate headers in the 401 Unauthorized response I receive from
the server however only NTLM is displayed in the parsed sip structure.
Is au_next supposed to have the next au_scheme?  If so, it's empty in my
case.  Why would that occur?

Any help is appreciated.

Regards,
Andy.

Confidentiality Notice: This e-mail message including attachments, if any, is 
intended only for the person or entity to which it is addressed and may contain 
confidential and/or privileged material. Any unauthorized review, use, 
disclosure or distribution is prohibited. If you are not the intended 
recipient, please contact the sender by reply e-mail and destroy all copies of 
the original message. If you are the intended recipient, but do not wish to 
receive communications through this medium, please so advise the sender 
immediately.

--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


Re: [Sofia-sip-devel] Multiple WWW-Authenticate headers and comparing au_scheme

2009-01-19 Thread Andrew Rechenberg Lists
Somehow this message was a dup ... sorry :(

Any word on the sub_alloc() question I posted on Friday?

Thanks,
Andy.

 -Original Message-
 From: Pekka Pessi [mailto:ppe...@gmail.com]
 Sent: Monday, January 19, 2009 7:11 AM
 To: Andrew Rechenberg Lists
 Cc: sofia-sip-devel@lists.sourceforge.net
 Subject: Re: [Sofia-sip-devel] Multiple WWW-Authenticate headers and
 comparing au_scheme
 
 2008/12/30 Andrew Rechenberg Lists flux...@sfg.com:
  Good day,
  if (sip-sip_www_authenticate-au_scheme == NTLM) {
   do something ...
  }
 
  I've also tried a NULL terminated comparison (NTLM\0) and just ==
 N
  and neither of those work either.
 
  Am I missing something simple?
 
 Try su_casematch().
 
  Also, I'm trying to do NTLM authentication according to
 
http://download.microsoft.com/download/1/6/F/16F4E321-AA6B-4FA3-8AD3-
 E94
  C895A3C97/%5BMS-SIPAE%5D.PDF but OCS2007 can be configured to use
 either
  NTLM or Kerberos for its authentication scheme therefore there are 2
  WWW-Authenticate headers in the 401 Unauthorized response I receive
 from
  the server however only NTLM is displayed in the parsed sip
structure.
  Is au_next supposed to have the next au_scheme?  If so, it's empty
in
 my
  case.  Why would that occur?
 
 This was discussed earlier, the parser from darcs is now updated to
 accept multiple WWW-Authenticate headers..,.
 
 --
 Pekka.Pessi mail at nokia.com

Confidentiality Notice: This e-mail message including attachments, if any, is 
intended only for the person or entity to which it is addressed and may contain 
confidential and/or privileged material. Any unauthorized review, use, 
disclosure or distribution is prohibited. If you are not the intended 
recipient, please contact the sender by reply e-mail and destroy all copies of 
the original message. If you are the intended recipient, but do not wish to 
receive communications through this medium, please so advise the sender 
immediately.

--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


Re: [Sofia-sip-devel] msg_header_format issue (?)

2009-01-16 Thread Andrew Rechenberg Lists

 
 The idea is to try to print header in a small buffer, and if it does
 not fit, allocate bigger one. If snprintf() works (and why it should
 not??), there should be no overflow.
 
 What the snprintf() returns on the first round, what is the value it
 returns?
 


My data gets overwritten before we even get to the vsnprintf. The first
msg_header_alloc before the for() loop in msg_header_vformat() in
msg_header_make.c is where my stuff is getting overwritten :(

To be more precise, my data is fine up until sub_alloc is called in
su_alloc which is called from msg_header_alloc.  Once I step into
sub_alloc() then the value of my Base 64 response variable is modified.


Confidentiality Notice: This e-mail message including attachments, if any, is 
intended only for the person or entity to which it is addressed and may contain 
confidential and/or privileged material. Any unauthorized review, use, 
disclosure or distribution is prohibited. If you are not the intended 
recipient, please contact the sender by reply e-mail and destroy all copies of 
the original message. If you are the intended recipient, but do not wish to 
receive communications through this medium, please so advise the sender 
immediately.

--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


[Sofia-sip-devel] msg_header_format issue (?)

2009-01-15 Thread Andrew Rechenberg Lists
More issues with my NTLM code - again, might be me, but I need some help
:)

I've got the NTLM code returning a Base 64 encoded auth challenge but
when I try to run my gssapi char * variable through msg_header_format
the actual value of the variable is being modified/overwritten somehow.

It appears to be modified in msg_header_alloc at this code:

  msg_header_t *h = su_alloc(home, size + extra);

Here is the function stack that leads me to that point:

auc_authorization
auc_ntlm_authorization
msg_header_format
msg_header_vformat
msg_header_alloc

Here's my code in auc_ntlm_authorization:

  http://dpaste.com/hold/109355/

Am I doing something wrong in my code to make this problem occur?

Thanks for any pointers (no pun intended :) ),
Andy.


Confidentiality Notice: This e-mail message including attachments, if any, is 
intended only for the person or entity to which it is addressed and may contain 
confidential and/or privileged material. Any unauthorized review, use, 
disclosure or distribution is prohibited. If you are not the intended 
recipient, please contact the sender by reply e-mail and destroy all copies of 
the original message. If you are the intended recipient, but do not wish to 
receive communications through this medium, please so advise the sender 
immediately.

--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


Re: [Sofia-sip-devel] msg_header_format issue (?)

2009-01-15 Thread Andrew Rechenberg Lists
 
  I've got the NTLM code returning a Base 64 encoded auth challenge
but
  when I try to run my gssapi char * variable through
msg_header_format
  the actual value of the variable is being modified/overwritten
 somehow.
 
 Interesting... Can you run your code under valgrind? Sounds like a
 fandango en core problem...
 

I don't believe so.  I'm using Apple XCode's integrated interface to GDB
to step through my code (the code has a .ar of the sofia code compiled
in and I'm using the iPhone simulator to run my code.

I'm modified my code so that the pointer isn't getting overwritten now
by memcpy'ing the data into the ar struct, however I still am only
getting part of the gssapi-data.  The amount of data alloc'd for the
Authorization header is well short of what is needed and I only get 4
bytes in the portion of the header I set aside for it (the
gssapi-data=%s portion.  The %s only has 4 character in it).

I have to be doing something wrong, but I have no idea what. :(

Confidentiality Notice: This e-mail message including attachments, if any, is 
intended only for the person or entity to which it is addressed and may contain 
confidential and/or privileged material. Any unauthorized review, use, 
disclosure or distribution is prohibited. If you are not the intended 
recipient, please contact the sender by reply e-mail and destroy all copies of 
the original message. If you are the intended recipient, but do not wish to 
receive communications through this medium, please so advise the sender 
immediately.

--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


Re: [Sofia-sip-devel] nua_authenticate and NTLM

2009-01-09 Thread Andrew Rechenberg Lists
 
 2009/1/8 Pekka Pessi ppe...@gmail.com:
  There is nothing wrong here, but it looks like parsing two
  WWW-Authenticate headers just fails. *Blush*. I'll have a peek in
the
  parer
 
 OK, parser was just configured to reject multiple WWW-Authenticate
 headers, probably copypaste error from HTTP. I've pushed a patch to
 darcs...
 

Thanks.  I applied that patch and now I'm seeing both headers, but my
app is misbehaving now :(

In my event callback function I'm trying to null-out the ca_next portion
of the nh_auth portion of the nua_handle_t that's passed in but my code
sense isn't finding the nh_auth param of the struct.  Am I allowed to
access that structure or is it private?

When I set a breakpoint in my code I can see that my nua_handle_t
pointer is populated, but I can't compile my code if I put:

nh-nh_auth-ca_next = NULL;

I get a dereferencing point to incomplete type error.  I have included
sofia-sip/nua_tag.h in my code.

Thanks again for all the work on Sofia,
Andy.

Confidentiality Notice: This e-mail message including attachments, if any, is 
intended only for the person or entity to which it is addressed and may contain 
confidential and/or privileged material. Any unauthorized review, use, 
disclosure or distribution is prohibited. If you are not the intended 
recipient, please contact the sender by reply e-mail and destroy all copies of 
the original message. If you are the intended recipient, but do not wish to 
receive communications through this medium, please so advise the sender 
immediately.

--
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


Re: [Sofia-sip-devel] nua_authenticate and NTLM

2009-01-09 Thread Andrew Rechenberg Lists

  In my event callback function I'm trying to null-out the ca_next
 portion
  of the nh_auth portion of the nua_handle_t that's passed in but my
 code
  sense isn't finding the nh_auth param of the struct.  Am I allowed
to
  access that structure or is it private?
 
 The structure is private. Why you try to null it? nua_authenticate()
 refuses to re-send the REGISTER because it has no credentials for
 Kerberos?
 
 The authentication stuff probably needs some kind of mechanism to tell
 it to ignore some challenges...
 

It appears that when there are 2 WWW-Authenticate headers that the code
in ca_credentials gets peeved when the authentication comes back in
there (don't know a better way to describe it).

I've stepped through the code and this is what I have found:

When ca_next is NULL the authentication register-response process
appears to go normally.  When there are 2 headers and ca_next is not
null when ca_credentials in auth_client.c is called ca-ca_user and
ca-ca_pass are not null and the str0cmp() comparisons == 0 therefore
ca_credentials returns 0 and the nua_stack returns a 904.

I figured as a test I could null-out ca_next in my code and see if
things worked.  Since it's private I'm stuck.  

Any other way to do what I'm trying to do?


Confidentiality Notice: This e-mail message including attachments, if any, is 
intended only for the person or entity to which it is addressed and may contain 
confidential and/or privileged material. Any unauthorized review, use, 
disclosure or distribution is prohibited. If you are not the intended 
recipient, please contact the sender by reply e-mail and destroy all copies of 
the original message. If you are the intended recipient, but do not wish to 
receive communications through this medium, please so advise the sender 
immediately.

--
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


Re: [Sofia-sip-devel] nua_authenticate and NTLM

2009-01-08 Thread Andrew Rechenberg Lists

 
  Could I add the Supported and ms-keep-alive portions of that
 header?
 
 Sure, SIPTAG_SUPPORTED_STR(gruu-10, adhoclist),
 SIPTAG_HEADER_STR(ms-keep-alive: uac;hop-hop=yes)
 

Great!

 
 You need 3 request-responses for authentication? Or should we include
 something in the first REGISTER. Nua should retry with new
 auc_authorize results if auc_challenge returns something  0.
 


Yes, there are 3 request-response pairs for a typical OCS authentication
handshake.  I don't believe we can put anything in the first REGISTER
because the server keeps track of REGISTERs and since it's the first one
I don't believe it will return a challend in gssapi-data.

Here's the basic auth flow:


. REGISTER (no Authorization header)

. 401 Response (with 2 WWW-Authenticate headers - NTLM and Kerberos)

. re-REGISTER with an empty gssapi-data param:
Authorization: NTLM qop=auth, realm=SIP Communications Service,
targetname=myocs.domain.local, gssapi-data=

. 401 Response with an NTLM challenge in the gssapi-data param
  - This challenge is parsed (Base 64 decoded) and used as a nonce in
creating the NTLM authenticate message

. re-REGISTER with a Base 64 encoded NTLM authenticate message

. 200 response


I'm thinking about just creating a ca_ocs_ntlm_plugin because this type
of authorization is probably very different than a typical digest, or
regular NTLM authorization.

  Oh, another thing, should sip-sip_www_authenticate-au_next contain
 the
  next WWW-Authenticate header if there are multiple authenticate
 headers?
  Because in my case the NTLM header is the only one in the sip
pointer;
  au_next is null.
 
 Yes, if there are several WWW-Authenticate challenges they are linked
 via au_next.
 

For some reason the NTLM WWW-Authenticate header is the only one that it
finds.  The Kerberos header is not in the au_next.  Any reason why this
would be the case?

Confidentiality Notice: This e-mail message including attachments, if any, is 
intended only for the person or entity to which it is addressed and may contain 
confidential and/or privileged material. Any unauthorized review, use, 
disclosure or distribution is prohibited. If you are not the intended 
recipient, please contact the sender by reply e-mail and destroy all copies of 
the original message. If you are the intended recipient, but do not wish to 
receive communications through this medium, please so advise the sender 
immediately.

--
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


Re: [Sofia-sip-devel] nua_authenticate and NTLM

2009-01-08 Thread Andrew Rechenberg Lists
 
 Perhaps there is a problem parsing the Kerberos header? Could you send
 a trace containing such a WWW-Authenticate header.
 

Here's a snipped trace (also available at
http://dpaste.com/hold/106771/)

tport_recv_event(0x1044830)
tport_tls_recv(0x1044830): tls_read() returned -1
tport_tls_set_events(0x1044830): logical events IN OUT real IN
tport(0x1044830): reset timer
tport_wakeup(0x1044830): events IN
tls_read: server certificate doesn't verify
tport_send_event(0x1044830) - ready to send to (tls/192.168.43.20:5061)
tport_tls_writevec: vec 0x1037e30 0x182c800 524 (524)
tport_vsend(0x1044830): 524 bytes of 524 to tls/192.168.43.20:5061
send 524 bytes to tls/[192.168.43.20]:5061 at 22:24:38.204362:
 

   REGISTER sip:192.168.43.20:5061 SIP/2.0
   Via: SIP/2.0/TLS 192.168.43.1:5069;branch=z9hG4bK47ZUrFK0v5eQa
   Max-Forwards: 70
   From: sip:192.168.43.1:5069;epid=1234567890;tag=48BXgr379e85j
   To: sip:1...@192.168.43.20:5061;transport=tls
   Call-ID: cf12f708-57ac-122c-ad90-6f23d7babf4f
   CSeq: 109565202 REGISTER
   Contact: sip:192.168.43.1:5069
   User-Agent: sofia-sip/1.12.9
   Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, PRACK, MESSAGE, SUBSCRIBE,
NOTIFY, REFER, UPDATE
   Supported: gruu-10, adhoclist, path
   Content-Length: 0
   
 

tport_tls_set_events(0x1044830): logical events IN real IN
tport(0x1044830): reset timer
tls_read: server certificate doesn't verify
tport_recv_event(0x1044830)
tport_tls_recv(0x1044830): tls_read() returned 646
tport_recv_iovec(0x1044830) msg 0x104b4d0 from (tls/192.168.43.20:5061)
has 646 bytes, veclen = 1
recv 646 bytes from tls/[192.168.43.20]:5061 at 22:24:38.231754:
 

   SIP/2.0 401 Unauthorized
   Date: Wed, 07 Jan 2009 22:24:39 GMT
   WWW-Authenticate: NTLM realm=SIP Communications Service,
targetname=OCS1.flux.local, version=3
   WWW-Authenticate: Kerberos realm=SIP Communications Service,
targetname=sip/OCS1.flux.local, version=3
   From: sip:192.168.43.1:5069;epid=1234567890;tag=48BXgr379e85j
   To:
sip:1...@192.168.43.20:5061;transport=tls;tag=B57737091022903031FF2046
96B79CC4
   Call-ID: cf12f708-57ac-122c-ad90-6f23d7babf4f
   CSeq: 109565202 REGISTER
   Via: SIP/2.0/TLS
192.168.43.1:5069;branch=z9hG4bK47ZUrFK0v5eQa;received=192.168.43.1;ms-r
eceived-port=54059;ms-received-cid=E500
   Content-Length: 0
   
 

tport_deliver(0x1044830): msg 0x104b4d0 (646 bytes) from
tls/192.168.43.20:5061/sips next=0x0
nta: received 401 Unauthorized for REGISTER (109565202)
nta: 401 Unauthorized is going to a transaction
nta_outgoing: RTT is 205.498 ms
tport_release(0x1044830): 0x1043cf0 by 0x10446a0 with 0x104b4d0
nua(0x1042940): event r_register 401 Unauthorized
nta: outgoing_free(0x10446a0)
tport(0x1044830): reset timer

Confidentiality Notice: This e-mail message including attachments, if any, is 
intended only for the person or entity to which it is addressed and may contain 
confidential and/or privileged material. Any unauthorized review, use, 
disclosure or distribution is prohibited. If you are not the intended 
recipient, please contact the sender by reply e-mail and destroy all copies of 
the original message. If you are the intended recipient, but do not wish to 
receive communications through this medium, please so advise the sender 
immediately.

--
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


Re: [Sofia-sip-devel] nua_authenticate and NTLM

2009-01-05 Thread Andrew Rechenberg Lists
  There are some other things that need to get added to the header for
  OCS.  Can I just use TAGs to add those?  Can I add those tags in
  nua_authenticate?
 
 That depends on the things to add? You can add SIP headers with
 nua_authenticate(), but the extra tags are not passed to auc*
 functions.
 

Here is a valid REGISTER with Authorization header for OCS2007:

http://dpaste.com/hold/103780/

Could I add the Supported and ms-keep-alive portions of that header?

According to page 35 of the MS-SIPAE document
(http://msdn.microsoft.com/en-us/library/cc431510.aspx), the client
calls the NTLM authentication protocol implementation with [the user's]
credentials (user name, domain, and password) and Datagram, Identify,
and Integrity parameters, to initialize the security context and
generate NEGOTIATE_MESSAGE. Because in the current NTLM implementation,
this message is not generated for datagram NTLM contexts, the output
from NTLM is an empty buffer.

What all that means is that the first re-REGISTER sent back to the
server has an empty gssapi-data parameter in the Authorization header.

Is there any way to do that with the current nua_authenticate code or
will I have to hack that in order to get it to resend the REGISTER with
an empty gssapi-data param?

Oh, another thing, should sip-sip_www_authenticate-au_next contain the
next WWW-Authenticate header if there are multiple authenticate headers?
Because in my case the NTLM header is the only one in the sip pointer;
au_next is null.

Thanks for your help,
Andy.



Confidentiality Notice: This e-mail message including attachments, if any, is 
intended only for the person or entity to which it is addressed and may contain 
confidential and/or privileged material. Any unauthorized review, use, 
disclosure or distribution is prohibited. If you are not the intended 
recipient, please contact the sender by reply e-mail and destroy all copies of 
the original message. If you are the intended recipient, but do not wish to 
receive communications through this medium, please so advise the sender 
immediately.

--
___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


Re: [Sofia-sip-devel] nua_authenticate and NTLM

2009-01-05 Thread Andrew Rechenberg Lists
 
 2008/12/31 Andrew Rechenberg Lists 
  I'm trying to send an NTLM Authorization header to a Microsoft
Office
  Communications Server 2007 and my code is getting a EXC_BAD_ACCESS
in
  ca_credentials when using the macro AUTH_CLIENT_IS_EXTENDED.  This
  function seems to be called indirectly when I use nua_authenticate.
 
 As far as I can recall the NTLM code is just copied from the digest
 code but there is actually no real functionality there.. It should
 probably be deactivated, or better, completed...

I've started working on completing the NTLM code.  The Pidgin SIPE
project has some working NTLM code to authenticate to a MS OCS server so
I'll try to port that over.

 
  Can I create my own authorization header with
SIPTAG_AUTHORIZATION_STR
  and re-run nua_register with the same handle?  I've tried that in my
  nua_r_register handler and my code just hangs and a REGISTER is
never
  re-sent to the server.
 
 I'm afraid if the server returns just an unknown authentication scheme
 it makes the handle unusable. The
 auc_challenge()/auc_credentials()/nua_authenticate() API is not very
 well thought out for such a case. ;-/


So if I get the NTLM plugin code working then I should just be able to
use nua_authenticate()?

There are some other things that need to get added to the header for
OCS.  Can I just use TAGs to add those?  Can I add those tags in
nua_authenticate?

Also, what is the proper way to add an additional auth_plugin?  Create
auth_plugin_dummy.c|h, add the ca_X_plugin struct to ca_plugins?
Anything else?

I'd like to maybe add a Kerberos plugin and I just wanted to follow the
proper procedure.

Thanks,
Andy.



Confidentiality Notice: This e-mail message including attachments, if any, is 
intended only for the person or entity to which it is addressed and may contain 
confidential and/or privileged material. Any unauthorized review, use, 
disclosure or distribution is prohibited. If you are not the intended 
recipient, please contact the sender by reply e-mail and destroy all copies of 
the original message. If you are the intended recipient, but do not wish to 
receive communications through this medium, please so advise the sender 
immediately.

--
___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


[Sofia-sip-devel] nua_authenticate and NTLM

2008-12-31 Thread Andrew Rechenberg Lists
Good day,

I'm trying to send an NTLM Authorization header to a Microsoft Office
Communications Server 2007 and my code is getting a EXC_BAD_ACCESS in
ca_credentials when using the macro AUTH_CLIENT_IS_EXTENDED.  This
function seems to be called indirectly when I use nua_authenticate.
Here's my auth code:

const char *scheme, *realm;
char auth[256];

scheme = sip-sip_www_authenticate-au_scheme;
realm = msg_params_find(sip_www_authenticate-au_params, realm=);

sprint(auth, %s:%s:%s:%s, scheme, realm, test, test);

nua_authenticate(nh, NUTAG_AUTH(auth), TAG_END());

Looking at the source for the AUTH_CLIENT_IS_EXTENDED macro it is
checking for ca-ca_auc-auc_plugin_size and when I step through my code
in the debugger, ca_auc is nil (0x0) so I think that's why the program
bombs. 

Is ca_auc not getting set because the au_scheme is NTLM?  Where is ca
set?  

Can I create my own authorization header with SIPTAG_AUTHORIZATION_STR
and re-run nua_register with the same handle?  I've tried that in my
nua_r_register handler and my code just hangs and a REGISTER is never
re-sent to the server.

Any help would be appreciated.

Thanks,
Andy.

Confidentiality Notice: This e-mail message including attachments, if any, is 
intended only for the person or entity to which it is addressed and may contain 
confidential and/or privileged material. Any unauthorized review, use, 
disclosure or distribution is prohibited. If you are not the intended 
recipient, please contact the sender by reply e-mail and destroy all copies of 
the original message. If you are the intended recipient, but do not wish to 
receive communications through this medium, please so advise the sender 
immediately.

--
___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


Re: [Sofia-sip-devel] [NEWBIE] How to print a SIP message

2008-11-20 Thread Andrew Rechenberg Lists
Working on my test app for the iPhone I just wanted to get the payload
from a SIP message and display it.  Is this what you want to do?

I did it by doing the following (which may not be the RightThing, but it
works for me).  I my event_callback I output the following to my logs:

sip-sip_payload-pl_data

Again, it's probably not the correct way to do what you want but I can
pop a dialog window on the iPhone simulator with the text of the message
I sent to my UA.

Hope this helps.

 -Original Message-
 From: Stefano Sabatini [mailto:[EMAIL PROTECTED]
 Sent: Thursday, November 20, 2008 7:38 AM
 To: sofia-sip-devel@lists.sourceforge.net
 Subject: Re: [Sofia-sip-devel] [NEWBIE] How to print a SIP message
 
 On date Thursday 2008-11-20 10:49:21 +0100, Stefano Sabatini phoned
this:
 [...]
  How can I get a msg_t from a sip_t?
 
  I can convert a msg_t - sip_t using sip_object, but how can I
perform
  the inverse conversion?
 
 Again auto-replying to myself...
 
 Contemplating the sip module doc picture I finally got for the first
 time a complete understanding of the msg_t struct.
 
 I don't know if there is function for such a conversion, anyway it
 shouldn't too hard to define a function to create a msg_t struct and
 fill the fields in order to create (maybe even refactorizing some code
 from msg_as_string()).
 
 As suggested by Pessa in a previous mail, for example it should be
 possible to iterate through the headers contained in sip_t, print a
 representation of them (e.g. using sip_header_as_string()) and fill a
 buffer which will be equivalent to the original buffer.
 
  All I want to do is to simply print out the sip_t message received
by
  the event callback, so the solution looks either convert sip_t -
  msg_t and use msg_as_string() either to print sip_t using some to
text
  conversion function, which I can't find.
 
 Even without to access the sip_t struct there is a solution using the
 nua_current_request() function. Sofia-sip somehow stores the current
 message processed (the name is misleading, since it also stores
 response messages), the following snippet may be executed for example
 at the beginning of the event callback:
 
 /* print the incoming message */
 int msg_size = 0;
 msg_t* msg = nua_current_request(nua);
 if (msg) {
 char * msg_str = msg_as_string(home, msg, NULL, 0,
msg_size);
 printf (SIP message:\n
 %s\n, msg_str);
 }
 
 Regards.
 


-
 This SF.Net email is sponsored by the Moblin Your Move Developer's
challenge
 Build the coolest Linux based applications with Moblin SDK  win great
prizes
 Grand prize is a trip for two to an Open Source event anywhere in the
world
 http://moblin-contest.org/redirect.php?banner_id=100url=/
 ___
 Sofia-sip-devel mailing list
 Sofia-sip-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel

Confidentiality Notice: This e-mail message including attachments, if any, is 
intended only for the person or entity to which it is addressed and may contain 
confidential and/or privileged material. Any unauthorized review, use, 
disclosure or distribution is prohibited. If you are not the intended 
recipient, please contact the sender by reply e-mail and destroy all copies of 
the original message. If you are the intended recipient, but do not wish to 
receive communications through this medium, please so advise the sender 
immediately.

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
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 and timer questions WRT Sofia andiPhone

2008-11-20 Thread Andrew Rechenberg Lists
Replying to myself in hope that it helps someone else and for posterity.

I think I fixed my issue.  I used su_root_step in my thread loop instead
of su_root_run.  So now my pseudo code looks like:

AppSingleton *myapp;
su_init()
su_home_t *tmp
tmp = su_home_new()
myapp-home = tmp;
su_home_init(myapp-home)
myapp-root = su_root_osx_runloop_create(*myapp)
nua_create(...)
su_root_release(myapp-root)
pthread_create(thread,NULL,root_thread,NULL)

void root_thread() {
   AppSingleton *myapp;
   su_root_obtain(myapp-root);
   su_root_osx_prepare_run(myapp-root);
   while (1) {
 su_root_step(myapp-root, 20);
   }
   su_root_release)(myapp-root);
}

If anyone sees an issue with running the event loop in this fashion,
please advise me.  I'd like to write it in the proper fashion, but this
works and does what I want.

Thanks,
Andy.

 -Original Message-
 From: Andrew Rechenberg Lists [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, November 19, 2008 9:59 AM
 To: sofia-sip-devel@lists.sourceforge.net
 Subject: Re: [Sofia-sip-devel] Threading and timer questions WRT Sofia
 andiPhone
 
 I think I figured out my problem, but I'm not sure how to fix it.
 
 I pumped up SU_DEBUG to 9 and I receive line after line of
 su_osx_port_run: entering in the console until I my event_callback
 function is called the first time, then su_osx_port_run stops
appearing
 in the console.  It's almost as if the root stops running or the
thread
 terminates.
 
 What have done incorrectly?
 
 Thanks again.
 
 PS Sorry about the 3 postings.  I was having issues with my default
SMTP
 address in Exchange.  It shouldn't happen again.
 
  -Original Message-
  From: Andrew Rechenberg Lists [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, November 18, 2008 9:21 AM
  To: sofia-sip-devel@lists.sourceforge.net
  Subject: [Sofia-sip-devel] Threading and timer questions WRT Sofia
and
 iPhone
 
  Good day,
 
  I'm doing some personal research on developing for the iPhone and
I've
  been using Sofia to create a basic SIP UA for the iPhone.
 
  I have a static Sofia SIP library compiled for the iPhone simulator
 and
  my app successfully registers with a SIP server and I can receive
SIP
  MESSAGEs as shown by the debugger console for the simulator.
 Everything
  works as expected if I don't interact with the iPhone GUI.  I have a
  button that will send a REGISTER to my SIP server and I can use the
  sofsip_cli to connect to the same SIP server and send the iPhone UA
 SIP
  MESSAGEs and I see them show up in the console.  The nua_i_message
  callback fires just fine.
 
  I seem to be having a problem with pop up alerts though on the
iPhone
  simulator and I don't know whether it's a threading problem, a timer
  problem with Sofia, or some other problem related to the iPhone and
 was
  wondering if someone could provide some assistance.
 
  Once I add code in the event_callback function to show a UIAlertView
  (basically a pop-up dialog on the iPhone), the dialog displays once
 and
  once I click OK it disappears, however subsequent nua_i_message
events
  timeout with:
 
  nta: timer J fired, terminate 200 response.
 
  Am I missing something with threading?  My su_root_t runs in a POSIX
  thread that I created when the application launched.  I'm using a
  singleton object that has a pointer to a root as a property to be
able
  to pass the root object around (maybe not the RightThing to do?).
  Here's some pseudo-code for how I run it in
  applicationDidFinishLaunching (run after main() runs):
 
  AppSingleton *myapp;
  su_init()
  su_home_t *tmp
  tmp = su_home_new()
  myapp-home = tmp;
  su_home_init(myapp-home)
  myapp-root = su_root_osx_runloop_create(*myapp)
  nua_create(...)
  su_root_release(myapp-root)
  pthread_create(thread,NULL,root_thread,NULL)
 
  void root_thread() {
AppSingleton *myapp;
su_root_obtain(myapp-root);
su_root_osx_prepare_run(myapp-root);
while (1) {
  su_root_run(myapp-root)
}
su_root_release)(myapp-root)
  }
 
  I'm thinking my problem is either with the UIAlertView and/or me not
  understanding how I should be handle the threading of the root
object.
 
  This code is my first experience with pthreads so I'm probably doing
  something wrong (maybe need mutexes?).
 
  I'm going to post this question to the Apple Developer Forums as
well
  because I don't know where to go from here.
 
  If anyone has more questions, please let me know.
 
  Thanks for your help,
  Andy.
 
  Confidentiality Notice: This e-mail message including attachments,
if
 any, is
  intended only for the person or entity to which it is addressed and
 may
  contain confidential and/or privileged material. Any unauthorized
 review,
  use, disclosure or distribution is prohibited. If you are not the
 intended
  recipient, please contact the sender by reply e-mail and destroy all
 copies
  of the original message. If you are the intended recipient, but do
not
 wish
  to receive communications through this medium, please so advise

[Sofia-sip-devel] Threading and timer questions WRT Sofia and iPhone

2008-11-19 Thread Andrew Rechenberg Lists
Good day,

I'm doing some personal research on developing for the iPhone and I've
been using Sofia to create a basic SIP UA for the iPhone.

I have a static Sofia SIP library compiled for the iPhone simulator and
my app successfully registers with a SIP server and I can receive SIP
MESSAGEs as shown by the debugger console for the simulator.  Everything
works as expected if I don't interact with the iPhone GUI.  I have a
button that will send a REGISTER to my SIP server and I can use the
sofsip_cli to connect to the same SIP server and send the iPhone UA SIP
MESSAGEs and I see them show up in the console.  The nua_i_message
callback fires just fine.

I seem to be having a problem with pop up alerts though on the iPhone
simulator and I don't know whether it's a threading problem, a timer
problem with Sofia, or some other problem related to the iPhone and was
wondering if someone could provide some assistance.

Once I add code in the event_callback function to show a UIAlertView
(basically a pop-up dialog on the iPhone), the dialog displays once and
once I click OK it disappears, however subsequent nua_i_message events
timeout with:

nta: timer J fired, terminate 200 response.

Am I missing something with threading?  My su_root_t runs in a POSIX
thread that I created when the application launched.  I'm using a
singleton object that has a pointer to a root as a property to be able
to pass the root object around (maybe not the RightThing to do?).
Here's some pseudo-code for how I run it in
applicationDidFinishLaunching (run after main() runs):

AppSingleton *myapp;
su_init()
su_home_t *tmp
tmp = su_home_new()
myapp-home = tmp;
su_home_init(myapp-home)
myapp-root = su_root_osx_runloop_create(*myapp)
nua_create(...)
su_root_release(myapp-root)
pthread_create(thread,NULL,root_thread,NULL)

void root_thread() {
  AppSingleton *myapp;
  su_root_obtain(myapp-root);
  su_root_osx_prepare_run(myapp-root);
  while (1) {
su_root_run(myapp-root)
  }
  su_root_release)(myapp-root)
}

I'm thinking my problem is either with the UIAlertView and/or me not
understanding how I should be handle the threading of the root object.

This code is my first experience with pthreads so I'm probably doing
something wrong (maybe need mutexes?).

I'm going to post this question to the Apple Developer Forums as well
because I don't know where to go from here.

If anyone has more questions, please let me know.

Thanks for your help,
Andy.

Confidentiality Notice: This e-mail message including attachments, if any, is 
intended only for the person or entity to which it is addressed and may contain 
confidential and/or privileged material. Any unauthorized review, use, 
disclosure or distribution is prohibited. If you are not the intended 
recipient, please contact the sender by reply e-mail and destroy all copies of 
the original message. If you are the intended recipient, but do not wish to 
receive communications through this medium, please so advise the sender 
immediately.

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


[Sofia-sip-devel] Threading and timer questions WRT Sofia and iPhone

2008-11-19 Thread Andrew Rechenberg Lists
Good day,

I'm doing some personal research on developing for the iPhone and I've
been using Sofia to create a basic SIP UA for the iPhone.

I have a static Sofia SIP library compiled for the iPhone simulator and
my app successfully registers with a SIP server and I can receive SIP
MESSAGEs as shown by the debugger console for the simulator.  Everything
works as expected if I don't interact with the iPhone GUI.  I have a
button that will send a REGISTER to my SIP server and I can use the
sofsip_cli to connect to the same SIP server and send the iPhone UA SIP
MESSAGEs and I see them show up in the console.  The nua_i_message
callback fires just fine.

I seem to be having a problem with pop up alerts though on the iPhone
simulator and I don't know whether it's a threading problem, a timer
problem with Sofia, or some other problem related to the iPhone and was
wondering if someone could provide some assistance.

Once I add code in the event_callback function to show a UIAlertView
(basically a pop-up dialog on the iPhone), the dialog displays once and
once I click OK it disappears, however subsequent nua_i_message events
timeout with:

nta: timer J fired, terminate 200 response.

Am I missing something with threading?  My su_root_t runs in a POSIX
thread that I created when the application launched.  I'm using a
singleton object that has a pointer to a root as a property to be able
to pass the root object around (maybe not the RightThing to do?).
Here's some pseudo-code for how I run it in
applicationDidFinishLaunching (run after main() runs):

AppSingleton *myapp;
su_init()
su_home_t *tmp
tmp = su_home_new()
myapp-home = tmp;
su_home_init(myapp-home)
myapp-root = su_root_osx_runloop_create(*myapp)
nua_create(...)
su_root_release(myapp-root)
pthread_create(thread,NULL,root_thread,NULL)

void root_thread() {
  AppSingleton *myapp;
  su_root_obtain(myapp-root);
  su_root_osx_prepare_run(myapp-root);
  while (1) {
su_root_run(myapp-root)
  }
  su_root_release)(myapp-root)
}

I'm thinking my problem is either with the UIAlertView and/or me not
understanding how I should be handle the threading of the root object.

This code is my first experience with pthreads so I'm probably doing
something wrong (maybe need mutexes?).

I'm going to post this question to the Apple Developer Forums as well
because I don't know where to go from here.

If anyone has more questions, please let me know.

Thanks for your help,
Andy.

Confidentiality Notice: This e-mail message including attachments, if any, is 
intended only for the person or entity to which it is addressed and may contain 
confidential and/or privileged material. Any unauthorized review, use, 
disclosure or distribution is prohibited. If you are not the intended 
recipient, please contact the sender by reply e-mail and destroy all copies of 
the original message. If you are the intended recipient, but do not wish to 
receive communications through this medium, please so advise the sender 
immediately.

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel