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/linkedlists.h"
00028
00029 #define FEATURE_MAX_LEN 11
00030 #define FEATURE_APP_LEN 64
00031 #define FEATURE_APP_ARGS_LEN 256
00032 #define FEATURE_SNAME_LEN 32
00033 #define FEATURE_EXTEN_LEN 32
00034 #define FEATURE_MOH_LEN 80
00035
00036 #define PARK_APP_NAME "Park"
00037
00038 #define FEATURE_RETURN_HANGUP -1
00039 #define FEATURE_RETURN_SUCCESSBREAK 0
00040 #define FEATURE_RETURN_PBX_KEEPALIVE AST_PBX_KEEPALIVE
00041 #define FEATURE_RETURN_NO_HANGUP_PEER AST_PBX_NO_HANGUP_PEER
00042 #define FEATURE_RETURN_PASSDIGITS 21
00043 #define FEATURE_RETURN_STOREDIGITS 22
00044 #define FEATURE_RETURN_SUCCESS 23
00045 #define FEATURE_RETURN_KEEPTRYING 24
00046 #define FEATURE_RETURN_PARKFAILED 25
00047
00048 #define FEATURE_SENSE_CHAN (1 << 0)
00049 #define FEATURE_SENSE_PEER (1 << 1)
00050
00051 typedef int (*ast_feature_operation)(struct ast_channel *chan, struct ast_channel *peer, struct ast_bridge_config *config, char *code, int sense, void *data);
00052
00053
00054 struct ast_call_feature {
00055 int feature_mask;
00056 char *fname;
00057 char sname[FEATURE_SNAME_LEN];
00058 char exten[FEATURE_MAX_LEN];
00059 char default_exten[FEATURE_MAX_LEN];
00060 int (*operation)(struct ast_channel *chan, struct ast_channel *peer, struct ast_bridge_config *config, char *code, int sense, void *data);
00061 unsigned int flags;
00062 char app[FEATURE_APP_LEN];
00063 char app_args[FEATURE_APP_ARGS_LEN];
00064 char moh_class[FEATURE_MOH_LEN];
00065 AST_LIST_ENTRY(ast_call_feature) feature_entry;
00066 };
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080 int ast_park_call(struct ast_channel *chan, struct ast_channel *host, int timeout, int *extout);
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090 int ast_masq_park_call(struct ast_channel *rchan, struct ast_channel *host, int timeout, int *extout);
00091
00092
00093
00094
00095 char *ast_parking_ext(void);
00096
00097
00098 char *ast_pickup_ext(void);
00099
00100
00101 int ast_bridge_call(struct ast_channel *chan, struct ast_channel *peer,struct ast_bridge_config *config);
00102
00103
00104
00105
00106
00107
00108
00109 int ast_feature_detect(struct ast_channel *chan, struct ast_flags *features, char *code, struct ast_call_feature *feature);
00110
00111
00112 int ast_pickup_call(struct ast_channel *chan);
00113
00114
00115
00116
00117
00118 void ast_register_feature(struct ast_call_feature *feature);
00119
00120
00121
00122 void ast_unregister_feature(struct ast_call_feature *feature);
00123
00124 #endif