diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 1999-10-27 00:56:38 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 1999-10-27 00:56:38 +0000 |
commit | a561260fdab6fed8b474e89f797c0e64eefc4684 (patch) | |
tree | 60333681c40ddcaf6a39c782d713d94143aaa6b7 /include/asterisk/pbx.h | |
parent | 43ddba956a94b7316dd0b3fdb031b2e1b794941a (diff) |
Version 0.1.0 from FTP
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@10 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include/asterisk/pbx.h')
-rwxr-xr-x | include/asterisk/pbx.h | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/include/asterisk/pbx.h b/include/asterisk/pbx.h new file mode 100755 index 000000000..0474936c1 --- /dev/null +++ b/include/asterisk/pbx.h @@ -0,0 +1,74 @@ +/* + * Asterisk -- A telephony toolkit for Linux. + * + * Core PBX routines and definitions. + * + * Copyright (C) 1999, Adtran Inc. and Linux Support Services, LLC + * + * Mark Spencer <markster@linux-support.net> + * + * This program is free software, distributed under the terms of + * the GNU General Public License + */ +#ifndef _ASTERISK_PBX_H +#define _ASTERISK_PBX_H + +#include <asterisk/sched.h> +#include <asterisk/channel.h> + +#if defined(__cplusplus) || defined(c_plusplus) +extern "C" { +#endif + +#define AST_PBX_KEEP 0 +#define AST_PBX_REPLACE 1 + +/* Max length of an application */ +#define AST_MAX_APP 32 + +struct ast_context; + +/* Register a new context */ +struct ast_context *ast_context_create(char *name); + +/* Destroy a context */ +void ast_context_destroy(struct ast_context *); + +/* Find a context */ +struct ast_context *ast_context_find(char *name); + +/* Create a new thread and start the PBX (or whatever) */ +int ast_pbx_start(struct ast_channel *c); + + + +/* Add an extension to an extension context, this time with an ast_context * */ +int ast_add_extension2(struct ast_context *con, + int replace, char *extension, int priority, + char *application, void *data, void (*datad)(void *)); + +/* Add an application. The function 'execute' should return non-zero if the line needs to be hung up. */ +int ast_register_application(char *app, int (*execute)(struct ast_channel *, void *)); + +/* Remove an application */ +int ast_unregister_application(char *app); + +/* If an extension exists, return non-zero */ +int ast_exists_extension(struct ast_channel *c, char *context, char *exten, int priority); + +/* Launch a new extension (i.e. new stack) */ +int ast_spawn_extension(struct ast_channel *c, char *context, char *exten, int priority); + +/* Execute an extension. 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, char *context, char *exten, int priority); +/* Longest extension */ +int ast_pbx_longest_extension(char *context); + +#if defined(__cplusplus) || defined(c_plusplus) +} +#endif + + +#endif |