Hello:

If I use call nua_create() with sip:0.0.0.0:* and then call nua_invite() to 
another process listening at port 5060, I always get 503 service unavailable. 
Am I doing something wrong?

su_log_set_level(su_log_default, SU_LOG_MAX);
su_log_set_level(su_log_global, SU_LOG_MAX);
su_log_redirect(su_log_global, logger_callback, NULL);
su_log_redirect(su_log_default, logger_callback, NULL);
su_init();
root = su_root_create(NULL);
nua = nua_create(root, callback, NULL, NUTAG_URL("sip:0.0.0.0:*"), TAG_NULL());
handle = nua_handle(nua, NULL, TAG_END());
nua_invite(handle, SIPTAG_TO_STR("sip:127.0.0.1:5060"), 
SOATAG_USER_SDP_STR(sdp), NUTAG_AUTOACK(1),TAG_END());
su_root_run(root);

Here is the debug output

C:\sandbox\sofia-sip\test\Debug>client
su_socket_port_init(008330E8, 0FE97FF0) called
su_pthread_port_init(008330E8, 0FE97FF0) called
su_socket_port_init(00834FB8, 0FE97FF0) called
su_pthread_port_init(00834FB8, 0FE97FF0) called
soa_create("default", 00835908, 00835A08) called
soa_set_params(static::00835F88, ...) called
soa_set_params(static::00835F88, ...) called
nta_agent_create: initialized hash tables
nta_agent_create: initialized transports
nta_agent_create: initialized random identifiers
nta_agent_create: initialized timer
Adding nameserver: 10.120.21.5
Adding nameserver: 10.101.21.6
nta_agent_create: initialized resolver
tport_create(): 00837898
nta: master transport created
tport(00837898) to */0.0.0.0:1234/sip
tport(00837898): calling tport_listen for udp
tport(00837898): new primary tport 00837D48
tport(00837D48): listening at udp/10.120.100.188:1234/sip
tport(00837898): calling tport_listen for tcp
tport(00837898): new primary tport 008380C0
tport(008380C0): listening at tcp/10.120.100.188:1234/sip
tport(00837898): calling tport_listen for udp
tport(00837898): new primary tport 00838438
tport(00838438): listening at udp/127.0.0.1:1234/sip
tport(00837898): calling tport_listen for tcp
tport(00837898): new primary tport 008387A8
tport(008387A8): listening at tcp/127.0.0.1:1234/sip
nta: bound to (0.0.0.0:1234;transport=*)
nta: agent_init_via: SIP/2.0/udp 10.120.100.188:1234 (sip)
nta: agent_init_via: SIP/2.0/tcp 10.120.100.188:1234 (sip)
nta: agent_init_via: SIP/2.0/udp 127.0.0.1:1234 (sip)
nta: agent_init_via: SIP/2.0/tcp 127.0.0.1:1234 (sip)
nta: Via fields initialized
nta: Contact header created
nua_register: Adding contact URL '10.120.100.188' to list.
nua_register: ignoring contact candidate 127.0.0.1:1234.
nua(0083CFC0): sent signal r_invite
soa_clone(static::00835F88, 00835908, 0083CFC0) called
soa_set_params(static::0083D400, ...) called
soa_set_params(static::0083D400, ...) called
soa_set_user_sdp(static::0083D400, 00000000, 0083D237, -1) called
soa_set_capability_sdp(static::0083D400, 00000000, 0083D237, -1) called
soa: prefer IP4 because of the user sdp
soa: selected IN IP4 10.120.100.188 (a local address)
nua(0083CFC0): adding session usage
nta_leg_tcreate(0083FC90)
soa_init_offer_answer(static::0083D400) called
soa_generate_offer(static::0083D400, 0) called
soa_static_offer_answer_action(0083D400, soa_generate_offer): called
soa_static(0083D400, soa_generate_offer): generating local description
soa_static(0083D400, soa_generate_offer): upgrade with local description
soa_sdp_mode_set(00FDEAB4, 00000000, ""): called
soa: prefer IP4 because of an existing c= line
soa: selected IN IP4 10.120.100.188 (a local address)
soa_static(0083D400, soa_generate_offer): storing local description
soa_get_local_sdp(static::0083D400, [00000000], [00FDEBAC], [00FDEBA0]) called
nta: selecting scheme sip
tport_tsend(00837D48) tpn = */127.0.0.1:5060
tport_resolve addrinfo = 127.0.0.1:5060
tport(00837D48): not found by name */127.0.0.1:5060
tport_vsend(00837D48): Can't assign requested address with (s=396 */127.0.0.1:50
60)
tport_vsend returned -1
nta: INVITE (33416111): Can't assign requested address (10049) with */[127.0.0.1
]:5060
nta: timer set to 32000 ms
nua(0083CFC0): call state changed: init -> calling, sent offer
soa_get_local_sdp(static::0083D400, [00FDEC58], [00FDEC4C], [00000000]) called
state change. 7: 000 INVITE sent
nua(0083CFC0): call state changed: calling -> init
response. 31: 503 Service Unavailable
nua(0083CFC0): removing session usage
state change. 7: 503 Service Unavailable
soa_destroy(static::0083D400) called
unknown event. 6: 503 Service Unavailable
nta_leg_destroy(0083FC90)

Thanks in advance
Kun-Yao Huang

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel

Reply via email to