diff options
Diffstat (limited to 'include/asterisk/features.h')
-rw-r--r-- | include/asterisk/features.h | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/include/asterisk/features.h b/include/asterisk/features.h index c4abbae31..7a88abcb1 100644 --- a/include/asterisk/features.h +++ b/include/asterisk/features.h @@ -36,6 +36,21 @@ #define PARK_APP_NAME "Park" +#define AST_FEATURE_RETURN_HANGUP -1 +#define AST_FEATURE_RETURN_SUCCESSBREAK 0 +#define AST_FEATURE_RETURN_PBX_KEEPALIVE AST_PBX_KEEPALIVE +#define AST_FEATURE_RETURN_NO_HANGUP_PEER AST_PBX_NO_HANGUP_PEER +#define AST_FEATURE_RETURN_PASSDIGITS 21 +#define AST_FEATURE_RETURN_STOREDIGITS 22 +#define AST_FEATURE_RETURN_SUCCESS 23 +#define AST_FEATURE_RETURN_KEEPTRYING 24 +#define AST_FEATURE_RETURN_PARKFAILED 25 + +#define FEATURE_SENSE_CHAN (1 << 0) +#define FEATURE_SENSE_PEER (1 << 1) + +typedef int (*ast_feature_operation)(struct ast_channel *chan, struct ast_channel *peer, struct ast_bridge_config *config, char *code, int sense, void *data); + /*! \brief main call feature structure */ enum { @@ -53,7 +68,7 @@ struct ast_call_feature { char sname[FEATURE_SNAME_LEN]; char exten[FEATURE_MAX_LEN]; char default_exten[FEATURE_MAX_LEN]; - int (*operation)(struct ast_channel *chan, struct ast_channel *peer, struct ast_bridge_config *config, char *code, int sense, void *data); + ast_feature_operation operation; unsigned int flags; char app[FEATURE_APP_LEN]; char app_args[FEATURE_APP_ARGS_LEN]; @@ -61,14 +76,6 @@ struct ast_call_feature { AST_LIST_ENTRY(ast_call_feature) feature_entry; }; -#define AST_FEATURE_RETURN_HANGUP -1 -#define AST_FEATURE_RETURN_SUCCESSBREAK 0 -#define AST_FEATURE_RETURN_PASSDIGITS 21 -#define AST_FEATURE_RETURN_STOREDIGITS 22 -#define AST_FEATURE_RETURN_SUCCESS 23 -#define AST_FEATURE_RETURN_KEEPTRYING 24 -#define AST_FEATURE_RETURN_PARKFAILED 25 - /*! * \brief Park a call and read back parked location * \param chan the channel to actually be parked @@ -123,6 +130,10 @@ void ast_register_feature(struct ast_call_feature *feature); \param feature the ast_call_feature object which was registered before*/ void ast_unregister_feature(struct ast_call_feature *feature); +/*! \brief detect a feature before bridging + \para chan, ast_flags ptr, code, ast_call_feature ptr to be set if found */ +int ast_feature_detect(struct ast_channel *chan, struct ast_flags *features, char *code, struct ast_call_feature *feature); + /*! \brief look for a call feature entry by its sname \param name a string ptr, should match "automon", "blindxfer", "atxfer", etc. */ struct ast_call_feature *ast_find_call_feature(const char *name); |