On date Friday 2008-06-06 14:50:26 +0200, Stefano Sabatini wrote: > On date Friday 2008-06-06 13:38:57 +0200, Timo Bruhn wrote: > [...] > > Hi Stefano, > > > > maybe this helps you: > > > > nua_invite(handle, NUTAG_MEDIA_ENABLE(0), TAG_END()); > > > > As far as i know this deactivates the SDP offer/answer engine for the call, > > which would wait for user sdp and won't > > send the invite if none is provided. You can activate the engine later in > > the call with: > > nua_set_hparams(handle, NUTAG_MEDIA_ENABLE(1), TAG_END()); > > Yes in this way it worked fine. > > > By the way: if you destroy the handle directly after calling nua_invite(), > > sofia will end the call. Maybe this causes some > > trouble, two. Perhaps it would be better to destroy the handle in the event > > callback. > > Good point, I'll simply leave that for now (I still have to understand > how to associate an arriving message of a dialog to an already sent > one). > > BTW, which is the simpler way to print an incoming message in the > event callback function? [...] > Since I enabled the sofia-sip logging facility, now I can see: > > make sip-inviter; and env TPORT_DEBUG=1 sip-inviter sip:xx.xx.x.204:5060 > gcc -g -O0 -I/home/stefano/include/sofia-sip-1.12 -L/home/stefano/lib > -lsofia-sip-ua -o sip-inviter sip-inviter.c > su_port_create(0x804a008): epoll_create() => 0: OK > su_socket_port_init(0x804a008, 0xb7f62f80) called > su_pthread_port_init(0x804a008, 0xb7f62f80) called > nua: nua_create: entering > su_port_create(0x804a790): epoll_create() => 0: OK > su_socket_port_init(0x804a790, 0xb7f62f80) called > su_pthread_port_init(0x804a790, 0xb7f62f80) called > nua: nua_stack_init: entering > nua: nua_stack_set_params: entering > soa_create("default", 0x804ac18, 0x804acb0) called > soa_set_params(static::0x804b0a0, ...) called > soa_set_params(static::0x804b0a0, ...) 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 > nta: master transport created > nta: bound to (localhost:5060;transport=*) > nta: agent_init_via: SIP/2.0/udp localhost (sip) > nta: agent_init_via: SIP/2.0/tcp localhost (sip) > nta: Via fields initialized > nta: Contact header created > nua_register: Adding contact URL 'localhost' to list. > nua: nh_create_handle: entering > Sending the invite to sip:10.88.3.204:5060... > nua: nua_invite: entering > nua(0x804d8b8): sent signal r_invite > nua: nua_handle_destroy: entering > nua(0x804d8b8): sent signal r_destroy > nua: nua_stack_set_params: entering > nta_leg_tcreate(0x804e050) > nua(0x804d8b8): adding session usage > nta: selecting scheme sip > nta: INVITE (100259833): Invalid argument (22) with */[xx.xx.x.204]:5060 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > Do you have any hint about this? What's the meaning of the 22 code?
It turned out that the problem was that the stack doesn't seem to recognize as valid an IP address (using latest Sofia darcs). It is this a limitation of sofia-sip or is it an error from myself? Anyway maybe a more clear message in the function tport_prepare_and_send in would be nice. Well so I put in my /etc/hosts a name for the hardsipphone I'm sending the invite to, and now I get: Starting program: /home/stefano/src/Sandbox/C/libsofia/sip-inviter sip:[EMAIL PROTECTED]:5060 [Thread debugging using libthread_db enabled] su_port_create(0x804a008): epoll_create() => 0: OK su_socket_port_init(0x804a008, 0xb7f42f80) called su_pthread_port_init(0x804a008, 0xb7f42f80) called nua: nua_create: entering [New Thread 0xb7ac86b0 (LWP 19128)] [New Thread 0xb7ac7b90 (LWP 19133)] su_port_create(0x804a790): epoll_create() => 0: OK su_socket_port_init(0x804a790, 0xb7f42f80) called su_pthread_port_init(0x804a790, 0xb7f42f80) called nua: nua_stack_init: entering nua: nua_stack_set_params: entering soa_create("default", 0x804ac18, 0x804acb0) called soa_set_params(static::0x804b0a0, ...) called soa_set_params(static::0x804b0a0, ...) 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(): 0x804c328 nta: master transport created tport_bind_server(0x804c328) to */localhost:5060/sip tport_bind_server(0x804c328): calling tport_listen for udp tport_alloc_primary(0x804c328): new primary tport 0x804cea8 tport_listen(0x804cea8): listening at udp/127.0.0.1:5060/sip tport_bind_server(0x804c328): calling tport_listen for tcp tport_alloc_primary(0x804c328): new primary tport 0x804d1b0 tport_listen(0x804d1b0): listening at tcp/127.0.0.1:5060/sip nta: bound to (localhost:5060;transport=*) nta: agent_init_via: SIP/2.0/udp localhost (sip) nta: agent_init_via: SIP/2.0/tcp localhost (sip) nta: Via fields initialized nta: Contact header created nua_register: Adding contact URL 'localhost' to list. nua: nh_create_handle: entering Sending the invite to sip:[EMAIL PROTECTED]:5060... nua: nua_invite: entering nua(0x804d8b8): sent signal r_invite nua: nua_stack_set_params: entering soa_clone(static::0x804b0a0, 0x804ac18, 0x804d8b8) called soa_set_params(static::0x804dc10, ...) called soa_set_params(static::0x804dc10, ...) called soa_set_user_sdp(static::0x804dc10, (nil), 0x804db44, -1) called soa_set_capability_sdp(static::0x804dc10, (nil), 0x804db44, -1) called nta_leg_tcreate(0x804e0e0) nua(0x804d8b8): adding session usage soa_init_offer_answer(static::0x804dc10) called soa_generate_offer(static::0x804dc10, 0) called soa_static_offer_answer_action(0x804dc10, soa_generate_offer): called soa_static(0x804dc10, soa_generate_offer): generating local description soa_static(0x804dc10, soa_generate_offer): upgrade with local description soa_sdp_mode_set(0xb7ac6f24, (nil), ""): called soa_static(0x804dc10, soa_generate_offer): storing local description soa_get_local_sdp(static::0x804dc10, [(nil)], [0xb7ac6fcc], [0xb7ac6fc8]) called nta: selecting scheme sip sres_cache_get(0x804ba78, A, "aastra-204.") called nta: for "aastra-204" query "aastra-204" A sres_query(0x804b900, 0x804fcf8, A, "aastra-204") called sres_send_dns_query(0x804b900, 0x804fec0) called sres_sofia_update(0x804c038, 15, -1) sres_send_dns_query(0x804b900, 0x804fec0) id=38713 A aastra-204 (to [10.xx.x.254]:53) nua(0x804d8b8): call state changed: init -> calling, sent offer soa_get_local_sdp(static::0x804dc10, [0xb7ac6ff8], [0xb7ac6ff4], [(nil)]) called nua: nua_application_event: entering Arrived event number 1 I have received the event nua_i_state with status 0: INVITE sent At this point I get an error message number 3 in sres_resolver_receive (res=0x804b900, socket=15) at sres.c:3386 then it continues like this: RR received . SOA IN 9121 rdlen=64 sres(q=0x804fec0): reporting errors for 1 aastra-204 nta: timer set to 32000 ms nua(0x804d8b8): call state changed: calling -> init nua(0x804d8b8): removing session usage soa_destroy(static::0x804dc10) called nta_leg_destroy(0x804e0e0) nua: nua_application_event: entering Arrived event number 2 I have received the event nua_r_invite with status 503: DNS Error nua: nua_application_event: entering Arrived event number 3 I have received the event nua_i_state with status 503: DNS Error nua: nua_application_event: entering Arrived event number 4 I have received the event nua_i_terminated with status 503: DNS Error I'm not a DNS expert, can you suggest what's going wrong now? Many thanks in advance, best regards. ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ Sofia-sip-devel mailing list Sofia-sip-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel