]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
update
authorAnthony Minessale <anthony.minessale@gmail.com>
Fri, 18 Jul 2008 22:30:22 +0000 (22:30 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Fri, 18 Jul 2008 22:30:22 +0000 (22:30 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9101 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_rtp.c

index a59f96d4c6f97d636693ce7a6595d89e6f439922..137df1a1340aa5218567014285a2b79517699f4e 100644 (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;