Re: [Sofia-sip-devel] Sending nua_invite - DNS Error 503
iOS doesn’t allow file access. You need to use iOS API to query DNS server IP which isn’t done for Sofia SIP yet. From: Alexander Heinrich alexan...@sn0wfreeze.demailto:alexan...@sn0wfreeze.de Date: Sunday, November 17, 2013 at 3:52 AM To: sofia-sip-devel@lists.sourceforge.netmailto:sofia-sip-devel@lists.sourceforge.net sofia-sip-devel@lists.sourceforge.netmailto:sofia-sip-devel@lists.sourceforge.net Subject: [Sofia-sip-devel] Sending nua_invite - DNS Error 503 Hey, I got good help from that mailing list last time. So I’ll try again to send my problems to you. When I’m sending a nua_invite message I get a DNS 503 error. I saw some mails in the archive concerning this problem, but I could not find a good answer for that problem. I am working with an iPhone and the newest version of sofia sip. The confusing is, that it worked two days ago and now it doesn’t. I didn’t changed anything in the code. Here’s my code: app.nua = nua_create(app.root, event_callback, NULL, NUTAG_URL(sip:0.0.0.0:5060), TAG_END()); su_root_run (app.root); //Invite url_string_t *url = URL_STRING_MAKE(sip:mu...@iptel.org:5060) ; sip_to_t *to = sip_to_create(NULL, url); op.handle = nua_handle(app.nua, NULL,SIPTAG_TO(to), TAG_END()); nua_invite(op.handle,SOATAG_USER_SDP_STR(m=audio 5004 RTP/AVP 0 8), TAG_END()); Here’s my output: su_socket_port_init(0x15e91590, 0x1201ac) called su_pthread_port_init(0x15e91590, 0x1201ac) called nua: nua_create: entering su_socket_port_init(0x15e8fdf0, 0x1201ac) called su_pthread_port_init(0x15e8fdf0, 0x1201ac) called nua: nua_stack_init: entering nua: nua_stack_set_params: entering soa_create(default, 0x15eaef20, 0x15eafbd0) called soa_set_params(static::0x15eb1710, ...) called soa_set_params(static::0x15eb1710, ...) 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(): 0x15d60180 nta: master transport created tport_bind_server(0x15d60180) to */0.0.0.0:5060/sip tport_bind_server(0x15d60180): calling tport_listen for udp tport_alloc_primary(0x15d60180): new primary tport 0x15e68540 tport_listen(0x15e68540): listening at udp/10.60.59.59:5060/sip tport_bind_server(0x15d60180): calling tport_listen for tcp tport_alloc_primary(0x15d60180): new primary tport 0x15e686e0 tport_listen(0x15e686e0): listening at tcp/10.60.59.59:5060/sip tport_bind_server(0x15d60180): calling tport_listen for udp tport_alloc_primary(0x15d60180): new primary tport 0x15eb81e0 tport_listen(0x15eb81e0): listening at udp/192.168.178.136:5060/sip tport_bind_server(0x15d60180): calling tport_listen for tcp tport_alloc_primary(0x15d60180): new primary tport 0x15e60cc0 tport_listen(0x15e60cc0): listening at tcp/192.168.178.136:5060/sip tport_bind_server(0x15d60180): calling tport_listen for udp tport_alloc_primary(0x15d60180): new primary tport 0x15e5d490 tport_listen(0x15e5d490): listening at udp/127.0.0.1:5060/sip tport_bind_server(0x15d60180): calling tport_listen for tcp tport_alloc_primary(0x15d60180): new primary tport 0x15e6ce70 tport_listen(0x15e6ce70): listening at tcp/127.0.0.1:5060/sip nta: bound to (0.0.0.0:5060;transport=*) nta: agent_init_via: SIP/2.0/udp 10.60.59.59 (sip) nta: agent_init_via: SIP/2.0/tcp 10.60.59.59 (sip) nta: agent_init_via: SIP/2.0/udp 192.168.178.136 (sip) nta: agent_init_via: SIP/2.0/tcp 192.168.178.136 (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 nua_register: Adding contact URL '10.60.59.59' to list. nua_register: Adding contact URL '192.168.178.136' to list. nua_register: ignoring contact candidate 127.0.0.1:. nua: nh_create_handle: entering nua: nua_invite: entering nua(0x15d5af20): sent signal r_invite nua: nua_stack_set_params: entering soa_clone(static::0x15eb1710, 0x15eaef20, 0x15d5af20) called soa_set_params(static::0x15e5c940, ...) called soa_set_params(static::0x15e5c940, ...) called soa_set_user_sdp(static::0x15e5c940, 0x0, 0x15d505ac, -1) called soa_set_capability_sdp(static::0x15e5c940, 0x0, 0x15d505ac, -1) called soa_init_sdp_connection_with_session: selected IN IP4 10.60.59.59 (a local address) nua(0x15d5af20): adding session usage nta_leg_tcreate(0x15ebed70) soa_init_offer_answer(static::0x15e5c940) called soa_generate_offer(static::0x15e5c940, 0) called soa_static_offer_answer_action(0x15e5c940, soa_generate_offer): called soa_static(0x15e5c940, soa_generate_offer): generating local description soa_static(0x15e5c940, soa_generate_offer): upgrade with local description soa_sdp_mode_set(0x2e23a88, 0x0, ): called soa_init_sdp_connection_with_session: selected IN IP4 10.60.59.59 (a local address) soa_static(0x15e5c940, soa_generate_offer):
Re: [Sofia-sip-devel] Sending nua_invite - DNS Error 503
Try binding to a specific interface instead of 0.0.0.0. Sofia SIP chooses an arbitrary interface for out-going requests when you bind to 0.0.0.0 http://www.mail-archive.com/sofia-sip-devel@lists.sourceforge.net/msg04427.html http://www.mail-archive.com/sofia-sip-devel@lists.sourceforge.net/msg03185.html Kun-Yao Huang From: Alexander Heinrich [mailto:alexan...@sn0wfreeze.de] Sent: Sunday, November 17, 2013 10:53 PM To: sofia-sip-devel@lists.sourceforge.net Subject: [Sofia-sip-devel] Sending nua_invite - DNS Error 503 Hey, I got good help from that mailing list last time. So I'll try again to send my problems to you. When I'm sending a nua_invite message I get a DNS 503 error. I saw some mails in the archive concerning this problem, but I could not find a good answer for that problem. I am working with an iPhone and the newest version of sofia sip. The confusing is, that it worked two days ago and now it doesn't. I didn't changed anything in the code. Here's my code: app.nua = nua_create(app.root, event_callback, NULL, NUTAG_URL(sip:0.0.0.0:5060), TAG_END()); su_root_run (app.root); //Invite url_string_t *url = URL_STRING_MAKE(sip:mu...@iptel.org:5060) ; sip_to_t *to = sip_to_create(NULL, url); op.handle = nua_handle(app.nua, NULL,SIPTAG_TO(to), TAG_END()); nua_invite(op.handle,SOATAG_USER_SDP_STR(m=audio 5004 RTP/AVP 0 8), TAG_END()); Here's my output: su_socket_port_init(0x15e91590, 0x1201ac) called su_pthread_port_init(0x15e91590, 0x1201ac) called nua: nua_create: entering su_socket_port_init(0x15e8fdf0, 0x1201ac) called su_pthread_port_init(0x15e8fdf0, 0x1201ac) called nua: nua_stack_init: entering nua: nua_stack_set_params: entering soa_create(default, 0x15eaef20, 0x15eafbd0) called soa_set_params(static::0x15eb1710, ...) called soa_set_params(static::0x15eb1710, ...) 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(): 0x15d60180 nta: master transport created tport_bind_server(0x15d60180) to */0.0.0.0:5060/sip tport_bind_server(0x15d60180): calling tport_listen for udp tport_alloc_primary(0x15d60180): new primary tport 0x15e68540 tport_listen(0x15e68540): listening at udp/10.60.59.59:5060/sip tport_bind_server(0x15d60180): calling tport_listen for tcp tport_alloc_primary(0x15d60180): new primary tport 0x15e686e0 tport_listen(0x15e686e0): listening at tcp/10.60.59.59:5060/sip tport_bind_server(0x15d60180): calling tport_listen for udp tport_alloc_primary(0x15d60180): new primary tport 0x15eb81e0 tport_listen(0x15eb81e0): listening at udp/192.168.178.136:5060/sip tport_bind_server(0x15d60180): calling tport_listen for tcp tport_alloc_primary(0x15d60180): new primary tport 0x15e60cc0 tport_listen(0x15e60cc0): listening at tcp/192.168.178.136:5060/sip tport_bind_server(0x15d60180): calling tport_listen for udp tport_alloc_primary(0x15d60180): new primary tport 0x15e5d490 tport_listen(0x15e5d490): listening at udp/127.0.0.1:5060/sip tport_bind_server(0x15d60180): calling tport_listen for tcp tport_alloc_primary(0x15d60180): new primary tport 0x15e6ce70 tport_listen(0x15e6ce70): listening at tcp/127.0.0.1:5060/sip nta: bound to (0.0.0.0:5060;transport=*) nta: agent_init_via: SIP/2.0/udp 10.60.59.59 (sip) nta: agent_init_via: SIP/2.0/tcp 10.60.59.59 (sip) nta: agent_init_via: SIP/2.0/udp 192.168.178.136 (sip) nta: agent_init_via: SIP/2.0/tcp 192.168.178.136 (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 nua_register: Adding contact URL '10.60.59.59' to list. nua_register: Adding contact URL '192.168.178.136' to list. nua_register: ignoring contact candidate 127.0.0.1:. nua: nh_create_handle: entering nua: nua_invite: entering nua(0x15d5af20): sent signal r_invite nua: nua_stack_set_params: entering soa_clone(static::0x15eb1710, 0x15eaef20, 0x15d5af20) called soa_set_params(static::0x15e5c940, ...) called soa_set_params(static::0x15e5c940, ...) called soa_set_user_sdp(static::0x15e5c940, 0x0, 0x15d505ac, -1) called soa_set_capability_sdp(static::0x15e5c940, 0x0, 0x15d505ac, -1) called soa_init_sdp_connection_with_session: selected IN IP4 10.60.59.59 (a local address) nua(0x15d5af20): adding session usage nta_leg_tcreate(0x15ebed70) soa_init_offer_answer(static::0x15e5c940) called soa_generate_offer(static::0x15e5c940, 0) called soa_static_offer_answer_action(0x15e5c940, soa_generate_offer): called soa_static(0x15e5c940, soa_generate_offer): generating local description soa_static(0x15e5c940, soa_generate_offer): upgrade with local description soa_sdp_mode_set(0x2e23a88, 0x0, ): called soa_init_sdp_connection_with_session: selected IN IP4 10.60.59.59 (a local
Re: [Sofia-sip-devel] Sending nua_invite - DNS Error 503
Check and add this in libsofia-sip-ua/sresolv/sres.c #ifdef IOS_BUILD #include resolv.h #endif ... static sres_config_t *sres_parse_resolv_conf(sres_resolver_t *res, char const **options) { sres_config_t *c = su_home_new(sizeof *c); if (c) { FILE *f; int i; f = fopen(c-c_filename = res-res_cnffile, r); sres_parse_config(c, f); if (f) fclose(f); #if HAVE_WIN32 /* note: no 127.0.0.1 on win32 systems */ /* on win32, query the registry for nameservers */ if (sres_parse_win32_ip(c) == 0 || sres_parse_win32_reg(c) == 0) /* success */; else /* now what? */; #else #ifdef IOS_BUILD if ((_res.options RES_INIT) == 0) { res_init(); } for (i = 0; i _res.nscount; i++) { char* pDNS = inet_ntoa(_res.nsaddr_list[i].sin_addr); if (pDNS) { sres_parse_nameserver(c, pDNS); } } #endif /* IOS_BUILD */ /* Use local nameserver by default */ if (c-c_nameservers[0] == NULL) sres_parse_nameserver(c, 127.0.0.1); #endif On 11/17/13, 9:39 PM, Andreas Wehrmann andreas_wehrm...@yahoo.at wrote: On 11/18/2013 12:12 AM, Huang, Kun-Yao wrote: Try binding to a specific interface instead of 0.0.0.0. Sofia SIP chooses an arbitrary interface for out-going requests when you bind to 0.0.0.0 http://www.mail-archive.com/sofia-sip-devel@lists.sourceforge.net/msg0442 7.html http://www.mail-archive.com/sofia-sip-devel@lists.sourceforge.net/msg0318 5.html Kun-Yao Huang I don't have any experience with iOS, but how about resolving the DNS manually and then use the resolved address with Sofia? I know this is ugly... Regards, Andreas -- DreamFactory - Open Source REST JSON Services for HTML5 Native Apps OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access Free app hosting. Or install the open source package on any LAMP server. Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! http://pubads.g.doubleclick.net/gampad/clk?id=63469471iu=/4140/ostg.clktr k ___ Sofia-sip-devel mailing list Sofia-sip-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel -- DreamFactory - Open Source REST JSON Services for HTML5 Native Apps OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access Free app hosting. Or install the open source package on any LAMP server. Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! http://pubads.g.doubleclick.net/gampad/clk?id=63469471iu=/4140/ostg.clktrk ___ Sofia-sip-devel mailing list Sofia-sip-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel