From 335f844ac1373b6064e71e14535445b697046e39 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 18 Jul 2008 22:04:10 +0000 Subject: [PATCH] update git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9099 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/endpoints/mod_sofia/sofia_glue.c | 2 +- src/switch_stun.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/mod/endpoints/mod_sofia/sofia_glue.c b/src/mod/endpoints/mod_sofia/sofia_glue.c index 6e4e428e20..7bb36c9674 100644 --- a/src/mod/endpoints/mod_sofia/sofia_glue.c +++ b/src/mod/endpoints/mod_sofia/sofia_glue.c @@ -471,7 +471,7 @@ switch_status_t sofia_glue_ext_address_lookup(sofia_profile_t *profile, private_ } } if (status != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Stun Failed! %s:%d [%s]\n", stun_ip, SWITCH_STUN_DEFAULT_PORT, error); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Stun Failed! %s:%d [%s]\n", stun_ip, stun_port, error); goto out; } if (!*ip) { diff --git a/src/switch_stun.c b/src/switch_stun.c index 5ed6b6862d..de0c4b4e8f 100644 --- a/src/switch_stun.c +++ b/src/switch_stun.c @@ -489,6 +489,12 @@ SWITCH_DECLARE(switch_status_t) switch_stun_lookup(char **ip, switch_stun_random_string(username, 32, NULL); switch_stun_packet_attribute_add_username(packet, username, 32); bytes = switch_stun_packet_length(packet); + + if (funny) { + packet = (switch_stun_packet_t *) buf; + bytes += 4; + } + switch_socket_sendto(sock, remote_addr, 0, (void *) packet, &bytes); started = switch_timestamp_now();