2 * Asterisk -- A telephony toolkit for Linux.
4 * Call Parking and Pickup API
6 * Copyright (C) 1999, Mark Spencer
8 * Mark Spencer <markster@linux-support.net>
10 * This program is free software, distributed under the terms of
11 * the GNU General Public License.
13 * Includes code and algorithms from the Zapata library.
17 #ifndef _AST_FEATURES_H
18 #define _AST_FEATURES_H
20 #define FEATURE_MAX_LEN 11
21 #define FEATURE_APP_LEN 64
22 #define FEATURE_APP_ARGS_LEN 256
23 #define FEATURE_SNAME_LEN 32
24 #define FEATURE_EXTEN_LEN 32
26 /* main call feature structure */
27 struct ast_call_feature {
30 char sname[FEATURE_SNAME_LEN];
31 char exten[FEATURE_MAX_LEN];
32 char default_exten[FEATURE_MAX_LEN];
33 int (*operation)(struct ast_channel *chan, struct ast_channel *peer, struct ast_bridge_config *config, char *code, int sense);
35 char app[FEATURE_APP_LEN];
36 char app_args[FEATURE_APP_ARGS_LEN];
37 AST_LIST_ENTRY(ast_call_feature) feature_entry;
42 /*! Park a call and read back parked location */
43 /*! \param chan the channel to actually be parked
44 \param host the channel which will have the parked location read to
45 Park the channel chan, and read back the parked location to the
46 host. If the call is not picked up within a specified period of
47 time, then the call will return to the last step that it was in
48 (in terms of exten, priority and context)
49 \param timeout is a timeout in milliseconds
50 \param extout is a parameter to an int that will hold the parked location, or NULL if you want
52 extern int ast_park_call(struct ast_channel *chan, struct ast_channel *host, int timeout, int *extout);
53 /*! Park a call via a masqueraded channel */
54 /*! \param rchan the real channel to be parked
55 \param host the channel to have the parking read to
56 Masquerade the channel rchan into a new, empty channel which is then
57 parked with ast_park_call
58 \param timeout is a timeout in milliseconds
59 \param extout is a parameter to an int that will hold the parked location, or NULL if you want
61 extern int ast_masq_park_call(struct ast_channel *rchan, struct ast_channel *host, int timeout, int *extout);
63 /*! Determine system parking extension */
64 /*! Returns the call parking extension for drivers that provide special
66 extern char *ast_parking_ext(void);
67 extern char *ast_pickup_ext(void);
69 /*! Bridge a call, optionally allowing redirection */
71 extern int ast_bridge_call(struct ast_channel *chan, struct ast_channel *peer,struct ast_bridge_config *config);
73 extern int ast_pickup_call(struct ast_channel *chan);
75 /*! register new feature into feature_set
76 \param feature an ast_call_feature object which contains a keysequence
77 and a callback function which is called when this keysequence is pressed
79 extern void ast_register_feature(struct ast_call_feature *feature);
81 /*! unregister feature from feature_set
82 \param feature the ast_call_feature object which was registered before*/
83 extern void ast_unregister_feature(struct ast_call_feature *feature);
86 #endif /* _AST_FEATURES_H */