summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_agent.c6
-rw-r--r--channels/chan_alsa.c2
-rw-r--r--channels/chan_console.c3
-rw-r--r--channels/chan_dahdi.c12
-rw-r--r--channels/chan_iax2.c17
-rw-r--r--channels/chan_mgcp.c6
-rw-r--r--channels/chan_misdn.c36
-rw-r--r--channels/chan_nbs.c2
-rw-r--r--channels/chan_oss.c10
-rw-r--r--channels/chan_sip.c146
-rw-r--r--channels/chan_skinny.c10
-rw-r--r--channels/chan_unistim.c13
-rw-r--r--channels/console_gui.c2
-rw-r--r--channels/iax2-parser.c2
-rw-r--r--channels/misdn/chan_misdn_config.h2
-rw-r--r--channels/misdn_config.c2
-rw-r--r--channels/vcodecs.c4
17 files changed, 141 insertions, 134 deletions
diff --git a/channels/chan_agent.c b/channels/chan_agent.c
index b705b6f04..d922d4927 100644
--- a/channels/chan_agent.c
+++ b/channels/chan_agent.c
@@ -1708,7 +1708,7 @@ static int agent_logoff(const char *agent, int soft)
static char *agent_logoff_cmd(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
int ret;
- char *agent;
+ const char *agent;
switch (cmd) {
case CLI_INIT:
@@ -1956,7 +1956,7 @@ static struct ast_cli_entry cli_agents[] = {
* \returns
* \sa agentmonitoroutgoing_exec(), load_module().
*/
-static int login_exec(struct ast_channel *chan, void *data)
+static int login_exec(struct ast_channel *chan, const char *data)
{
int res=0;
int tries = 0;
@@ -2284,7 +2284,7 @@ static int login_exec(struct ast_channel *chan, void *data)
* \returns
* \sa login_exec(), load_module().
*/
-static int agentmonitoroutgoing_exec(struct ast_channel *chan, void *data)
+static int agentmonitoroutgoing_exec(struct ast_channel *chan, const char *data)
{
int exitifnoagentid = 0;
int nowarnings = 0;
diff --git a/channels/chan_alsa.c b/channels/chan_alsa.c
index 16efefbbf..520ef940a 100644
--- a/channels/chan_alsa.c
+++ b/channels/chan_alsa.c
@@ -782,7 +782,7 @@ static char *console_dial(struct ast_cli_entry *e, int cmd, struct ast_cli_args
{
char tmp[256], *tmp2;
char *mye, *myc;
- char *d;
+ const char *d;
char *res = CLI_SUCCESS;
switch (cmd) {
diff --git a/channels/chan_console.c b/channels/chan_console.c
index ee26f2195..5bdfa99ba 100644
--- a/channels/chan_console.c
+++ b/channels/chan_console.c
@@ -797,6 +797,7 @@ static char *cli_console_dial(struct ast_cli_entry *e, int cmd, struct ast_cli_a
if (pvt->owner) { /* already in a call */
int i;
struct ast_frame f = { AST_FRAME_DTMF, 0 };
+ const char *s;
if (a->argc == e->args) { /* argument is mandatory here */
ast_cli(a->fd, "Already in a call. You can only dial digits until you hangup.\n");
@@ -883,7 +884,7 @@ static char *cli_console_hangup(struct ast_cli_entry *e, int cmd, struct ast_cli
static char *cli_console_mute(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
- char *s;
+ const char *s;
struct console_pvt *pvt = get_active_pvt();
char *res = CLI_SUCCESS;
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c
index da16b57b5..ce490e6ad 100644
--- a/channels/chan_dahdi.c
+++ b/channels/chan_dahdi.c
@@ -620,7 +620,7 @@ struct dahdi_distRings {
struct ringContextData ringContext[3];
};
-static char *subnames[] = {
+static const char * const subnames[] = {
"Real",
"Callwait",
"Threeway"
@@ -2364,7 +2364,7 @@ out:
return res;
}
-static char *events[] = {
+static const char * const events[] = {
"No event",
"On hook",
"Ring/Answered",
@@ -2409,7 +2409,7 @@ static char *alarm2str(int alm)
return alm ? "Unknown Alarm" : "No Alarm";
}
-static char *event2str(int event)
+static const char *event2str(int event)
{
static char buf[256];
if ((event < (ARRAY_LEN(events))) && (event > -1))
@@ -3987,11 +3987,11 @@ static void destroy_all_channels(void)
#if defined(HAVE_PRI)
static char *dahdi_send_keypad_facility_app = "DAHDISendKeypadFacility";
-static int dahdi_send_keypad_facility_exec(struct ast_channel *chan, void *data)
+static int dahdi_send_keypad_facility_exec(struct ast_channel *chan, const char *data)
{
/* Data will be our digit string */
struct dahdi_pvt *p;
- char *digits = (char *) data;
+ const char *digits = (const char *) data;
if (ast_strlen_zero(digits)) {
ast_debug(1, "No digit string sent to application!\n");
@@ -4032,7 +4032,7 @@ static int dahdi_send_keypad_facility_exec(struct ast_channel *chan, void *data)
#if defined(HAVE_PRI_PROG_W_CAUSE)
static char *dahdi_send_callrerouting_facility_app = "DAHDISendCallreroutingFacility";
-static int dahdi_send_callrerouting_facility_exec(struct ast_channel *chan, void *data)
+static int dahdi_send_callrerouting_facility_exec(struct ast_channel *chan, const char *data)
{
/* Data will be our digit string */
struct dahdi_pvt *p;
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index f343b3d24..383f97ed9 100644
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -1051,7 +1051,7 @@ static int iax2_fixup(struct ast_channel *oldchannel, struct ast_channel *newcha
static int iax2_hangup(struct ast_channel *c);
static int iax2_indicate(struct ast_channel *c, int condition, const void *data, size_t datalen);
static int iax2_poke_peer(struct iax2_peer *peer, int heldcall);
-static int iax2_provision(struct sockaddr_in *end, int sockfd, char *dest, const char *template, int force);
+static int iax2_provision(struct sockaddr_in *end, int sockfd, const char *dest, const char *template, int force);
static int iax2_send(struct chan_iax2_pvt *pvt, struct ast_frame *f, unsigned int ts, int seqno, int now, int transfer, int final);
static int iax2_sendhtml(struct ast_channel *c, int subclass, const char *data, int datalen);
static int iax2_sendimage(struct ast_channel *c, struct ast_frame *img);
@@ -2660,7 +2660,7 @@ static char *handle_cli_iax2_prune_realtime(struct ast_cli_entry *e, int cmd, st
{
struct iax2_peer *peer = NULL;
struct iax2_user *user = NULL;
- static char *choices[] = { "all", NULL };
+ static const char * const choices[] = { "all", NULL };
char *cmplt;
switch (cmd) {
@@ -5377,7 +5377,7 @@ static char *handle_cli_iax2_show_users(struct ast_cli_entry *e, int cmd, struct
#undef FORMAT2
}
-static int __iax2_show_peers(int manager, int fd, struct mansession *s, int argc, char *argv[])
+static int __iax2_show_peers(int manager, int fd, struct mansession *s, const int argc, const char * const argv[])
{
regex_t regexbuf;
int havepattern = 0;
@@ -5708,14 +5708,14 @@ static char *handle_cli_iax2_show_firmware(struct ast_cli_entry *e, int cmd, str
/*! \brief callback to display iax peers in manager */
static int manager_iax2_show_peers(struct mansession *s, const struct message *m)
{
- char *a[] = { "iax2", "show", "users" };
+ static const char * const a[] = { "iax2", "show", "peers" };
const char *id = astman_get_header(m,"ActionID");
char idtext[256] = "";
if (!ast_strlen_zero(id))
snprintf(idtext, sizeof(idtext), "ActionID: %s\r\n", id);
astman_send_ack(s, m, "Peer status list will follow");
- return __iax2_show_peers(1, -1, s, 3, a );
+ return __iax2_show_peers(1, -1, s, 3, a);
}
/*! \brief callback to display iax peers in manager format */
@@ -7987,9 +7987,6 @@ static int iax_park(struct ast_channel *chan1, struct ast_channel *chan2)
return -1;
}
-
-static int iax2_provision(struct sockaddr_in *end, int sockfd, char *dest, const char *template, int force);
-
static int check_provisioning(struct sockaddr_in *sin, int sockfd, char *si, unsigned int ver)
{
unsigned int ourver;
@@ -10279,7 +10276,7 @@ static int iax2_do_register(struct iax2_registry *reg)
return 0;
}
-static int iax2_provision(struct sockaddr_in *end, int sockfd, char *dest, const char *template, int force)
+static int iax2_provision(struct sockaddr_in *end, int sockfd, const char *dest, const char *template, int force)
{
/* Returns 1 if provisioned, -1 if not able to find destination, or 0 if no provisioning
is found for template */
@@ -10331,7 +10328,7 @@ static char *papp = "IAX2Provision";
/*! iax2provision
\ingroup applications
*/
-static int iax2_prov_app(struct ast_channel *chan, void *data)
+static int iax2_prov_app(struct ast_channel *chan, const char *data)
{
int res;
char *sdata;
diff --git a/channels/chan_mgcp.c b/channels/chan_mgcp.c
index 0ba8290a1..be38e87b6 100644
--- a/channels/chan_mgcp.c
+++ b/channels/chan_mgcp.c
@@ -119,7 +119,7 @@ static const char config[] = "mgcp.conf";
#define MGCP_CX_INACTIVE 4
/*! } */
-static char *mgcp_cxmodes[] = {
+static const char * const mgcp_cxmodes[] = {
"sendonly",
"recvonly",
"sendrecv",
@@ -1098,7 +1098,7 @@ static char *handle_mgcp_audit_endpoint(struct ast_cli_entry *e, int cmd, struct
if (a->argc != 4)
return CLI_SHOWUSAGE;
/* split the name into parts by null */
- ename = a->argv[3];
+ ename = ast_strdupa(a->argv[3]);
gname = ename;
while (*gname) {
if (*gname == '@') {
@@ -1919,7 +1919,7 @@ static int process_sdp(struct mgcp_subchannel *sub, struct mgcp_request *req)
return 0;
}
-static int add_header(struct mgcp_request *req, char *var, char *value)
+static int add_header(struct mgcp_request *req, const char *var, const char *value)
{
if (req->len >= sizeof(req->data) - 4) {
ast_log(LOG_WARNING, "Out of space, can't add anymore\n");
diff --git a/channels/chan_misdn.c b/channels/chan_misdn.c
index 01af221fe..d75798483 100644
--- a/channels/chan_misdn.c
+++ b/channels/chan_misdn.c
@@ -711,11 +711,11 @@ static void release_chan(struct misdn_bchannel *bc);
#if defined(AST_MISDN_ENHANCEMENTS)
static const char misdn_command_name[] = "misdn_command";
-static int misdn_command_exec(struct ast_channel *chan, void *data);
+static int misdn_command_exec(struct ast_channel *chan, const char *data);
#endif /* defined(AST_MISDN_ENHANCEMENTS) */
-static int misdn_check_l2l1(struct ast_channel *chan, void *data);
-static int misdn_set_opt_exec(struct ast_channel *chan, void *data);
-static int misdn_facility_exec(struct ast_channel *chan, void *data);
+static int misdn_check_l2l1(struct ast_channel *chan, const char *data);
+static int misdn_set_opt_exec(struct ast_channel *chan, const char *data);
+static int misdn_facility_exec(struct ast_channel *chan, const char *data);
int chan_misdn_jb_empty(struct misdn_bchannel *bc, char *buf, int len);
@@ -748,7 +748,7 @@ static struct chan_list *get_chan_by_ast(struct ast_channel *ast)
return NULL;
}
-static struct chan_list *get_chan_by_ast_name(char *name)
+static struct chan_list *get_chan_by_ast_name(const char *name)
{
struct chan_list *tmp;
@@ -4025,7 +4025,7 @@ struct state_struct {
char txt[255];
};
-static struct state_struct state_array[] = {
+static const struct state_struct state_array[] = {
/* *INDENT-OFF* */
{ MISDN_NOTHING, "NOTHING" }, /* at beginning */
{ MISDN_WAITING4DIGS, "WAITING4DIGS" }, /* when waiting for infos */
@@ -5125,11 +5125,11 @@ static const struct FacParm Fac_Msgs[] = {
static char *handle_cli_misdn_send_facility(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
- char *channame;
- char *nr;
+ const char *channame;
+ const char *nr;
struct chan_list *tmp;
int port;
- char *served_nr;
+ const char *served_nr;
struct misdn_bchannel dummy, *bc=&dummy;
unsigned max_len;
@@ -5381,8 +5381,8 @@ static char *handle_cli_misdn_send_restart(struct ast_cli_entry *e, int cmd, str
static char *handle_cli_misdn_send_digit(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
- char *channame;
- char *msg;
+ const char *channame;
+ const char *msg;
struct chan_list *tmp;
int i, msglen;
@@ -5430,7 +5430,7 @@ static char *handle_cli_misdn_send_digit(struct ast_cli_entry *e, int cmd, struc
static char *handle_cli_misdn_toggle_echocancel(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
- char *channame;
+ const char *channame;
struct chan_list *tmp;
switch (cmd) {
@@ -5476,8 +5476,8 @@ static char *handle_cli_misdn_toggle_echocancel(struct ast_cli_entry *e, int cmd
static char *handle_cli_misdn_send_display(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
- char *channame;
- char *msg;
+ const char *channame;
+ const char *msg;
struct chan_list *tmp;
switch (cmd) {
@@ -11357,7 +11357,7 @@ static const struct misdn_command_table misdn_commands[] = {
* \retval 0 on success.
* \retval -1 on error.
*/
-static int misdn_command_exec(struct ast_channel *chan, void *data)
+static int misdn_command_exec(struct ast_channel *chan, const char *data)
{
char *parse;
unsigned index;
@@ -11397,7 +11397,7 @@ static int misdn_command_exec(struct ast_channel *chan, void *data)
}
#endif /* defined(AST_MISDN_ENHANCEMENTS) */
-static int misdn_facility_exec(struct ast_channel *chan, void *data)
+static int misdn_facility_exec(struct ast_channel *chan, const char *data)
{
struct chan_list *ch = MISDN_ASTERISK_TECH_PVT(chan);
char *parse;
@@ -11476,7 +11476,7 @@ static int misdn_facility_exec(struct ast_channel *chan, void *data)
return 0;
}
-static int misdn_check_l2l1(struct ast_channel *chan, void *data)
+static int misdn_check_l2l1(struct ast_channel *chan, const char *data)
{
char *parse;
char group[BUFFERSIZE + 1];
@@ -11550,7 +11550,7 @@ static int misdn_check_l2l1(struct ast_channel *chan, void *data)
return 0;
}
-static int misdn_set_opt_exec(struct ast_channel *chan, void *data)
+static int misdn_set_opt_exec(struct ast_channel *chan, const char *data)
{
struct chan_list *ch = MISDN_ASTERISK_TECH_PVT(chan);
char *tok;
diff --git a/channels/chan_nbs.c b/channels/chan_nbs.c
index 92b93553a..8729f1074 100644
--- a/channels/chan_nbs.c
+++ b/channels/chan_nbs.c
@@ -53,7 +53,7 @@ static const char tdesc[] = "Network Broadcast Sound Driver";
static int prefformat = AST_FORMAT_SLINEAR;
static char context[AST_MAX_EXTENSION] = "default";
-static char type[] = "NBS";
+static const char type[] = "NBS";
/* NBS creates private structures on demand */
diff --git a/channels/chan_oss.c b/channels/chan_oss.c
index a967cc911..b3ff44883 100644
--- a/channels/chan_oss.c
+++ b/channels/chan_oss.c
@@ -305,7 +305,7 @@ struct chan_oss_pvt {
};
/*! forward declaration */
-static struct chan_oss_pvt *find_desc(char *dev);
+static struct chan_oss_pvt *find_desc(const char *dev);
static char *oss_active; /*!< the active device */
@@ -367,7 +367,7 @@ static struct ast_channel_tech oss_tech = {
/*!
* \brief returns a pointer to the descriptor with the given name
*/
-static struct chan_oss_pvt *find_desc(char *dev)
+static struct chan_oss_pvt *find_desc(const char *dev)
{
struct chan_oss_pvt *o = NULL;
@@ -1075,7 +1075,8 @@ static char *console_flash(struct ast_cli_entry *e, int cmd, struct ast_cli_args
static char *console_dial(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
- char *s = NULL, *mye = NULL, *myc = NULL;
+ char *s = NULL;
+ char *mye = NULL, *myc = NULL;
struct chan_oss_pvt *o = find_desc(oss_active);
if (cmd == CLI_INIT) {
@@ -1092,6 +1093,7 @@ static char *console_dial(struct ast_cli_entry *e, int cmd, struct ast_cli_args
if (o->owner) { /* already in a call */
int i;
struct ast_frame f = { AST_FRAME_DTMF, 0 };
+ const char *s;
if (a->argc == e->args) { /* argument is mandatory here */
ast_cli(a->fd, "Already in a call. You can only dial digits until you hangup.\n");
@@ -1126,7 +1128,7 @@ static char *console_dial(struct ast_cli_entry *e, int cmd, struct ast_cli_args
static char *console_mute(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
struct chan_oss_pvt *o = find_desc(oss_active);
- char *s;
+ const char *s;
int toggle = 0;
if (cmd == CLI_INIT) {
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 1f3f1554b..4679265e9 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -2348,7 +2348,7 @@ static void free_old_route(struct sip_route *route);
static void list_route(struct sip_route *route);
static void build_route(struct sip_pvt *p, struct sip_request *req, int backwards);
static enum check_auth_result register_verify(struct sip_pvt *p, struct sockaddr_in *sin,
- struct sip_request *req, char *uri);
+ struct sip_request *req, const char *uri);
static struct sip_pvt *get_sip_pvt_byid_locked(const char *callid, const char *totag, const char *fromtag);
static void check_pendings(struct sip_pvt *p);
static void *sip_park_thread(void *stuff);
@@ -2376,11 +2376,11 @@ static int reply_digest(struct sip_pvt *p, struct sip_request *req, char *header
static int build_reply_digest(struct sip_pvt *p, int method, char *digest, int digest_len);
static enum check_auth_result check_auth(struct sip_pvt *p, struct sip_request *req, const char *username,
const char *secret, const char *md5secret, int sipmethod,
- char *uri, enum xmittype reliable, int ignore);
+ const char *uri, enum xmittype reliable, int ignore);
static enum check_auth_result check_user_full(struct sip_pvt *p, struct sip_request *req,
- int sipmethod, char *uri, enum xmittype reliable,
+ int sipmethod, const char *uri, enum xmittype reliable,
struct sockaddr_in *sin, struct sip_peer **authpeer);
-static int check_user(struct sip_pvt *p, struct sip_request *req, int sipmethod, char *uri, enum xmittype reliable, struct sockaddr_in *sin);
+static int check_user(struct sip_pvt *p, struct sip_request *req, int sipmethod, const char *uri, enum xmittype reliable, struct sockaddr_in *sin);
/*--- Domain handling */
static int check_sip_domain(const char *domain, char *context, size_t len); /* Check if domain is one of our local domains */
@@ -2485,13 +2485,13 @@ static char *complete_sipnotify(const char *line, const char *word, int pos, int
static char *sip_show_channel(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a);
static char *sip_show_channelstats(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a);
static char *sip_show_history(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a);
-static char *sip_do_debug_ip(int fd, char *arg);
-static char *sip_do_debug_peer(int fd, char *arg);
+static char *sip_do_debug_ip(int fd, const char *arg);
+static char *sip_do_debug_peer(int fd, const char *arg);
static char *sip_do_debug(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a);
static char *sip_cli_notify(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a);
static char *sip_set_history(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a);
-static int sip_dtmfmode(struct ast_channel *chan, void *data);
-static int sip_addheader(struct ast_channel *chan, void *data);
+static int sip_dtmfmode(struct ast_channel *chan, const char *data);
+static int sip_addheader(struct ast_channel *chan, const char *data);
static int sip_do_reload(enum channelreloadreason reason);
static char *sip_reload(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a);
static int acf_channel_read(struct ast_channel *chan, const char *funcname, char *preparse, char *buf, size_t buflen);
@@ -2619,26 +2619,26 @@ static void build_contact(struct sip_pvt *p);
/*------Request handling functions */
static int handle_incoming(struct sip_pvt *p, struct sip_request *req, struct sockaddr_in *sin, int *recount, int *nounlock);
static int handle_request_update(struct sip_pvt *p, struct sip_request *req);
-static int handle_request_invite(struct sip_pvt *p, struct sip_request *req, int debug, int seqno, struct sockaddr_in *sin, int *recount, char *e, int *nounlock);
+static int handle_request_invite(struct sip_pvt *p, struct sip_request *req, int debug, int seqno, struct sockaddr_in *sin, int *recount, const char *e, int *nounlock);
static int handle_request_refer(struct sip_pvt *p, struct sip_request *req, int debug, int seqno, int *nounlock);
static int handle_request_bye(struct sip_pvt *p, struct sip_request *req);
-static int handle_request_register(struct sip_pvt *p, struct sip_request *req, struct sockaddr_in *sin, char *e);
+static int handle_request_register(struct sip_pvt *p, struct sip_request *req, struct sockaddr_in *sin, const char *e);
static int handle_request_cancel(struct sip_pvt *p, struct sip_request *req);
static int handle_request_message(struct sip_pvt *p, struct sip_request *req);
-static int handle_request_subscribe(struct sip_pvt *p, struct sip_request *req, struct sockaddr_in *sin, int seqno, char *e);
+static int handle_request_subscribe(struct sip_pvt *p, struct sip_request *req, struct sockaddr_in *sin, int seqno, const char *e);
static void handle_request_info(struct sip_pvt *p, struct sip_request *req);
static int handle_request_options(struct sip_pvt *p, struct sip_request *req);
static int handle_invite_replaces(struct sip_pvt *p, struct sip_request *req, int debug, int seqno, struct sockaddr_in *sin);
-static int handle_request_notify(struct sip_pvt *p, struct sip_request *req, struct sockaddr_in *sin, int seqno, char *e);
+static int handle_request_notify(struct sip_pvt *p, struct sip_request *req, struct sockaddr_in *sin, int seqno, const char *e);
static int local_attended_transfer(struct sip_pvt *transferer, struct sip_dual *current, struct sip_request *req, int seqno);
/*------Response handling functions */
-static void handle_response_invite(struct sip_pvt *p, int resp, char *rest, struct sip_request *req, int seqno);
-static void handle_response_notify(struct sip_pvt *p, int resp, char *rest, struct sip_request *req, int seqno);
-static void handle_response_refer(struct sip_pvt *p, int resp, char *rest, struct sip_request *req, int seqno);
-static void handle_response_subscribe(struct sip_pvt *p, int resp, char *rest, struct sip_request *req, int seqno);
-static int handle_response_register(struct sip_pvt *p, int resp, char *rest, struct sip_request *req, int seqno);
-static void handle_response(struct sip_pvt *p, int resp, char *rest, struct sip_request *req, int seqno);
+static void handle_response_invite(struct sip_pvt *p, int resp, const char *rest, struct sip_request *req, int seqno);
+static void handle_response_notify(struct sip_pvt *p, int resp, const char *rest, struct sip_request *req, int seqno);
+static void handle_response_refer(struct sip_pvt *p, int resp, const char *rest, struct sip_request *req, int seqno);
+static void handle_response_subscribe(struct sip_pvt *p, int resp, const char *rest, struct sip_request *req, int seqno);
+static int handle_response_register(struct sip_pvt *p, int resp, const char *rest, struct sip_request *req, int seqno);
+static void handle_response(struct sip_pvt *p, int resp, const char *rest, struct sip_request *req, int seqno);
/*------ T38 Support --------- */
static int transmit_response_with_t38_sdp(struct sip_pvt *p, char *msg, struct sip_request *req, int retrans);
@@ -6598,9 +6598,9 @@ static const char *__get_header(const struct sip_request *req, const char *name,
for (pass = 0; name && pass < 2;pass++) {
int x, len = strlen(name);
for (x = *start; x < req->headers; x++) {
- char *header = REQ_OFFSET_TO_STR(req, header[x]);
+ const char *header = REQ_OFFSET_TO_STR(req, header[x]);
if (!strncasecmp(header, name, len)) {
- char *r = header + len; /* skip name */
+ const char *r = header + len; /* skip name */
if (sip_cfg.pedanticsipchecking)
r = ast_skip_blanks(r);
@@ -7545,7 +7545,7 @@ static int find_sdp(struct sip_request *req)
sdp part and the end boundry if it exists */
for (x = 0; x < (req->lines); x++) {
- char *line = REQ_OFFSET_TO_STR(req, line[x]);
+ const char *line = REQ_OFFSET_TO_STR(req, line[x]);
if (!strncasecmp(line, boundary, strlen(boundary))){
if (found_application_sdp && found_end_of_headers) {
req->sdp_end = x-1;
@@ -10859,7 +10859,7 @@ static int manager_sipnotify(struct mansession *s, const struct message *m)
return 0;
}
-static char mandescr_sipnotify[] =
+static const char mandescr_sipnotify[] =
"Description: Sends a SIP Notify event\n"
"All parameters for this event must be specified in the body of this request\n"
"via multiple Variable: name=value sequences.\n"
@@ -12039,7 +12039,7 @@ AST_THREADSTORAGE(check_auth_buf);
*/
static enum check_auth_result check_auth(struct sip_pvt *p, struct sip_request *req, const char *username,
const char *secret, const char *md5secret, int sipmethod,
- char *uri, enum xmittype reliable, int ignore)
+ const char *uri, enum xmittype reliable, int ignore)
{
const char *response;
char *reqheader, *respheader;
@@ -12404,15 +12404,16 @@ static char *terminate_uri(char *uri)
- Registration requests are only matched with peers that are marked as "dynamic"
*/
static enum check_auth_result register_verify(struct sip_pvt *p, struct sockaddr_in *sin,
- struct sip_request *req, char *uri)
+ struct sip_request *req, const char *uri)
{
enum check_auth_result res = AUTH_NOT_FOUND;
struct sip_peer *peer;
char tmp[256];
char *name, *c;
char *domain;
+ char *uri2 = ast_strdupa(uri);
- terminate_uri(uri); /* warning, overwrite the string */
+ terminate_uri(uri2);
ast_copy_string(tmp, get_header(req, "To"), sizeof(tmp));
if (sip_cfg.pedanticsipchecking)
@@ -12472,7 +12473,7 @@ static enum check_auth_result register_verify(struct sip_pvt *p, struct sockaddr
ast_copy_flags(&p->flags[0], &peer->flags[0], SIP_NAT);
if (ast_test_flag(&p->flags[1], SIP_PAGE2_REGISTERTRYING))
transmit_response(p, "100 Trying", req);
- if (!(res = check_auth(p, req, peer->name, peer->secret, peer->md5secret, SIP_REGISTER, uri, XMIT_UNRELIABLE, req->ignore))) {
+ if (!(res = check_auth(p, req, peer->name, peer->secret, peer->md5secret, SIP_REGISTER, uri2, XMIT_UNRELIABLE, req->ignore))) {
if (sip_cancel_destroy(p))
ast_log(LOG_WARNING, "Unable to cancel SIP destruction. Expect bad things.\n");
@@ -13695,7 +13696,7 @@ static enum check_auth_result check_peer_ok(struct sip_pvt *p, char *of,
\return 0 on success, non-zero on failure
*/
static enum check_auth_result check_user_full(struct sip_pvt *p, struct sip_request *req,
- int sipmethod, char *uri, enum xmittype reliable,
+ int sipmethod, const char *uri, enum xmittype reliable,
struct sockaddr_in *sin, struct sip_peer **authpeer)
{
char from[256];
@@ -13813,7 +13814,7 @@ static enum check_auth_result check_user_full(struct sip_pvt *p, struct sip_requ
/*! \brief Find user
If we get a match, this will add a reference pointer to the user object in ASTOBJ, that needs to be unreferenced
*/
-static int check_user(struct sip_pvt *p, struct sip_request *req, int sipmethod, char *uri, enum xmittype reliable, struct sockaddr_in *sin)
+static int check_user(struct sip_pvt *p, struct sip_request *req, int sipmethod, const char *uri, enum xmittype reliable, struct sockaddr_in *sin)
{
return check_user_full(p, req, sipmethod, uri, reliable, sin, NULL);
}
@@ -13830,7 +13831,7 @@ static int get_msg_text(char *buf, int len, struct sip_request *req, int addnewl
if (y < 0)
y = 0;
for (x = 0; x < req->lines; x++) {
- char *line = REQ_OFFSET_TO_STR(req, line[x]);
+ const char *line = REQ_OFFSET_TO_STR(req, line[x]);
strncat(buf, line, y); /* safe */
y -= strlen(line) + 1;
if (y < 0)
@@ -13949,7 +13950,7 @@ static char *transfermode2str(enum transfermodes mode)
return "strict";
}
-static struct _map_x_s natmodes[] = {
+static const struct _map_x_s natmodes[] = {
{ SIP_NAT_NEVER, "No"},
{ SIP_NAT_ROUTE, "Route"},
{ SIP_NAT_ALWAYS, "Always"},
@@ -13968,7 +13969,7 @@ static const char *nat2str(int nat)
delete it. Keeping it enabled generates compiler warnings.
*/
-static struct _map_x_s natcfgmodes[] = {
+static const struct _map_x_s natcfgmodes[] = {
{ SIP_NAT_NEVER, "never"},
{ SIP_NAT_ROUTE, "route"},
{ SIP_NAT_ALWAYS, "yes"},
@@ -13989,7 +13990,7 @@ static const char *nat2strconfig(int nat)
/* Session-Timer Modes */
-static struct _map_x_s stmodes[] = {
+static const struct _map_x_s stmodes[] = {
{ SESSION_TIMER_MODE_ACCEPT, "Accept"},
{ SESSION_TIMER_MODE_ORIGINATE, "Originate"},
{ SESSION_TIMER_MODE_REFUSE, "Refuse"},
@@ -14007,7 +14008,7 @@ static enum st_mode str2stmode(const char *s)
}
/* Session-Timer Refreshers */
-static struct _map_x_s strefreshers[] = {
+static const struct _map_x_s strefreshers[] = {
{ SESSION_TIMER_REFRESHER_AUTO, "auto"},
{ SESSION_TIMER_REFRESHER_UAC, "uac"},
{ SESSION_TIMER_REFRESHER_UAS, "uas"},
@@ -14166,7 +14167,7 @@ static char *sip_show_users(struct ast_cli_entry *e, int cmd, struct ast_cli_arg
}
/*! \brief Manager Action SIPShowRegistry description */
-static char mandescr_show_registry[] =
+static const char mandescr_show_registry[] =
"Description: Lists all registration requests and status\n"
"Registrations will follow as separate events. followed by a final event called\n"
"RegistrationsComplete.\n"
@@ -14211,7 +14212,7 @@ static int manager_show_registry(struct mansession *s, const struct message *m)
return 0;
}
-static char mandescr_show_peers[] =
+static const char mandescr_show_peers[] =
"Description: Lists SIP peers in text format with details on current status.\n"
"Peerlist will follow as separate events, followed by a final event called\n"
"PeerlistComplete.\n"
@@ -14447,10 +14448,10 @@ static int peer_dump_func(void *userobj, void *arg, int flags)
{
struct sip_peer *peer = userobj;
int refc = ao2_t_ref(userobj, 0, "");
- int *fd = arg;
+ struct ast_cli_args *a = (struct ast_cli_args *) arg;
- ast_cli(*fd, "name: %s\ntype: peer\nobjflags: %d\nrefcount: %d\n\n",
- peer->name, 0, refc);
+ ast_cli(a->fd, "name: %s\ntype: peer\nobjflags: %d\nrefcount: %d\n\n",
+ peer->name, 0, refc);
return 0;
}
@@ -14458,10 +14459,10 @@ static int dialog_dump_func(void *userobj, void *arg, int flags)
{
struct sip_pvt *pvt = userobj;
int refc = ao2_t_ref(userobj, 0, "");
- int *fd = arg;
+ struct ast_cli_args *a = (struct ast_cli_args *) arg;
- ast_cli(*fd, "name: %s\ntype: dialog\nobjflags: %d\nrefcount: %d\n\n",
- pvt->callid, 0, refc);
+ ast_cli(a->fd, "name: %s\ntype: dialog\nobjflags: %d\nrefcount: %d\n\n",
+ pvt->callid, 0, refc);
return 0;
}
@@ -14485,22 +14486,22 @@ static char *sip_show_objects(struct ast_cli_entry *e, int cmd, struct ast_cli_a
if (a->argc != 3)
return CLI_SHOWUSAGE;
ast_cli(a->fd, "-= Peer objects: %d static, %d realtime, %d autocreate =-\n\n", speerobjs, rpeerobjs, apeerobjs);
- ao2_t_callback(peers, OBJ_NODATA, peer_dump_func, &a->fd, "initiate ao2_callback to dump peers");
+ ao2_t_callback(peers, OBJ_NODATA, peer_dump_func, a, "initiate ao2_callback to dump peers");
ast_cli(a->fd, "-= Registry objects: %d =-\n\n", regobjs);
ASTOBJ_CONTAINER_DUMP(a->fd, tmp, sizeof(tmp), &regl);
ast_cli(a->fd, "-= Dialog objects:\n\n");
- ao2_t_callback(dialogs, OBJ_NODATA, dialog_dump_func, &a->fd, "initiate ao2_callback to dump dialogs");
+ ao2_t_callback(dialogs, OBJ_NODATA, dialog_dump_func, a, "initiate ao2_callback to dump dialogs");
return CLI_SUCCESS;
}
/*! \brief Print call group and pickup group */
-static void print_group(int fd, ast_group_t group, int crlf)
+static void print_group(int fd, ast_group_t group, int crlf)
{
char buf[256];
ast_cli(fd, crlf ? "%s\r\n" : "%s\n", ast_print_group(buf, sizeof(buf), group) );
}
/*! \brief mapping between dtmf flags and strings */
-static struct _map_x_s dtmfstr[] = {
+static const struct _map_x_s dtmfstr[] = {
{ SIP_DTMF_RFC2833, "rfc2833" },
{ SIP_DTMF_INFO, "info" },
{ SIP_DTMF_SHORTINFO, "shortinfo" },
@@ -14521,7 +14522,7 @@ static int str2dtmfmode(const char *str)
return map_s_x(dtmfstr, str, -1);
}
-static struct _map_x_s insecurestr[] = {
+static const struct _map_x_s insecurestr[] = {
{ SIP_INSECURE_PORT, "port" },
{ SIP_INSECURE_INVITE, "invite" },
{ SIP_INSECURE_PORT | SIP_INSECURE_INVITE, "port,invite" },
@@ -14644,10 +14645,10 @@ static char *sip_prune_realtime(struct ast_cli_entry *e, int cmd, struct ast_cli
struct sip_peer *peer, *pi;
int prunepeer = FALSE;
int multi = FALSE;
- char *name = NULL;
+ const char *name = NULL;
regex_t regexbuf;
struct ao2_iterator i;
- static char *choices[] = { "all", "like", NULL };
+ static const char * const choices[] = { "all", "like", NULL };
char *cmplt;
if (cmd == CLI_INIT) {
@@ -14836,7 +14837,7 @@ static char *sip_show_domains(struct ast_cli_entry *e, int cmd, struct ast_cli_a
}
#undef FORMAT
-static char mandescr_show_peer[] =
+static const char mandescr_show_peer[] =
"Description: Show one SIP peer with details on current status.\n"
"Variables: \n"
" Peer: <name> The peer name you want to check.\n"
@@ -16393,14 +16394,14 @@ static void handle_request_info(struct sip_pvt *p, struct sip_request *req)
}
/*! \brief Enable SIP Debugging for a single IP */
-static char *sip_do_debug_ip(int fd, char *arg)
+static char *sip_do_debug_ip(int fd, const char *arg)
{
struct hostent *hp;
struct ast_hostent ahp;
int port = 0;
char *p;
- p = arg;
+ p = ast_strdupa(arg);
strsep(&p, ":");
if (p)
port = atoi(p);
@@ -16422,7 +16423,7 @@ static char *sip_do_debug_ip(int fd, char *arg)
}
/*! \brief Turn on SIP debugging for a given peer */
-static char *sip_do_debug_peer(int fd, char *arg)
+static char *sip_do_debug_peer(int fd, const char *arg)
{
struct sip_peer *peer = find_peer(arg, NULL, TRUE, FINDPEERS, FALSE);
if (!peer)
@@ -16446,7 +16447,7 @@ static char *sip_do_debug_peer(int fd, char *arg)
static char *sip_do_debug(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
int oldsipdebug = sipdebug & sip_debug_console;
- char *what;
+ const char *what;
if (cmd == CLI_INIT) {
e->command = "sip set debug {on|off|ip|peer}";
@@ -17310,7 +17311,7 @@ static int sip_reinvite_retry(const void *data)
*
* This function is only called upon the receipt of a 401/407 response to an UPDATE.
*/
-static void handle_response_update(struct sip_pvt *p, int resp, char *rest, struct sip_request *req, int seqno)
+static void handle_response_update(struct sip_pvt *p, int resp, const char *rest, struct sip_request *req, int seqno)
{
if (p->options) {
p->options->auth_type = (resp == 401 ? WWW_AUTH : PROXY_AUTH);
@@ -17321,7 +17322,7 @@ static void handle_response_update(struct sip_pvt *p, int resp, char *rest, stru
}
/*! \brief Handle SIP response to INVITE dialogue */
-static void handle_response_invite(struct sip_pvt *p, int resp, char *rest, struct sip_request *req, int seqno)
+static void handle_response_invite(struct sip_pvt *p, int resp, const char *rest, struct sip_request *req, int seqno)
{
int outgoing = ast_test_flag(&p->flags[0], SIP_OUTGOING);
int res = 0;
@@ -17689,7 +17690,7 @@ static void handle_response_invite(struct sip_pvt *p, int resp, char *rest, stru
/* \brief Handle SIP response in NOTIFY transaction
We've sent a NOTIFY, now handle responses to it
*/
-static void handle_response_notify(struct sip_pvt *p, int resp, char *rest, struct sip_request *req, int seqno)
+static void handle_response_notify(struct sip_pvt *p, int resp, const char *rest, struct sip_request *req, int seqno)
{
switch (resp) {
case 200: /* Notify accepted */
@@ -17732,7 +17733,7 @@ static void handle_response_notify(struct sip_pvt *p, int resp, char *rest, stru
}
/* \brief Handle SIP response in SUBSCRIBE transaction */
-static void handle_response_subscribe(struct sip_pvt *p, int resp, char *rest, struct sip_request *req, int seqno)
+static void handle_response_subscribe(struct sip_pvt *p, int resp, const char *rest, struct sip_request *req, int seqno)
{
struct sip_peer *peer;
if (!p->mwi) {
@@ -17803,7 +17804,7 @@ static void handle_response_subscribe(struct sip_pvt *p, int resp, char *rest, s
/* \brief Handle SIP response in REFER transaction
We've sent a REFER, now handle responses to it
*/
-static void handle_response_refer(struct sip_pvt *p, int resp, char *rest, struct sip_request *req, int seqno)
+static void handle_response_refer(struct sip_pvt *p, int resp, const char *rest, struct sip_request *req, int seqno)
{
enum ast_control_transfer message = AST_TRANSFER_FAILED;
@@ -17874,7 +17875,7 @@ static void handle_response_refer(struct sip_pvt *p, int resp, char *rest, struc
}
/*! \brief Handle responses on REGISTER to services */
-static int handle_response_register(struct sip_pvt *p, int resp, char *rest, struct sip_request *req, int seqno)
+static int handle_response_register(struct sip_pvt *p, int resp, const char *rest, struct sip_request *req, int seqno)
{
int expires, expires_ms;
struct sip_registry *r;
@@ -18100,7 +18101,7 @@ static void stop_media_flows(struct sip_pvt *p)
/*! \brief Handle SIP response in dialogue
\note only called by handle_incoming */
-static void handle_response(struct sip_pvt *p, int resp, char *rest, struct sip_request *req, int seqno)
+static void handle_response(struct sip_pvt *p, int resp, const char *rest, struct sip_request *req, int seqno)
{
struct ast_channel *owner;
int sipmethod;
@@ -18810,7 +18811,7 @@ static const char *gettag(const struct sip_request *req, const char *header, cha
}
/*! \brief Handle incoming notifications */
-static int handle_request_notify(struct sip_pvt *p, struct sip_request *req, struct sockaddr_in *sin, int seqno, char *e)
+static int handle_request_notify(struct sip_pvt *p, struct sip_request *req, struct sockaddr_in *sin, int seqno, const char *e)
{
/* This is mostly a skeleton for future improvements */
/* Mostly created to return proper answers on notifications on outbound REFER's */
@@ -19517,7 +19518,7 @@ static int handle_request_update(struct sip_pvt *p, struct sip_request *req)
* plan but try to find the active call and masquerade
* into it
*/
-static int handle_request_invite(struct sip_pvt *p, struct sip_request *req, int debug, int seqno, struct sockaddr_in *sin, int *recount, char *e, int *nounlock)
+static int handle_request_invite(struct sip_pvt *p, struct sip_request *req, int debug, int seqno, struct sockaddr_in *sin, int *recount, const char *e, int *nounlock)
{
int res = 1;
int gotdest;
@@ -19580,8 +19581,8 @@ static int handle_request_invite(struct sip_pvt *p, struct sip_request *req, int
/* If pedantic is on, we need to check the tags. If they're different, this is
in fact a forked call through a SIP proxy somewhere. */
int different;
- char *initial_rlPart2 = REQ_OFFSET_TO_STR(&p->initreq, rlPart2);
- char *this_rlPart2 = REQ_OFFSET_TO_STR(req, rlPart2);
+ const char *initial_rlPart2 = REQ_OFFSET_TO_STR(&p->initreq, rlPart2);
+ const char *this_rlPart2 = REQ_OFFSET_TO_STR(req, rlPart2);
if (sip_cfg.pedanticsipchecking)
different = sip_uri_cmp(initial_rlPart2, this_rlPart2);
else
@@ -21013,7 +21014,7 @@ static void add_peer_mwi_subs(struct sip_peer *peer)
}
/*! \brief Handle incoming SUBSCRIBE request */
-static int handle_request_subscribe(struct sip_pvt *p, struct sip_request *req, struct sockaddr_in *sin, int seqno, char *e)
+static int handle_request_subscribe(struct sip_pvt *p, struct sip_request *req, struct sockaddr_in *sin, int seqno, const char *e)
{
int gotdest = 0;
int res = 0;
@@ -21333,7 +21334,7 @@ static int handle_request_subscribe(struct sip_pvt *p, struct sip_request *req,
}
/*! \brief Handle incoming REGISTER request */
-static int handle_request_register(struct sip_pvt *p, struct sip_request *req, struct sockaddr_in *sin, char *e)
+static int handle_request_register(struct sip_pvt *p, struct sip_request *req, struct sockaddr_in *sin, const char *e)
{
enum check_auth_result res;
@@ -21401,7 +21402,7 @@ static int handle_incoming(struct sip_pvt *p, struct sip_request *req, struct so
int respid;
int res = 0;
int debug = sip_debug_test_pvt(p);
- char *e;
+ const char *e;
int error = 0;
/* Get Method and Cseq */
@@ -25058,10 +25059,10 @@ static char *app_sipaddheader = "SIPAddHeader";
static char *app_sipremoveheader = "SIPRemoveHeader";
/*! \brief Set the DTMFmode for an outbound SIP call (application) */
-static int sip_dtmfmode(struct ast_channel *chan, void *data)
+static int sip_dtmfmode(struct ast_channel *chan, const char *data)
{
struct sip_pvt *p;
- char *mode = data;
+ const char *mode = data;
if (!data) {
ast_log(LOG_WARNING, "This application requires the argument: info, inband, rfc2833\n");
@@ -25116,12 +25117,13 @@ static int sip_dtmfmode(struct ast_channel *chan, void *data)
}
/*! \brief Add a SIP header to an outbound INVITE */
-static int sip_addheader(struct ast_channel *chan, void *data)
+static int sip_addheader(struct ast_channel *chan, const char *data)
{
int no = 0;
int ok = FALSE;
char varbuf[30];
- char *inbuf = data, *subbuf;
+ const char *inbuf = data;
+ char *subbuf;
if (ast_strlen_zero(inbuf)) {
ast_log(LOG_WARNING, "This application requires the argument: Header\n");
@@ -25155,7 +25157,7 @@ static int sip_addheader(struct ast_channel *chan, void *data)
}
/*! \brief Remove SIP headers added previously with SipAddHeader application */
-static int sip_removeheader(struct ast_channel *chan, void *data)
+static int sip_removeheader(struct ast_channel *chan, const char *data)
{
struct ast_var_t *newvariable;
struct varshead *headp;
diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c
index ebea1491a..dbb90a5d5 100644
--- a/channels/chan_skinny.c
+++ b/channels/chan_skinny.c
@@ -1076,7 +1076,7 @@ static int callnums = 1;
#define SKINNY_CX_INACTIVE 4
#if 0
-static char *skinny_cxmodes[] = {
+static const char * const skinny_cxmodes[] = {
"sendonly",
"recvonly",
"sendrecv",
@@ -3049,7 +3049,7 @@ static char *_skinny_show_devices(int fd, int *total, struct mansession *s, cons
return CLI_SUCCESS;
}
-static char mandescr_show_devices[] =
+static const char mandescr_show_devices[] =
"Description: Lists Skinny devices in text format with details on current status.\n"
"Devicelist will follow as separate events, followed by a final event called\n"
"DevicelistComplete.\n"
@@ -3194,7 +3194,7 @@ static char *_skinny_show_device(int type, int fd, struct mansession *s, const s
return CLI_SUCCESS;
}
-static char mandescr_show_device[] =
+static const char mandescr_show_device[] =
"Description: Show one SKINNY device with details on current status.\n"
"Variables: \n"
" Device: <name> The device name you want to check.\n"
@@ -3310,7 +3310,7 @@ static char *_skinny_show_lines(int fd, int *total, struct mansession *s, const
return CLI_SUCCESS;
}
-static char mandescr_show_lines[] =
+static const char mandescr_show_lines[] =
"Description: Lists Skinny lines in text format with details on current status.\n"
"Linelist will follow as separate events, followed by a final event called\n"
"LinelistComplete.\n"
@@ -3502,7 +3502,7 @@ static char *_skinny_show_line(int type, int fd, struct mansession *s, const str
return CLI_SUCCESS;
}
-static char mandescr_show_line[] =
+static const char mandescr_show_line[] =
"Description: Show one SKINNY line with details on current status.\n"
"Variables: \n"
" Line: <name> The line name you want to check.\n"
diff --git a/channels/chan_unistim.c b/channels/chan_unistim.c
index 95a8ce869..27e8e0cb2 100644
--- a/channels/chan_unistim.c
+++ b/channels/chan_unistim.c
@@ -502,7 +502,7 @@ static struct unistimsession {
static const unsigned char packet_rcv_discovery[] =
{ 0xff, 0xff, 0xff, 0xff, 0x02, 0x02, 0xff, 0xff, 0xff, 0xff, 0x9e, 0x03, 0x08 };
-static unsigned char packet_send_discovery_ack[] =
+static const unsigned char packet_send_discovery_ack[] =
{ 0x00, 0x00, /*Initial Seq (2 bytes) */ 0x00, 0x00, 0x00, 0x01 };
static const unsigned char packet_recv_firm_version[] =
@@ -733,8 +733,8 @@ static unsigned int get_tick_count(void)
}
/* Send data to a phone without retransmit nor buffering */
-static void send_raw_client(int size, unsigned char *data, struct sockaddr_in *addr_to,
- const struct sockaddr_in *addr_ourip)
+static void send_raw_client(int size, const unsigned char *data, struct sockaddr_in *addr_to,
+ const struct sockaddr_in *addr_ourip)
{
#ifdef HAVE_PKTINFO
struct iovec msg_iov;
@@ -743,7 +743,12 @@ static void send_raw_client(int size, unsigned char *data, struct sockaddr_in *a
struct cmsghdr *ip_msg = (struct cmsghdr *) buffer;
struct in_pktinfo *pki = (struct in_pktinfo *) CMSG_DATA(ip_msg);
- msg_iov.iov_base = data;
+ /* cast this to a non-const pointer, since the sendmsg() API
+ * does not provide read-only and write-only flavors of the
+ * structures used for its arguments, but in this case we know
+ * the data will not be modified
+ */
+ msg_iov.iov_base = (char *) data;
msg_iov.iov_len = size;
msg.msg_name = addr_to; /* optional address */
diff --git a/channels/console_gui.c b/channels/console_gui.c
index 21088baa0..375a4019c 100644
--- a/channels/console_gui.c
+++ b/channels/console_gui.c
@@ -1505,7 +1505,7 @@ static int kp_match_area(const struct keypad_entry *e, int x, int y)
}
struct _s_k { const char *s; int k; };
-static struct _s_k gui_key_map[] = {
+static const struct _s_k gui_key_map[] = {
{"FREEZE", KEY_FREEZE},
{"PIP", KEY_PIP},
{"PICK_UP", KEY_PICK_UP },
diff --git a/channels/iax2-parser.c b/channels/iax2-parser.c
index 950fc78dd..f23ae5033 100644
--- a/channels/iax2-parser.c
+++ b/channels/iax2-parser.c
@@ -279,7 +279,7 @@ static struct iax2_ie {
{ IAX_IE_OSPTOKEN, "OSPTOKEN" },
};
-static struct iax2_ie prov_ies[] = {
+static const struct iax2_ie prov_ies[] = {
{ PROV_IE_USEDHCP, "USEDHCP" },
{ PROV_IE_IPADDR, "IPADDR", dump_ipaddr },
{ PROV_IE_SUBNET, "SUBNET", dump_ipaddr },
diff --git a/channels/misdn/chan_misdn_config.h b/channels/misdn/chan_misdn_config.h
index 40df71f97..e1fe16766 100644
--- a/channels/misdn/chan_misdn_config.h
+++ b/channels/misdn/chan_misdn_config.h
@@ -136,7 +136,7 @@ void misdn_cfg_update_ptp( void );
void misdn_cfg_get(int port, enum misdn_cfg_elements elem, void* buf, int bufsize);
/* returns the enum element for the given name, returns MISDN_CFG_FIRST if none was found */
-enum misdn_cfg_elements misdn_cfg_get_elem (char *name);
+enum misdn_cfg_elements misdn_cfg_get_elem (const char *name);
/* fills the buffer with the name of the given config element */
void misdn_cfg_get_name (enum misdn_cfg_elements elem, void *buf, int bufsize);
diff --git a/channels/misdn_config.c b/channels/misdn_config.c
index 1b645f27c..70bc8a6c2 100644
--- a/channels/misdn_config.c
+++ b/channels/misdn_config.c
@@ -600,7 +600,7 @@ void misdn_cfg_get(int port, enum misdn_cfg_elements elem, void *buf, int bufsiz
misdn_cfg_unlock();
}
-enum misdn_cfg_elements misdn_cfg_get_elem(char *name)
+enum misdn_cfg_elements misdn_cfg_get_elem(const char *name)
{
int pos;
diff --git a/channels/vcodecs.c b/channels/vcodecs.c
index ecb7a8c71..c667fdb13 100644
--- a/channels/vcodecs.c
+++ b/channels/vcodecs.c
@@ -1113,7 +1113,7 @@ struct _cm { /* map ffmpeg codec types to asterisk formats */
//struct video_codec_desc *codec_desc;
};
-static struct _cm video_formats[] = {
+static const struct _cm video_formats[] = {
{ AST_FORMAT_H263_PLUS, CODEC_ID_H263, CM_RD }, /* incoming H263P ? */
{ AST_FORMAT_H263_PLUS, CODEC_ID_H263P, CM_WR },
{ AST_FORMAT_H263, CODEC_ID_H263, CM_RD },
@@ -1137,7 +1137,7 @@ static enum CodecID map_video_format(uint32_t ast_format, int rw)
}
/* pointers to supported codecs. We assume the first one to be non null. */
-static struct video_codec_desc *supported_codecs[] = {
+static const struct video_codec_desc *supported_codecs[] = {
&h263p_codec,
&h264_codec,
&h263_codec,