print out the IAX DATETIME IE in 'iax2 debug' in human readable form

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5711 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant
2005-05-17 19:41:09 +00:00
parent f03896d1fc
commit 9f9fcca6c0
2 changed files with 34 additions and 17 deletions

View File

@@ -2764,12 +2764,12 @@ static unsigned int iax2_datetime(char *tz)
localtime_r(&t, &tm);
if (!ast_strlen_zero(tz))
ast_localtime(&t, &tm, tz);
tmp = (tm.tm_sec >> 1) & 0x1f; /* 5 bits of seconds */
tmp |= (tm.tm_min & 0x3f) << 5; /* 6 bits of minutes */
tmp |= (tm.tm_hour & 0x1f) << 11; /* 5 bits of hours */
tmp |= (tm.tm_mday & 0x1f) << 16; /* 5 bits of day of month */
tmp |= ((tm.tm_mon + 1) & 0xf) << 21; /* 4 bits of month */
tmp |= ((tm.tm_year - 100) & 0x7f) << 25; /* 7 bits of year */
tmp = (tm.tm_sec >> 1) & 0x1f; /* 5 bits of seconds */
tmp |= (tm.tm_min & 0x3f) << 5; /* 6 bits of minutes */
tmp |= (tm.tm_hour & 0x1f) << 11; /* 5 bits of hours */
tmp |= (tm.tm_mday & 0x1f) << 16; /* 5 bits of day of month */
tmp |= ((tm.tm_mon + 1) & 0xf) << 21; /* 4 bits of month */
tmp |= ((tm.tm_year - 100) & 0x7f) << 25; /* 7 bits of year */
return tmp;
}