major dialplan functions update

deprecate LANGUAGE() and MUSICCLASS(), in favor of CHANNEL()


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@9674 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kevin P. Fleming
2006-02-12 04:28:58 +00:00
parent 3d2404c62c
commit 96bf384e7d
35 changed files with 1160 additions and 1101 deletions

View File

@@ -1,7 +1,7 @@
/*
* Asterisk -- An open source telephony toolkit.
*
* Copyright (C) 1999 - 2005, Digium, Inc.
* Copyright (C) 1999 - 2006, Digium, Inc.
*
* Mark Spencer <markster@digium.com>
*
@@ -256,6 +256,10 @@ struct ast_channel_tech {
/*! Find bridged channel */
struct ast_channel *(* const bridged_channel)(struct ast_channel *chan, struct ast_channel *bridge);
/*! Provide additional items for CHANNEL() dialplan function */
int (* func_channel_read)(struct ast_channel *chan, char *function, char *data, char *buf, size_t len);
int (* func_channel_write)(struct ast_channel *chan, char *function, char *data, const char *value);
};
struct ast_channel_spy_list;

View File

@@ -336,7 +336,7 @@ void ast_unregister_atexit(void (*func)(void));
\
if (!(u=calloc(1,sizeof(*u)))) { \
ast_log(LOG_WARNING, "Out of memory\n"); \
return ""; \
return -1; \
} \
ast_mutex_lock(&localuser_lock); \
u->chan = chan; \

View File

@@ -1,7 +1,7 @@
/*
* Asterisk -- An open source telephony toolkit.
*
* Copyright (C) 1999 - 2005, Digium, Inc.
* Copyright (C) 1999 - 2006, Digium, Inc.
*
* Mark Spencer <markster@digium.com>
*
@@ -88,8 +88,8 @@ struct ast_custom_function {
char *synopsis;
char *desc;
char *syntax;
char *(*read)(struct ast_channel *, char *, char *, char *, size_t);
void (*write)(struct ast_channel *, char *, char *, const char *);
int (*read)(struct ast_channel *, char *, char *, char *, size_t);
int (*write)(struct ast_channel *, char *, char *, const char *);
struct ast_custom_function *next;
};
@@ -636,25 +636,24 @@ int ast_active_calls(void);
/*! executes a read operation on a function */
/*!
* \param chan Channel to execute on
* \param in Data containing the function call string
* \param function Data containing the function call string (will be modified)
* \param workspace A pointer to safe memory to use for a return value
* \param len the number of bytes in workspace
* \return zero on success, non-zero on failure
* This application executes an function in read mode on a given channel.
* It returns a pointer to workspace if the buffer contains any new data
* or NULL if there was a problem.
*/
* */
char *ast_func_read(struct ast_channel *chan, const char *in, char *workspace, size_t len);
int ast_func_read(struct ast_channel *chan, char *function, char *workspace, size_t len);
/*! executes a write operation on a function */
/*!
* \param chan Channel to execute on
* \param in Data containing the function call string
* \param function Data containing the function call string (will be modified)
* \param value A value parameter to pass for writing
* \return zero on success, non-zero on failure
* This application executes an function in write mode on a given channel.
* It has no return value.
*/
void ast_func_write(struct ast_channel *chan, const char *in, const char *value);
int ast_func_write(struct ast_channel *chan, char *function, const char *value);
void ast_hint_state_changed(const char *device);