Constify some more channel driver technology callback parameters.

Review: https://reviewboard.asterisk.org/r/1707/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353685 65c4cc65-6c06-0410-ace0-fbb531ad65f3
certified/11.2
Richard Mudgett 15 years ago
parent 797d633139
commit 23bc964e1c

@ -198,15 +198,15 @@ static char *mblsendsms_desc =
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);
@ -868,7 +868,7 @@ e_return:
}
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;
@ -890,7 +890,7 @@ static struct ast_channel *mbl_request(const char *type, struct ast_format_cap *
return NULL;
}
dest_dev = ast_strdupa((char *)data);
dest_dev = ast_strdupa(data);
dest_num = strchr(dest_dev, '/');
if (dest_num)
@ -939,14 +939,13 @@ static struct ast_channel *mbl_request(const char *type, struct ast_format_cap *
}
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;
@ -1179,14 +1178,14 @@ 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)
{
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);

@ -71,10 +71,10 @@ static struct ast_jb_conf global_jbconf;
/* 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);
@ -561,7 +561,7 @@ static struct ooh323_pvt *ooh323_alloc(int callref, char *callToken)
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;
@ -574,7 +574,7 @@ static struct ast_channel *ooh323_request(const char *type, struct ast_format_ca
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))) {
@ -585,7 +585,7 @@ static struct ast_channel *ooh323_request(const char *type, struct ast_format_ca
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);
@ -917,7 +917,7 @@ static int ooh323_digit_end(struct ast_channel *chan, char digit, unsigned int d
}
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];

@ -358,7 +358,7 @@ static int rec_write(struct ast_channel *ast, struct ast_frame *f)
{
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",
@ -366,7 +366,7 @@ static struct ast_channel_tech record_tech = {
.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;

@ -330,11 +330,11 @@ static AST_LIST_HEAD_STATIC(agents, agent_pvt); /*!< Holds the list of agents (l
} 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);
@ -772,7 +772,7 @@ static int agent_digit_end(struct ast_channel *ast, char digit, unsigned int dur
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;
@ -1353,11 +1353,11 @@ static int check_beep(struct agent_pvt *newlyavailable, int needlock)
}
/*! \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;
@ -2240,10 +2240,10 @@ static int agentmonitoroutgoing_exec(struct ast_channel *chan, const char *data)
}
/*! \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;

@ -135,13 +135,13 @@ static int autoanswer = 1;
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);
@ -313,7 +313,7 @@ static void grab_owner(void)
}
}
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 };
@ -597,7 +597,7 @@ static struct ast_channel *alsa_new(struct chan_alsa_pvt *p, int state, const ch
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];

@ -51,8 +51,8 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#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);
@ -116,7 +116,7 @@ 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;
@ -155,7 +155,7 @@ static int bridge_hangup(struct ast_channel *ast)
}
/*! \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;

@ -186,14 +186,14 @@ static struct ast_jb_conf global_jbconf;
/*! 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);
@ -444,14 +444,14 @@ static struct ast_channel *console_new(struct console_pvt *pvt, const char *ext,
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;
}
@ -554,7 +554,7 @@ static struct ast_frame *console_read(struct ast_channel *chan)
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;

@ -1505,11 +1505,11 @@ static struct dahdi_chan_conf dahdi_chan_conf_default(void)
}
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);
@ -1521,7 +1521,7 @@ static int dahdi_setoption(struct ast_channel *chan, int option, void *data, int
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 = {
@ -5322,7 +5322,7 @@ static int dahdi_callwait(struct ast_channel *ast)
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;
@ -13594,7 +13594,7 @@ static struct dahdi_pvt *determine_starting_point(const char *data, struct dahdi
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;
@ -13666,7 +13666,7 @@ static struct ast_channel *dahdi_request(const char *type, struct ast_format_cap
#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;
}
@ -13716,7 +13716,7 @@ static struct ast_channel *dahdi_request(const char *type, struct ast_format_cap
}
#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;
}
@ -13764,10 +13764,10 @@ next:
* \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;

@ -175,12 +175,12 @@ static struct ast_format_cap *global_capability;
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);
@ -1852,7 +1852,7 @@ static int gtalk_sendhtml(struct ast_channel *ast, int subclass, const char *dat
/*!\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;
@ -1897,7 +1897,7 @@ static int gtalk_hangup(struct ast_channel *ast)
}
/*!\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;
@ -1912,7 +1912,7 @@ static struct ast_channel *gtalk_request(const char *type, struct ast_format_cap
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;
}
}

@ -242,10 +242,10 @@ static void delete_users(void);
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);
@ -587,7 +587,7 @@ static int oh323_digit_end(struct ast_channel *c, char digit, unsigned int durat
* 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;
@ -1787,21 +1787,20 @@ static int create_addr(struct oh323_pvt *pvt, char *opeer)
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))) {

@ -1167,8 +1167,8 @@ static int maxnontrunkcall = 1;
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);
@ -1193,7 +1193,7 @@ static int send_command_final(struct chan_iax2_pvt *, char, int, unsigned int, c
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);
@ -5074,7 +5074,7 @@ static void parse_dial_string(char *data, struct parsed_dial_string *pds)
}
}
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;
@ -12168,7 +12168,7 @@ static void free_context(struct iax2_context *con)
}
}
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;
@ -12183,7 +12183,7 @@ static struct ast_channel *iax2_request(const char *type, struct ast_format_cap
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));
@ -14055,7 +14055,7 @@ static int acf_channel_read(struct ast_channel *chan, const char *funcname, char
}
/*! \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);
@ -14066,7 +14066,7 @@ static int iax2_devicestate(void *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;
}

@ -171,11 +171,11 @@ static struct ast_format_cap *global_capability;
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);
@ -1498,7 +1498,7 @@ static int jingle_auto_congest(void *nothing)
/*! \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;
@ -1542,7 +1542,7 @@ static int jingle_hangup(struct ast_channel *ast)
}
/*! \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;
@ -1556,7 +1556,7 @@ static struct ast_channel *jingle_request(const char *type, struct ast_format_ca
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;
}
}

@ -92,10 +92,10 @@ static struct ast_jb_conf g_jb_conf = {
.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);
@ -104,7 +104,7 @@ static int local_indicate(struct ast_channel *ast, int condition, const void *da
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);
@ -277,7 +277,7 @@ setoption_cleanup:
}
/*! \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;
@ -809,7 +809,7 @@ static int local_sendhtml(struct ast_channel *ast, int subclass, const char *dat
/*! \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;
@ -1185,7 +1185,7 @@ static struct ast_channel *local_new(struct local_pvt *p, int state, const char
}
/*! \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;

@ -441,8 +441,8 @@ static void dump_cmd_queues(struct mgcp_endpoint *p, struct mgcp_subchannel *sub
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);
@ -451,7 +451,7 @@ static int mgcp_indicate(struct ast_channel *ast, int ind, const void *data, siz
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);
@ -832,7 +832,7 @@ static int send_request(struct mgcp_endpoint *p, struct mgcp_subchannel *sub,
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;
@ -1357,7 +1357,7 @@ static int mgcp_senddigit_end(struct ast_channel *ast, char digit, unsigned int
*
* \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;
@ -3920,12 +3920,11 @@ static int restart_monitor(void)
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));

@ -6484,7 +6484,7 @@ static void misdn_update_redirecting(struct ast_channel *ast, struct misdn_bchan
/*** 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;
@ -7772,7 +7772,7 @@ static struct chan_list *chan_list_init(int orig)
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] = "";
@ -7797,7 +7797,7 @@ static struct ast_channel *misdn_request(const char *type, struct ast_format_cap
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

@ -56,8 +56,8 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
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);
@ -88,7 +88,7 @@ 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;
@ -110,7 +110,7 @@ static int multicast_rtp_hangup(struct ast_channel *ast)
}
/*! \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;

@ -67,8 +67,8 @@ struct nbs_pvt {
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);
@ -83,7 +83,7 @@ static struct ast_channel_tech nbs_tech = {
.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;
@ -117,7 +117,7 @@ static void nbs_destroy(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;
@ -251,7 +251,7 @@ static struct ast_channel *nbs_new(struct nbs_pvt *i, int state, const char *lin
}
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;

@ -329,14 +329,14 @@ static struct chan_oss_pvt oss_default = {
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);
@ -590,7 +590,7 @@ static int oss_text(struct ast_channel *c, const char *text)
/*!
* \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, };
@ -834,7 +834,7 @@ static struct ast_channel *oss_new(struct chan_oss_pvt *o, char *ext, char *ctx,
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;
@ -849,7 +849,7 @@ static struct ast_channel *oss_request(const char *type, struct ast_format_cap *
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 ? */

@ -151,10 +151,10 @@ static struct phone_pvt {
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);
@ -284,7 +284,7 @@ static int phone_digit_end(struct ast_channel *ast, char digit, unsigned int dur
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;
@ -325,7 +325,7 @@ static int phone_call(struct ast_channel *ast, char *dest, int timeout)
return -1;
if (p->mode == MODE_FXS) {
char *digit = strchr(dest, '/');
const char *digit = strchr(dest, '/');
if (digit)
{
digit++;
@ -1231,11 +1231,11 @@ static struct phone_pvt *mkif(const char *iface, int mode, int txgain, int rxgai
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)) {

@ -1227,10 +1227,10 @@ static struct ast_config *notify_types = NULL; /*!< The list of manual NOTIFY
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);
@ -1373,7 +1373,6 @@ static int do_magic_pickup(struct ast_channel *channel, const char *extension, c
/*--- 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);
@ -5568,7 +5567,7 @@ static int auto_congest(const void *arg)
/*! \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 */
@ -27304,7 +27303,7 @@ static int sip_poke_peer(struct sip_peer *peer, int force)
!= 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;
@ -27383,14 +27382,13 @@ static int sip_devicestate(void *data)
* 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;

@ -1469,11 +1469,11 @@ struct skinnysession {
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);
@ -4362,7 +4362,7 @@ static int skinny_autoanswer_cb(const void *data)
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;
@ -7060,7 +7060,7 @@ static void *accept_thread(void *ignore)
return 0;
}
static int skinny_devicestate(void *data)
static int skinny_devicestate(const char *data)
{
struct skinny_line *l;
char *tmp;
@ -7072,13 +7072,12 @@ static int skinny_devicestate(void *data)
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));

@ -686,8 +686,8 @@ static int unload_module(void);
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);
@ -3744,7 +3744,7 @@ static struct unistimsession *channel_to_session(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;
@ -4740,14 +4740,13 @@ static int restart_monitor(void)
/*--- 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,

@ -667,14 +667,14 @@ static int setformat(struct chan_usbradio_pvt *o, int mode);
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);
@ -1253,7 +1253,7 @@ static void *hidthread(void *arg)
/*
* 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;
@ -1683,7 +1683,7 @@ static void ring(struct chan_usbradio_pvt *o, int x)
/*
* 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;
@ -2217,7 +2217,7 @@ static struct ast_channel *usbradio_new(struct chan_usbradio_pvt *o, char *ext,
}
/*
*/
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);
@ -2226,10 +2226,10 @@ static struct ast_channel *usbradio_request(const char *type, struct ast_format_
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;
}

@ -331,10 +331,10 @@ static struct vpb_pvt {
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);
@ -1787,11 +1787,11 @@ static int vpb_digit_end(struct ast_channel *ast, char digit, unsigned int durat
}
/* 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] = "";
/*
@ -2505,11 +2505,11 @@ static struct ast_channel *vpb_new(struct vpb_pvt *me, enum ast_channel_state st
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;

@ -1002,7 +1002,7 @@ static void analog_set_inthreeway(struct analog_pvt *p, enum analog_sub sub, int
}
}
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;

@ -351,7 +351,7 @@ void analog_delete(struct analog_pvt *doomed);
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);

@ -7367,7 +7367,7 @@ AST_APP_OPTIONS(sig_pri_call_opts, BEGIN_OPTIONS
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 */

@ -589,7 +589,7 @@ struct sig_pri_span {
};
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);

@ -1407,7 +1407,7 @@ static unsigned char cid_pres2ss7screen(int cid_pres)
* \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;

@ -282,7 +282,7 @@ void sig_ss7_link_noalarm(struct sig_ss7_linkset *linkset, int which);
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);

@ -473,14 +473,23 @@ struct ast_set_party_redirecting {
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 {
@ -518,11 +527,23 @@ struct ast_channel_tech {
/*!
* \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
@ -539,11 +560,15 @@ struct ast_channel_tech {
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);
@ -600,10 +625,16 @@ struct ast_channel_tech {
/*! \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) */
@ -1300,19 +1331,19 @@ struct ast_channel *ast_channel_release(struct ast_channel *chan);
* \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
@ -1321,7 +1352,7 @@ struct ast_channel *ast_request(const char *type, struct ast_format_cap *cap, co
* \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
@ -1330,7 +1361,7 @@ struct ast_channel *ast_request(const char *type, struct ast_format_cap *cap, co
* \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);
/*!
@ -1339,7 +1370,7 @@ struct ast_channel *ast_request_and_dial(const char *type, struct ast_format_cap
* \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
@ -1348,7 +1379,7 @@ struct ast_channel *ast_request_and_dial(const char *type, struct ast_format_cap
* \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);
/*!
@ -1623,15 +1654,14 @@ int __ast_answer(struct ast_channel *chan, unsigned int delay, int cdr_answer);
* \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

@ -913,11 +913,11 @@ int ast_async_goto_by_name(const char *chan, const char *context, const char *ex
/*! 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

@ -5295,7 +5295,7 @@ struct ast_channel *ast_call_forward(struct ast_channel *caller, struct ast_chan
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;
@ -5309,9 +5309,9 @@ struct ast_channel *__ast_request_and_dial(const char *type, struct ast_format_c
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;
}
@ -5357,8 +5357,8 @@ struct ast_channel *__ast_request_and_dial(const char *type, struct ast_format_c
}
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) {
@ -5461,7 +5461,7 @@ struct ast_channel *__ast_request_and_dial(const char *type, struct ast_format_c
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);
@ -5478,9 +5478,9 @@ struct ast_channel *__ast_request_and_dial(const char *type, struct ast_format_c
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)
@ -5523,7 +5523,7 @@ static int set_security_requirements(const struct ast_channel *requestor, struct
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;
@ -5580,7 +5580,7 @@ struct ast_channel *ast_request(const char *type, struct ast_format_cap *request
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;
}
@ -5604,7 +5604,7 @@ struct ast_channel *ast_request(const char *type, struct ast_format_cap *request
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

@ -902,7 +902,7 @@ static void check_goto_on_transfer(struct ast_channel *chan)
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);
/*!
@ -3369,7 +3369,7 @@ static void set_config_flags(struct ast_channel *chan, struct ast_bridge_config
* \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.
@ -3395,7 +3395,7 @@ static void set_config_flags(struct ast_channel *chan, struct ast_bridge_config
*/
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;
@ -3428,8 +3428,8 @@ static struct ast_channel *feature_request_and_dial(struct ast_channel *caller,
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;
@ -3452,8 +3452,8 @@ static struct ast_channel *feature_request_and_dial(struct ast_channel *caller,
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;

@ -3730,13 +3730,13 @@ static void *fast_originate(void *data)
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),

@ -8935,7 +8935,7 @@ static int ast_pbx_outgoing_cdr_failed(void)
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;
@ -8952,7 +8952,7 @@ int ast_pbx_outgoing_exten(const char *type, struct ast_format_cap *cap, void *d
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)
@ -9042,7 +9042,7 @@ int ast_pbx_outgoing_exten(const char *type, struct ast_format_cap *cap, void *d
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)
@ -9104,7 +9104,7 @@ static void *ast_pbx_run_app(void *data)
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;
@ -9122,7 +9122,7 @@ int ast_pbx_outgoing_app(const char *type, struct ast_format_cap *cap, void *dat
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)
@ -9190,7 +9190,7 @@ int ast_pbx_outgoing_app(const char *type, struct ast_format_cap *cap, void *dat
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;

@ -349,11 +349,15 @@ static void *attempt_thread(void *data)
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) {

Loading…
Cancel
Save