Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef _AST_FEATURES_H
00025 #define _AST_FEATURES_H
00026
00027 #include "asterisk/pbx.h"
00028 #include "asterisk/linkedlists.h"
00029
00030 #define FEATURE_MAX_LEN 11
00031 #define FEATURE_APP_LEN 64
00032 #define FEATURE_APP_ARGS_LEN 256
00033 #define FEATURE_SNAME_LEN 32
00034 #define FEATURE_EXTEN_LEN 32
00035 #define FEATURE_MOH_LEN 80
00036
00037 #define PARK_APP_NAME "Park"
00038
00039
00040
00041 enum {
00042 AST_FEATURE_FLAG_NEEDSDTMF = (1 << 0),
00043 AST_FEATURE_FLAG_ONPEER = (1 << 1),
00044 AST_FEATURE_FLAG_ONSELF = (1 << 2),
00045 AST_FEATURE_FLAG_BYCALLEE = (1 << 3),
00046 AST_FEATURE_FLAG_BYCALLER = (1 << 4),
00047 AST_FEATURE_FLAG_BYBOTH = (3 << 3),
00048 };
00049
00050 struct ast_call_feature {
00051 int feature_mask;
00052 char *fname;
00053 char sname[FEATURE_SNAME_LEN];
00054 char exten[FEATURE_MAX_LEN];
00055 char default_exten[FEATURE_MAX_LEN];
00056 int (*operation)(struct ast_channel *chan, struct ast_channel *peer, struct ast_bridge_config *config, char *code, int sense, void *data);
00057 unsigned int flags;
00058 char app[FEATURE_APP_LEN];
00059 char app_args[FEATURE_APP_ARGS_LEN];
00060 char moh_class[FEATURE_MOH_LEN];
00061 AST_LIST_ENTRY(ast_call_feature) feature_entry;
00062 };
00063
00064 #define AST_FEATURE_RETURN_HANGUP -1
00065 #define AST_FEATURE_RETURN_SUCCESSBREAK 0
00066 #define AST_FEATURE_RETURN_PASSDIGITS 21
00067 #define AST_FEATURE_RETURN_STOREDIGITS 22
00068 #define AST_FEATURE_RETURN_SUCCESS 23
00069 #define AST_FEATURE_RETURN_KEEPTRYING 24
00070 #define AST_FEATURE_RETURN_PARKFAILED 25
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086 int ast_park_call(struct ast_channel *chan, struct ast_channel *host, int timeout, int *extout);
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099 int ast_masq_park_call(struct ast_channel *rchan, struct ast_channel *host, int timeout, int *extout);
00100
00101
00102
00103
00104
00105 const char *ast_parking_ext(void);
00106
00107
00108 const char *ast_pickup_ext(void);
00109
00110
00111 int ast_bridge_call(struct ast_channel *chan, struct ast_channel *peer,struct ast_bridge_config *config);
00112
00113
00114 int ast_pickup_call(struct ast_channel *chan);
00115
00116
00117
00118
00119
00120 void ast_register_feature(struct ast_call_feature *feature);
00121
00122
00123
00124 void ast_unregister_feature(struct ast_call_feature *feature);
00125
00126
00127
00128 struct ast_call_feature *ast_find_call_feature(const char *name);
00129
00130 void ast_rdlock_call_features(void);
00131 void ast_unlock_call_features(void);
00132
00133
00134 int ast_features_reload(void);
00135
00136 #endif