switch_rtp_flag_t flags, char *timer_name, const char **err, switch_memory_pool_t *pool)
{
switch_rtp_t *rtp_session = NULL;
- uint32_t ssrc = rand() & 0xffffffff;
*new_rtp_session = NULL;
rtp_session->seq = (uint16_t) rand();
- rtp_session->ssrc = ssrc;
+ rtp_session->ssrc = (uint32_t) ((intptr_t) &rtp_session + (uint32_t) switch_timestamp(NULL));
rtp_session->send_msg.header.ssrc = htonl(rtp_session->ssrc);
rtp_session->send_msg.header.ts = 0;
rtp_session->send_msg.header.m = 0;
}
if (rtp_session->timer.interval) {
- sleep_mss = 1000;//rtp_session->timer.interval * 1000;
+ sleep_mss = rtp_session->timer.interval * 1000;
} else {
rtp_session->last_time = switch_time_now();
}
SWITCH_DECLARE(void) switch_sleep(switch_interval_time_t t)
{
+#if defined(HAVE_USLEEP)
+ usleep(t);
+#elif defined(WIN32)
+ Sleep((DWORD) ((t) / 1000));
+#else
+ apr_sleep(t);
+#endif
+
+#if 0
#if defined(HAVE_CLOCK_NANOSLEEP) && defined(SWITCH_USE_CLOCK_FUNCS)
struct timespec ts;
ts.tv_sec = t / APR_USEC_PER_SEC;
#else
apr_sleep(t);
#endif
-
+#endif
}