static struct ast_channel *mbl_new(int state, struct mbl_pvt *pvt, char *cid_num,
const struct ast_channel *requestor);
static struct ast_channel *mbl_request(const char *type, struct ast_format_cap *cap,
- const struct ast_channel *requestor, void *data, int *cause);
-static int mbl_call(struct ast_channel *ast, char *dest, int timeout);
+ const struct ast_channel *requestor, const char *data, int *cause);
+static int mbl_call(struct ast_channel *ast, const char *dest, int timeout);
static int mbl_hangup(struct ast_channel *ast);
static int mbl_answer(struct ast_channel *ast);
static int mbl_digit_end(struct ast_channel *ast, char digit, unsigned int duration);
static struct ast_frame *mbl_read(struct ast_channel *ast);
static int mbl_write(struct ast_channel *ast, struct ast_frame *frame);
static int mbl_fixup(struct ast_channel *oldchan, struct ast_channel *newchan);
-static int mbl_devicestate(void *data);
+static int mbl_devicestate(const char *data);
static void do_alignment_detection(struct mbl_pvt *pvt, char *buf, int buflen);
}
static struct ast_channel *mbl_request(const char *type, struct ast_format_cap *cap,
- const struct ast_channel *requestor, void *data, int *cause)
+ const struct ast_channel *requestor, const char *data, int *cause)
{
struct ast_channel *chn = NULL;
return NULL;
}
- dest_dev = ast_strdupa((char *)data);
+ dest_dev = ast_strdupa(data);
dest_num = strchr(dest_dev, '/');
if (dest_num)
}
-static int mbl_call(struct ast_channel *ast, char *dest, int timeout)
+static int mbl_call(struct ast_channel *ast, const char *dest, int timeout)
{
-
struct mbl_pvt *pvt;
- char *dest_dev = NULL;
+ char *dest_dev;
char *dest_num = NULL;
- dest_dev = ast_strdupa((char *)dest);
+ dest_dev = ast_strdupa(dest);
pvt = ast->tech_pvt;
}
-static int mbl_devicestate(void *data)
+static int mbl_devicestate(const char *data)
{
char *device;
int res = AST_DEVICE_INVALID;
struct mbl_pvt *pvt;
- device = ast_strdupa(S_OR((char *) data, ""));
+ device = ast_strdupa(S_OR(data, ""));
ast_debug(1, "Checking device state for device %s\n", device);
/* Channel Definition */
static struct ast_channel *ooh323_request(const char *type, struct ast_format_cap *cap,
- const struct ast_channel *requestor, void *data, int *cause);
+ const struct ast_channel *requestor, const char *data, int *cause);
static int ooh323_digit_begin(struct ast_channel *ast, char digit);
static int ooh323_digit_end(struct ast_channel *ast, char digit, unsigned int duration);
-static int ooh323_call(struct ast_channel *ast, char *dest, int timeout);
+static int ooh323_call(struct ast_channel *ast, const char *dest, int timeout);
static int ooh323_hangup(struct ast_channel *ast);
static int ooh323_answer(struct ast_channel *ast);
static struct ast_frame *ooh323_read(struct ast_channel *ast);
Possible data values - peername, exten/peername, exten@ip
*/
static struct ast_channel *ooh323_request(const char *type, struct ast_format_cap *cap,
- const struct ast_channel *requestor, void *data, int *cause)
+ const struct ast_channel *requestor, const char *data, int *cause)
{
struct ast_channel *chan = NULL;
int port = 0;
if (gH323Debug)
- ast_verb(0, "--- ooh323_request - data %s format %s\n", (char*)data,
+ ast_verb(0, "--- ooh323_request - data %s format %s\n", data,
ast_getformatname_multiple(formats,FORMAT_STRING_SIZE,cap));
if (!(ast_format_cap_has_type(cap, AST_FORMAT_TYPE_AUDIO))) {
p = ooh323_alloc(0,0); /* Initial callRef is zero */
if (!p) {
- ast_log(LOG_WARNING, "Unable to build pvt data for '%s'\n", (char*)data);
+ ast_log(LOG_WARNING, "Unable to build pvt data for '%s'\n", data);
return NULL;
}
ast_mutex_lock(&p->lock);
}
-static int ooh323_call(struct ast_channel *ast, char *dest, int timeout)
+static int ooh323_call(struct ast_channel *ast, const char *dest, int timeout)
{
struct ooh323_pvt *p = ast->tech_pvt;
char destination[256];
{
return 0;
}
-static struct ast_channel *rec_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, void *data, int *cause);
+static struct ast_channel *rec_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *data, int *cause);
static struct ast_channel_tech record_tech = {
.type = "ConfBridgeRec",
.description = "Conference Bridge Recording Channel",
.read = rec_read,
.write = rec_write,
};
-static struct ast_channel *rec_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, void *data, int *cause)
+static struct ast_channel *rec_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *data, int *cause)
{
struct ast_channel *tmp;
struct ast_format fmt;
} while(0)
/*--- Forward declarations */
-static struct ast_channel *agent_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, void *data, int *cause);
-static int agent_devicestate(void *data);
+static struct ast_channel *agent_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *data, int *cause);
+static int agent_devicestate(const char *data);
static int agent_digit_begin(struct ast_channel *ast, char digit);
static int agent_digit_end(struct ast_channel *ast, char digit, unsigned int duration);
-static int agent_call(struct ast_channel *ast, char *dest, int timeout);
+static int agent_call(struct ast_channel *ast, const char *dest, int timeout);
static int agent_hangup(struct ast_channel *ast);
static int agent_answer(struct ast_channel *ast);
static struct ast_frame *agent_read(struct ast_channel *ast);
return 0;
}
-static int agent_call(struct ast_channel *ast, char *dest, int timeout)
+static int agent_call(struct ast_channel *ast, const char *dest, int timeout)
{
struct agent_pvt *p = ast->tech_pvt;
int res = -1;
}
/*! \brief Part of the Asterisk PBX interface */
-static struct ast_channel *agent_request(const char *type, struct ast_format_cap *cap, const struct ast_channel* requestor, void *data, int *cause)
+static struct ast_channel *agent_request(const char *type, struct ast_format_cap *cap, const struct ast_channel* requestor, const char *data, int *cause)
{
struct agent_pvt *p;
struct ast_channel *chan = NULL;
- char *s;
+ const char *s;
ast_group_t groupmatch;
int groupoff;
int waitforagent=0;
}
/*! \brief Part of PBX channel interface */
-static int agent_devicestate(void *data)
+static int agent_devicestate(const char *data)
{
struct agent_pvt *p;
- char *s;
+ const char *s;
ast_group_t groupmatch;
int groupoff;
int res = AST_DEVICE_INVALID;
static int mute = 0;
static int noaudiocapture = 0;
-static struct ast_channel *alsa_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, void *data, int *cause);
+static struct ast_channel *alsa_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *data, int *cause);
static int alsa_digit(struct ast_channel *c, char digit, unsigned int duration);
static int alsa_text(struct ast_channel *c, const char *text);
static int alsa_hangup(struct ast_channel *c);
static int alsa_answer(struct ast_channel *c);
static struct ast_frame *alsa_read(struct ast_channel *chan);
-static int alsa_call(struct ast_channel *c, char *dest, int timeout);
+static int alsa_call(struct ast_channel *c, const char *dest, int timeout);
static int alsa_write(struct ast_channel *chan, struct ast_frame *f);
static int alsa_indicate(struct ast_channel *chan, int cond, const void *data, size_t datalen);
static int alsa_fixup(struct ast_channel *oldchan, struct ast_channel *newchan);
}
}
-static int alsa_call(struct ast_channel *c, char *dest, int timeout)
+static int alsa_call(struct ast_channel *c, const char *dest, int timeout)
{
struct ast_frame f = { AST_FRAME_CONTROL };
return tmp;
}
-static struct ast_channel *alsa_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, void *data, int *cause)
+static struct ast_channel *alsa_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *data, int *cause)
{
struct ast_format tmpfmt;
char buf[256];
#include "asterisk/bridging.h"
#include "asterisk/astobj2.h"
-static struct ast_channel *bridge_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, void *data, int *cause);
-static int bridge_call(struct ast_channel *ast, char *dest, int timeout);
+static struct ast_channel *bridge_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *data, int *cause);
+static int bridge_call(struct ast_channel *ast, const char *dest, int timeout);
static int bridge_hangup(struct ast_channel *ast);
static struct ast_frame *bridge_read(struct ast_channel *ast);
static int bridge_write(struct ast_channel *ast, struct ast_frame *f);
}
/*! \brief Called when the channel should actually be dialed */
-static int bridge_call(struct ast_channel *ast, char *dest, int timeout)
+static int bridge_call(struct ast_channel *ast, const char *dest, int timeout)
{
struct bridge_pvt *p = ast->tech_pvt;
}
/*! \brief Called when we want to place a call somewhere, but not actually call it... yet */
-static struct ast_channel *bridge_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, void *data, int *cause)
+static struct ast_channel *bridge_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *data, int *cause)
{
struct bridge_pvt *p = NULL;
struct ast_format slin;
/*! Channel Technology Callbacks @{ */
static struct ast_channel *console_request(const char *type, struct ast_format_cap *cap,
- const struct ast_channel *requestor, void *data, int *cause);
+ const struct ast_channel *requestor, const char *data, int *cause);
static int console_digit_begin(struct ast_channel *c, char digit);
static int console_digit_end(struct ast_channel *c, char digit, unsigned int duration);
static int console_text(struct ast_channel *c, const char *text);
static int console_hangup(struct ast_channel *c);
static int console_answer(struct ast_channel *c);
static struct ast_frame *console_read(struct ast_channel *chan);
-static int console_call(struct ast_channel *c, char *dest, int timeout);
+static int console_call(struct ast_channel *c, const char *dest, int timeout);
static int console_write(struct ast_channel *chan, struct ast_frame *f);
static int console_indicate(struct ast_channel *chan, int cond,
const void *data, size_t datalen);
return chan;
}
-static struct ast_channel *console_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, void *data, int *cause)
+static struct ast_channel *console_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *data, int *cause)
{
struct ast_channel *chan = NULL;
struct console_pvt *pvt;
char buf[512];
if (!(pvt = find_pvt(data))) {
- ast_log(LOG_ERROR, "Console device '%s' not found\n", (char *) data);
+ ast_log(LOG_ERROR, "Console device '%s' not found\n", data);
return NULL;
}
return &ast_null_frame;
}
-static int console_call(struct ast_channel *c, char *dest, int timeout)
+static int console_call(struct ast_channel *c, const char *dest, int timeout)
{
struct console_pvt *pvt = c->tech_pvt;
enum ast_control_frame_type ctrl;
}
-static struct ast_channel *dahdi_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, void *data, int *cause);
+static struct ast_channel *dahdi_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *data, int *cause);
static int dahdi_digit_begin(struct ast_channel *ast, char digit);
static int dahdi_digit_end(struct ast_channel *ast, char digit, unsigned int duration);
static int dahdi_sendtext(struct ast_channel *c, const char *text);
-static int dahdi_call(struct ast_channel *ast, char *rdest, int timeout);
+static int dahdi_call(struct ast_channel *ast, const char *rdest, int timeout);
static int dahdi_hangup(struct ast_channel *ast);
static int dahdi_answer(struct ast_channel *ast);
static struct ast_frame *dahdi_read(struct ast_channel *ast);
static int dahdi_queryoption(struct ast_channel *chan, int option, void *data, int *datalen);
static int dahdi_func_read(struct ast_channel *chan, const char *function, char *data, char *buf, size_t len);
static int dahdi_func_write(struct ast_channel *chan, const char *function, char *data, const char *value);
-static int dahdi_devicestate(void *data);
+static int dahdi_devicestate(const char *data);
static int dahdi_cc_callback(struct ast_channel *inbound, const char *dest, ast_cc_callback_fn callback);
static struct ast_channel_tech dahdi_tech = {
return 0;
}
-static int dahdi_call(struct ast_channel *ast, char *rdest, int timeout)
+static int dahdi_call(struct ast_channel *ast, const char *rdest, int timeout)
{
struct dahdi_pvt *p = ast->tech_pvt;
int x, res, mysig;
return p;
}
-static struct ast_channel *dahdi_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, void *data, int *cause)
+static struct ast_channel *dahdi_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *data, int *cause)
{
int callwait = 0;
struct dahdi_pvt *p;
#endif /* defined(HAVE_PRI) || defined(HAVE_SS7) */
break;
default:
- ast_log(LOG_WARNING, "Unknown option '%c' in '%s'\n", start.opt, (char *)data);
+ ast_log(LOG_WARNING, "Unknown option '%c' in '%s'\n", start.opt, data);
break;
}
}
#endif /* defined(HAVE_PRI) */
} else {
- snprintf(p->dialstring, sizeof(p->dialstring), "DAHDI/%s", (char *) data);
+ snprintf(p->dialstring, sizeof(p->dialstring), "DAHDI/%s", data);
}
break;
}
* \retval device_state enum ast_device_state value.
* \retval AST_DEVICE_UNKNOWN if we could not determine the device's state.
*/
-static int dahdi_devicestate(void *data)
+static int dahdi_devicestate(const char *data)
{
#if defined(HAVE_PRI)
- char *device;
+ const char *device;
unsigned span;
int res;
AST_MUTEX_DEFINE_STATIC(gtalklock); /*!< Protect the interface list (of gtalk_pvt's) */
/* Forward declarations */
-static struct ast_channel *gtalk_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, void *data, int *cause);
+static struct ast_channel *gtalk_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *data, int *cause);
/*static int gtalk_digit(struct ast_channel *ast, char digit, unsigned int duration);*/
static int gtalk_sendtext(struct ast_channel *ast, const char *text);
static int gtalk_digit_begin(struct ast_channel *ast, char digit);
static int gtalk_digit_end(struct ast_channel *ast, char digit, unsigned int duration);
-static int gtalk_call(struct ast_channel *ast, char *dest, int timeout);
+static int gtalk_call(struct ast_channel *ast, const char *dest, int timeout);
static int gtalk_hangup(struct ast_channel *ast);
static int gtalk_answer(struct ast_channel *ast);
static int gtalk_action(struct gtalk *client, struct gtalk_pvt *p, const char *action);
/*!\brief Initiate new call, part of PBX interface
* dest is the dial string */
-static int gtalk_call(struct ast_channel *ast, char *dest, int timeout)
+static int gtalk_call(struct ast_channel *ast, const char *dest, int timeout)
{
struct gtalk_pvt *p = ast->tech_pvt;
}
/*!\brief Part of PBX interface */
-static struct ast_channel *gtalk_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, void *data, int *cause)
+static struct ast_channel *gtalk_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *data, int *cause)
{
struct gtalk_pvt *p = NULL;
struct gtalk *client = NULL;
to = strsep(&s, "/");
}
if (!to) {
- ast_log(LOG_ERROR, "Bad arguments in Gtalk Dialstring: %s\n", (char*) data);
+ ast_log(LOG_ERROR, "Bad arguments in Gtalk Dialstring: %s\n", data);
return NULL;
}
}
static void delete_aliases(void);
static void prune_peers(void);
-static struct ast_channel *oh323_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, void *data, int *cause);
+static struct ast_channel *oh323_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *dest, int *cause);
static int oh323_digit_begin(struct ast_channel *c, char digit);
static int oh323_digit_end(struct ast_channel *c, char digit, unsigned int duration);
-static int oh323_call(struct ast_channel *c, char *dest, int timeout);
+static int oh323_call(struct ast_channel *c, const char *dest, int timeout);
static int oh323_hangup(struct ast_channel *c);
static int oh323_answer(struct ast_channel *c);
static struct ast_frame *oh323_read(struct ast_channel *c);
* destination.
* Returns -1 on error, 0 on success.
*/
-static int oh323_call(struct ast_channel *c, char *dest, int timeout)
+static int oh323_call(struct ast_channel *c, const char *dest, int timeout)
{
int res = 0;
struct oh323_pvt *pvt = (struct oh323_pvt *)c->tech_pvt;
return 0;
}
}
-static struct ast_channel *oh323_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, void *data, int *cause)
+static struct ast_channel *oh323_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *dest, int *cause)
{
struct oh323_pvt *pvt;
struct ast_channel *tmpc = NULL;
- char *dest = (char *)data;
char *ext, *host;
char *h323id = NULL;
char tmp[256], tmp1[256];
if (h323debug)
- ast_debug(1, "type=%s, format=%s, data=%s.\n", type, ast_getformatname_multiple(tmp, sizeof(tmp), cap), (char *)data);
+ ast_debug(1, "type=%s, format=%s, data=%s.\n", type, ast_getformatname_multiple(tmp, sizeof(tmp), cap), dest);
pvt = oh323_alloc(0);
if (!pvt) {
- ast_log(LOG_WARNING, "Unable to build pvt data for '%s'\n", (char *)data);
+ ast_log(LOG_WARNING, "Unable to build pvt data for '%s'\n", dest);
return NULL;
}
if (!(ast_format_cap_has_type(cap, AST_FORMAT_TYPE_AUDIO))) {
static enum ast_bridge_result iax2_bridge(struct ast_channel *c0, struct ast_channel *c1, int flags, struct ast_frame **fo, struct ast_channel **rc, int timeoutms);
static int expire_registry(const void *data);
static int iax2_answer(struct ast_channel *c);
-static int iax2_call(struct ast_channel *c, char *dest, int timeout);
-static int iax2_devicestate(void *data);
+static int iax2_call(struct ast_channel *c, const char *dest, int timeout);
+static int iax2_devicestate(const char *data);
static int iax2_digit_begin(struct ast_channel *c, char digit);
static int iax2_digit_end(struct ast_channel *c, char digit, unsigned int duration);
static int iax2_do_register(struct iax2_registry *reg);
static int send_command_immediate(struct chan_iax2_pvt *, char, int, unsigned int, const unsigned char *, int, int);
static int send_command_locked(unsigned short callno, char, int, unsigned int, const unsigned char *, int, int);
static int send_command_transfer(struct chan_iax2_pvt *, char, int, unsigned int, const unsigned char *, int);
-static struct ast_channel *iax2_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, void *data, int *cause);
+static struct ast_channel *iax2_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *data, int *cause);
static struct ast_frame *iax2_read(struct ast_channel *c);
static struct iax2_peer *build_peer(const char *name, struct ast_variable *v, struct ast_variable *alt, int temponly);
static struct iax2_user *build_user(const char *name, struct ast_variable *v, struct ast_variable *alt, int temponly);
}
}
-static int iax2_call(struct ast_channel *c, char *dest, int timeout)
+static int iax2_call(struct ast_channel *c, const char *dest, int timeout)
{
struct sockaddr_in sin;
char *l=NULL, *n=NULL, *tmpstr;
}
}
-static struct ast_channel *iax2_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, void *data, int *cause)
+static struct ast_channel *iax2_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *data, int *cause)
{
int callno;
int res;
parse_dial_string(tmpstr, &pds);
if (ast_strlen_zero(pds.peer)) {
- ast_log(LOG_WARNING, "No peer provided in the IAX2 dial string '%s'\n", (char *) data);
+ ast_log(LOG_WARNING, "No peer provided in the IAX2 dial string '%s'\n", data);
return NULL;
}
memset(&cai, 0, sizeof(cai));
}
/*! \brief Part of the device state notification system ---*/
-static int iax2_devicestate(void *data)
+static int iax2_devicestate(const char *data)
{
struct parsed_dial_string pds;
char *tmp = ast_strdupa(data);
parse_dial_string(tmp, &pds);
if (ast_strlen_zero(pds.peer)) {
- ast_log(LOG_WARNING, "No peer provided in the IAX2 dial string '%s'\n", (char *) data);
+ ast_log(LOG_WARNING, "No peer provided in the IAX2 dial string '%s'\n", data);
return res;
}
AST_MUTEX_DEFINE_STATIC(jinglelock); /*!< Protect the interface list (of jingle_pvt's) */
/* Forward declarations */
-static struct ast_channel *jingle_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, void *data, int *cause);
+static struct ast_channel *jingle_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *data, int *cause);
static int jingle_sendtext(struct ast_channel *ast, const char *text);
static int jingle_digit_begin(struct ast_channel *ast, char digit);
static int jingle_digit_end(struct ast_channel *ast, char digit, unsigned int duration);
-static int jingle_call(struct ast_channel *ast, char *dest, int timeout);
+static int jingle_call(struct ast_channel *ast, const char *dest, int timeout);
static int jingle_hangup(struct ast_channel *ast);
static int jingle_answer(struct ast_channel *ast);
static int jingle_newcall(struct jingle *client, ikspak *pak);
/*! \brief Initiate new call, part of PBX interface
* dest is the dial string */
-static int jingle_call(struct ast_channel *ast, char *dest, int timeout)
+static int jingle_call(struct ast_channel *ast, const char *dest, int timeout)
{
struct jingle_pvt *p = ast->tech_pvt;
}
/*! \brief Part of PBX interface */
-static struct ast_channel *jingle_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, void *data, int *cause)
+static struct ast_channel *jingle_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *data, int *cause)
{
struct jingle_pvt *p = NULL;
struct jingle *client = NULL;
if (sender && (sender[0] != '\0'))
to = strsep(&s, "/");
if (!to) {
- ast_log(LOG_ERROR, "Bad arguments in Jingle Dialstring: %s\n", (char*) data);
+ ast_log(LOG_ERROR, "Bad arguments in Jingle Dialstring: %s\n", data);
return NULL;
}
}
.target_extra = -1,
};
-static struct ast_channel *local_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, void *data, int *cause);
+static struct ast_channel *local_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *data, int *cause);
static int local_digit_begin(struct ast_channel *ast, char digit);
static int local_digit_end(struct ast_channel *ast, char digit, unsigned int duration);
-static int local_call(struct ast_channel *ast, char *dest, int timeout);
+static int local_call(struct ast_channel *ast, const char *dest, int timeout);
static int local_hangup(struct ast_channel *ast);
static int local_answer(struct ast_channel *ast);
static struct ast_frame *local_read(struct ast_channel *ast);
static int local_fixup(struct ast_channel *oldchan, struct ast_channel *newchan);
static int local_sendhtml(struct ast_channel *ast, int subclass, const char *data, int datalen);
static int local_sendtext(struct ast_channel *ast, const char *text);
-static int local_devicestate(void *data);
+static int local_devicestate(const char *data);
static struct ast_channel *local_bridgedchannel(struct ast_channel *chan, struct ast_channel *bridge);
static int local_queryoption(struct ast_channel *ast, int option, void *data, int *datalen);
static int local_setoption(struct ast_channel *chan, int option, void *data, int datalen);
}
/*! \brief Adds devicestate to local channels */
-static int local_devicestate(void *data)
+static int local_devicestate(const char *data)
{
char *exten = ast_strdupa(data);
char *context = NULL, *opts = NULL;
/*! \brief Initiate new call, part of PBX interface
* dest is the dial string */
-static int local_call(struct ast_channel *ast, char *dest, int timeout)
+static int local_call(struct ast_channel *ast, const char *dest, int timeout)
{
struct local_pvt *p = ast->tech_pvt;
int pvt_locked = 0;
}
/*! \brief Part of PBX interface */
-static struct ast_channel *local_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, void *data, int *cause)
+static struct ast_channel *local_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *data, int *cause)
{
struct local_pvt *p = NULL;
struct ast_channel *chan = NULL;
static char *mgcp_reload(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a);
static int reload_config(int reload);
-static struct ast_channel *mgcp_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, void *data, int *cause);
-static int mgcp_call(struct ast_channel *ast, char *dest, int timeout);
+static struct ast_channel *mgcp_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *dest, int *cause);
+static int mgcp_call(struct ast_channel *ast, const char *dest, int timeout);
static int mgcp_hangup(struct ast_channel *ast);
static int mgcp_answer(struct ast_channel *ast);
static struct ast_frame *mgcp_read(struct ast_channel *ast);
static int mgcp_fixup(struct ast_channel *oldchan, struct ast_channel *newchan);
static int mgcp_senddigit_begin(struct ast_channel *ast, char digit);
static int mgcp_senddigit_end(struct ast_channel *ast, char digit, unsigned int duration);
-static int mgcp_devicestate(void *data);
+static int mgcp_devicestate(const char *data);
static void add_header_offhook(struct mgcp_subchannel *sub, struct mgcp_request *resp, char *tone);
static int transmit_connect_with_sdp(struct mgcp_subchannel *sub, struct ast_rtp_instance *rtp);
static struct mgcp_gateway *build_gateway(char *cat, struct ast_variable *v);
return res;
}
-static int mgcp_call(struct ast_channel *ast, char *dest, int timeout)
+static int mgcp_call(struct ast_channel *ast, const char *dest, int timeout)
{
int res;
struct mgcp_endpoint *p;
*
* \return device status result (from devicestate.h) AST_DEVICE_INVALID (not available) or AST_DEVICE_UNKNOWN (available but unknown state)
*/
-static int mgcp_devicestate(void *data)
+static int mgcp_devicestate(const char *data)
{
struct mgcp_gateway *g;
struct mgcp_endpoint *e = NULL;
return 0;
}
-static struct ast_channel *mgcp_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, void *data, int *cause)
+static struct ast_channel *mgcp_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *dest, int *cause)
{
struct mgcp_subchannel *sub;
struct ast_channel *tmpc = NULL;
char tmp[256];
- char *dest = data;
if (!(ast_format_cap_has_joint(cap, global_capability))) {
ast_log(LOG_NOTICE, "Asked to get a channel of unsupported format '%s'\n", ast_getformatname_multiple(tmp, sizeof(tmp), cap));
/*** AST Indications Start ***/
/*****************************/
-static int misdn_call(struct ast_channel *ast, char *dest, int timeout)
+static int misdn_call(struct ast_channel *ast, const char *dest, int timeout)
{
int port = 0;
int r;
return cl;
}
-static struct ast_channel *misdn_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, void *data, int *cause)
+static struct ast_channel *misdn_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *data, int *cause)
{
struct ast_channel *ast;
char group[BUFFERSIZE + 1] = "";
AST_APP_ARG(opts); /* options token */
);
- snprintf(dial_str, sizeof(dial_str), "%s/%s", misdn_type, (char *) data);
+ snprintf(dial_str, sizeof(dial_str), "%s/%s", misdn_type, data);
/*
* data is ---v
static const char tdesc[] = "Multicast RTP Paging Channel Driver";
/* Forward declarations */
-static struct ast_channel *multicast_rtp_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, void *data, int *cause);
-static int multicast_rtp_call(struct ast_channel *ast, char *dest, int timeout);
+static struct ast_channel *multicast_rtp_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *data, int *cause);
+static int multicast_rtp_call(struct ast_channel *ast, const char *dest, int timeout);
static int multicast_rtp_hangup(struct ast_channel *ast);
static struct ast_frame *multicast_rtp_read(struct ast_channel *ast);
static int multicast_rtp_write(struct ast_channel *ast, struct ast_frame *f);
}
/*! \brief Function called when we should actually call the destination */
-static int multicast_rtp_call(struct ast_channel *ast, char *dest, int timeout)
+static int multicast_rtp_call(struct ast_channel *ast, const char *dest, int timeout)
{
struct ast_rtp_instance *instance = ast->tech_pvt;
}
/*! \brief Function called when we should prepare to call the destination */
-static struct ast_channel *multicast_rtp_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, void *data, int *cause)
+static struct ast_channel *multicast_rtp_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *data, int *cause)
{
char *tmp = ast_strdupa(data), *multicast_type = tmp, *destination, *control;
struct ast_rtp_instance *instance;
struct ast_module_user *u; /*! for holding a reference to this module */
};
-static struct ast_channel *nbs_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, void *data, int *cause);
-static int nbs_call(struct ast_channel *ast, char *dest, int timeout);
+static struct ast_channel *nbs_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *data, int *cause);
+static int nbs_call(struct ast_channel *ast, const char *dest, int timeout);
static int nbs_hangup(struct ast_channel *ast);
static struct ast_frame *nbs_xread(struct ast_channel *ast);
static int nbs_xwrite(struct ast_channel *ast, struct ast_frame *frame);
.write = nbs_xwrite,
};
-static int nbs_call(struct ast_channel *ast, char *dest, int timeout)
+static int nbs_call(struct ast_channel *ast, const char *dest, int timeout)
{
struct nbs_pvt *p;
ast_free(p);
}
-static struct nbs_pvt *nbs_alloc(void *data)
+static struct nbs_pvt *nbs_alloc(const char *data)
{
struct nbs_pvt *p;
int flags = 0;
}
-static struct ast_channel *nbs_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, void *data, int *cause)
+static struct ast_channel *nbs_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *data, int *cause)
{
struct nbs_pvt *p;
struct ast_channel *tmp = NULL;
static int setformat(struct chan_oss_pvt *o, int mode);
static struct ast_channel *oss_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor,
- void *data, int *cause);
+ const char *data, int *cause);
static int oss_digit_begin(struct ast_channel *c, char digit);
static int oss_digit_end(struct ast_channel *c, char digit, unsigned int duration);
static int oss_text(struct ast_channel *c, const char *text);
static int oss_hangup(struct ast_channel *c);
static int oss_answer(struct ast_channel *c);
static struct ast_frame *oss_read(struct ast_channel *chan);
-static int oss_call(struct ast_channel *c, char *dest, int timeout);
+static int oss_call(struct ast_channel *c, const char *dest, int timeout);
static int oss_write(struct ast_channel *chan, struct ast_frame *f);
static int oss_indicate(struct ast_channel *chan, int cond, const void *data, size_t datalen);
static int oss_fixup(struct ast_channel *oldchan, struct ast_channel *newchan);
/*!
* \brief handler for incoming calls. Either autoanswer, or start ringing
*/
-static int oss_call(struct ast_channel *c, char *dest, int timeout)
+static int oss_call(struct ast_channel *c, const char *dest, int timeout)
{
struct chan_oss_pvt *o = c->tech_pvt;
struct ast_frame f = { AST_FRAME_CONTROL, };
return c;
}
-static struct ast_channel *oss_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, void *data, int *cause)
+static struct ast_channel *oss_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *data, int *cause)
{
struct ast_channel *c;
struct chan_oss_pvt *o;
AST_NONSTANDARD_APP_ARGS(args, parse, '/');
o = find_desc(args.name);
- ast_log(LOG_WARNING, "oss_request ty <%s> data 0x%p <%s>\n", type, data, (char *) data);
+ ast_log(LOG_WARNING, "oss_request ty <%s> data 0x%p <%s>\n", type, data, data);
if (o == NULL) {
ast_log(LOG_NOTICE, "Device %s not found\n", args.name);
/* XXX we could default to 'dsp' perhaps ? */
static char cid_num[AST_MAX_EXTENSION];
static char cid_name[AST_MAX_EXTENSION];
-static struct ast_channel *phone_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, void *data, int *cause);
+static struct ast_channel *phone_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *data, int *cause);
static int phone_digit_begin(struct ast_channel *ast, char digit);
static int phone_digit_end(struct ast_channel *ast, char digit, unsigned int duration);
-static int phone_call(struct ast_channel *ast, char *dest, int timeout);
+static int phone_call(struct ast_channel *ast, const char *dest, int timeout);
static int phone_hangup(struct ast_channel *ast);
static int phone_answer(struct ast_channel *ast);
static struct ast_frame *phone_read(struct ast_channel *ast);
return 0;
}
-static int phone_call(struct ast_channel *ast, char *dest, int timeout)
+static int phone_call(struct ast_channel *ast, const char *dest, int timeout)
{
struct phone_pvt *p;
return -1;
if (p->mode == MODE_FXS) {
- char *digit = strchr(dest, '/');
+ const char *digit = strchr(dest, '/');
if (digit)
{
digit++;
return tmp;
}
-static struct ast_channel *phone_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, void *data, int *cause)
+static struct ast_channel *phone_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *data, int *cause)
{
struct phone_pvt *p;
struct ast_channel *tmp = NULL;
- char *name = data;
+ const char *name = data;
/* Search for an unowned channel */
if (ast_mutex_lock(&iflock)) {
in coming releases. */
/*--- PBX interface functions */
-static struct ast_channel *sip_request_call(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, void *data, int *cause);
-static int sip_devicestate(void *data);
+static struct ast_channel *sip_request_call(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *dest, int *cause);
+static int sip_devicestate(const char *data);
static int sip_sendtext(struct ast_channel *ast, const char *text);
-static int sip_call(struct ast_channel *ast, char *dest, int timeout);
+static int sip_call(struct ast_channel *ast, const char *dest, int timeout);
static int sip_sendhtml(struct ast_channel *chan, int subclass, const char *data, int datalen);
static int sip_hangup(struct ast_channel *ast);
static int sip_answer(struct ast_channel *ast);
/*--- Device monitoring and Device/extension state/event handling */
static int cb_extensionstate(const char *context, const char *exten, enum ast_extension_states state, void *data);
-static int sip_devicestate(void *data);
static int sip_poke_noanswer(const void *data);
static int sip_poke_peer(struct sip_peer *peer, int force);
static void sip_poke_all_peers(void);
/*! \brief Initiate SIP call from PBX
* used from the dial() application */
-static int sip_call(struct ast_channel *ast, char *dest, int timeout)
+static int sip_call(struct ast_channel *ast, const char *dest, int timeout)
{
int res;
struct sip_pvt *p = ast->tech_pvt; /* chan is locked, so the reference cannot go away */
!= AST_DEVICE_NOT_INUSE and != AST_DEVICE_UNKNOWN
*/
-static int sip_devicestate(void *data)
+static int sip_devicestate(const char *data)
{
char *host;
char *tmp;
* or SIP/host!dnid
* \endverbatim
*/
-static struct ast_channel *sip_request_call(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, void *data, int *cause)
+static struct ast_channel *sip_request_call(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *dest, int *cause)
{
struct sip_pvt *p;
struct ast_channel *tmpc = NULL;
char *ext = NULL, *host;
char tmp[256];
char tmp2[256];
- char *dest = data;
char *dnid;
char *secret = NULL;
char *md5secret = NULL;
AST_LIST_ENTRY(skinnysession) list;
};
-static struct ast_channel *skinny_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, void *data, int *cause);
+static struct ast_channel *skinny_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *dest, int *cause);
static AST_LIST_HEAD_STATIC(sessions, skinnysession);
-static int skinny_devicestate(void *data);
-static int skinny_call(struct ast_channel *ast, char *dest, int timeout);
+static int skinny_devicestate(const char *data);
+static int skinny_call(struct ast_channel *ast, const char *dest, int timeout);
static int skinny_hangup(struct ast_channel *ast);
static int skinny_answer(struct ast_channel *ast);
static struct ast_frame *skinny_read(struct ast_channel *ast);
return 0;
}
-static int skinny_call(struct ast_channel *ast, char *dest, int timeout)
+static int skinny_call(struct ast_channel *ast, const char *dest, int timeout)
{
int res = 0;
struct skinny_subchannel *sub = ast->tech_pvt;
return 0;
}
-static int skinny_devicestate(void *data)
+static int skinny_devicestate(const char *data)
{
struct skinny_line *l;
char *tmp;
return get_devicestate(l);
}
-static struct ast_channel *skinny_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, void *data, int *cause)
+static struct ast_channel *skinny_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *dest, int *cause)
{
struct skinny_line *l;
struct skinny_subline *subline = NULL;
struct ast_channel *tmpc = NULL;
char tmp[256];
- char *dest = data;
if (!(ast_format_cap_has_type(cap, AST_FORMAT_TYPE_AUDIO))) {
ast_log(LOG_NOTICE, "Asked to get a channel of unsupported format '%s'\n", ast_getformatname_multiple(tmp, sizeof(tmp), cap));
static int reload_config(void);
static void show_main_page(struct unistimsession *pte);
static struct ast_channel *unistim_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor,
- void *data, int *cause);
-static int unistim_call(struct ast_channel *ast, char *dest, int timeout);
+ const char *dest, int *cause);
+static int unistim_call(struct ast_channel *ast, const char *dest, int timeout);
static int unistim_hangup(struct ast_channel *ast);
static int unistim_answer(struct ast_channel *ast);
static struct ast_frame *unistim_read(struct ast_channel *ast);
/*--- unistim_call: Initiate UNISTIM call from PBX ---*/
/* used from the dial() application */
-static int unistim_call(struct ast_channel *ast, char *dest, int timeout)
+static int unistim_call(struct ast_channel *ast, const char *dest, int timeout)
{
int res = 0;
struct unistim_subchannel *sub;
/*--- unistim_request: PBX interface function ---*/
/* UNISTIM calls initiated by the PBX arrive here */
-static struct ast_channel *unistim_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, void *data,
+static struct ast_channel *unistim_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *dest,
int *cause)
{
struct unistim_subchannel *sub;
struct ast_channel *tmpc = NULL;
char tmp[256];
char tmp2[256];
- char *dest = data;
if (!(ast_format_cap_has_joint(cap, global_cap))) {
ast_log(LOG_NOTICE,
static struct ast_channel *usbradio_request(const char *type, struct ast_format_cap *cap,
const struct ast_channel *requestor,
- void *data, int *cause);
+ const char *data, int *cause);
static int usbradio_digit_begin(struct ast_channel *c, char digit);
static int usbradio_digit_end(struct ast_channel *c, char digit, unsigned int duration);
static int usbradio_text(struct ast_channel *c, const char *text);
static int usbradio_hangup(struct ast_channel *c);
static int usbradio_answer(struct ast_channel *c);
static struct ast_frame *usbradio_read(struct ast_channel *chan);
-static int usbradio_call(struct ast_channel *c, char *dest, int timeout);
+static int usbradio_call(struct ast_channel *c, const char *dest, int timeout);
static int usbradio_write(struct ast_channel *chan, struct ast_frame *f);
static int usbradio_indicate(struct ast_channel *chan, int cond, const void *data, size_t datalen);
static int usbradio_fixup(struct ast_channel *oldchan, struct ast_channel *newchan);
/*
* returns a pointer to the descriptor with the given name
*/
-static struct chan_usbradio_pvt *find_desc(char *dev)
+static struct chan_usbradio_pvt *find_desc(const char *dev)
{
struct chan_usbradio_pvt *o = NULL;
/*
* handler for incoming calls. Either autoanswer, or start ringing
*/
-static int usbradio_call(struct ast_channel *c, char *dest, int timeout)
+static int usbradio_call(struct ast_channel *c, const char *dest, int timeout)
{
struct chan_usbradio_pvt *o = c->tech_pvt;
}
/*
*/
-static struct ast_channel *usbradio_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, void *data, int *cause)
+static struct ast_channel *usbradio_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *data, int *cause)
{
struct ast_channel *c;
struct chan_usbradio_pvt *o = find_desc(data);
if (0)
{
- ast_log(LOG_WARNING, "usbradio_request type <%s> data 0x%p <%s>\n", type, data, (char *) data);
+ ast_log(LOG_WARNING, "usbradio_request type <%s> data 0x%p <%s>\n", type, data, data);
}
if (o == NULL) {
- ast_log(LOG_NOTICE, "Device %s not found\n", (char *) data);
+ ast_log(LOG_NOTICE, "Device %s not found\n", data);
/* XXX we could default to 'dsp' perhaps ? */
return NULL;
}
static struct ast_channel *vpb_new(struct vpb_pvt *i, enum ast_channel_state state, const char *context, const char *linkedid);
static void *do_chanreads(void *pvt);
-static struct ast_channel *vpb_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, void *data, int *cause);
+static struct ast_channel *vpb_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *data, int *cause);
static int vpb_digit_begin(struct ast_channel *ast, char digit);
static int vpb_digit_end(struct ast_channel *ast, char digit, unsigned int duration);
-static int vpb_call(struct ast_channel *ast, char *dest, int timeout);
+static int vpb_call(struct ast_channel *ast, const char *dest, int timeout);
static int vpb_hangup(struct ast_channel *ast);
static int vpb_answer(struct ast_channel *ast);
static struct ast_frame *vpb_read(struct ast_channel *ast);
}
/* Places a call out of a VPB channel */
-static int vpb_call(struct ast_channel *ast, char *dest, int timeout)
+static int vpb_call(struct ast_channel *ast, const char *dest, int timeout)
{
struct vpb_pvt *p = (struct vpb_pvt *)ast->tech_pvt;
int res = 0, i;
- char *s = strrchr(dest, '/');
+ const char *s = strrchr(dest, '/');
char dialstring[254] = "";
/*
return tmp;
}
-static struct ast_channel *vpb_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, void *vdata, int *cause)
+static struct ast_channel *vpb_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *data, int *cause)
{
struct vpb_pvt *p;
struct ast_channel *tmp = NULL;
- char *sepstr, *data = (char *)vdata, *name;
+ char *sepstr, *name;
const char *s;
int group = -1;
struct ast_format slin;
}
}
-int analog_call(struct analog_pvt *p, struct ast_channel *ast, char *rdest, int timeout)
+int analog_call(struct analog_pvt *p, struct ast_channel *ast, const char *rdest, int timeout)
{
int res, idx, mysig;
char *c, *n, *l;
void analog_free(struct analog_pvt *p);
-int analog_call(struct analog_pvt *p, struct ast_channel *ast, char *rdest, int timeout);
+int analog_call(struct analog_pvt *p, struct ast_channel *ast, const char *rdest, int timeout);
int analog_hangup(struct analog_pvt *p, struct ast_channel *ast);
END_OPTIONS);
/*! \note Parsing must remain in sync with sig_pri_extract_called_num_subaddr(). */
-int sig_pri_call(struct sig_pri_chan *p, struct ast_channel *ast, char *rdest, int timeout, int layer1)
+int sig_pri_call(struct sig_pri_chan *p, struct ast_channel *ast, const char *rdest, int timeout, int layer1)
{
char dest[256]; /* must be same length as p->dialdest */
struct ast_party_subaddress dialed_subaddress; /* Called subaddress */
};
void sig_pri_extract_called_num_subaddr(struct sig_pri_chan *p, const char *rdest, char *called, size_t called_buff_size);
-int sig_pri_call(struct sig_pri_chan *p, struct ast_channel *ast, char *rdest, int timeout, int layer1);
+int sig_pri_call(struct sig_pri_chan *p, struct ast_channel *ast, const char *rdest, int timeout, int layer1);
int sig_pri_hangup(struct sig_pri_chan *p, struct ast_channel *ast);
* \retval 0 on success.
* \retval -1 on error.
*/
-int sig_ss7_call(struct sig_ss7_chan *p, struct ast_channel *ast, char *rdest)
+int sig_ss7_call(struct sig_ss7_chan *p, struct ast_channel *ast, const char *rdest)
{
char ss7_called_nai;
int called_nai_strip;
int sig_ss7_add_sigchan(struct sig_ss7_linkset *linkset, int which, int ss7type, int transport, int inalarm, int networkindicator, int pointcode, int adjpointcode);
int sig_ss7_available(struct sig_ss7_chan *p);
-int sig_ss7_call(struct sig_ss7_chan *p, struct ast_channel *ast, char *rdest);
+int sig_ss7_call(struct sig_ss7_chan *p, struct ast_channel *ast, const char *rdest);
int sig_ss7_hangup(struct sig_ss7_chan *p, struct ast_channel *ast);
int sig_ss7_answer(struct sig_ss7_chan *p, struct ast_channel *ast);
void sig_ss7_fixup(struct ast_channel *oldchan, struct ast_channel *newchan, struct sig_ss7_chan *pchan);
struct ast_set_party_id to;
};
-/*! \brief Typedef for a custom read function */
-typedef int (*ast_acf_read_fn_t)(struct ast_channel *, const char *, char *, char *, size_t);
+/*!
+ * \brief Typedef for a custom read function
+ * \note data should be treated as const char *.
+ */
+typedef int (*ast_acf_read_fn_t)(struct ast_channel *chan, const char *function, char *data, char *buf, size_t len);
-/*! \brief Typedef for a custom read2 function */
-typedef int (*ast_acf_read2_fn_t)(struct ast_channel *, const char *, char *, struct ast_str **, ssize_t);
+/*!
+ * \brief Typedef for a custom read2 function
+ * \note data should be treated as const char *.
+ */
+typedef int (*ast_acf_read2_fn_t)(struct ast_channel *chan, const char *cmd, char *data, struct ast_str **str, ssize_t len);
-/*! \brief Typedef for a custom write function */
-typedef int (*ast_acf_write_fn_t)(struct ast_channel *, const char *, char *, const char *);
+/*!
+ * \brief Typedef for a custom write function
+ * \note data should be treated as const char *.
+ */
+typedef int (*ast_acf_write_fn_t)(struct ast_channel *chan, const char *function, char *data, const char *value);
/*! \brief Structure to handle passing func_channel_write info to channels via setoption */
typedef struct {
/*!
* \brief Requester - to set up call data structures (pvt's)
- * \note data should be treated as const char *.
+ *
+ * \param type type of channel to request
+ * \param cap Format capabilities for requested channel
+ * \param requestor channel asking for data
+ * \param addr destination of the call
+ * \param cause Cause of failure
+ *
+ * \details
+ * Request a channel of a given type, with addr as optional information used
+ * by the low level module
+ *
+ * \retval NULL failure
+ * \retval non-NULL channel on success
*/
- struct ast_channel *(* const requester)(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, void *data, int *cause);
+ struct ast_channel *(* const requester)(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *addr, int *cause);
- int (* const devicestate)(void *data); /*!< Devicestate call back */
+ int (* const devicestate)(const char *device_number); /*!< Devicestate call back */
/*!
* \brief Start sending a literal DTMF digit
int (* const send_digit_end)(struct ast_channel *chan, char digit, unsigned int duration);
/*!
- * \brief Call a given phone number (address, etc), but don't
- * take longer than timeout seconds to do so.
- * \note addr should be treated as const char *.
+ * \brief Make a call
+ * \note The channel is locked when called.
+ * \param chan which channel to make the call on
+ * \param addr destination of the call
+ * \param timeout time to wait on for connect (Doesn't seem to be used.)
+ * \retval 0 on success
+ * \retval -1 on failure
*/
- int (* const call)(struct ast_channel *chan, char *addr, int timeout);
+ int (* const call)(struct ast_channel *chan, const char *addr, int timeout);
/*! \brief Hangup (and possibly destroy) the channel */
int (* const hangup)(struct ast_channel *chan);
/*! \brief Find bridged channel */
struct ast_channel *(* const bridged_channel)(struct ast_channel *chan, struct ast_channel *bridge);
- /*! \brief Provide additional read items for CHANNEL() dialplan function */
+ /*!
+ * \brief Provide additional read items for CHANNEL() dialplan function
+ * \note data should be treated as a const char *.
+ */
int (* func_channel_read)(struct ast_channel *chan, const char *function, char *data, char *buf, size_t len);
- /*! \brief Provide additional write items for CHANNEL() dialplan function */
+ /*!
+ * \brief Provide additional write items for CHANNEL() dialplan function
+ * \note data should be treated as a const char *.
+ */
int (* func_channel_write)(struct ast_channel *chan, const char *function, char *data, const char *value);
/*! \brief Retrieve base channel (agent and local) */
* \brief Requests a channel
*
* \param type type of channel to request
- * \param format capabilities for requested channel
+ * \param request_cap Format capabilities for requested channel
* \param requestor channel asking for data
- * \param data data to pass to the channel requester (Should be treated as const char *)
- * \param status status
+ * \param addr destination of the call
+ * \param cause Cause of failure
*
* \details
- * Request a channel of a given type, with data as optional information used
+ * Request a channel of a given type, with addr as optional information used
* by the low level module
*
* \retval NULL failure
* \retval non-NULL channel on success
*/
-struct ast_channel *ast_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, void *data, int *status);
+struct ast_channel *ast_request(const char *type, struct ast_format_cap *request_cap, const struct ast_channel *requestor, const char *addr, int *cause);
/*!
* \brief Request a channel of a given type, with data as optional information used
* \param type type of channel to request
* \param format capabilities for requested channel
* \param requestor channel asking for data
- * \param data data to pass to the channel requester
+ * \param addr destination of the call
* \param timeout maximum amount of time to wait for an answer
* \param reason why unsuccessful (if unsuccessful)
* \param cid_num Caller-ID Number
* \return Returns an ast_channel on success or no answer, NULL on failure. Check the value of chan->_state
* to know if the call was answered or not.
*/
-struct ast_channel *ast_request_and_dial(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, void *data,
+struct ast_channel *ast_request_and_dial(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *addr,
int timeout, int *reason, const char *cid_num, const char *cid_name);
/*!
* \param type type of channel to request
* \param format capabilities for requested channel
* \param requestor channel requesting data
- * \param data data to pass to the channel requester
+ * \param addr destination of the call
* \param timeout maximum amount of time to wait for an answer
* \param reason why unsuccessful (if unsuccessful)
* \param cid_num Caller-ID Number
* \return Returns an ast_channel on success or no answer, NULL on failure. Check the value of chan->_state
* to know if the call was answered or not.
*/
-struct ast_channel *__ast_request_and_dial(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, void *data,
+struct ast_channel *__ast_request_and_dial(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *addr,
int timeout, int *reason, const char *cid_num, const char *cid_name, struct outgoing_helper *oh);
/*!
* \brief Make a call
* \note Absolutely _NO_ channel locks should be held before calling this function.
* \param chan which channel to make the call on
- * \param addr destination of the call (Should be treated as const char *)
- * \param timeout time to wait on for connect
+ * \param addr destination of the call
+ * \param timeout time to wait on for connect (Doesn't seem to be used.)
* \details
* Place a call, take no longer than timeout ms.
- * \return -1 on failure, 0 on not enough time
- * (does not automatically stop ringing), and
- * the number of seconds the connect took otherwise.
+ * \retval 0 on success
+ * \retval -1 on failure
*/
-int ast_call(struct ast_channel *chan, char *addr, int timeout);
+int ast_call(struct ast_channel *chan, const char *addr, int timeout);
/*!
* \brief Indicates condition of channel
/*! Synchronously or asynchronously make an outbound call and send it to a
particular extension */
-int ast_pbx_outgoing_exten(const char *type, struct ast_format_cap *cap, void *data, int timeout, const char *context, const char *exten, int priority, int *reason, int sync, const char *cid_num, const char *cid_name, struct ast_variable *vars, const char *account, struct ast_channel **locked_channel);
+int ast_pbx_outgoing_exten(const char *type, struct ast_format_cap *cap, const char *addr, int timeout, const char *context, const char *exten, int priority, int *reason, int sync, const char *cid_num, const char *cid_name, struct ast_variable *vars, const char *account, struct ast_channel **locked_channel);
/*! Synchronously or asynchronously make an outbound call and send it to a
particular application with given extension */
-int ast_pbx_outgoing_app(const char *type, struct ast_format_cap *cap, void *data, int timeout, const char *app, const char *appdata, int *reason, int sync, const char *cid_num, const char *cid_name, struct ast_variable *vars, const char *account, struct ast_channel **locked_channel);
+int ast_pbx_outgoing_app(const char *type, struct ast_format_cap *cap, const char *addr, int timeout, const char *app, const char *appdata, int *reason, int sync, const char *cid_num, const char *cid_name, struct ast_variable *vars, const char *account, struct ast_channel **locked_channel);
/*!
* \brief Evaluate a condition
return new_chan;
}
-struct ast_channel *__ast_request_and_dial(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, void *data, int timeout, int *outstate, const char *cid_num, const char *cid_name, struct outgoing_helper *oh)
+struct ast_channel *__ast_request_and_dial(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *addr, int timeout, int *outstate, const char *cid_num, const char *cid_name, struct outgoing_helper *oh)
{
int dummy_outstate;
int cause = 0;
else
outstate = &dummy_outstate; /* make outstate always a valid pointer */
- chan = ast_request(type, cap, requestor, data, &cause);
+ chan = ast_request(type, cap, requestor, addr, &cause);
if (!chan) {
- ast_log(LOG_NOTICE, "Unable to request channel %s/%s\n", type, (char *)data);
+ ast_log(LOG_NOTICE, "Unable to request channel %s/%s\n", type, addr);
handle_cause(cause, outstate);
return NULL;
}
}
ast_channel_set_connected_line(chan, &connected, NULL);
- if (ast_call(chan, data, 0)) { /* ast_call failed... */
- ast_log(LOG_NOTICE, "Unable to call channel %s/%s\n", type, (char *)data);
+ if (ast_call(chan, addr, 0)) { /* ast_call failed... */
+ ast_log(LOG_NOTICE, "Unable to call channel %s/%s\n", type, addr);
} else {
res = 1; /* mark success in case chan->_state is already AST_STATE_UP */
while (timeout && chan->_state != AST_STATE_UP) {
if (chan->cdr) {
char tmp[256];
- snprintf(tmp, sizeof(tmp), "%s/%s", type, (char *)data);
+ snprintf(tmp, sizeof(tmp), "%s/%s", type, addr);
ast_cdr_setapp(chan->cdr, "Dial", tmp);
ast_cdr_update(chan);
ast_cdr_start(chan->cdr);
return chan;
}
-struct ast_channel *ast_request_and_dial(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, void *data, int timeout, int *outstate, const char *cidnum, const char *cidname)
+struct ast_channel *ast_request_and_dial(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *addr, int timeout, int *outstate, const char *cidnum, const char *cidname)
{
- return __ast_request_and_dial(type, cap, requestor, data, timeout, outstate, cidnum, cidname, NULL);
+ return __ast_request_and_dial(type, cap, requestor, addr, timeout, outstate, cidnum, cidname, NULL);
}
static int set_security_requirements(const struct ast_channel *requestor, struct ast_channel *out)
return 0;
}
-struct ast_channel *ast_request(const char *type, struct ast_format_cap *request_cap, const struct ast_channel *requestor, void *data, int *cause)
+struct ast_channel *ast_request(const char *type, struct ast_format_cap *request_cap, const struct ast_channel *requestor, const char *addr, int *cause)
{
struct chanlist *chan;
struct ast_channel *c;
ast_format_cap_remove_bytype(joint_cap, AST_FORMAT_TYPE_AUDIO);
ast_format_cap_add(joint_cap, &best_audio_fmt);
- if (!(c = chan->tech->requester(type, joint_cap, requestor, data, cause))) {
+ if (!(c = chan->tech->requester(type, joint_cap, requestor, addr, cause))) {
ast_format_cap_destroy(joint_cap);
return NULL;
}
return NULL;
}
-int ast_call(struct ast_channel *chan, char *addr, int timeout)
+int ast_call(struct ast_channel *chan, const char *addr, int timeout)
{
/* Place an outgoing call, but don't wait any longer than timeout ms before returning.
If the remote end does not answer within the timeout, then do NOT hang up, but
static struct ast_channel *feature_request_and_dial(struct ast_channel *caller,
const char *caller_name, struct ast_channel *requestor,
- struct ast_channel *transferee, const char *type, struct ast_format_cap *cap, void *data,
+ struct ast_channel *transferee, const char *type, struct ast_format_cap *cap, const char *addr,
int timeout, int *outstate, const char *language);
/*!
* \param transferee Channel that the dialed channel will be transferred to.
* \param type Channel technology type to dial.
* \param format Codec formats for dialed channel.
- * \param data Dialed channel extra parameters for ast_request() and ast_call().
+ * \param addr destination of the call
* \param timeout Time limit for dialed channel to answer in ms. Must be greater than zero.
* \param outstate Status of dialed channel if unsuccessful.
* \param language Language of the caller.
*/
static struct ast_channel *feature_request_and_dial(struct ast_channel *caller,
const char *caller_name, struct ast_channel *requestor,
- struct ast_channel *transferee, const char *type, struct ast_format_cap *cap, void *data,
+ struct ast_channel *transferee, const char *type, struct ast_format_cap *cap, const char *addr,
int timeout, int *outstate, const char *language)
{
int state = 0;
caller_hungup = ast_check_hangup(caller);
- if (!(chan = ast_request(type, tmp_cap, requestor, data, &cause))) {
- ast_log(LOG_NOTICE, "Unable to request channel %s/%s\n", type, (char *)data);
+ if (!(chan = ast_request(type, tmp_cap, requestor, addr, &cause))) {
+ ast_log(LOG_NOTICE, "Unable to request channel %s/%s\n", type, addr);
switch (cause) {
case AST_CAUSE_BUSY:
state = AST_CONTROL_BUSY;
ast_connected_line_copy_from_caller(&chan->connected, &requestor->caller);
ast_channel_unlock(chan);
- if (ast_call(chan, data, timeout)) {
- ast_log(LOG_NOTICE, "Unable to call channel %s/%s\n", type, (char *)data);
+ if (ast_call(chan, addr, timeout)) {
+ ast_log(LOG_NOTICE, "Unable to call channel %s/%s\n", type, addr);
switch (chan->hangupcause) {
case AST_CAUSE_BUSY:
state = AST_CONTROL_BUSY;
char requested_channel[AST_CHANNEL_NAME];
if (!ast_strlen_zero(in->app)) {
- res = ast_pbx_outgoing_app(in->tech, in->cap, (char *) in->data,
+ res = ast_pbx_outgoing_app(in->tech, in->cap, in->data,
in->timeout, in->app, in->appdata, &reason, 1,
S_OR(in->cid_num, NULL),
S_OR(in->cid_name, NULL),
in->vars, in->account, &chan);
} else {
- res = ast_pbx_outgoing_exten(in->tech, in->cap, (char *) in->data,
+ res = ast_pbx_outgoing_exten(in->tech, in->cap, in->data,
in->timeout, in->context, in->exten, in->priority, &reason, 1,
S_OR(in->cid_num, NULL),
S_OR(in->cid_name, NULL),
return 0; /* success */
}
-int ast_pbx_outgoing_exten(const char *type, struct ast_format_cap *cap, void *data, int timeout, const char *context, const char *exten, int priority, int *reason, int synchronous, const char *cid_num, const char *cid_name, struct ast_variable *vars, const char *account, struct ast_channel **channel)
+int ast_pbx_outgoing_exten(const char *type, struct ast_format_cap *cap, const char *addr, int timeout, const char *context, const char *exten, int priority, int *reason, int synchronous, const char *cid_num, const char *cid_name, struct ast_variable *vars, const char *account, struct ast_channel **channel)
{
struct ast_channel *chan;
struct async_stat *as;
oh.vars = vars;
oh.parent_channel = NULL;
- chan = __ast_request_and_dial(type, cap, NULL, data, timeout, reason, cid_num, cid_name, &oh);
+ chan = __ast_request_and_dial(type, cap, NULL, addr, timeout, reason, cid_num, cid_name, &oh);
if (channel) {
*channel = chan;
if (chan)
res = -1;
goto outgoing_exten_cleanup;
}
- chan = ast_request_and_dial(type, cap, NULL, data, timeout, reason, cid_num, cid_name);
+ chan = ast_request_and_dial(type, cap, NULL, addr, timeout, reason, cid_num, cid_name);
if (channel) {
*channel = chan;
if (chan)
return NULL;
}
-int ast_pbx_outgoing_app(const char *type, struct ast_format_cap *cap, void *data, int timeout, const char *app, const char *appdata, int *reason, int synchronous, const char *cid_num, const char *cid_name, struct ast_variable *vars, const char *account, struct ast_channel **locked_channel)
+int ast_pbx_outgoing_app(const char *type, struct ast_format_cap *cap, const char *addr, int timeout, const char *app, const char *appdata, int *reason, int synchronous, const char *cid_num, const char *cid_name, struct ast_variable *vars, const char *account, struct ast_channel **locked_channel)
{
struct ast_channel *chan;
struct app_tmp *tmp;
goto outgoing_app_cleanup;
}
if (synchronous) {
- chan = __ast_request_and_dial(type, cap, NULL, data, timeout, reason, cid_num, cid_name, &oh);
+ chan = __ast_request_and_dial(type, cap, NULL, addr, timeout, reason, cid_num, cid_name, &oh);
if (chan) {
ast_set_variables(chan, vars);
if (account)
res = -1;
goto outgoing_app_cleanup;
}
- chan = __ast_request_and_dial(type, cap, NULL, data, timeout, reason, cid_num, cid_name, &oh);
+ chan = __ast_request_and_dial(type, cap, NULL, addr, timeout, reason, cid_num, cid_name, &oh);
if (!chan) {
ast_free(as);
res = -1;
int res, reason;
if (!ast_strlen_zero(o->app)) {
ast_verb(3, "Attempting call on %s/%s for application %s(%s) (Retry %d)\n", o->tech, o->dest, o->app, o->data, o->retries);
- res = ast_pbx_outgoing_app(o->tech, o->capabilities, (void *) o->dest, o->waittime * 1000, o->app, o->data, &reason, 2 /* wait to finish */, o->cid_num, o->cid_name, o->vars, o->account, NULL);
+ res = ast_pbx_outgoing_app(o->tech, o->capabilities, o->dest, o->waittime * 1000,
+ o->app, o->data, &reason, 2 /* wait to finish */, o->cid_num, o->cid_name,
+ o->vars, o->account, NULL);
o->vars = NULL;
} else {
ast_verb(3, "Attempting call on %s/%s for %s@%s:%d (Retry %d)\n", o->tech, o->dest, o->exten, o->context,o->priority, o->retries);
- res = ast_pbx_outgoing_exten(o->tech, o->capabilities, (void *) o->dest, o->waittime * 1000, o->context, o->exten, o->priority, &reason, 2 /* wait to finish */, o->cid_num, o->cid_name, o->vars, o->account, NULL);
+ res = ast_pbx_outgoing_exten(o->tech, o->capabilities, o->dest,
+ o->waittime * 1000, o->context, o->exten, o->priority, &reason,
+ 2 /* wait to finish */, o->cid_num, o->cid_name, o->vars, o->account, NULL);
o->vars = NULL;
}
if (res) {