summaryrefslogtreecommitdiff
path: root/channels/chan_zap.c
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2007-07-18 19:47:20 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2007-07-18 19:47:20 +0000
commit81bc1d7af5886089bcd065382476f202ad7cc9ea (patch)
tree540f82bac3e6105b6fc34cd4b4613c1756a7512b /channels/chan_zap.c
parentb96fde308cd75eb17e5fdb0ea6d54c0f1f593ff9 (diff)
Merge in ast_strftime branch, which changes timestamps to be accurate to the microsecond, instead of only to the second
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75706 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_zap.c')
-rw-r--r--channels/chan_zap.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/channels/chan_zap.c b/channels/chan_zap.c
index c8b4feb76..0e52a7b2d 100644
--- a/channels/chan_zap.c
+++ b/channels/chan_zap.c
@@ -3059,7 +3059,7 @@ static int zt_answer(struct ast_channel *ast)
/* Pick up the line */
ast_debug(1, "Took %s off hook\n", ast->name);
if (p->hanguponpolarityswitch) {
- gettimeofday(&p->polaritydelaytv, NULL);
+ p->polaritydelaytv = ast_tvnow();
}
res = zt_set_hook(p->subs[SUB_REAL].zfd, ZT_OFFHOOK);
tone_zone_play_tone(p->subs[index].zfd, -1);
@@ -4463,7 +4463,7 @@ static struct ast_frame *zt_handle_event(struct ast_channel *ast)
break;
}
/* Remember last time we got a flash-hook */
- gettimeofday(&p->flashtime, NULL);
+ p->flashtime = ast_tvnow();
switch (mysig) {
case SIG_FXOLS:
case SIG_FXOGS:
@@ -4733,7 +4733,7 @@ static struct ast_frame *zt_handle_event(struct ast_channel *ast)
ast_debug(1, "Answering on polarity switch!\n");
ast_setstate(p->owner, AST_STATE_UP);
if (p->hanguponpolarityswitch) {
- gettimeofday(&p->polaritydelaytv, NULL);
+ p->polaritydelaytv = ast_tvnow();
}
} else
ast_debug(1, "Ignore switch to REVERSED Polarity on channel %d, state %d\n", p->channel, ast->_state);
@@ -4836,7 +4836,7 @@ static struct ast_frame *__zt_exception(struct ast_channel *ast)
/* Do nothing */
break;
case ZT_EVENT_WINKFLASH:
- gettimeofday(&p->flashtime, NULL);
+ p->flashtime = ast_tvnow();
if (p->owner) {
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Channel %d flashed to other channel %s\n", p->channel, p->owner->name);
@@ -8539,7 +8539,7 @@ static void *ss7_linkset(void *data)
while(1) {
ast_mutex_lock(&linkset->lock);
if ((next = ss7_schedule_next(ss7))) {
- gettimeofday(&tv, NULL);
+ tv = ast_tvnow();
tv.tv_sec = next->tv_sec - tv.tv_sec;
tv.tv_usec = next->tv_usec - tv.tv_usec;
if (tv.tv_usec < 0) {
@@ -9302,7 +9302,7 @@ static void *pri_dchannel(void *vpri)
int nextidle = -1;
struct ast_channel *c;
struct timeval tv, lowest, *next;
- struct timeval lastidle = { 0, 0 };
+ struct timeval lastidle = ast_tvnow();
int doidling=0;
char *cc;
char idlen[80];
@@ -9319,7 +9319,6 @@ static void *pri_dchannel(void *vpri)
char plancallingani[256];
char calledtonstr[10];
- gettimeofday(&lastidle, NULL);
if (!ast_strlen_zero(pri->idledial) && !ast_strlen_zero(pri->idleext)) {
/* Need to do idle dialing, check to be sure though */
cc = strchr(pri->idleext, '@');
@@ -9389,7 +9388,7 @@ static void *pri_dchannel(void *vpri)
}
} else
ast_log(LOG_WARNING, "Unable to request channel 'Zap/%s' for idle call\n", idlen);
- gettimeofday(&lastidle, NULL);
+ lastidle = ast_tvnow();
}
} else if ((haveidles < pri->minunused) &&
(activeidles > pri->minidle)) {