aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authordvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2009-03-19 17:08:23 +0000
committerdvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2009-03-19 17:08:23 +0000
commitb1290136b33434c92e3cfbce69313f071738638b (patch)
treeb29ddaf61d3591b7ea19b725cc4476a086427746 /include
parentc11007b8e9a7108d3c353cbd6b8a9871f371cdc0 (diff)
Merged revisions 183172 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r183172 | dvossel | 2009-03-19 11:28:33 -0500 (Thu, 19 Mar 2009) | 20 lines 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: http://svn.digium.com/svn/asterisk/branches/1.6.1@183198 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-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);