update
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9101 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
60ab746d86
commit
a60409d72f
|
@ -207,7 +207,7 @@ static switch_status_t do_stun_ping(switch_rtp_t *rtp_session)
|
||||||
uint8_t buf[256] = { 0 };
|
uint8_t buf[256] = { 0 };
|
||||||
uint8_t *start = buf;
|
uint8_t *start = buf;
|
||||||
switch_stun_packet_t *packet;
|
switch_stun_packet_t *packet;
|
||||||
unsigned int elapsed;
|
//unsigned int elapsed;
|
||||||
switch_size_t bytes;
|
switch_size_t bytes;
|
||||||
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
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;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
if (rtp_session->last_stun) {
|
if (rtp_session->last_stun) {
|
||||||
elapsed = (unsigned int) ((switch_timestamp_now() - rtp_session->last_stun) / 1000);
|
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;
|
goto end;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (rtp_session->funny_stun) {
|
if (rtp_session->funny_stun) {
|
||||||
*start++ = 0;
|
*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);
|
packet = switch_stun_packet_build_header(SWITCH_STUN_BINDING_REQUEST, NULL, start);
|
||||||
bytes = switch_stun_packet_length(packet);
|
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);
|
switch_socket_sendto(rtp_session->sock_output, rtp_session->remote_stun_addr, 0, (void *) packet, &bytes);
|
||||||
rtp_session->stuncount = rtp_session->default_stuncount;
|
rtp_session->stuncount = rtp_session->default_stuncount;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue