2001-11-02 01:22:37 +00:00
|
|
|
/*
|
2005-08-30 18:32:10 +00:00
|
|
|
* Asterisk -- An open source telephony toolkit.
|
2001-11-02 01:22:37 +00:00
|
|
|
*
|
2005-08-30 18:32:10 +00:00
|
|
|
* Copyright (C) 1999 - 2005, Digium, Inc.
|
2001-11-02 01:22:37 +00:00
|
|
|
*
|
2005-08-30 18:32:10 +00:00
|
|
|
* Mark Spencer <markster@digium.com>
|
2001-11-02 01:22:37 +00:00
|
|
|
*
|
2005-08-30 18:32:10 +00:00
|
|
|
* See http://www.asterisk.org for more information about
|
|
|
|
|
* the Asterisk project. Please do not directly contact
|
|
|
|
|
* any of the maintainers of this project for assistance;
|
|
|
|
|
* the project provides a web site, mailing lists and IRC
|
|
|
|
|
* channels for your use.
|
2001-11-02 01:22:37 +00:00
|
|
|
*
|
2005-08-30 18:32:10 +00:00
|
|
|
* This program is free software, distributed under the terms of
|
|
|
|
|
* the GNU General Public License Version 2. See the LICENSE file
|
|
|
|
|
* at the top of the source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
2005-10-24 20:12:06 +00:00
|
|
|
/*! \file
|
|
|
|
|
* \brief Call Parking and Pickup API
|
2001-11-02 01:22:37 +00:00
|
|
|
* Includes code and algorithms from the Zapata library.
|
|
|
|
|
*/
|
|
|
|
|
|
2004-07-17 23:56:12 +00:00
|
|
|
#ifndef _AST_FEATURES_H
|
|
|
|
|
#define _AST_FEATURES_H
|
2001-11-02 01:22:37 +00:00
|
|
|
|
2005-08-23 02:22:33 +00:00
|
|
|
#define FEATURE_MAX_LEN 11
|
|
|
|
|
#define FEATURE_APP_LEN 64
|
|
|
|
|
#define FEATURE_APP_ARGS_LEN 256
|
|
|
|
|
#define FEATURE_SNAME_LEN 32
|
|
|
|
|
#define FEATURE_EXTEN_LEN 32
|
|
|
|
|
|
2005-10-24 20:12:06 +00:00
|
|
|
/*! \brief main call feature structure */
|
2005-08-23 02:22:33 +00:00
|
|
|
struct ast_call_feature {
|
|
|
|
|
int feature_mask;
|
|
|
|
|
char *fname;
|
|
|
|
|
char sname[FEATURE_SNAME_LEN];
|
|
|
|
|
char exten[FEATURE_MAX_LEN];
|
|
|
|
|
char default_exten[FEATURE_MAX_LEN];
|
|
|
|
|
int (*operation)(struct ast_channel *chan, struct ast_channel *peer, struct ast_bridge_config *config, char *code, int sense);
|
|
|
|
|
unsigned int flags;
|
|
|
|
|
char app[FEATURE_APP_LEN];
|
|
|
|
|
char app_args[FEATURE_APP_ARGS_LEN];
|
|
|
|
|
AST_LIST_ENTRY(ast_call_feature) feature_entry;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-10-24 20:12:06 +00:00
|
|
|
/*! \brief Park a call and read back parked location
|
|
|
|
|
* \param chan the channel to actually be parked
|
2001-11-02 01:22:37 +00:00
|
|
|
\param host the channel which will have the parked location read to
|
|
|
|
|
Park the channel chan, and read back the parked location to the
|
|
|
|
|
host. If the call is not picked up within a specified period of
|
|
|
|
|
time, then the call will return to the last step that it was in
|
|
|
|
|
(in terms of exten, priority and context)
|
2002-10-11 14:55:03 +00:00
|
|
|
\param timeout is a timeout in milliseconds
|
|
|
|
|
\param extout is a parameter to an int that will hold the parked location, or NULL if you want
|
2001-11-02 01:22:37 +00:00
|
|
|
*/
|
2006-03-31 00:11:45 +00:00
|
|
|
int ast_park_call(struct ast_channel *chan, struct ast_channel *host, int timeout, int *extout);
|
2005-10-24 20:12:06 +00:00
|
|
|
|
|
|
|
|
/*! \brief Park a call via a masqueraded channel
|
|
|
|
|
* \param rchan the real channel to be parked
|
2001-11-02 01:22:37 +00:00
|
|
|
\param host the channel to have the parking read to
|
|
|
|
|
Masquerade the channel rchan into a new, empty channel which is then
|
|
|
|
|
parked with ast_park_call
|
2002-10-11 14:55:03 +00:00
|
|
|
\param timeout is a timeout in milliseconds
|
|
|
|
|
\param extout is a parameter to an int that will hold the parked location, or NULL if you want
|
2001-11-02 01:22:37 +00:00
|
|
|
*/
|
2006-03-31 00:11:45 +00:00
|
|
|
int ast_masq_park_call(struct ast_channel *rchan, struct ast_channel *host, int timeout, int *extout);
|
2001-11-02 01:22:37 +00:00
|
|
|
|
2005-10-24 20:12:06 +00:00
|
|
|
/*! \brief Determine system parking extension
|
|
|
|
|
* Returns the call parking extension for drivers that provide special
|
2001-11-02 01:22:37 +00:00
|
|
|
call parking help */
|
2006-03-31 00:11:45 +00:00
|
|
|
char *ast_parking_ext(void);
|
2001-11-02 01:22:37 +00:00
|
|
|
|
2005-10-24 20:12:06 +00:00
|
|
|
/*! \brief Determine system call pickup extension */
|
2006-03-31 00:11:45 +00:00
|
|
|
char *ast_pickup_ext(void);
|
2001-11-02 01:22:37 +00:00
|
|
|
|
2005-10-24 20:12:06 +00:00
|
|
|
/*! \brief Bridge a call, optionally allowing redirection */
|
2006-03-31 00:11:45 +00:00
|
|
|
int ast_bridge_call(struct ast_channel *chan, struct ast_channel *peer,struct ast_bridge_config *config);
|
2004-04-26 23:22:34 +00:00
|
|
|
|
2005-10-24 20:12:06 +00:00
|
|
|
/*! \brief Pickup a call */
|
2006-03-31 00:11:45 +00:00
|
|
|
int ast_pickup_call(struct ast_channel *chan);
|
2003-04-09 04:00:43 +00:00
|
|
|
|
2005-10-24 20:12:06 +00:00
|
|
|
/*! \brief register new feature into feature_set
|
2005-08-23 02:22:33 +00:00
|
|
|
\param feature an ast_call_feature object which contains a keysequence
|
|
|
|
|
and a callback function which is called when this keysequence is pressed
|
|
|
|
|
during a call. */
|
2006-03-31 00:11:45 +00:00
|
|
|
void ast_register_feature(struct ast_call_feature *feature);
|
2005-08-23 02:22:33 +00:00
|
|
|
|
2005-10-24 20:12:06 +00:00
|
|
|
/*! \brief unregister feature from feature_set
|
2005-08-23 02:22:33 +00:00
|
|
|
\param feature the ast_call_feature object which was registered before*/
|
2006-03-31 00:11:45 +00:00
|
|
|
void ast_unregister_feature(struct ast_call_feature *feature);
|
2001-11-02 01:22:37 +00:00
|
|
|
|
2004-07-17 23:56:12 +00:00
|
|
|
#endif /* _AST_FEATURES_H */
|