summaryrefslogtreecommitdiff
path: root/include/asterisk/features.h
diff options
context:
space:
mode:
authorDavid Vossel <dvossel@digium.com>2009-03-19 16:28:33 +0000
committerDavid Vossel <dvossel@digium.com>2009-03-19 16:28:33 +0000
commit2764c2821feb60aa28bdfdb65ff01b4117052ef5 (patch)
tree5d7a9fdf7feb5d442499999738e08efd7f756f91 /include/asterisk/features.h
parent10529ea0299f427dd03bfe1f5709ced3bda24df0 (diff)
Merged revisions 183126 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r183126 | dvossel | 2009-03-19 11:15:16 -0500 (Thu, 19 Mar 2009) | 17 lines Allow disconnect feature before a call is bridged feature.conf has a disconnect option. By default this option is set to '*', but it could be anything. If a user wishes to disconnect a call before the other side answers, only '*' will work, regardless if the disconnect option is set to something else. This is because features are unavailable until bridging takes place. The default disconnect option, '*', was hardcoded in app_dial, which doesn't make any sense from a user perspective since they may expect it to be something different. This patch allows features to be detected from outside of the bridge, but not operated on. In this case, the disconnect feature can be detected before briding and handled outside of features.c. (closes issue #11583) Reported by: sobomax Patches: patch-apps__app_dial.c uploaded by sobomax (license 359) 11583.latest-patch uploaded by murf (license 17) detect_disconnect.diff uploaded by dvossel (license 671) Tested by: sobomax, dvossel Review: http://reviewboard.digium.com/r/195/ ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@183172 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk/features.h')
-rw-r--r--include/asterisk/features.h29
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);