diff options
author | Kevin P. Fleming <kpfleming@digium.com> | 2006-02-12 04:28:58 +0000 |
---|---|---|
committer | Kevin P. Fleming <kpfleming@digium.com> | 2006-02-12 04:28:58 +0000 |
commit | 96bf384e7d84291c40dcbe2e26e16af1c5a974c1 (patch) | |
tree | 5c4270c1ac3d265b96361d98722a75b947f2f8c6 /include/asterisk | |
parent | 3d2404c62cc4ff50c05900f305d2a4939a9d5c8b (diff) |
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
Diffstat (limited to 'include/asterisk')
-rw-r--r-- | include/asterisk/channel.h | 6 | ||||
-rw-r--r-- | include/asterisk/module.h | 2 | ||||
-rw-r--r-- | include/asterisk/pbx.h | 21 |
3 files changed, 16 insertions, 13 deletions
diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h index 545724774..6c00e2a87 100644 --- a/include/asterisk/channel.h +++ b/include/asterisk/channel.h @@ -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; diff --git a/include/asterisk/module.h b/include/asterisk/module.h index 80806de5e..0f8cd5036 100644 --- a/include/asterisk/module.h +++ b/include/asterisk/module.h @@ -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; \ diff --git a/include/asterisk/pbx.h b/include/asterisk/pbx.h index e8d6507bb..83997b48d 100644 --- a/include/asterisk/pbx.h +++ b/include/asterisk/pbx.h @@ -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); |