diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-07-18 19:47:20 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-07-18 19:47:20 +0000 |
commit | 74c2948c2299773fd3816af43e06e3bdf714ba3a (patch) | |
tree | 540f82bac3e6105b6fc34cd4b4613c1756a7512b /channels/chan_mgcp.c | |
parent | fd471b4a0cbb2abd7b4c8f30fee850cedefedaa1 (diff) |
Merge in ast_strftime branch, which changes timestamps to be accurate to the microsecond, instead of only to the second
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@75706 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_mgcp.c')
-rw-r--r-- | channels/chan_mgcp.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/channels/chan_mgcp.c b/channels/chan_mgcp.c index c55f38976..76744cc10 100644 --- a/channels/chan_mgcp.c +++ b/channels/chan_mgcp.c @@ -736,15 +736,11 @@ static int mgcp_postrequest(struct mgcp_endpoint *p, struct mgcp_subchannel *sub gw->msgs = msg; } - if (gettimeofday(&tv, NULL) < 0) { - /* This shouldn't ever happen, but let's be sure */ - ast_log(LOG_NOTICE, "gettimeofday() failed!\n"); - } else { - msg->expire = tv.tv_sec * 1000 + tv.tv_usec / 1000 + DEFAULT_RETRANS; + tv = ast_tvnow(); + msg->expire = tv.tv_sec * 1000 + tv.tv_usec / 1000 + DEFAULT_RETRANS; - if (gw->retransid == -1) - gw->retransid = ast_sched_add(sched, DEFAULT_RETRANS, retrans_pkt, (void *)gw); - } + if (gw->retransid == -1) + gw->retransid = ast_sched_add(sched, DEFAULT_RETRANS, retrans_pkt, (void *)gw); ast_mutex_unlock(&gw->msgs_lock); /* SC if (!gw->messagepending) { @@ -2232,11 +2228,10 @@ static int transmit_notify_request_with_callerid(struct mgcp_subchannel *sub, ch struct mgcp_request resp; char tone2[256]; char *l, *n; - time_t t; - struct tm tm; + struct timeval t = ast_tvnow(); + struct ast_tm tm; struct mgcp_endpoint *p = sub->parent; - time(&t); ast_localtime(&t, &tm, NULL); n = callername; l = callernum; |