Thu Oct 8 21:57:26 2009

Asterisk developer's documentation


features.h

Go to the documentation of this file.
00001 /*
00002  * Asterisk -- An open source telephony toolkit.
00003  *
00004  * Copyright (C) 1999 - 2005, Digium, Inc.
00005  *
00006  * Mark Spencer <markster@digium.com>
00007  *
00008  * See http://www.asterisk.org for more information about
00009  * the Asterisk project. Please do not directly contact
00010  * any of the maintainers of this project for assistance;
00011  * the project provides a web site, mailing lists and IRC
00012  * channels for your use.
00013  *
00014  * This program is free software, distributed under the terms of
00015  * the GNU General Public License Version 2. See the LICENSE file
00016  * at the top of the source tree.
00017  */
00018 
00019 /*! \file
00020  * \brief Call Parking and Pickup API 
00021  * Includes code and algorithms from the Zapata library.
00022  */
00023 
00024 #ifndef _AST_FEATURES_H
00025 #define _AST_FEATURES_H
00026 
00027 #define FEATURE_MAX_LEN    11
00028 #define FEATURE_APP_LEN    64
00029 #define FEATURE_APP_ARGS_LEN  256
00030 #define FEATURE_SNAME_LEN  32
00031 #define FEATURE_EXTEN_LEN  32
00032 #define FEATURE_MOH_LEN    80  /* same as MAX_MUSICCLASS from channel.h */
00033 
00034 /*! \brief main call feature structure */
00035 struct ast_call_feature {
00036    int feature_mask;
00037    char *fname;
00038    char sname[FEATURE_SNAME_LEN];
00039    char exten[FEATURE_MAX_LEN];
00040    char default_exten[FEATURE_MAX_LEN];
00041    int (*operation)(struct ast_channel *chan, struct ast_channel *peer, struct ast_bridge_config *config, char *code, int sense, void *data);
00042    unsigned int flags;
00043    char app[FEATURE_APP_LEN];    
00044    char app_args[FEATURE_APP_ARGS_LEN];
00045    char moh_class[FEATURE_MOH_LEN];
00046    AST_LIST_ENTRY(ast_call_feature) feature_entry;
00047 };
00048 
00049 
00050 extern int ast_autoanswer_login(struct ast_channel *chan, void *data);
00051 extern int ast_masq_autoanswer_login(struct ast_channel *rchan, void *data);
00052 
00053 /*! \brief Park a call and read back parked location 
00054  *  \param chan the channel to actually be parked
00055     \param host the channel which will have the parked location read to
00056    Park the channel chan, and read back the parked location to the
00057    host.  If the call is not picked up within a specified period of
00058    time, then the call will return to the last step that it was in 
00059    (in terms of exten, priority and context)
00060    \param timeout is a timeout in milliseconds
00061    \param extout is a parameter to an int that will hold the parked location, or NULL if you want
00062 */
00063 int ast_park_call(struct ast_channel *chan, struct ast_channel *host, int timeout, int *extout);
00064 
00065 /*! \brief Park a call via a masqueraded channel
00066  *  \param rchan the real channel to be parked
00067     \param host the channel to have the parking read to
00068    Masquerade the channel rchan into a new, empty channel which is then
00069    parked with ast_park_call
00070    \param timeout is a timeout in milliseconds
00071    \param extout is a parameter to an int that will hold the parked location, or NULL if you want
00072 */
00073 int ast_masq_park_call(struct ast_channel *rchan, struct ast_channel *host, int timeout, int *extout);
00074 
00075 extern int ast_hold_call(struct ast_channel *chan, struct ast_channel *host);
00076 extern int ast_masq_hold_call(struct ast_channel *rchan, struct ast_channel *host);
00077 extern int ast_retrieve_call(struct ast_channel *chan, char *uniqueid);
00078 extern int ast_retrieve_call_to_death(char *uniqueid);
00079 extern struct ast_channel *ast_get_holded_call(char *uniqueid);
00080 
00081 /*! \brief Determine system parking extension
00082  *  Returns the call parking extension for drivers that provide special
00083     call parking help */
00084 char *ast_parking_ext(void);
00085 
00086 /*! \brief Determine system call pickup extension */
00087 char *ast_pickup_ext(void);
00088 
00089 /*! \brief Bridge a call, optionally allowing redirection */
00090 int ast_bridge_call(struct ast_channel *chan, struct ast_channel *peer,struct ast_bridge_config *config);
00091 
00092 /*! \brief Pickup a call */
00093 int ast_pickup_call(struct ast_channel *chan);
00094 
00095 /*! \brief register new feature into feature_set 
00096    \param feature an ast_call_feature object which contains a keysequence
00097    and a callback function which is called when this keysequence is pressed
00098    during a call. */
00099 void ast_register_feature(struct ast_call_feature *feature);
00100 
00101 /*! \brief unregister feature from feature_set
00102     \param feature the ast_call_feature object which was registered before*/
00103 void ast_unregister_feature(struct ast_call_feature *feature);
00104 
00105 #endif /* _AST_FEATURES_H */

Generated on Thu Oct 8 21:57:26 2009 for Asterisk - the Open Source PBX by  doxygen 1.5.8