[asterisk-commits] russell: branch russell/chan_console r95376 - /team/russell/chan_console/chan...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Sun Dec 30 13:33:39 CST 2007
Author: russell
Date: Sun Dec 30 13:33:39 2007
New Revision: 95376
URL: http://svn.digium.com/view/asterisk?view=rev&rev=95376
Log:
Add a few doxygen and other text updates. Put supported formats in a define.
Modified:
team/russell/chan_console/channels/chan_console.c
Modified: team/russell/chan_console/channels/chan_console.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/channels/chan_console.c?view=diff&rev=95376&r1=95375&r2=95376
==============================================================================
--- team/russell/chan_console/channels/chan_console.c (original)
+++ team/russell/chan_console/channels/chan_console.c Sun Dec 30 13:33:39 2007
@@ -100,12 +100,19 @@
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#endif
-/*! \brief Dance, Kirby, Dance! */
+/*! \brief Dance, Kirby, Dance! @{ */
#define V_BEGIN " --- <(\"<) --- "
#define V_END " --- (>\")> ---\n"
+/*! @} */
static const char config_file[] = "console.conf";
+/*!
+ * \brief Console pvt structure
+ *
+ * Currently, this is a singleton object. However, multiple instances will be
+ * needed when this module is updated for multiple device support.
+ */
static struct console_pvt {
AST_DECLARE_STRING_FIELDS(
/*! Name of the device */
@@ -143,6 +150,7 @@
unsigned int overridecontext:1;
/*! Lock for this struct */
ast_mutex_t lock;
+ /*! ID for the stream monitor thread */
pthread_t thread;
} console_pvt = {
.lock = AST_MUTEX_INIT_VALUE,
@@ -158,6 +166,7 @@
};
static struct ast_jb_conf global_jbconf;
+/*! Channel Technology Callbacks @{ */
static struct ast_channel *console_request(const char *type, int format,
void *data, int *cause);
static int console_digit_begin(struct ast_channel *c, char digit);
@@ -171,11 +180,14 @@
static int console_indicate(struct ast_channel *chan, int cond,
const void *data, size_t datalen);
static int console_fixup(struct ast_channel *oldchan, struct ast_channel *newchan);
+/*! @} */
+
+#define SUPPORTED_FORMATS ( AST_FORMAT_SLINEAR )
static const struct ast_channel_tech console_tech = {
.type = "Console",
- .description = "Generic Console Channel Driver",
- .capabilities = AST_FORMAT_SLINEAR,
+ .description = "Cross-platform Console Channel Driver",
+ .capabilities = SUPPORTED_FORMATS,
.requester = console_request,
.send_digit_begin = console_digit_begin,
.send_digit_end = console_digit_end,
@@ -189,6 +201,16 @@
.fixup = console_fixup,
};
+/*!
+ * \brief Stream monitor thread
+ *
+ * \arg data A pointer to the console_pvt structure that contains the portaudio
+ * stream that needs to be monitored.
+ *
+ * This function runs in its own thread to monitor data coming in from a
+ * portaudio stream. When enough data is available, it is queued up to
+ * be read from the Asterisk channel.
+ */
static void *stream_monitor(void *data)
{
struct console_pvt *pvt = data;
@@ -321,7 +343,7 @@
struct ast_channel *chan = NULL;
struct console_pvt *pvt = &console_pvt;
- format &= AST_FORMAT_SLINEAR;
+ format &= SUPPORTED_FORMATS;
if (!format) {
ast_log(LOG_NOTICE, "Channel requested with unsupported format(s): '%d'\n", oldformat);
return NULL;
More information about the asterisk-commits
mailing list