Make res/snmp/agent.c build
authorMark Michelson <mmichelson@digium.com>
Fri, 2 May 2008 14:51:59 +0000 (14:51 +0000)
committerMark Michelson <mmichelson@digium.com>
Fri, 2 May 2008 14:51:59 +0000 (14:51 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@115199 65c4cc65-6c06-0410-ace0-fbb531ad65f3

res/snmp/agent.c

index 327d0af..c0eda9f 100644 (file)
@@ -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;