diff options
author | rizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-03-30 21:29:39 +0000 |
---|---|---|
committer | rizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-03-30 21:29:39 +0000 |
commit | c977f70f81f8d6abeb251b56e71d67c05d4e4c6b (patch) | |
tree | 19e1a3bfe72426fb7dbb848341e68fd087e1fcbd /include | |
parent | 1c79f1e9fb0aafeba06856ef93eb544c60fd67e0 (diff) |
as discussed with Mark a few weeks ago, the 'newstack' argument
in pbx_exec is always 1 so it can be removed.
This change also takes away ast_exec_extension(), and lets all
switch functions (exists, canmatch, exec, matchmore) all use the same
prototype, which makes the code a bit cleaner.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@16558 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rw-r--r-- | include/asterisk/channel.h | 6 | ||||
-rw-r--r-- | include/asterisk/pbx.h | 41 |
2 files changed, 13 insertions, 34 deletions
diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h index 9cdc280ac..9fcc4b133 100644 --- a/include/asterisk/channel.h +++ b/include/asterisk/channel.h @@ -317,10 +317,8 @@ struct ast_channel { /*! Procedure causing blocking */ const char *blockproc; - /*! Current application */ - char *appl; - /*! Data passed to current application */ - char *data; + const char *appl; /*! Current application */ + const char *data; /*! Data passed to current application */ /*! Which fd had an event detected on */ int fdno; diff --git a/include/asterisk/pbx.h b/include/asterisk/pbx.h index 8c18fcc03..deaa578bf 100644 --- a/include/asterisk/pbx.h +++ b/include/asterisk/pbx.h @@ -82,22 +82,20 @@ struct ast_custom_function { struct ast_custom_function *next; }; +/*! \brief All switch functions have the same interface, so define a type for them */ +typedef int (ast_switch_f)(struct ast_channel *chan, const char *context, + const char *exten, int priority, const char *callerid, const char *data); + /*! Data structure associated with an asterisk switch */ struct ast_switch { - /*! NULL */ struct ast_switch *next; - /*! Name of the switch */ - const char *name; - /*! Description of the switch */ - const char *description; - - int (*exists)(struct ast_channel *chan, const char *context, const char *exten, int priority, const char *callerid, const char *data); - - int (*canmatch)(struct ast_channel *chan, const char *context, const char *exten, int priority, const char *callerid, const char *data); + const char *name; /*! Name of the switch */ + const char *description; /*! Description of the switch */ - int (*exec)(struct ast_channel *chan, const char *context, const char *exten, int priority, const char *callerid, int newstack, const char *data); - - int (*matchmore)(struct ast_channel *chan, const char *context, const char *exten, int priority, const char *callerid, const char *data); + ast_switch_f *exists; + ast_switch_f *canmatch; + ast_switch_f *exec; + ast_switch_f *matchmore; }; struct ast_timing { @@ -160,7 +158,6 @@ struct ast_app *pbx_findapp(const char *app); * \param c channel to execute on * \param app which app to execute * \param data the data passed into the app - * \param newstack stack pointer * * This application executes an application on a given channel. It * saves the stack and executes the given appliation passing in @@ -168,7 +165,7 @@ struct ast_app *pbx_findapp(const char *app); * * \return 0 on success, and -1 on failure */ -int pbx_exec(struct ast_channel *c, struct ast_app *app, void *data, int newstack); +int pbx_exec(struct ast_channel *c, struct ast_app *app, void *data); /*! * \brief Register a new context @@ -487,22 +484,6 @@ int ast_spawn_extension(struct ast_channel *c, const char *context, const char *exten, int priority, const char *callerid); /*! - * \brief Execute an extension. - * - * \param c channel to execute upon - * \param context which context extension is in - * \param exten extension to execute - * \param priority priority to execute within the given extension - * \param callerid Caller-ID - * - * If it's not available, do whatever you should do for - * default extensions and halt the thread if necessary. This function does not - * return, except on error. - */ -int ast_exec_extension(struct ast_channel *c, const char *context, - const char *exten, int priority, const char *callerid); - -/*! * \brief Add a context include * * \param context context to add include to |