diff options
author | David M. Lee <dlee@digium.com> | 2013-04-15 16:22:03 +0000 |
---|---|---|
committer | David M. Lee <dlee@digium.com> | 2013-04-15 16:22:03 +0000 |
commit | 2450722f52401b8537e9c0ffb1192f38b7dd146d (patch) | |
tree | 2a798888a6601082b150a2eada805b0b82aadaa4 /include | |
parent | c6cf12408edc133c229b323a9039e04f3c12c248 (diff) |
DTMF events are now published on a channel's stasis_topic. AMI was
refactored to use these events rather than producing the events directly
in channel.c. Finally, the code was added to app_stasis to produce
DTMF events on the WebSocket.
The AMI events are completely backward compatible, including sending
events on transmitted DTMF, and sending DTMF start events.
The Stasis-HTTP events are somewhat simplified. Since DTMF start and
DTMF send events are generally less useful, Stasis-HTTP will only send
events on received DTMF end.
(closes issue ASTERISK-21282)
(closes issue ASTERISK-21359)
Review: https://reviewboard.asterisk.org/r/2439
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@385734 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include')
-rw-r--r-- | include/asterisk/cli.h | 16 | ||||
-rw-r--r-- | include/asterisk/strings.h | 12 |
2 files changed, 23 insertions, 5 deletions
diff --git a/include/asterisk/cli.h b/include/asterisk/cli.h index 21a03834d..458ebc8aa 100644 --- a/include/asterisk/cli.h +++ b/include/asterisk/cli.h @@ -28,6 +28,7 @@ extern "C" { #endif #include "asterisk/linkedlists.h" +#include "asterisk/strings.h" void ast_cli(int fd, const char *fmt, ...) __attribute__((format(printf, 2, 3))); @@ -57,12 +58,17 @@ void ast_cli(int fd, const char *fmt, ...) */ #define ESS(x) ((x) == 1 ? "" : "s") -/*! \brief return Yes or No depending on the argument. - * This is used in many places in CLI command, having a function to generate - * this helps maintaining a consistent output (and possibly emitting the - * output in other languages, at some point). +/*! + * \brief Return Yes or No depending on the argument. + * + * Note that this should probably still be used for CLI commands instead of + * AST_YESNO(), in the off chance we someday want to translate the CLI. + * + * \param x Boolean value + * \return "Yes" if x is true (non-zero) + * \return "No" if x is false (zero) */ -#define AST_CLI_YESNO(x) (x) ? "Yes" : "No" +#define AST_CLI_YESNO(x) AST_YESNO(x) /*! \brief return On or Off depending on the argument. * This is used in many places in CLI command, having a function to generate diff --git a/include/asterisk/strings.h b/include/asterisk/strings.h index afbda7816..d16e9f7bd 100644 --- a/include/asterisk/strings.h +++ b/include/asterisk/strings.h @@ -83,6 +83,18 @@ static force_inline int attribute_pure ast_strlen_zero(const char *s) #define S_COR(a, b, c) ({typeof(&((b)[0])) __x = (b); (a) && !ast_strlen_zero(__x) ? (__x) : (c);}) /*! + * \brief return Yes or No depending on the argument. + * + * Note that this macro is used my AMI, where a literal "Yes" and "No" are + * expected, and translations would cause problems. + * + * \param x Boolean value + * \return "Yes" if x is true (non-zero) + * \return "No" if x is false (zero) + */ +#define AST_YESNO(x) ((x) ? "Yes" : "No") + +/*! \brief Gets a pointer to the first non-whitespace character in a string. \param str the input string \return a pointer to the first non-whitespace character |