mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-29 22:54:18 +00:00
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:
1 parent
1973ee74bc
commit
0463541d61
49 files changed
+180
-180
No files matched your search
@@ -1384,13 +1384,13 @@ SWITCH_STANDARD_API(tone_detect_session_function)
|
||||
uint32_t mto;
|
||||
if (*argv[4] == '+') {
|
||||
if ((mto = atoi(argv[4] + 1)) > 0) {
|
||||
to = switch_timestamp(NULL) + mto;
|
||||
to = switch_epoch_time_now(NULL) + mto;
|
||||
} else {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "INVALID Timeout!\n");
|
||||
goto done;
|
||||
}
|
||||
} else {
|
||||
if ((to = atoi(argv[4])) < switch_timestamp(NULL)) {
|
||||
if ((to = atoi(argv[4])) < switch_epoch_time_now(NULL)) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "INVALID Timeout!\n");
|
||||
to = 0;
|
||||
goto done;
|
||||
@@ -1520,7 +1520,7 @@ SWITCH_STANDARD_API(sched_transfer_function)
|
||||
time_t when;
|
||||
|
||||
if (*argv[0] == '+') {
|
||||
when = switch_timestamp(NULL) + atol(argv[0] + 1);
|
||||
when = switch_epoch_time_now(NULL) + atol(argv[0] + 1);
|
||||
} else {
|
||||
when = atol(argv[0]);
|
||||
}
|
||||
@@ -1558,7 +1558,7 @@ SWITCH_STANDARD_API(sched_hangup_function)
|
||||
switch_call_cause_t cause = SWITCH_CAUSE_ALLOTTED_TIMEOUT;
|
||||
|
||||
if (*argv[0] == '+') {
|
||||
when = switch_timestamp(NULL) + atol(argv[0] + 1);
|
||||
when = switch_epoch_time_now(NULL) + atol(argv[0] + 1);
|
||||
} else {
|
||||
when = atol(argv[0]);
|
||||
}
|
||||
@@ -1665,7 +1665,7 @@ SWITCH_STANDARD_API(sched_broadcast_function)
|
||||
time_t when;
|
||||
|
||||
if (*argv[0] == '+') {
|
||||
when = switch_timestamp(NULL) + atol(argv[0] + 1);
|
||||
when = switch_epoch_time_now(NULL) + atol(argv[0] + 1);
|
||||
} else {
|
||||
when = atol(argv[0]);
|
||||
}
|
||||
@@ -2205,7 +2205,7 @@ static void sch_api_callback(switch_scheduler_task_t *task)
|
||||
switch_safe_free(cmd);
|
||||
|
||||
if (api_task->recur) {
|
||||
task->runtime = switch_timestamp(NULL) + api_task->recur;
|
||||
task->runtime = switch_epoch_time_now(NULL) + api_task->recur;
|
||||
}
|
||||
|
||||
|
||||
@@ -2252,10 +2252,10 @@ SWITCH_STANDARD_API(sched_api_function)
|
||||
|
||||
|
||||
if (*tm == '+') {
|
||||
when = switch_timestamp(NULL) + atol(tm + 1);
|
||||
when = switch_epoch_time_now(NULL) + atol(tm + 1);
|
||||
} else if (*tm == '@') {
|
||||
recur = (uint32_t) atol(tm + 1);
|
||||
when = switch_timestamp(NULL) + recur;
|
||||
when = switch_epoch_time_now(NULL) + recur;
|
||||
} else {
|
||||
when = atol(tm);
|
||||
}
|
||||
|
||||
@@ -473,7 +473,7 @@ SWITCH_STANDARD_APP(sched_transfer_function)
|
||||
time_t when;
|
||||
|
||||
if (*argv[0] == '+') {
|
||||
when = switch_timestamp(NULL) + atol(argv[0] + 1);
|
||||
when = switch_epoch_time_now(NULL) + atol(argv[0] + 1);
|
||||
} else {
|
||||
when = atol(argv[0]);
|
||||
}
|
||||
@@ -498,7 +498,7 @@ SWITCH_STANDARD_APP(sched_hangup_function)
|
||||
switch_bool_t bleg = SWITCH_FALSE;
|
||||
|
||||
if (*argv[0] == '+') {
|
||||
when = switch_timestamp(NULL) + atol(argv[0] + 1);
|
||||
when = switch_epoch_time_now(NULL) + atol(argv[0] + 1);
|
||||
} else {
|
||||
when = atol(argv[0]);
|
||||
}
|
||||
@@ -530,7 +530,7 @@ SWITCH_STANDARD_APP(sched_broadcast_function)
|
||||
switch_media_flag_t flags = SMF_NONE;
|
||||
|
||||
if (*argv[0] == '+') {
|
||||
when = switch_timestamp(NULL) + atol(argv[0] + 1);
|
||||
when = switch_epoch_time_now(NULL) + atol(argv[0] + 1);
|
||||
} else {
|
||||
when = atol(argv[0]);
|
||||
}
|
||||
@@ -981,7 +981,7 @@ SWITCH_STANDARD_APP(strftime_function)
|
||||
switch_time_exp_t tm;
|
||||
char date[80] = "";
|
||||
|
||||
switch_time_exp_lt(&tm, switch_timestamp_now());
|
||||
switch_time_exp_lt(&tm, switch_micro_time_now());
|
||||
switch_strftime(date, &retsize, sizeof(date), argv[1], &tm);
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "SET [%s]=[%s]\n", argv[0], date);
|
||||
switch_channel_set_variable(switch_core_session_get_channel(session), argv[0], date);
|
||||
@@ -993,7 +993,7 @@ SWITCH_STANDARD_API(strepoch_api_function)
|
||||
switch_time_t out;
|
||||
|
||||
if (switch_strlen_zero(cmd)) {
|
||||
out = switch_timestamp_now();
|
||||
out = switch_micro_time_now();
|
||||
} else {
|
||||
out = switch_str_time(cmd);
|
||||
}
|
||||
@@ -1014,7 +1014,7 @@ SWITCH_STANDARD_API(strftime_api_function)
|
||||
thetime = switch_time_make(atoi(cmd), 0);
|
||||
cmd = p + 1;
|
||||
} else {
|
||||
thetime = switch_timestamp_now();
|
||||
thetime = switch_micro_time_now();
|
||||
}
|
||||
switch_time_exp_lt(&tm, thetime);
|
||||
if (switch_strlen_zero(cmd)) {
|
||||
@@ -1207,12 +1207,12 @@ SWITCH_STANDARD_APP(tone_detect_session_function)
|
||||
uint32_t mto;
|
||||
if (*argv[3] == '+') {
|
||||
if ((mto = atol(argv[3] + 1)) > 0) {
|
||||
to = switch_timestamp(NULL) + mto;
|
||||
to = switch_epoch_time_now(NULL) + mto;
|
||||
} else {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "INVALID Timeout!\n");
|
||||
}
|
||||
} else {
|
||||
if ((to = atol(argv[3])) < switch_timestamp(NULL)) {
|
||||
if ((to = atol(argv[3])) < switch_epoch_time_now(NULL)) {
|
||||
if (to >= 1) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "INVALID Timeout!\n");
|
||||
}
|
||||
|
||||
@@ -531,7 +531,7 @@ static switch_status_t enum_lookup(char *root, char *in, enum_record_t **results
|
||||
tv.tv_sec = i;
|
||||
tv.tv_usec = 0;
|
||||
i = select((int) (fd + 1), &fds, 0, 0, &tv);
|
||||
now = switch_timestamp(NULL);
|
||||
now = switch_epoch_time_now(NULL);
|
||||
if (i > 0) {
|
||||
dns_ioevent(nctx, now);
|
||||
}
|
||||
|
||||
@@ -205,7 +205,7 @@ SWITCH_STANDARD_APP(bcast_function)
|
||||
}
|
||||
}
|
||||
|
||||
control_packet.unique_id = htonl((u_long) switch_timestamp(NULL));
|
||||
control_packet.unique_id = htonl((u_long) switch_epoch_time_now(NULL));
|
||||
control_packet.command = htonl(LS_START_BCAST);
|
||||
control_packet.ip = inet_addr(mcast_ip);
|
||||
control_packet.port = htonl(mcast_port);
|
||||
@@ -233,7 +233,7 @@ SWITCH_STANDARD_APP(bcast_function)
|
||||
}
|
||||
}
|
||||
|
||||
control_packet.unique_id = htonl((u_long) switch_timestamp(NULL));
|
||||
control_packet.unique_id = htonl((u_long) switch_epoch_time_now(NULL));
|
||||
control_packet.command = htonl(LS_STOP_BCAST);
|
||||
bytes = 8;
|
||||
switch_socket_sendto(socket, control_packet_addr, 0, (void *) &control_packet, &bytes);
|
||||
|
||||
@@ -195,7 +195,7 @@ static switch_status_t caller_read_frame_callback(switch_core_session_t *session
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
if (cd->total && switch_timestamp(NULL) >= cd->next) {
|
||||
if (cd->total && switch_epoch_time_now(NULL) >= cd->next) {
|
||||
if (cd->index == MAX_CHIME || cd->index == cd->total || !cd->list[cd->index]) {
|
||||
cd->index = 0;
|
||||
}
|
||||
@@ -213,10 +213,10 @@ static switch_status_t caller_read_frame_callback(switch_core_session_t *session
|
||||
cd->abort = 1;
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
cd->next = switch_timestamp(NULL) + cd->freq;
|
||||
cd->next = switch_epoch_time_now(NULL) + cd->freq;
|
||||
cd->index++;
|
||||
}
|
||||
} else if (cd->orbit_timeout && switch_timestamp(NULL) >= cd->orbit_timeout) {
|
||||
} else if (cd->orbit_timeout && switch_epoch_time_now(NULL) >= cd->orbit_timeout) {
|
||||
cd->do_orbit = 1;
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
@@ -418,7 +418,7 @@ static switch_status_t hanguphook(switch_core_session_t *session)
|
||||
if (state == CS_HANGUP || state == CS_ROUTING) {
|
||||
if ((uuid = switch_channel_get_variable(channel, "fifo_outbound_uuid"))) {
|
||||
switch_snprintf(sql, sizeof(sql), "update fifo_outbound set use_count=use_count-1, outbound_call_count=outbound_call_count+1, next_avail=%ld + lag where uuid='%s'",
|
||||
(long)switch_timestamp(NULL), uuid);
|
||||
(long)switch_epoch_time_now(NULL), uuid);
|
||||
|
||||
fifo_execute_sql(sql, globals.sql_mutex);
|
||||
}
|
||||
@@ -451,7 +451,7 @@ static void *SWITCH_THREAD_FUNC o_thread_run(switch_thread_t *thread, void *obj)
|
||||
|
||||
if (switch_ivr_originate(NULL, &session, &cause, h->originate_string, h->timeout, NULL, NULL, NULL, NULL, NULL, SOF_NONE) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_snprintf(sql, sizeof(sql), "update fifo_outbound set use_count=use_count-1, outbound_fail_count=outbound_fail_count+1, next_avail=%ld + lag where uuid='%s'",
|
||||
(long)switch_timestamp(NULL), h->uuid);
|
||||
(long)switch_epoch_time_now(NULL), h->uuid);
|
||||
fifo_execute_sql(sql, globals.sql_mutex);
|
||||
goto end;
|
||||
}
|
||||
@@ -512,7 +512,7 @@ static void find_consumers(fifo_node_t *node)
|
||||
sql = switch_mprintf("select uuid, fifo_name, originate_string, simo_count, use_count, timeout, lag, "
|
||||
"next_avail, expires, static, outbound_call_count, outbound_fail_count, hostname "
|
||||
"from fifo_outbound where (use_count < simo_count) and (next_avail = 0 or next_avail <= %ld) order by outbound_call_count",
|
||||
(long) switch_timestamp(NULL));
|
||||
(long) switch_epoch_time_now(NULL));
|
||||
switch_assert(sql);
|
||||
fifo_execute_sql_callback(globals.sql_mutex, sql, place_call_callback, &need);
|
||||
free(sql);
|
||||
@@ -668,7 +668,7 @@ SWITCH_STANDARD_APP(fifo_function)
|
||||
switch_event_t *event = NULL;
|
||||
char date[80] = "";
|
||||
switch_time_exp_t tm;
|
||||
switch_time_t ts = switch_timestamp_now();
|
||||
switch_time_t ts = switch_micro_time_now();
|
||||
switch_size_t retsize;
|
||||
char *list_string;
|
||||
int nlist_count;
|
||||
@@ -796,7 +796,7 @@ SWITCH_STANDARD_APP(fifo_function)
|
||||
to = 60;
|
||||
}
|
||||
}
|
||||
cd.orbit_timeout = switch_timestamp(NULL) + to;
|
||||
cd.orbit_timeout = switch_epoch_time_now(NULL) + to;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -823,7 +823,7 @@ SWITCH_STANDARD_APP(fifo_function)
|
||||
}
|
||||
|
||||
if (!node_consumer_wait_count(node)) {
|
||||
node->start_waiting = switch_timestamp_now();
|
||||
node->start_waiting = switch_micro_time_now();
|
||||
}
|
||||
|
||||
if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, FIFO_EVENT) == SWITCH_STATUS_SUCCESS) {
|
||||
@@ -843,7 +843,7 @@ SWITCH_STANDARD_APP(fifo_function)
|
||||
|
||||
switch_mutex_unlock(node->mutex);
|
||||
|
||||
ts = switch_timestamp_now();
|
||||
ts = switch_micro_time_now();
|
||||
switch_time_exp_lt(&tm, ts);
|
||||
switch_strftime_nocheck(date, &retsize, sizeof(date), "%Y-%m-%d %T", &tm);
|
||||
switch_channel_set_variable(channel, "fifo_status", "WAITING");
|
||||
@@ -856,7 +856,7 @@ SWITCH_STANDARD_APP(fifo_function)
|
||||
char *list_dup = switch_core_session_strdup(session, chime_list);
|
||||
cd.total = switch_separate_string(list_dup, ',', cd.list, (sizeof(cd.list) / sizeof(cd.list[0])));
|
||||
cd.freq = freq;
|
||||
cd.next = switch_timestamp(NULL) + cd.freq;
|
||||
cd.next = switch_epoch_time_now(NULL) + cd.freq;
|
||||
}
|
||||
|
||||
send_presence(node);
|
||||
@@ -930,7 +930,7 @@ SWITCH_STANDARD_APP(fifo_function)
|
||||
switch_channel_set_state(channel, CS_HIBERNATE);
|
||||
goto done;
|
||||
} else {
|
||||
ts = switch_timestamp_now();
|
||||
ts = switch_micro_time_now();
|
||||
switch_time_exp_lt(&tm, ts);
|
||||
switch_strftime_nocheck(date, &retsize, sizeof(date), "%Y-%m-%d %T", &tm);
|
||||
switch_channel_set_variable(channel, "fifo_status", cd.do_orbit ? "TIMEOUT" : "ABORTED");
|
||||
@@ -1027,7 +1027,7 @@ SWITCH_STANDARD_APP(fifo_function)
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
|
||||
ts = switch_timestamp_now();
|
||||
ts = switch_micro_time_now();
|
||||
switch_time_exp_lt(&tm, ts);
|
||||
switch_strftime_nocheck(date, &retsize, sizeof(date), "%Y-%m-%d %T", &tm);
|
||||
switch_channel_set_variable(channel, "fifo_status", "WAITING");
|
||||
@@ -1220,7 +1220,7 @@ SWITCH_STANDARD_APP(fifo_function)
|
||||
switch_assert(cloned_profile->next == NULL);
|
||||
switch_channel_set_originatee_caller_profile(channel, cloned_profile);
|
||||
|
||||
ts = switch_timestamp_now();
|
||||
ts = switch_micro_time_now();
|
||||
switch_time_exp_lt(&tm, ts);
|
||||
switch_strftime_nocheck(date, &retsize, sizeof(date), "%Y-%m-%d %T", &tm);
|
||||
switch_channel_set_variable(channel, "fifo_status", "TALKING");
|
||||
@@ -1251,7 +1251,7 @@ SWITCH_STANDARD_APP(fifo_function)
|
||||
}
|
||||
}
|
||||
|
||||
ts = switch_timestamp_now();
|
||||
ts = switch_micro_time_now();
|
||||
switch_time_exp_lt(&tm, ts);
|
||||
switch_strftime_nocheck(date, &retsize, sizeof(date), "%Y-%m-%d %T", &tm);
|
||||
switch_channel_set_variable(channel, "fifo_status", "WAITING");
|
||||
@@ -1300,7 +1300,7 @@ SWITCH_STANDARD_APP(fifo_function)
|
||||
}
|
||||
|
||||
if (fifo_consumer_wrapup_time) {
|
||||
wrapup_time_started = switch_timestamp_now();
|
||||
wrapup_time_started = switch_micro_time_now();
|
||||
}
|
||||
|
||||
if (!switch_strlen_zero(fifo_consumer_wrapup_key) && strcmp(buf, fifo_consumer_wrapup_key)) {
|
||||
@@ -1308,7 +1308,7 @@ SWITCH_STANDARD_APP(fifo_function)
|
||||
char terminator = 0;
|
||||
|
||||
if (fifo_consumer_wrapup_time) {
|
||||
wrapup_time_elapsed = (switch_timestamp_now() - wrapup_time_started) / 1000;
|
||||
wrapup_time_elapsed = (switch_micro_time_now() - wrapup_time_started) / 1000;
|
||||
if (wrapup_time_elapsed > fifo_consumer_wrapup_time) {
|
||||
break;
|
||||
} else {
|
||||
@@ -1324,7 +1324,7 @@ SWITCH_STANDARD_APP(fifo_function)
|
||||
}
|
||||
} else if (fifo_consumer_wrapup_time && (switch_strlen_zero(fifo_consumer_wrapup_key) || !strcmp(buf, fifo_consumer_wrapup_key))) {
|
||||
while(switch_channel_ready(channel)) {
|
||||
wrapup_time_elapsed = (switch_timestamp_now() - wrapup_time_started) / 1000;
|
||||
wrapup_time_elapsed = (switch_micro_time_now() - wrapup_time_started) / 1000;
|
||||
if (wrapup_time_elapsed > fifo_consumer_wrapup_time) {
|
||||
break;
|
||||
}
|
||||
@@ -1949,7 +1949,7 @@ SWITCH_STANDARD_API(fifo_member_api_function)
|
||||
lag = atoi(argv[5]);
|
||||
}
|
||||
if (argc > 6) {
|
||||
expires = switch_timestamp(NULL) + atoi(argv[6]);
|
||||
expires = switch_epoch_time_now(NULL) + atoi(argv[6]);
|
||||
}
|
||||
if (simo_count < 0) {
|
||||
simo_count = 1;
|
||||
|
||||
@@ -140,7 +140,7 @@ SWITCH_STANDARD_APP(record_fsv_function)
|
||||
vid_codec = switch_core_session_get_video_read_codec(session);
|
||||
|
||||
h.version = VERSION;
|
||||
h.created = switch_timestamp_now();
|
||||
h.created = switch_micro_time_now();
|
||||
switch_set_string(h.video_codec_name, vid_codec->implementation->iananame);
|
||||
if (vid_codec->fmtp_in) {
|
||||
switch_set_string(h.video_fmtp, vid_codec->fmtp_in);
|
||||
|
||||
@@ -811,7 +811,7 @@ SWITCH_STANDARD_APP(limit_hash_function)
|
||||
char *szinterval = NULL;
|
||||
limit_hash_item_t *item = NULL;
|
||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||
time_t now = switch_timestamp(NULL);
|
||||
time_t now = switch_epoch_time_now(NULL);
|
||||
switch_hash_t *channel_hash = NULL;
|
||||
uint8_t increment = 1;
|
||||
uint8_t new_channel = 0;
|
||||
|
||||
@@ -478,7 +478,7 @@ SWITCH_STANDARD_APP(rss_function)
|
||||
switch_size_t retsize;
|
||||
char dtmf[5] = "";
|
||||
|
||||
switch_time_exp_lt(&tm, switch_timestamp_now());
|
||||
switch_time_exp_lt(&tm, switch_micro_time_now());
|
||||
switch_strftime_nocheck(date, &retsize, sizeof(date), "%I:%M %p", &tm);
|
||||
|
||||
|
||||
|
||||
@@ -1767,7 +1767,7 @@ static void voicemail_check_main(switch_core_session_t *session, const char *pro
|
||||
}
|
||||
}
|
||||
switch_snprintf(sql, sizeof(sql), "update voicemail_msgs set read_epoch=%ld where username='%s' and domain='%s' and flags='save'",
|
||||
(long) switch_timestamp(NULL), myid, domain_name);
|
||||
(long) switch_epoch_time_now(NULL), myid, domain_name);
|
||||
vm_execute_sql(profile, sql, profile->mutex);
|
||||
switch_snprintf(sql, sizeof(sql), "select file_path from voicemail_msgs where username='%s' and domain='%s' and flags='delete'", myid,
|
||||
domain_name);
|
||||
@@ -2309,11 +2309,11 @@ static switch_status_t deliver_vm(vm_profile_t *profile,
|
||||
switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "VM-Flags", read_flags);
|
||||
switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "VM-Folder", myfolder);
|
||||
switch_event_add_header(message_event, SWITCH_STACK_BOTTOM, "VM-Message-Len", "%u", message_len);
|
||||
switch_event_add_header(message_event, SWITCH_STACK_BOTTOM, "VM-Timestamp", "%lu", (unsigned long) switch_timestamp(NULL));
|
||||
switch_event_add_header(message_event, SWITCH_STACK_BOTTOM, "VM-Timestamp", "%lu", (unsigned long) switch_epoch_time_now(NULL));
|
||||
|
||||
switch_event_fire(&message_event);
|
||||
|
||||
usql = switch_mprintf("insert into voicemail_msgs values(%ld,0,'%q','%q','%q','%q','%q','%q','%q','%u','','%q')", (long) switch_timestamp(NULL),
|
||||
usql = switch_mprintf("insert into voicemail_msgs values(%ld,0,'%q','%q','%q','%q','%q','%q','%q','%u','','%q')", (long) switch_epoch_time_now(NULL),
|
||||
myid, domain_name, uuid_str, caller_id_name, caller_id_number,
|
||||
myfolder, file_path, message_len, read_flags);
|
||||
|
||||
@@ -2346,7 +2346,7 @@ static switch_status_t deliver_vm(vm_profile_t *profile,
|
||||
&total_new_urgent_messages, &total_saved_urgent_messages);
|
||||
|
||||
if (switch_strlen_zero(vm_timezone) || (switch_strftime_tz(vm_timezone, profile->date_fmt, date, sizeof(date), 0) != SWITCH_STATUS_SUCCESS)) {
|
||||
switch_time_exp_lt(&tm, switch_timestamp_now());
|
||||
switch_time_exp_lt(&tm, switch_micro_time_now());
|
||||
switch_strftime(date, &retsize, sizeof(date), profile->date_fmt, &tm);
|
||||
}
|
||||
|
||||
@@ -2696,7 +2696,7 @@ static switch_status_t voicemail_leave_main(switch_core_session_t *session, cons
|
||||
switch_time_exp_t tm;
|
||||
char date[80] = "";
|
||||
switch_size_t retsize;
|
||||
switch_time_t ts = switch_timestamp_now();
|
||||
switch_time_t ts = switch_micro_time_now();
|
||||
char *dbuf = NULL;
|
||||
char *vm_storage_dir = NULL;
|
||||
char *record_macro = VM_RECORD_MESSAGE_MACRO;
|
||||
@@ -3271,7 +3271,7 @@ static void do_play(vm_profile_t *profile, char *user, char *domain, char *file,
|
||||
struct holder holder;
|
||||
|
||||
sql = switch_mprintf("update voicemail_msgs set read_epoch=%ld where username='%s' and domain='%s' and file_path like '%%%s'",
|
||||
(long) switch_timestamp(NULL), user, domain, file);
|
||||
(long) switch_epoch_time_now(NULL), user, domain, file);
|
||||
|
||||
vm_execute_sql(profile, sql, profile->mutex);
|
||||
free(sql);
|
||||
|
||||
@@ -180,7 +180,7 @@ static switch_status_t channel_on_init(switch_core_session_t *session)
|
||||
assert(channel != NULL);
|
||||
|
||||
|
||||
last = switch_timestamp_now() - waitsec;
|
||||
last = switch_micro_time_now() - waitsec;
|
||||
|
||||
|
||||
|
||||
@@ -243,7 +243,7 @@ static switch_status_t channel_on_init(switch_core_session_t *session)
|
||||
switch_channel_mark_ring_ready(channel);
|
||||
|
||||
while (switch_channel_get_state(channel) == CS_INIT && !switch_test_flag(tech_pvt, TFLAG_ANSWER)) {
|
||||
if (switch_timestamp_now() - last >= waitsec) {
|
||||
if (switch_micro_time_now() - last >= waitsec) {
|
||||
char buf[512];
|
||||
switch_event_t *event;
|
||||
|
||||
@@ -257,7 +257,7 @@ static switch_status_t channel_on_init(switch_core_session_t *session)
|
||||
}
|
||||
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s\n", buf);
|
||||
last = switch_timestamp_now();
|
||||
last = switch_micro_time_now();
|
||||
if (ring_file) {
|
||||
unsigned int pos = 0;
|
||||
switch_core_file_seek(&fh, &pos, 0, SEEK_SET);
|
||||
|
||||
@@ -1070,7 +1070,7 @@ static switch_status_t negotiate_media(switch_core_session_t *session)
|
||||
|
||||
switch_set_flag_locked(tech_pvt, TFLAG_IO);
|
||||
|
||||
started = switch_timestamp_now();
|
||||
started = switch_micro_time_now();
|
||||
|
||||
/* jingle has no ringing indication so we will just pretend that we got one */
|
||||
switch_core_session_queue_indication(session, SWITCH_MESSAGE_INDICATE_RINGING);
|
||||
@@ -1088,7 +1088,7 @@ static switch_status_t negotiate_media(switch_core_session_t *session)
|
||||
switch_test_flag(tech_pvt, TFLAG_RTP_READY) &&
|
||||
switch_test_flag(tech_pvt, TFLAG_ANSWER) && switch_test_flag(tech_pvt, TFLAG_TRANSPORT_ACCEPT) &&
|
||||
tech_pvt->remote_ip && tech_pvt->remote_port && switch_test_flag(tech_pvt, TFLAG_TRANSPORT))) {
|
||||
now = switch_timestamp_now();
|
||||
now = switch_micro_time_now();
|
||||
elapsed = (unsigned int) ((now - started) / 1000);
|
||||
|
||||
if (switch_channel_get_state(channel) >= CS_HANGUP || switch_test_flag(tech_pvt, TFLAG_BYE)) {
|
||||
@@ -1340,7 +1340,7 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch
|
||||
|
||||
#if 0
|
||||
if (tech_pvt->last_read) {
|
||||
elapsed = (unsigned int) ((switch_timestamp_now() - tech_pvt->last_read) / 1000);
|
||||
elapsed = (unsigned int) ((switch_micro_time_now() - tech_pvt->last_read) / 1000);
|
||||
if (elapsed > 60000) {
|
||||
return SWITCH_STATUS_TIMEOUT;
|
||||
}
|
||||
@@ -1368,7 +1368,7 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch
|
||||
payload = tech_pvt->read_frame.payload;
|
||||
|
||||
#if 0
|
||||
elapsed = (unsigned int) ((switch_timestamp_now() - started) / 1000);
|
||||
elapsed = (unsigned int) ((switch_micro_time_now() - started) / 1000);
|
||||
|
||||
if (timeout > -1) {
|
||||
if (elapsed >= (unsigned int) timeout) {
|
||||
@@ -1376,7 +1376,7 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch
|
||||
}
|
||||
}
|
||||
|
||||
elapsed = (unsigned int) ((switch_timestamp_now() - last_act) / 1000);
|
||||
elapsed = (unsigned int) ((switch_micro_time_now() - last_act) / 1000);
|
||||
if (elapsed >= hard_timeout) {
|
||||
return SWITCH_STATUS_BREAK;
|
||||
}
|
||||
|
||||
@@ -182,7 +182,7 @@ static switch_status_t channel_on_init(switch_core_session_t *session)
|
||||
|
||||
switch_assert(tech_pvt != NULL);
|
||||
|
||||
last = switch_timestamp_now() - waitsec;
|
||||
last = switch_micro_time_now() - waitsec;
|
||||
|
||||
if ((val = switch_channel_get_variable(channel, "pa_hold_file"))) {
|
||||
hold_file = val;
|
||||
@@ -251,7 +251,7 @@ static switch_status_t channel_on_init(switch_core_session_t *session)
|
||||
while (switch_channel_get_state(channel) == CS_INIT && !switch_test_flag(tech_pvt, TFLAG_ANSWER)) {
|
||||
switch_size_t olen = globals.timer.samples;
|
||||
|
||||
if (switch_timestamp_now() - last >= waitsec) {
|
||||
if (switch_micro_time_now() - last >= waitsec) {
|
||||
char buf[512];
|
||||
switch_event_t *event;
|
||||
|
||||
@@ -264,7 +264,7 @@ static switch_status_t channel_on_init(switch_core_session_t *session)
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s\n", buf);
|
||||
last = switch_timestamp_now();
|
||||
last = switch_micro_time_now();
|
||||
}
|
||||
|
||||
if (ring_file) {
|
||||
@@ -449,7 +449,7 @@ static void remove_pvt(private_t *tech_pvt)
|
||||
if (globals.call_list) {
|
||||
switch_set_flag_locked(globals.call_list, TFLAG_MASTER);
|
||||
} else {
|
||||
globals.deactivate_timer = switch_timestamp(NULL) + 2;
|
||||
globals.deactivate_timer = switch_epoch_time_now(NULL) + 2;
|
||||
deactivate_audio_device();
|
||||
}
|
||||
|
||||
@@ -1259,7 +1259,7 @@ static switch_status_t engage_device(int restart)
|
||||
int codec_ms = globals.codec_ms;
|
||||
|
||||
switch_mutex_lock(globals.device_lock);
|
||||
while (globals.deactivate_timer > switch_timestamp(NULL)) {
|
||||
while (globals.deactivate_timer > switch_epoch_time_now(NULL)) {
|
||||
switch_yield(1000000);
|
||||
}
|
||||
switch_mutex_unlock(globals.device_lock);
|
||||
|
||||
@@ -1650,7 +1650,7 @@ static switch_status_t cmd_status(char **argv, int argc, switch_stream_handle_t
|
||||
switch_assert(gp->state < REG_STATE_LAST);
|
||||
stream->write_function(stream, "%25s\t%s\t %32s\t%s", gp->name, "gateway", gp->register_to, sofia_state_names[gp->state]);
|
||||
if (gp->state == REG_STATE_FAILED || gp->state == REG_STATE_TRYING) {
|
||||
time_t now = switch_timestamp(NULL);
|
||||
time_t now = switch_epoch_time_now(NULL);
|
||||
if (gp->retry > now) {
|
||||
stream->write_function(stream, " (retry: %ds)", gp->retry - now);
|
||||
} else {
|
||||
@@ -1842,7 +1842,7 @@ static switch_status_t cmd_xml_status(char **argv, int argc, switch_stream_handl
|
||||
switch_assert(gp->state < REG_STATE_LAST);
|
||||
stream->write_function(stream, "<gateway>\n<Name>%s</Name>\n<Type>%s</Type>\n<Data>%s</Data>\n<State>%s</State>\n</gateway>\n", gp->name, "gateway", gp->register_to, sofia_state_names[gp->state]);
|
||||
if (gp->state == REG_STATE_FAILED || gp->state == REG_STATE_TRYING) {
|
||||
time_t now = switch_timestamp(NULL);
|
||||
time_t now = switch_epoch_time_now(NULL);
|
||||
if (gp->retry > now) {
|
||||
stream->write_function(stream, " (retry: %ds)", gp->retry - now);
|
||||
} else {
|
||||
@@ -2042,7 +2042,7 @@ static switch_status_t cmd_profile(char **argv, int argc, switch_stream_handle_t
|
||||
|
||||
if (!strcasecmp(argv[1], "stop") || !strcasecmp(argv[1], "restart")) {
|
||||
int rsec = 10;
|
||||
int diff = (int) (switch_timestamp(NULL) - profile->started);
|
||||
int diff = (int) (switch_epoch_time_now(NULL) - profile->started);
|
||||
int remain = rsec - diff;
|
||||
if (diff < rsec) {
|
||||
stream->write_function(stream, "Profile %s must be up for at least %d seconds to stop/restart.\nPlease wait %d second%s\n",
|
||||
|
||||
@@ -284,11 +284,11 @@ void sofia_handle_sip_r_message(int status, sofia_profile_t *profile, nua_handle
|
||||
|
||||
void sofia_wait_for_reply(struct private_object *tech_pvt, nua_event_t event, uint32_t timeout)
|
||||
{
|
||||
time_t exp = switch_timestamp(NULL) + timeout;
|
||||
time_t exp = switch_epoch_time_now(NULL) + timeout;
|
||||
|
||||
tech_pvt->want_event = event;
|
||||
|
||||
while(switch_channel_ready(tech_pvt->channel) && tech_pvt->want_event && switch_timestamp(NULL) < exp) {
|
||||
while(switch_channel_ready(tech_pvt->channel) && tech_pvt->want_event && switch_epoch_time_now(NULL) < exp) {
|
||||
switch_yield(100000);
|
||||
}
|
||||
|
||||
@@ -522,7 +522,7 @@ void event_handler(switch_event_t *event)
|
||||
char *rpid = switch_event_get_header(event, "orig-rpid");
|
||||
char *call_id = switch_event_get_header(event, "orig-call-id");
|
||||
char *user_agent = switch_event_get_header(event, "user-agent");
|
||||
long expires = (long) switch_timestamp(NULL);
|
||||
long expires = (long) switch_epoch_time_now(NULL);
|
||||
char *profile_name = switch_event_get_header(event, "orig-profile-name");
|
||||
char *to_user = switch_event_get_header(event, "orig-to-user");
|
||||
char *presence_hosts = switch_event_get_header(event, "presence-hosts");
|
||||
@@ -601,12 +601,12 @@ void *SWITCH_THREAD_FUNC sofia_profile_worker_thread_run(switch_thread_t *thread
|
||||
|
||||
if (++loops >= 100) {
|
||||
if (++ireg_loops >= IREG_SECONDS) {
|
||||
sofia_reg_check_expire(profile, switch_timestamp(NULL), 0);
|
||||
sofia_reg_check_expire(profile, switch_epoch_time_now(NULL), 0);
|
||||
ireg_loops = 0;
|
||||
}
|
||||
|
||||
if (++gateway_loops >= GATEWAY_SECONDS) {
|
||||
sofia_reg_check_gateway(profile, switch_timestamp(NULL));
|
||||
sofia_reg_check_gateway(profile, switch_epoch_time_now(NULL));
|
||||
gateway_loops = 0;
|
||||
}
|
||||
sofia_sub_check_gateway(profile, time(NULL));
|
||||
@@ -778,7 +778,7 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void
|
||||
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Starting thread for %s\n", profile->name);
|
||||
|
||||
profile->started = switch_timestamp(NULL);
|
||||
profile->started = switch_epoch_time_now(NULL);
|
||||
|
||||
sofia_set_pflag_locked(profile, PFLAG_RUNNING);
|
||||
launch_sofia_worker_thread(profile);
|
||||
@@ -1104,7 +1104,7 @@ static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_tag)
|
||||
if (ping_freq) {
|
||||
if (ping_freq >= 5) {
|
||||
gateway->ping_freq = ping_freq;
|
||||
gateway->ping = switch_timestamp(NULL) + ping_freq;
|
||||
gateway->ping = switch_epoch_time_now(NULL) + ping_freq;
|
||||
} else {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ERROR: invalid ping!\n");
|
||||
}
|
||||
@@ -2350,12 +2350,12 @@ static void sofia_handle_sip_r_options(switch_core_session_t *session, int statu
|
||||
gateway->state = REG_STATE_FAILED;
|
||||
}
|
||||
}
|
||||
gateway->ping = switch_timestamp(NULL) + gateway->ping_freq;
|
||||
gateway->ping = switch_epoch_time_now(NULL) + gateway->ping_freq;
|
||||
sofia_reg_release_gateway(gateway);
|
||||
gateway->pinging = 0;
|
||||
} else if ((profile->pflags & PFLAG_UNREG_OPTIONS_FAIL) && status != 200 && sip && sip->sip_to) {
|
||||
char *sql;
|
||||
time_t now = switch_timestamp(NULL);
|
||||
time_t now = switch_epoch_time_now(NULL);
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Expire registration '%s@%s' due to options failure\n",
|
||||
sip->sip_to->a_url->url_user, sip->sip_to->a_url->url_host);
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ void sofia_glue_set_image_sdp(private_object_t *tech_pvt, switch_t38_options_t *
|
||||
}
|
||||
|
||||
if (!tech_pvt->owner_id) {
|
||||
tech_pvt->owner_id = (uint32_t) switch_timestamp(NULL) - port;
|
||||
tech_pvt->owner_id = (uint32_t) switch_epoch_time_now(NULL) - port;
|
||||
}
|
||||
|
||||
if (!tech_pvt->session_id) {
|
||||
@@ -145,7 +145,7 @@ void sofia_glue_set_local_sdp(private_object_t *tech_pvt, const char *ip, uint32
|
||||
}
|
||||
|
||||
if (!tech_pvt->owner_id) {
|
||||
tech_pvt->owner_id = (uint32_t) switch_timestamp(NULL) - port;
|
||||
tech_pvt->owner_id = (uint32_t) switch_epoch_time_now(NULL) - port;
|
||||
}
|
||||
|
||||
if (!tech_pvt->session_id) {
|
||||
@@ -2902,7 +2902,7 @@ void sofia_glue_restart_all_profiles(void)
|
||||
switch_hash_this(hi, &var, NULL, &val);
|
||||
if ((pptr = (sofia_profile_t *) val)) {
|
||||
int rsec = 10;
|
||||
int diff = (int) (switch_timestamp(NULL) - pptr->started);
|
||||
int diff = (int) (switch_epoch_time_now(NULL) - pptr->started);
|
||||
int remain = rsec - diff;
|
||||
if (sofia_test_pflag(pptr, PFLAG_RESPAWN) || !sofia_test_pflag(pptr, PFLAG_RUNNING)) {
|
||||
continue;
|
||||
|
||||
@@ -946,7 +946,7 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char *
|
||||
char *open;
|
||||
char *prpid;
|
||||
const char *ct = "no/idea";
|
||||
time_t exptime = switch_timestamp(NULL) + 3600;
|
||||
time_t exptime = switch_epoch_time_now(NULL) + 3600;
|
||||
int is_dialog = 0;
|
||||
sofia_profile_t *ext_profile = NULL, *profile = helper->profile;
|
||||
char sstr[128] = "";
|
||||
@@ -990,7 +990,7 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char *
|
||||
if (expires) {
|
||||
long tmp = atol(expires);
|
||||
if (tmp > 0) {
|
||||
exptime = tmp - switch_timestamp(NULL) - SUB_OVERLAP;
|
||||
exptime = tmp - switch_epoch_time_now(NULL) - SUB_OVERLAP;
|
||||
} else {
|
||||
exptime = tmp;
|
||||
}
|
||||
@@ -1281,7 +1281,7 @@ static int sofia_presence_mwi_callback(void *pArg, int argc, char **argv, char *
|
||||
}
|
||||
|
||||
id = switch_mprintf("sip:%s@%s", sub_to_user, sub_to_host);
|
||||
expire_sec = (int) (expire_sec - switch_timestamp(NULL));
|
||||
expire_sec = (int) (expire_sec - switch_epoch_time_now(NULL));
|
||||
if (expire_sec < 0) {
|
||||
expire_sec = 3600;
|
||||
}
|
||||
@@ -1585,7 +1585,7 @@ void sofia_presence_handle_sip_i_subscribe(int status,
|
||||
exp_delta = profile->force_subscription_expires ? profile->force_subscription_expires : (sip->sip_expires ? sip->sip_expires->ex_delta : 3600);
|
||||
|
||||
if (exp_delta) {
|
||||
exp_abs = (long) switch_timestamp(NULL) + exp_delta;
|
||||
exp_abs = (long) switch_epoch_time_now(NULL) + exp_delta;
|
||||
} else {
|
||||
exp_abs = 0;
|
||||
sub_state = nua_substate_terminated;
|
||||
@@ -1859,7 +1859,7 @@ void sofia_presence_handle_sip_i_publish(nua_t *nua, sofia_profile_t *profile, n
|
||||
}
|
||||
|
||||
exp_delta = (sip->sip_expires ? sip->sip_expires->ex_delta : 3600);
|
||||
exp = (long) switch_timestamp(NULL) + exp_delta;
|
||||
exp = (long) switch_epoch_time_now(NULL) + exp_delta;
|
||||
|
||||
if ((sql =
|
||||
switch_mprintf("delete from sip_presence where sip_user='%q' and sip_host='%q' "
|
||||
|
||||
@@ -612,7 +612,7 @@ void sofia_reg_auth_challenge(nua_t *nua, sofia_profile_t *profile, nua_handle_t
|
||||
switch_uuid_format(uuid_str, &uuid);
|
||||
|
||||
sql = switch_mprintf("insert into sip_authentication (nonce,expires,profile_name,hostname) "
|
||||
"values('%q', %ld, '%q', '%q')", uuid_str, switch_timestamp(NULL) + profile->nonce_ttl, profile->name, mod_sofia_globals.hostname);
|
||||
"values('%q', %ld, '%q', '%q')", uuid_str, switch_epoch_time_now(NULL) + profile->nonce_ttl, profile->name, mod_sofia_globals.hostname);
|
||||
switch_assert(sql != NULL);
|
||||
sofia_glue_actually_execute_sql(profile, SWITCH_FALSE, sql, profile->ireg_mutex);
|
||||
switch_safe_free(sql);
|
||||
@@ -940,7 +940,7 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
|
||||
"(call_id,sip_user,sip_host,presence_hosts,contact,status,rpid,expires,user_agent,server_user,server_host,profile_name,hostname) "
|
||||
"values ('%q','%q', '%q','%q','%q','%q', '%q', %ld, '%q', '%q', '%q', '%q', '%q')",
|
||||
call_id, to_user, reg_host, profile->presence_hosts ? profile->presence_hosts : reg_host,
|
||||
contact_str, reg_desc, rpid, (long) switch_timestamp(NULL) + (long) exptime * 2,
|
||||
contact_str, reg_desc, rpid, (long) switch_epoch_time_now(NULL) + (long) exptime * 2,
|
||||
agent, from_user, guess_ip4, profile->name, mod_sofia_globals.hostname);
|
||||
|
||||
if (sql) {
|
||||
@@ -1091,7 +1091,7 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
|
||||
}
|
||||
}
|
||||
|
||||
switch_rfc822_date(date, switch_timestamp_now());
|
||||
switch_rfc822_date(date, switch_micro_time_now());
|
||||
nua_respond(nh, SIP_200_OK, SIPTAG_CONTACT(sip->sip_contact),
|
||||
TAG_IF(path_val, SIPTAG_PATH_STR(path_val)),
|
||||
NUTAG_WITH_THIS(nua),
|
||||
|
||||
@@ -99,7 +99,7 @@ static void do_rotate(cdr_fd_t *fd)
|
||||
fd->fd = -1;
|
||||
|
||||
if (globals.rotate) {
|
||||
switch_time_exp_lt(&tm, switch_timestamp_now());
|
||||
switch_time_exp_lt(&tm, switch_micro_time_now());
|
||||
switch_strftime_nocheck(date, &retsize, sizeof(date), "%Y-%m-%d-%H-%M-%S", &tm);
|
||||
|
||||
len = strlen(fd->path) + strlen(date) + 2;
|
||||
|
||||
@@ -196,7 +196,7 @@ static void event_handler(switch_event_t *event)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (switch_test_flag(l, LFLAG_STATEFUL) && l->timeout && switch_timestamp(NULL) - l->last_flush > l->timeout) {
|
||||
if (switch_test_flag(l, LFLAG_STATEFUL) && l->timeout && switch_epoch_time_now(NULL) - l->last_flush > l->timeout) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Stateful Listener %u has expired\n", l->id);
|
||||
remove_listener(l);
|
||||
expire_listener(&l);
|
||||
|
||||
@@ -231,7 +231,7 @@ static void event_handler(switch_event_t *event)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (switch_test_flag(l, LFLAG_STATEFUL) && l->timeout && switch_timestamp(NULL) - l->last_flush > l->timeout) {
|
||||
if (switch_test_flag(l, LFLAG_STATEFUL) && l->timeout && switch_epoch_time_now(NULL) - l->last_flush > l->timeout) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Stateful Listener %u has expired\n", l->id);
|
||||
remove_listener(l);
|
||||
expire_listener(&l);
|
||||
@@ -718,7 +718,7 @@ SWITCH_STANDARD_API(event_sink_function)
|
||||
switch_thread_rwlock_create(&listener->rwlock, listener->pool);
|
||||
listener->id = next_id();
|
||||
listener->timeout = 60;
|
||||
listener->last_flush = switch_timestamp(NULL);
|
||||
listener->last_flush = switch_epoch_time_now(NULL);
|
||||
|
||||
if (events) {
|
||||
char delim = ',';
|
||||
@@ -820,7 +820,7 @@ SWITCH_STANDARD_API(event_sink_function)
|
||||
goto end;
|
||||
}
|
||||
|
||||
listener->last_flush = switch_timestamp(NULL);
|
||||
listener->last_flush = switch_epoch_time_now(NULL);
|
||||
stream->write_function(stream, "<data>\n <reply type=\"success\">Current Events Follow</reply>\n");
|
||||
xmlize_listener(listener, stream);
|
||||
|
||||
@@ -963,7 +963,7 @@ static switch_status_t read_packet(listener_t *listener, switch_event_t **event,
|
||||
int clen = 0;
|
||||
|
||||
*event = NULL;
|
||||
start = switch_timestamp(NULL);
|
||||
start = switch_epoch_time_now(NULL);
|
||||
ptr = mbuf;
|
||||
|
||||
|
||||
@@ -1074,7 +1074,7 @@ static switch_status_t read_packet(listener_t *listener, switch_event_t **event,
|
||||
}
|
||||
|
||||
if (timeout) {
|
||||
elapsed = (uint32_t) (switch_timestamp(NULL) - start);
|
||||
elapsed = (uint32_t) (switch_epoch_time_now(NULL) - start);
|
||||
if (elapsed >= timeout) {
|
||||
switch_clear_flag_locked(listener, LFLAG_RUNNING);
|
||||
return SWITCH_STATUS_FALSE;
|
||||
|
||||
@@ -2118,7 +2118,7 @@ static JSBool session_wait_for_media(JSContext * cx, JSObject * obj, uintN argc,
|
||||
channel = switch_core_session_get_channel(jss->session);
|
||||
CHANNEL_MEDIA_SANITY_CHECK();
|
||||
|
||||
started = switch_timestamp_now();
|
||||
started = switch_micro_time_now();
|
||||
|
||||
if (argc > 0) {
|
||||
JS_ValueToInt32(cx, argv[0], &timeout);
|
||||
@@ -2132,7 +2132,7 @@ static JSBool session_wait_for_media(JSContext * cx, JSObject * obj, uintN argc,
|
||||
}
|
||||
saveDepth = JS_SuspendRequest(cx);
|
||||
for (;;) {
|
||||
if (((elapsed = (unsigned int) ((switch_timestamp_now() - started) / 1000)) > (switch_time_t) timeout)
|
||||
if (((elapsed = (unsigned int) ((switch_micro_time_now() - started) / 1000)) > (switch_time_t) timeout)
|
||||
|| switch_channel_get_state(channel) >= CS_HANGUP) {
|
||||
*rval = BOOLEAN_TO_JSVAL(JS_FALSE);
|
||||
break;
|
||||
@@ -2165,7 +2165,7 @@ static JSBool session_wait_for_answer(JSContext * cx, JSObject * obj, uintN argc
|
||||
METHOD_SANITY_CHECK();
|
||||
channel = switch_core_session_get_channel(jss->session);
|
||||
|
||||
started = switch_timestamp_now();
|
||||
started = switch_micro_time_now();
|
||||
|
||||
if (argc > 0) {
|
||||
JS_ValueToInt32(cx, argv[0], &timeout);
|
||||
@@ -2180,7 +2180,7 @@ static JSBool session_wait_for_answer(JSContext * cx, JSObject * obj, uintN argc
|
||||
|
||||
saveDepth = JS_SuspendRequest(cx);
|
||||
for (;;) {
|
||||
if (((elapsed = (unsigned int) ((switch_timestamp_now() - started) / 1000)) > (switch_time_t) timeout)
|
||||
if (((elapsed = (unsigned int) ((switch_micro_time_now() - started) / 1000)) > (switch_time_t) timeout)
|
||||
|| switch_channel_get_state(channel) >= CS_HANGUP) {
|
||||
*rval = BOOLEAN_TO_JSVAL(JS_FALSE);
|
||||
break;
|
||||
|
||||
@@ -124,7 +124,7 @@ static switch_status_t mod_logfile_rotate(logfile_profile_t *profile)
|
||||
|
||||
switch_mutex_lock(globals.mutex);
|
||||
|
||||
switch_time_exp_lt(&tm, switch_timestamp_now());
|
||||
switch_time_exp_lt(&tm, switch_micro_time_now());
|
||||
switch_strftime_nocheck(date, &retsize, sizeof(date), "%Y-%m-%d-%H-%M-%S", &tm);
|
||||
|
||||
profile->log_size = 0;
|
||||
|
||||
@@ -303,7 +303,7 @@ static switch_status_t de_say_time(switch_core_session_t *session, char *tosay,
|
||||
}
|
||||
} else {
|
||||
if ((seconds = atoi(tosay)) <= 0) {
|
||||
seconds = (int64_t) switch_timestamp(NULL);
|
||||
seconds = (int64_t) switch_epoch_time_now(NULL);
|
||||
}
|
||||
|
||||
if (seconds >= 60) {
|
||||
@@ -361,7 +361,7 @@ static switch_status_t de_say_time(switch_core_session_t *session, char *tosay,
|
||||
if ((t = atoi(tosay)) > 0) {
|
||||
target = switch_time_make(t, 0);
|
||||
} else {
|
||||
target = switch_timestamp_now();
|
||||
target = switch_micro_time_now();
|
||||
}
|
||||
switch_time_exp_lt(&tm, target);
|
||||
|
||||
|
||||
@@ -294,7 +294,7 @@ static switch_status_t en_say_time(switch_core_session_t *session, char *tosay,
|
||||
}
|
||||
} else {
|
||||
if ((seconds = atol(tosay)) <= 0) {
|
||||
seconds = (int64_t) switch_timestamp(NULL);
|
||||
seconds = (int64_t) switch_epoch_time_now(NULL);
|
||||
}
|
||||
|
||||
if (seconds >= 60) {
|
||||
@@ -352,7 +352,7 @@ static switch_status_t en_say_time(switch_core_session_t *session, char *tosay,
|
||||
if ((t = atol(tosay)) > 0) {
|
||||
target = switch_time_make(t, 0);
|
||||
} else {
|
||||
target = switch_timestamp_now();
|
||||
target = switch_micro_time_now();
|
||||
}
|
||||
|
||||
if (tz) {
|
||||
|
||||
@@ -292,7 +292,7 @@ static switch_status_t es_say_time(switch_core_session_t *session, char *tosay,
|
||||
}
|
||||
} else {
|
||||
if ((seconds = atoi(tosay)) <= 0) {
|
||||
seconds = (int64_t) switch_timestamp(NULL);
|
||||
seconds = (int64_t) switch_epoch_time_now(NULL);
|
||||
}
|
||||
|
||||
if (seconds >= 60) {
|
||||
@@ -350,7 +350,7 @@ static switch_status_t es_say_time(switch_core_session_t *session, char *tosay,
|
||||
if ((t = atoi(tosay)) > 0) {
|
||||
target = switch_time_make(t, 0);
|
||||
} else {
|
||||
target = switch_timestamp_now();
|
||||
target = switch_micro_time_now();
|
||||
}
|
||||
switch_time_exp_lt(&tm, target);
|
||||
|
||||
|
||||
@@ -292,7 +292,7 @@ static switch_status_t fr_say_time(switch_core_session_t *session, char *tosay,
|
||||
}
|
||||
} else {
|
||||
if ((seconds = atoi(tosay)) <= 0) {
|
||||
seconds = (int64_t) switch_timestamp(NULL);
|
||||
seconds = (int64_t) switch_epoch_time_now(NULL);
|
||||
}
|
||||
|
||||
if (seconds >= 60) {
|
||||
@@ -350,7 +350,7 @@ static switch_status_t fr_say_time(switch_core_session_t *session, char *tosay,
|
||||
if ((t = atoi(tosay)) > 0) {
|
||||
target = switch_time_make(t, 0);
|
||||
} else {
|
||||
target = switch_timestamp_now();
|
||||
target = switch_micro_time_now();
|
||||
}
|
||||
switch_time_exp_lt(&tm, target);
|
||||
|
||||
|
||||
@@ -292,7 +292,7 @@ static switch_status_t it_say_time(switch_core_session_t *session, char *tosay,
|
||||
}
|
||||
} else {
|
||||
if ((seconds = atoi(tosay)) <= 0) {
|
||||
seconds = (int64_t) switch_timestamp(NULL);
|
||||
seconds = (int64_t) switch_epoch_time_now(NULL);
|
||||
}
|
||||
|
||||
if (seconds >= 60) {
|
||||
@@ -350,7 +350,7 @@ static switch_status_t it_say_time(switch_core_session_t *session, char *tosay,
|
||||
if ((t = atoi(tosay)) > 0) {
|
||||
target = switch_time_make(t, 0);
|
||||
} else {
|
||||
target = switch_timestamp_now();
|
||||
target = switch_micro_time_now();
|
||||
}
|
||||
switch_time_exp_lt(&tm, target);
|
||||
|
||||
|
||||
@@ -292,7 +292,7 @@ static switch_status_t nl_say_time(switch_core_session_t *session, char *tosay,
|
||||
}
|
||||
} else {
|
||||
if ((seconds = atoi(tosay)) <= 0) {
|
||||
seconds = (int64_t) switch_timestamp(NULL);
|
||||
seconds = (int64_t) switch_epoch_time_now(NULL);
|
||||
}
|
||||
|
||||
if (seconds >= 60) {
|
||||
@@ -350,7 +350,7 @@ static switch_status_t nl_say_time(switch_core_session_t *session, char *tosay,
|
||||
if ((t = atoi(tosay)) > 0) {
|
||||
target = switch_time_make(t, 0);
|
||||
} else {
|
||||
target = switch_timestamp_now();
|
||||
target = switch_micro_time_now();
|
||||
}
|
||||
switch_time_exp_lt(&tm, target);
|
||||
|
||||
|
||||
@@ -367,7 +367,7 @@ static switch_status_t zh_say_time(switch_core_session_t *session,
|
||||
}
|
||||
} else {
|
||||
if ((seconds = atoi(tosay)) <= 0) {
|
||||
seconds = (int64_t) switch_timestamp(NULL);
|
||||
seconds = (int64_t) switch_epoch_time_now(NULL);
|
||||
}
|
||||
|
||||
if (seconds >= 60) {
|
||||
@@ -425,7 +425,7 @@ static switch_status_t zh_say_time(switch_core_session_t *session,
|
||||
if ((t = atoi(tosay)) > 0)
|
||||
target = switch_time_make(t, 0);
|
||||
else
|
||||
target = switch_timestamp_now();
|
||||
target = switch_micro_time_now();
|
||||
switch_time_exp_lt(&tm, target);
|
||||
|
||||
switch (type) {
|
||||
@@ -455,7 +455,7 @@ static switch_status_t zh_say_time(switch_core_session_t *session,
|
||||
#if 0
|
||||
tm = *localtime(&then);
|
||||
|
||||
this_morning = switch_timestamp_now();
|
||||
this_morning = switch_micro_time_now();
|
||||
switch_time_exp_lt(&tm2, this_morning);
|
||||
tm2->tm_hour = 0;
|
||||
tm2->tm_min = 0;
|
||||
|
||||
Reference in new issue
Block a user