git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9101 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2008-07-18 22:30:22 +00:00
parent 60ab746d86
commit a60409d72f
1 changed files with 10 additions and 1 deletions

View File

@ -207,7 +207,7 @@ static switch_status_t do_stun_ping(switch_rtp_t *rtp_session)
uint8_t buf[256] = { 0 };
uint8_t *start = buf;
switch_stun_packet_t *packet;
unsigned int elapsed;
//unsigned int elapsed;
switch_size_t bytes;
switch_status_t status = SWITCH_STATUS_SUCCESS;
@ -220,6 +220,7 @@ static switch_status_t do_stun_ping(switch_rtp_t *rtp_session)
goto end;
}
#if 0
if (rtp_session->last_stun) {
elapsed = (unsigned int) ((switch_timestamp_now() - rtp_session->last_stun) / 1000);
@ -229,6 +230,7 @@ static switch_status_t do_stun_ping(switch_rtp_t *rtp_session)
goto end;
}
}
#endif
if (rtp_session->funny_stun) {
*start++ = 0;
@ -239,6 +241,13 @@ static switch_status_t do_stun_ping(switch_rtp_t *rtp_session)
packet = switch_stun_packet_build_header(SWITCH_STUN_BINDING_REQUEST, NULL, start);
bytes = switch_stun_packet_length(packet);
if (rtp_session->funny_stun) {
packet = (switch_stun_packet_t *) buf;
bytes += 4;
}
switch_socket_sendto(rtp_session->sock_output, rtp_session->remote_stun_addr, 0, (void *) packet, &bytes);
rtp_session->stuncount = rtp_session->default_stuncount;