aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authordvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2009-03-19 16:15:16 +0000
committerdvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2009-03-19 16:15:16 +0000
commit8da3da0e2bd336aea758d848c7cb5d7364858ec7 (patch)
treebdffd6a73516bcad0d3e9e13b7f5b3cd53a32420 /include
parenta7a0e1e586424706c1b1799d76eb09f6770771c2 (diff)
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.4@183126 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rw-r--r--include/asterisk/features.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/asterisk/features.h b/include/asterisk/features.h
index c67bd0380..7e4de1972 100644
--- a/include/asterisk/features.h
+++ b/include/asterisk/features.h
@@ -35,6 +35,21 @@
#define PARK_APP_NAME "Park"
+#define FEATURE_RETURN_HANGUP -1
+#define FEATURE_RETURN_SUCCESSBREAK 0
+#define FEATURE_RETURN_PBX_KEEPALIVE AST_PBX_KEEPALIVE
+#define FEATURE_RETURN_NO_HANGUP_PEER AST_PBX_NO_HANGUP_PEER
+#define FEATURE_RETURN_PASSDIGITS 21
+#define FEATURE_RETURN_STOREDIGITS 22
+#define FEATURE_RETURN_SUCCESS 23
+#define FEATURE_RETURN_KEEPTRYING 24
+#define 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 */
struct ast_call_feature {
int feature_mask;
@@ -85,6 +100,10 @@ char *ast_pickup_ext(void);
/*! \brief Bridge a call, optionally allowing redirection */
int ast_bridge_call(struct ast_channel *chan, struct ast_channel *peer,struct ast_bridge_config *config);
+/*! \brief detect a feature before bridging
+ \param 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 Pickup a call */
int ast_pickup_call(struct ast_channel *chan);