[Freeswitch-svn] [commit] r4981 - freeswitch/trunk/src
Freeswitch SVN
anthm at freeswitch.org
Thu Apr 19 20:29:18 EDT 2007
Author: anthm
Date: Thu Apr 19 20:29:18 2007
New Revision: 4981
Modified:
freeswitch/trunk/src/switch_rtp.c
Log:
silly socket test
Modified: freeswitch/trunk/src/switch_rtp.c
==============================================================================
--- freeswitch/trunk/src/switch_rtp.c (original)
+++ freeswitch/trunk/src/switch_rtp.c Thu Apr 19 20:29:18 2007
@@ -323,6 +323,8 @@
switch_socket_t *new_sock = NULL, *old_sock = NULL;
switch_status_t status = SWITCH_STATUS_FALSE;
*err = NULL;
+ char o[5] = "TEST", i[5] = "";
+ switch_size_t len;
if (switch_sockaddr_info_get(&rtp_session->local_addr, host, SWITCH_UNSPEC, port, 0, rtp_session->pool) != SWITCH_STATUS_SUCCESS) {
*err = "Local Address Error!";
@@ -348,6 +350,14 @@
goto done;
}
+ len = sizeof(i);
+ switch_socket_sendto(new_sock, rtp_session->local_addr, 0, (void *) o, &len);
+ switch_socket_recvfrom(rtp_session->from_addr, new_sock, 0, (void *) i, &len);
+
+ if (!len) {
+ goto done;
+ }
+
old_sock = rtp_session->sock;
rtp_session->sock = new_sock;
new_sock = NULL;
More information about the Freeswitch-svn
mailing list