Ok now I'm really confused.  I developed my application using version 1.12.4
(with a separate thread that calls NUA functions).  Then in the process of
upgrading to version 1.12.6 I ran into the problem below (which I posted on
9/13/2007).  On 9/19/2007, Pekka Pessi replied (below).  Perhaps, Pekka's
reply is not really my problem?  If at all possible I do not want to
re-write my application.  Help?

Best Regards,
Jerry

> ----------------9/19/2007 Post by Pekka Pessi:----------------------
> Unfortunately, yes. Now some su_root_ functions use the thread ID to
> do some optimizations. So you have to call su_root_create() and
> nua-create() from the same thread that acutally runs the stack.


>> --------------9/13/2007 Post by Jerry Richards:--------------------
>> I'm in the process of porting over to version 1.12.6.  I am able to
>> build it, but when I execute it, there are no packets transmitted.
>>
>> Below are logs from both my application and the sofia-sip stack.
>> Can anyone help me out by taking a look at this?  I'm using uClibc
>> compiler and a MIPS processor.  Thank you.
>>
>>        Type    Summary
>> 41.099p      CE2S    su_init()
>> 41.099p      CE2S    su_home_init(appl->home=0x10013100)
>> 41.099p      CE2S       ...su_home_init() returned 0x0
>> 41.099p      CE2S    su_root_create(magic=0x0)
>>              ****    su_socket_port_init(0x100e9ac8, 0x10056a70) called
>>              ****    su_pthread_port_init(0x100e9ac8, 0x10056a70) called
>> 41.439p      CE2S       ...su_root_create() returned appl->root=0x100ea4a0
>> 41.439p      CE2S    su_root_threading(self=0x100ea4a0, enable=0)
>> 41.439p      CE2S       ...su_root_threading() returned 0x0
>> 41.439p      CE2S    nua_create(root=0x100ea4a0, callback=0x4539b4,
>>                                      magic=0x10002830, 
>> url='sip:192.168.72.142:5061')
>> 41.439p      SOFI    nua: nua_create: entering
>> 41.439p      SOFI    nua: nua_stack_init: entering
>> 41.439p      SOFI    nua: nua_stack_set_params: entering
>> 41.439p      SOFI    soa_create("default", 0x100ea8b8, 0x100ea950) called
>> 41.439p      SOFI    soa_set_params(static::0x100ead50, ...) called
>> 41.439p      SOFI    nta_agent_create: initialized hash tables
>> 41.439p      SOFI    nta_agent_create: initialized transports
>> 41.439p      SOFI    nta_agent_create: initialized random identifiers
>> 41.439p      SOFI    nta_agent_create: initialized timer
>> 41.459p      SOFI    nta_agent_create: initialized resolver
>> 41.459p      SOFI    tport_create(): 0x100ebfe0
>> 41.459p      SOFI    nta: master transport created
>> 41.459p      SOFI    tport_bind_server(0x100ebfe0) to 
>> */192.168.72.142:5061/sip
>> 41.459p      SOFI    tport_bind_server(0x100ebfe0): calling tport_listen for 
>> udp
>> 41.459p      SOFI    tport_alloc_primary(0x100ebfe0): new primary tport
0x100ec3e0
>> 41.459p      SOFI    tport_listen(0x100ec3e0): listening at
udp/192.168.72.142:5061/sip
>> 41.459p      SOFI    tport_bind_server(0x100ebfe0): calling tport_listen for 
>> tcp
>> 41.469p      SOFI    tport_alloc_primary(0x100ebfe0): new primary tport
0x100ec678
>> 41.469p      SOFI    tport_listen(0x100ec678): listening at
tcp/192.168.72.142:5061/sip
>> 41.469p      SOFI    nta: bound to (192.168.72.142:5061;transport=*)
>> 41.469p      SOFI    nta: agent_init_via: SIP/2.0/udp 192.168.72.142:5061 
>> (sip)
>> 41.469p      SOFI    nta: agent_init_via: SIP/2.0/tcp 192.168.72.142:5061 
>> (sip)
>> 41.469p      SOFI    nta: Via fields initialized
>> 41.469p      SOFI    nta: Contact header created
>> 41.469p      SOFI    nua_register: Adding contact URL '192.168.72.142' to 
>> list.
>> 41.479p      CE2S       ...nua_create() returned
mkData[la].pLine->lineH=0x100ea640
>> 41.519p      CE2S    su_root_threading(self=0x100ea4a0, enable=0)
>> 41.519p      CE2S       ...su_root_threading() returned 0x0
>> 41.519p      CE2S    nua_create(root=0x100ea4a0, callback=0x4539b4,
magic=0x100030f4,
>>                                                                      
>> url='sip:192.168.72.142:5064')
>> 41.519p      SOFI    nua: nua_create: entering
>> 41.519p      SOFI    nua: nua_stack_init: entering
>> 41.519p      SOFI    nua: nua_stack_set_params: entering
>> 41.519p      SOFI    soa_create("default", 0x100eafb0, 0x100ed180) called
>> 41.519p      SOFI    soa_set_params(static::0x100ed538, ...) called
>> 41.519p      SOFI    nta_agent_create: initialized hash tables
>> 41.519p      SOFI    nta_agent_create: initialized transports
>> 41.519p      SOFI    nta_agent_create: initialized random identifiers
>> 41.519p      SOFI    nta_agent_create: initialized timer
>> 41.519p      SOFI    nta_agent_create: initialized resolver
>> 41.519p      SOFI    tport_create(): 0x100ee7c8
>> 41.519p      SOFI    nta: master transport created
>> 41.519p      SOFI    tport_bind_server(0x100ee7c8) to 
>> */192.168.72.142:5064/sip
>> 41.519p      SOFI    tport_bind_server(0x100ee7c8): calling tport_listen for 
>> udp
>> 41.529p      SOFI    tport_alloc_primary(0x100ee7c8): new primary tport
0x100eebc8
>> 41.539p      SOFI    tport_listen(0x100eebc8): listening at
udp/192.168.72.142:5064/sip
>> 41.539p      SOFI    tport_bind_server(0x100ee7c8): calling tport_listen for 
>> tcp
>> 41.539p      SOFI    tport_alloc_primary(0x100ee7c8): new primary tport
0x100eee60
>> 41.539p      SOFI    tport_listen(0x100eee60): listening at
tcp/192.168.72.142:5064/sip
>> 41.539p      SOFI    nta: bound to (192.168.72.142:5064;transport=*)
>> 41.539p      SOFI    nta: agent_init_via: SIP/2.0/udp 192.168.72.142:5064 
>> (sip)
>> 41.539p      SOFI    nta: agent_init_via: SIP/2.0/tcp 192.168.72.142:5064 
>> (sip)
>>              ****    ../../../libsofia-sip-ua/su/su_base_port.c: 303:
su_base_port_run:
>>                                                      Assertion 
>> `su_port_own_thread(self)' failed.
>> 41.539p      SOFI    nta: Via fields initialized
>> 41.539p      SOFI    nta: Contact header created
>> 41.539p      SOFI    nua_register: Adding contact URL '192.168.72.142' to 
>> list.
>> 41.539p      CE2S       ...nua_create() returned
mkData[la].pLine->lineH=0x100ecf20
>> 41.549p      CE2S    su_root_threading(self=0x100ea4a0, enable=0)
>> 41.549p      CE2S       ...su_root_threading() returned 0x0
>> 41.549p      CE2S    nua_create(root=0x100ea4a0, callback=0x4539b4,
magic=0x100033e0,
>>                                                                      
>> url='sip:192.168.72.142:5065')
>> 41.549p      SOFI    nua: nua_create: entering
>> 41.559p      SOFI    nua: nua_stack_init: entering
>> 41.559p      SOFI    nua: nua_stack_set_params: entering
>> 41.559p      SOFI    soa_create("default", 0x100ed798, 0x100ef968) called
>> 41.559p      SOFI    soa_set_params(static::0x100efd20, ...) called
>> 41.559p      SOFI    nta_agent_create: initialized hash tables
>> 41.559p      SOFI    nta_agent_create: initialized transports
>> 41.559p      SOFI    nta_agent_create: initialized random identifiers
>> 41.559p      SOFI    nta_agent_create: initialized timer
>> 41.559p      SOFI    nta_agent_create: initialized resolver
>> 41.559p      SOFI    tport_create(): 0x100f0fb0
>> 41.559p      SOFI    nta: master transport created
>> 41.559p      SOFI    tport_bind_server(0x100f0fb0) to 
>> */192.168.72.142:5065/sip
>> 41.559p      SOFI    tport_bind_server(0x100f0fb0): calling tport_listen for 
>> udp
>> 41.559p      SOFI    tport_alloc_primary(0x100f0fb0): new primary tport
0x100f13b0
>> 41.559p      SOFI    tport_listen(0x100f13b0): listening at
udp/192.168.72.142:5065/sip
>> 41.559p      SOFI    tport_bind_server(0x100f0fb0): calling tport_listen for 
>> tcp
>> 41.569p      SOFI    tport_alloc_primary(0x100f0fb0): new primary tport
0x100f1648
>> 41.569p      SOFI    tport_listen(0x100f1648): listening at
tcp/192.168.72.142:5065/sip
>> 41.569p      SOFI    nta: bound to (192.168.72.142:5065;transport=*)
>> 41.569p      SOFI    nta: agent_init_via: SIP/2.0/udp 192.168.72.142:5065 
>> (sip)
>> 41.569p      SOFI    nta: agent_init_via: SIP/2.0/tcp 192.168.72.142:5065 
>> (sip)
>> 41.569p      SOFI    nta: Via fields initialized
>> 41.569p      SOFI    nta: Contact header created
>> 41.569p      SOFI    nua_register: Adding contact URL '192.168.72.142' to 
>> list.
>> 41.569p      CE2S       ...nua_create() returned
mkData[la].pLine->lineH=0x100ef708
>> 41.579p      CE2S    su_root_threading(self=0x100ea4a0, enable=0)
>> 41.579p      CE2S       ...su_root_threading() returned 0x0
>> 41.579p      CE2S    nua_create(root=0x100ea4a0, callback=0x4539b4,
magic=0x100036cc,
>>                                                                      
>> url='sip:192.168.72.142:5066')
>> 41.579p      SOFI    nua: nua_create: entering
>> 41.589p      SOFI    nua: nua_stack_init: entering
>> 41.589p      SOFI    nua: nua_stack_set_params: entering
>> 41.589p      SOFI    soa_create("default", 0x100eff80, 0x100f2150) called
>> 41.589p      SOFI    soa_set_params(static::0x100f2508, ...) called
>> 41.589p      SOFI    nta_agent_create: initialized hash tables
>> 41.589p      SOFI    nta_agent_create: initialized transports
>> 41.589p      SOFI    nta_agent_create: initialized random identifiers
>> 41.589p      SOFI    nta_agent_create: initialized timer
>> 41.589p      SOFI    nta_agent_create: initialized resolver
>> 41.589p      SOFI    tport_create(): 0x100f3798
>> 41.589p      SOFI    nta: master transport created
>> 41.589p      SOFI    tport_bind_server(0x100f3798) to 
>> */192.168.72.142:5066/sip
>> 41.589p      SOFI    tport_bind_server(0x100f3798): calling tport_listen for 
>> udp
>> 41.589p      SOFI    tport_alloc_primary(0x100f3798): new primary tport
0x100f3b98
>> 41.599p      SOFI    tport_listen(0x100f3b98): listening at
udp/192.168.72.142:5066/sip
>> 41.599p      SOFI    tport_bind_server(0x100f3798): calling tport_listen for 
>> tcp
>> 41.599p      SOFI    tport_alloc_primary(0x100f3798): new primary tport
0x100f3e30
>> 41.599p      SOFI    tport_listen(0x100f3e30): listening at
tcp/192.168.72.142:5066/sip
>> 41.599p      SOFI    nta: bound to (192.168.72.142:5066;transport=*)
>> 41.599p      SOFI    nta: agent_init_via: SIP/2.0/udp 192.168.72.142:5066 
>> (sip)
>> 41.599p      SOFI    nta: agent_init_via: SIP/2.0/tcp 192.168.72.142:5066 
>> (sip)
>> 41.599p      SOFI    nta: Via fields initialized
>> 41.599p      SOFI    nta: Contact header created
>> 41.599p      SOFI    nua_register: Adding contact URL '192.168.72.142' to 
>> list.
>> 41.599p      CE2S       ...nua_create() returned
mkData[la].pLine->lineH=0x100f1ef0
>> 41.609p      CE2S    su_root_threading(self=0x100ea4a0, enable=0)
>> 41.609p      CE2S       ...su_root_threading() returned 0x0
>> 41.619p      CE2S    nua_create(root=0x100ea4a0, callback=0x4539b4,
magic=0x100039b8,
>>                                                                      
>> url='sip:192.168.72.142:5067')
>> 41.619p      SOFI    nua: nua_create: entering
>> 41.619p      SOFI    nua: nua_stack_init: entering
>> 41.619p      SOFI    nua: nua_stack_set_params: entering
>> 41.619p      SOFI    soa_create("default", 0x100f2768, 0x100f4938) called
>> 41.619p      SOFI    soa_set_params(static::0x100f4cf0, ...) called
>> 41.619p      SOFI    nta_agent_create: initialized hash tables
>> 41.619p      SOFI    nta_agent_create: initialized transports
>> 41.619p      SOFI    nta_agent_create: initialized random identifiers
>> 41.619p      SOFI    nta_agent_create: initialized timer
>> 41.619p      SOFI    nta_agent_create: initialized resolver
>> 41.619p      SOFI    tport_create(): 0x100f5f80
>> 41.619p      SOFI    nta: master transport created
>> 41.619p      SOFI    tport_bind_server(0x100f5f80) to 
>> */192.168.72.142:5067/sip
>> 41.619p      SOFI    tport_bind_server(0x100f5f80): calling tport_listen for 
>> udp
>> 41.619p      SOFI    tport_alloc_primary(0x100f5f80): new primary tport
0x100f6380
>> 41.629p      SOFI    tport_listen(0x100f6380): listening at
udp/192.168.72.142:5067/sip
>> 41.629p      SOFI    tport_bind_server(0x100f5f80): calling tport_listen for 
>> tcp
>> 41.629p      SOFI    tport_alloc_primary(0x100f5f80): new primary tport
0x100f6618
>> 41.629p      SOFI    tport_listen(0x100f6618): listening at
tcp/192.168.72.142:5067/sip
>> 41.629p      SOFI    nta: bound to (192.168.72.142:5067;transport=*)
>> 41.629p      SOFI    nta: agent_init_via: SIP/2.0/udp 192.168.72.142:5067 
>> (sip)
>> 41.629p      SOFI    nta: agent_init_via: SIP/2.0/tcp 192.168.72.142:5067 
>> (sip)
>> 41.629p      SOFI    nta: Via fields initialized
>> 41.629p      SOFI    nta: Contact header created
>> 41.629p      SOFI    nua_register: Adding contact URL '192.168.72.142' to 
>> list.
>> 41.629p      CE2S       ...nua_create() returned
mkData[la].pLine->lineH=0x100f46d8
>> 41.719p      CE2S    [2]nua_handle(nua=0x100ea640, hmagic=0x10002830,
>>                                                              url='sip:[EMAIL 
>> PROTECTED]:5060')
>> 41.719p      SOFI    nua: nh_create_handle: entering
>> 41.719p      CE2S       ...[2]nua_handle() returned nh=0x100f6d48
>> 41.719p      CE2S    nua_register(nh=0x100f6d48,
>>                                      SIPTAG_FROM(sip:[EMAIL PROTECTED]:5060),
>>                                      SIPTAG_CONTACT(sip:[EMAIL 
>> PROTECTED]:5061))
>> 41.719p      SOFI    nua: nua_register: entering
>> 41.719p      SOFI    nua(0x100f6d48): signal r_register
>> 41.719p      CE2S    [2]nua_handle(nua=0x100ea640, hmagic=0x10002830,
>>                                                              url='sip:[EMAIL 
>> PROTECTED]:5060')
>> 41.719p      SOFI    nua: nh_create_handle: entering
>> 41.719p      CE2S       ...[2]nua_handle() returned nh=0x100f70b8
>> 41.719p      CE2S    nua_subscribe(nh=0x100f70b8,
>> 41.719p      CE2S                    SIPTAG_FROM(sip:[EMAIL PROTECTED]:5060),
>>                                      SIPTAG_EXPIRES(3600),
>> 41.719p      CE2S                    SIPTAG_CONTACT(sip:[EMAIL 
>> PROTECTED]:5061),
>>                                      SIPTAG_EVENT(message-summary),
>> 41.719p      CE2S
SIPTAG_ACCEPT(application/simple-message-summary))
>> 41.719p      SOFI    nua: nua_subscribe: entering
>> 41.719p      SOFI    nua(0x100f70b8): signal r_subscribe
>>











-----Original Message-----
From: Kai Vehmanen [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 03, 2007 1:09 PM
To: Fabio Margarido; Jerry Richards
Cc: sofia-sip-devel@lists.sourceforge.net
Subject: Re: [Sofia-sip-devel] 1.12.6 Application Interface


Hi,

ok, forget my reply yesterday. :)

On Wed, 3 Oct 2007, Fabio Margarido wrote:

>> 1.12.4 allowed you to create the su_root object in one thread, and then
>> run it in another. This was changed in 1.12.6. But even with 1.12.4, you
>> weren't supposed to access nua objects from two threads at the same time!
>> This hasn't changed since 1.12.4 AFAIK.
>
> If that's so, I believe nua documentation is a bit misleading. Quoting
> the section 'Initialization and deinitialization':
>
> "If the application is not just responding to incoming SIP messages
> there must also be means to send messages to NUA. This can be handled
> for example by having a separate thread that calls NUA functions to

So it would seem this is supported as well after all and the documentation
is in fact correct. Basicly the public nua functions implement the
approach I outlined in my previous post, except using a different wake-up
mechanism. If I'm now reading the code right, the request execution
worst-case delay will be somewhat worse when submitting nua requests from
other threads, vs implementing the local pipe trick I described in my
mail. But I'll have to double-check this...

Oh well, I've never used the API this way myself, and didn't bother to
recheck the sources before pushing 'send' yesterday. Sorry for adding to
the confusion, and thanks Fabio for pointing this out!

--
  links, my public keys, etc at http://eca.cx/kv


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel

Reply via email to