Al 17/04/11 16:51, En/na Luca Olivetti ha escrit:
> Al 17/04/11 15:51, En/na Luca Olivetti ha escrit:
> 
>> Well, looking at su/su_os_nw.c (which I could have done before asking, duh)
>> it appears it is still so :-(
>>
>> Any plan to add Linux support?
>>
>> I can have a go at it myself, I'm not really good with C, but I can
>> start from here:
>>
>> http://stackoverflow.com/questions/579783/how-to-detect-ip-address-change-programmatically-in-linux
>> (the rely using socket(PF_NETLINK, SOCK_RAW, NETLINK_ROUTE)).
> 
> Do I need the su_msg_send and the su_nw_changed_msg_recv  or can I
> call the su_network_changed_cb directly from the monitoring thread?

Ok, I found the hard way: I have to send the message ;-)

But I still have problems:

1) if I monitor both for RTM_NEWADDR and RTM_DELADDR, on an ip change two 
messages will be sent (old address, new address) -> sofia crashes:

 eth0 was 192.168.10.168
tport_destroy(0x595e60)
tport_create(): 0x5962f0
nta: master transport created
eth0 is now 192.168.10.175   
root@OpenWrt:/# tport_bind_server(0x5962f0) to */*:5060/sip
tport_bind_server(0x5962f0): calling tport_listen for udp  
tport_alloc_primary(0x5962f0): new primary tport 0x595e60  
tport_listen(0x595e60): listening at udp/192.168.10.175:5060/sip
tport_bind_server(0x5962f0): calling tport_listen for tcp       
tport_alloc_primary(0x5962f0): new primary tport 0x5972d0       
tport_listen(0x5972d0): listening at tcp/192.168.10.175:5060/sip
tport_bind_server(0x5962f0): calling tport_listen for udp       
tport_alloc_primary(0x5962f0): new primary tport 0x597580       
tport_listen(0x597580): listening at udp/127.0.0.1:5060/sip     
tport_bind_server(0x5962f0): calling tport_listen for tcp       
tport_alloc_primary(0x5962f0): new primary tport 0x59d080       
tport_listen(0x59d080): listening at tcp/127.0.0.1:5060/sip     
nta: bound to (*:5060;transport=*)                              
nta: agent_init_via: SIP/2.0/udp 192.168.10.175 (sip)           
nta: agent_init_via: SIP/2.0/tcp 192.168.10.175 (sip)           
nta: agent_init_via: SIP/2.0/udp 127.0.0.1 (sip)                
nta: agent_init_via: SIP/2.0/tcp 127.0.0.1 (sip)                
nta: Via fields initialized                                     
nta: Contact header created                                     
stun_is_requested: entering.                                    
nua_register: Adding contact URL '192.168.10.175' to list.      
nua_register: ignoring contact candidate 127.0.0.1:.            
A2 = MD5(REGISTER:sip:ekiga.net)                                
auth_response: db79b8a5046c76654b742311b7d4a33d = 
MD5(53060310bbad90036d54e1954983ae4e:4dab21db0000e3306f1513e34e9e24eedc00a7827bd9394f:14bd7ed1967527d3770ab1f7c12901c5)
 (qop=NONE)
svd: nta.c: 7785: outgoing_create: Assertion 
`tport_name_is_resolved(orq->orq_tpn)' failed.                                  
                                                       

2) if I monitor for just RTM_NEWADDR, I just get one message, sometimes it 
still crashes (like above but the assertion isn't visible, it crashes before 
reaching it), but when it doesn't sofia still uses the old address for the 
local sdp (I don't prepare the address, I just prepare the "m=" and "a=" lines).

3) I noticed that su_root_add_network_changed is called three times, hence 
three threads are started, three messages were sent for each change-> instant 
crash. I put a workaround to start the thread just once.

Maybe it's better to forget about the NUTAG_DETECT_NETWORK_UPDATES and restart 
the application when the address changes?

Bye
-- 
Luca




------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload 
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve 
application availability and disaster protection. Learn more about boosting 
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel

Reply via email to