diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-05-01 23:06:23 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-05-01 23:06:23 +0000 |
commit | d1cc29c9c1c324a7421f220482d8cc4f321540ba (patch) | |
tree | 3df7d1e791a878179b45272be0b3f3cccf8eeee0 /include | |
parent | 995531248a14d3ac9e88ffc12836176688bb137e (diff) |
Modify TIMEOUT() to be accurate down to the millisecond.
(closes issue #10540)
Reported by: spendergrass
Patches:
20080417__bug10540.diff.txt uploaded by Corydon76 (license 14)
Tested by: blitzrage
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@115076 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rw-r--r-- | include/asterisk/channel.h | 12 | ||||
-rw-r--r-- | include/asterisk/pbx.h | 4 |
2 files changed, 9 insertions, 7 deletions
diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h index fcd1aa834..9fdc6deb7 100644 --- a/include/asterisk/channel.h +++ b/include/asterisk/channel.h @@ -455,7 +455,7 @@ struct ast_channel { int _softhangup; /*!< Whether or not we have been hung up... Do not set this value directly, use ast_softhangup() */ - time_t whentohangup; /*!< Non-zero, set to actual time when channel is to be hung up */ + struct timeval whentohangup; /*!< Non-zero, set to actual time when channel is to be hung up */ pthread_t blocker; /*!< If anyone is blocking, this is them */ ast_mutex_t lock_dont_use; /*!< Lock a channel for some operations. See ast_channel_lock() */ const char *blockproc; /*!< Procedure causing blocking */ @@ -920,19 +920,20 @@ int ast_check_hangup(struct ast_channel *chan); /*! \brief Compare a offset with the settings of when to hang a channel up * \param chan channel on which to check for hang up - * \param offset offset in seconds from current time + * \param offset offset in seconds and useconds from current time * \return 1, 0, or -1 * This function compares a offset from current time with the absolute time * out on a channel (when to hang up). If the absolute time out on a channel * is earlier than current time plus the offset, it returns 1, if the two * time values are equal, it return 0, otherwise, it return -1. */ -int ast_channel_cmpwhentohangup(struct ast_channel *chan, time_t offset); +int ast_channel_cmpwhentohangup(struct ast_channel *chan, time_t offset) __attribute__ ((deprecated)); +int ast_channel_cmpwhentohangup_tv(struct ast_channel *chan, struct timeval offset); /*! \brief Set when to hang a channel up * * \param chan channel on which to check for hang up - * \param offset offset in seconds from current time of when to hang up + * \param offset offset in seconds and useconds relative to the current time of when to hang up * * This function sets the absolute time out on a channel (when to hang up). * @@ -941,7 +942,8 @@ int ast_channel_cmpwhentohangup(struct ast_channel *chan, time_t offset); * * \return Nothing */ -void ast_channel_setwhentohangup(struct ast_channel *chan, time_t offset); +void ast_channel_setwhentohangup(struct ast_channel *chan, time_t offset) __attribute__ ((deprecated)); +void ast_channel_setwhentohangup_tv(struct ast_channel *chan, struct timeval offset); /*! * \brief Answer a channel diff --git a/include/asterisk/pbx.h b/include/asterisk/pbx.h index d38325bca..3e3669afb 100644 --- a/include/asterisk/pbx.h +++ b/include/asterisk/pbx.h @@ -112,8 +112,8 @@ int ast_build_timing(struct ast_timing *i, const char *info); int ast_check_timing(const struct ast_timing *i); struct ast_pbx { - int dtimeout; /*!< Timeout between digits (seconds) */ - int rtimeout; /*!< Timeout for response (seconds) */ + int dtimeoutms; /*!< Timeout between digits (milliseconds) */ + int rtimeoutms; /*!< Timeout for response (milliseconds) */ }; |