change low res sleep func api names

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11486 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2009-01-25 21:23:07 +00:00
parent 1973ee74bc
commit 0463541d61
49 changed files with 180 additions and 180 deletions

View File

@@ -42,7 +42,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_sleep(switch_core_session_t *session,
{
switch_channel_t *channel = switch_core_session_get_channel(session);
switch_status_t status = SWITCH_STATUS_SUCCESS;
switch_time_t start = switch_timestamp_now(), now, done = switch_timestamp_now() + (ms * 1000);
switch_time_t start = switch_micro_time_now(), now, done = switch_micro_time_now() + (ms * 1000);
switch_frame_t *read_frame, cng_frame = { 0 };
int32_t left, elapsed;
char data[2] = "";
@@ -114,7 +114,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_sleep(switch_core_session_t *session,
}
for (;;) {
now = switch_timestamp_now();
now = switch_micro_time_now();
elapsed = (int32_t) ((now - start) / 1000);
left = ms - elapsed;
@@ -452,9 +452,9 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_parse_event(switch_core_session_t *se
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s Command Execute %s(%s)\n",
switch_channel_get_name(channel), app_name, switch_str_nil(app_arg));
b4 = switch_timestamp_now();
b4 = switch_micro_time_now();
switch_core_session_exec(session, application_interface, app_arg);
aftr = switch_timestamp_now();
aftr = switch_micro_time_now();
if (!switch_channel_ready(channel) || switch_channel_test_flag(channel, CF_STOP_BROADCAST) || aftr - b4 < 500000) {
break;
}
@@ -593,7 +593,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_park(switch_core_session_t *session,
if ((timeout = atoi(to)) < 0) {
timeout = 0;
} else {
expires = switch_timestamp(NULL) + timeout;
expires = switch_epoch_time_now(NULL) + timeout;
}
}
@@ -610,7 +610,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_park(switch_core_session_t *session,
break;
}
if (expires && switch_timestamp(NULL) >= expires) {
if (expires && switch_epoch_time_now(NULL) >= expires) {
switch_channel_hangup(channel, SWITCH_CAUSE_RECOVERY_ON_TIMER_EXPIRE);
break;
}
@@ -733,7 +733,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_collect_digits_callback(switch_core_s
}
if (timeout) {
started = switch_timestamp_now();
started = switch_micro_time_now();
}
while (switch_channel_ready(channel)) {
@@ -748,7 +748,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_collect_digits_callback(switch_core_s
}
if (timeout) {
elapsed = (uint32_t) ((switch_timestamp_now() - started) / 1000);
elapsed = (uint32_t) ((switch_micro_time_now() - started) / 1000);
if (elapsed >= timeout) {
break;
}
@@ -855,7 +855,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_collect_digits_count(switch_core_sess
}
if (abs_timeout) {
started = switch_timestamp_now();
started = switch_micro_time_now();
}
if (digit_timeout && first_timeout) {
@@ -868,14 +868,14 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_collect_digits_count(switch_core_sess
if (eff_timeout) {
digit_started = switch_timestamp_now();
digit_started = switch_micro_time_now();
}
while (switch_channel_ready(channel)) {
switch_frame_t *read_frame;
if (abs_timeout) {
abs_elapsed = (uint32_t) ((switch_timestamp_now() - started) / 1000);
abs_elapsed = (uint32_t) ((switch_micro_time_now() - started) / 1000);
if (abs_elapsed >= abs_timeout) {
break;
}
@@ -887,7 +887,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_collect_digits_count(switch_core_sess
if (eff_timeout) {
digit_elapsed = (uint32_t) ((switch_timestamp_now() - digit_started) / 1000);
digit_elapsed = (uint32_t) ((switch_micro_time_now() - digit_started) / 1000);
if (digit_elapsed >= eff_timeout) {
status = SWITCH_STATUS_TIMEOUT;
break;
@@ -900,7 +900,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_collect_digits_count(switch_core_sess
if (eff_timeout) {
eff_timeout = digit_timeout;
digit_started = switch_timestamp_now();
digit_started = switch_micro_time_now();
}
for (y = 0; y <= maxdigits; y++) {
@@ -1476,12 +1476,12 @@ SWITCH_DECLARE(void *) switch_ivr_digit_stream_parser_feed(switch_ivr_digit_stre
stream->digits = tmp;
*(stream->digits + (len++)) = digit;
*(stream->digits + len) = '\0';
stream->last_digit_time = switch_timestamp_now() / 1000;
stream->last_digit_time = switch_micro_time_now() / 1000;
}
}
}
/* don't allow collected digit string testing if there are varying sized keys until timeout */
if (parser->maxlen - parser->minlen > 0 && (switch_timestamp_now() / 1000) - stream->last_digit_time < parser->digit_timeout_ms) {
if (parser->maxlen - parser->minlen > 0 && (switch_micro_time_now() / 1000) - stream->last_digit_time < parser->digit_timeout_ms) {
len = 0;
}
/* if we have digits to test */