From 1235d47242298611dcf17e2916dc46109d467a62 Mon Sep 17 00:00:00 2001
From: Mark Michelson <mmichelson@digium.com>
Date: Fri, 2 May 2008 14:51:59 +0000
Subject: [PATCH] Make res/snmp/agent.c build

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@115199 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 res/snmp/agent.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/res/snmp/agent.c b/res/snmp/agent.c
index 327d0af43a..c0eda9fe4b 100644
--- a/res/snmp/agent.c
+++ b/res/snmp/agent.c
@@ -301,9 +301,9 @@ static u_char *ast_var_channels_table(struct variable *vp, oid *name, size_t *le
 		}
 		break;
 	case ASTCHANWHENHANGUP:
-		if (chan->whentohangup) {
+		if (!ast_tvzero(chan->whentohangup)) {
 			gettimeofday(&tval, NULL);
-			long_ret = difftime(chan->whentohangup, tval.tv_sec) * 100 - tval.tv_usec / 10000;
+			long_ret = difftime(chan->whentohangup.tv_sec, tval.tv_sec) * 100 - tval.tv_usec / 10000;
 			ret= (u_char *)&long_ret;
 		}
 		break;
-- 
GitLab