Dear All, first of all, thanks for that great piece of software, i am using it now for quite a while and it's really nice ;) - under python via ctypes - YEAH !
but i im totally stuck with the stun thing - even the sofsip-cli isn't working as expected. i have searched the mailing list, looked at code which is using sofia-sip (sofsip-cli, tapioca and freeswitch) but no success. using the stun module standalone works perfect ! - even in python ;) well, what i can see with all debugging turned on is that the stun server gets connected one time, but it looks like successive connects, and/or binds to some local address fails. basically i am doing the following (sorry for the python code, eh ;): self.nua = self.ss.nua_create \ ( self.su_root # root object (reactor) , self.sip_event_callback_p # function pointer to callback funtion , None # nua_magic , self.ss.stuntag_server, ctypes.c_char_p ("stun.voipbuster.com") , None, None ) self.register_h = self.ss.nua_handle \ ( self.nua, None , self.ss.nutag_url, ctypes.c_char_p (to_url) , None, None ) self.ss.nua_register \ ( self.register_h , self.ss.nutag_registrar, ctypes.c_char_p ("my.own.regist.rar") , self.ss.stuntag_server, ctypes.c_char_p ("stun.voipbuster.com") , self.ss.nutag_outbound, ctypes.c_char_p ("natify") , self.ss.nutag_outbound, ctypes.c_char_p ("use-rport") , None, None ) and here is the log (ip-addresses and hostnames replaced): su_port_create(0x81488b8): epoll_create() => 0: OK su_socket_port_init(0x81488b8, 0xb6fc4040) called su_pthread_port_init(0x81488b8, 0xb6fc4040) called nua: nua_create: entering nua: nua_stack_init: entering nua: nua_stack_set_params: entering soa_create("default", 0x8169a48, 0x816b0f0) called soa_set_params(static::0x816b400, ...) 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 nua_stack_init_transport, nua_stack_init_transport, nua_stack_init_transport tport_create(): 0x816c5a8 nta: master transport created tport_bind_server(0x816c5a8) to */*:5060/sip tport_bind_server(0x816c5a8): calling tport_listen for udp tport_alloc_primary(0x816c5a8): new primary tport 0x816c968 tport_listen(0x816c968): listening at udp/192.168.2.9:5060/sip tport_bind_server(0x816c5a8): calling tport_listen for tcp tport_alloc_primary(0x816c5a8): new primary tport 0x816cd40 tport_listen(0x816cd40): listening at tcp/192.168.2.9:5060/sip tport_bind_server(0x816c5a8): calling tport_listen for udp tport_alloc_primary(0x816c5a8): new primary tport 0x816cfb8 tport_listen(0x816cfb8): listening at udp/127.0.0.1:5060/sip tport_bind_server(0x816c5a8): calling tport_listen for tcp tport_alloc_primary(0x816c5a8): new primary tport 0x816d230 tport_listen(0x816d230): listening at tcp/127.0.0.1:5060/sip nta: bound to (*:5060;transport=*) nta: agent_init_via: SIP/2.0/udp 192.168.2.9 (sip) nta: agent_init_via: SIP/2.0/tcp 192.168.2.9 (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. tport_bind_server(0x816c5a8) to */0.0.0.0:*/stun tport_bind_server(0x816c5a8): calling tport_listen for udp tport_alloc_primary(0x816c5a8): new primary tport 0x816d818 stun_handle_init: entering. stun_handle_init("stun.voipbuster.com"): called stun_atoaddr: entering. stun_bind: entering. stun_discovery_create: entering. assign_socket: entering. stun_request_create: entering. stun_make_binding_req: entering. stun_send_binding_request: entering. stun_send_message: message sent to 194.221.62.209:3478 tport_listen(0x816d818): listening at UDP/192.168.2.9:32861/stun tport_bind_server(0x816c5a8): calling tport_listen for udp tport_alloc_primary(0x816c5a8): new primary tport 0x816f028 stun_handle_init: entering. stun_handle_init("stun.voipbuster.com"): called stun_atoaddr: entering. stun_bind: entering. stun_discovery_create: entering. assign_socket: entering. stun_request_create: entering. stun_make_binding_req: entering. stun_send_binding_request: entering. stun_send_message: sendto: Invalid argument stun_discovery_destroy: entering. stun_handle_destroy: entering. stun_request_destroy: entering. stun_request_destroy: request destroyed. tport_listen(0x816c5a8): stun_bind()(pf=2 UDP/[127.0.0.1]:32861): Invalid argument stun_handle_destroy: entering. stun_request_destroy: entering. stun_request_destroy: timer destroyed. stun_request_destroy: request destroyed. stun_discovery_destroy: entering. nta: bind(0.0.0.0:*;transport=*): Invalid argument nua: error initializing STUN transport # well, i think the "Invalid argument" messages cause the trouble, # but i was not able to find out where they come from - and moreover - # how to avoid them ... nua_register: Adding contact URL '192.168.2.9' to list. nua_register: ignoring contact candidate 127.0.0.1:. nua: nh_create_handle: entering nua: nua_register: entering nua(0x816ee30): signal r_register nua: nua_stack_set_params: entering soa_clone(static::0x816b400, 0x8169a48, 0x816ee30) called soa_set_params(static::0x816db28, ...) called soa_set_params(static::0x816db28, ...) called nta_leg_create(0x816dcc0) nua(0x816ee30): adding register usage nta: selecting scheme sip sres_cache_get(0x814a8f8, NAPTR, "my.own.regist.rar.") called nta: for "my.own.regist.rar" query "my.own.regist.rar" NAPTR sres_query(0x816bc48, 0x8170218, NAPTR, "my.own.regist.rar") called sres_send_dns_query(0x816bc48, 0x81703b0) called sres_sofia_update(0x816c2d0, 13, -1) sres_send_dns_query(0x816bc48, 0x81703b0) id=37140 NAPTR my.own.regist.rar (to [192.168.2.1]:53) sres_resolver_receive(0x816bc48, 13) called sres(q=0x81703b0): reporting errors for 35 my.own.regist.rar sres_cache_get(0x814a8f8, SRV, "_sip._udp.my.own.regist.rar.") called nta: for "my.own.regist.rar" query "_sip._udp.my.own.regist.rar" SRV sres_query(0x816bc48, 0x8170218, SRV, "_sip._udp.my.own.regist.rar") called sres_send_dns_query(0x816bc48, 0x8170538) called sres_send_dns_query(0x816bc48, 0x8170538) id=37141 SRV _sip._udp.my.own.regist.rar (to [192.168.2.1]:53) sres_resolver_receive(0x816bc48, 13) called sres(q=0x8170538): reporting errors for 33 _sip._udp.my.own.regist.rar sres_cache_get(0x814a8f8, SRV, "_sip._tcp.my.own.regist.rar.") called nta: for "my.own.regist.rar" query "_sip._tcp.my.own.regist.rar" SRV sres_query(0x816bc48, 0x8170218, SRV, "_sip._tcp.my.own.regist.rar") called sres_send_dns_query(0x816bc48, 0x8170678) called sres_send_dns_query(0x816bc48, 0x8170678) id=37142 SRV _sip._tcp.my.own.regist.rar (to [192.168.2.1]:53) sres_resolver_receive(0x816bc48, 13) called sres(q=0x8170678): reporting errors for 33 _sip._tcp.my.own.regist.rar sres_cache_get(0x814a8f8, A, "my.own.regist.rar.") called nta: for "my.own.regist.rar" query "my.own.regist.rar" A sres_query(0x816bc48, 0x8170218, A, "my.own.regist.rar") called sres_send_dns_query(0x816bc48, 0x8170538) called sres_send_dns_query(0x816bc48, 0x8170538) id=37143 A my.own.regist.rar (to [192.168.2.1]:53) sres_resolver_receive(0x816bc48, 13) called RR received my.own.regist.rar. A IN 17755 rdlen=4 nta: my.own.regist.rar. IN A AAA.BBB.CCC.DDD tport(0x816c968): EXPENSIVE unresolved */AAA.BBB.CCC.DDD: tport_tsend(0x816c968) tpn = */AAA.BBB.CCC.DDD:5060 tport_resolve addrinfo = AAA.BBB.CCC.DDD:5060 tport_by_addrinfo(0x816c968): not found by name */AAA.BBB.CCC.DDD:5060 tport_vsend(0x816c968): 479 bytes of 479 to */AAA.BBB.CCC.DDD:5060 tport_vsend returned 479 send 479 bytes to udp/[AAA.BBB.CCC.DDD]:5060 at 14:52:06.944787: ------------------------------------------------------------------------ REGISTER sip:[EMAIL PROTECTED] SIP/2.0 Via: SIP/2.0/UDP 192.168.2.9;rport;branch=z9hG4bK81Z0ZBjNc2Zpg Max-Forwards: 70 From: <sip:192.168.2.9>;tag=86tDQKceDcp3m To: <sip:[EMAIL PROTECTED]> Call-ID: db9c3ea7-7e5f-122a-4fb3-003018ad2db6 CSeq: 83545227 REGISTER Contact: <sip:192.168.2.9> User-Agent: sofia-sip/1.12.6 Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, PRACK, MESSAGE, SUBSCRIBE, NOTIFY, REFER, UPDATE Supported: timer, 100rel, path Content-Length: 0 ------------------------------------------------------------------------ nta: sent REGISTER (83545227) to */AAA.BBB.CCC.DDD:5060 tport_pend(0x816c968): pending 0x816fcf0 for udp/192.168.2.9:5060 (already 0) nta: timer set to 32000 ms nta: timer shortened to 500 ms nta: timer E fired, retransmit REGISTER (83545227) tport_tsend(0x816c968) tpn = */AAA.BBB.CCC.DDD:5060 tport_resolve addrinfo = AAA.BBB.CCC.DDD:5060 tport_by_addrinfo(0x816c968): not found by name */AAA.BBB.CCC.DDD:5060 tport_vsend(0x816c968): 479 bytes of 479 to */AAA.BBB.CCC.DDD:5060 tport_vsend returned 479 send 479 bytes to udp/[AAA.BBB.CCC.DDD]:5060 at 14:52:07.445287: ------------------------------------------------------------------------ REGISTER sip:[EMAIL PROTECTED] SIP/2.0 Via: SIP/2.0/UDP 192.168.2.9;rport;branch=z9hG4bK81Z0ZBjNc2Zpg Max-Forwards: 70 From: <sip:192.168.2.9>;tag=86tDQKceDcp3m REGISTER events get sent periodically, but never get any answer from my registrar. by specifying tptag_stun_server = 1 and tptag_public = 2 i managed that the stack sends SIP Via Header with random.is.invalid hostnames in it, and got a nua_i_outbound 101 NAT detected event - i also get this in the sofsip-cli (but it's also unhandled there) i am using version 1.12.6 of sofia-sip, i have also tried 1.12.2 as i read something on the list that 1.12.3 had problems with stun, and 1.12.2 was fine ... but the same there ... hmmm. well, can anyone give me a hint on this ... i'm pretty sure ;) thanks a lot, mexx. ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Sofia-sip-devel mailing list Sofia-sip-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel