use more correct const char * for things that should not be modified. This should also fix the switch_cpp.cpp changes from MODAPP-44. More patches to follow up on this for a few more modules that will likely break with this commit.

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6120 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris committed 2007-11-01 11:28:26 +00:00
1 parent b416d80212
commit 622a2733dc
52 files changed
+254 -246

No files matched your search

@@ -286,7 +286,7 @@ SWITCH_STANDARD_API(transfer_function)
switch_channel_t *channel = switch_core_session_get_channel(tsession);
arg++;
if (!strcasecmp(arg, "bleg")) {
char *uuid = switch_channel_get_variable(channel, SWITCH_BRIDGE_VARIABLE);
const char *uuid = switch_channel_get_variable(channel, SWITCH_BRIDGE_VARIABLE);
if (uuid && (other_session = switch_core_session_locate(uuid))) {
switch_core_session_t *tmp = tsession;
tsession = other_session;
@@ -294,7 +294,7 @@ SWITCH_STANDARD_API(transfer_function)
switch_core_session_rwunlock(tmp);
}
} else if (!strcasecmp(arg, "both")) {
char *uuid = switch_channel_get_variable(channel, SWITCH_BRIDGE_VARIABLE);
const char *uuid = switch_channel_get_variable(channel, SWITCH_BRIDGE_VARIABLE);
switch_core_session_t *other_session;
if (uuid && (other_session = switch_core_session_locate(uuid))) {
switch_ivr_session_transfer(other_session, dest, dp, context);
@@ -312,7 +312,7 @@ static switch_status_t conference_outcall(conference_obj_t * conference,
char *bridgeto, uint32_t timeout, char *flags, char *cid_name, char *cid_num, switch_call_cause_t *cause);
static switch_status_t conference_outcall_bg(conference_obj_t * conference,
char *conference_name,
switch_core_session_t *session, char *bridgeto, uint32_t timeout, char *flags, char *cid_name, char *cid_num);
switch_core_session_t *session, char *bridgeto, uint32_t timeout, const char *flags, const char *cid_name, const char *cid_num);
SWITCH_STANDARD_APP(conference_function);
static void launch_conference_thread(conference_obj_t * conference);
static void *SWITCH_THREAD_FUNC conference_loop_input(switch_thread_t * thread, void *obj);
@@ -1531,11 +1531,11 @@ static void conference_loop_output(conference_member_t * member)
if ((call_list = switch_channel_get_private(channel, "_conference_autocall_list_"))) {
char *cid_name = switch_channel_get_variable(channel, "conference_auto_outcall_caller_id_name");
char *cid_num = switch_channel_get_variable(channel, "conference_auto_outcall_caller_id_number");
char *toval = switch_channel_get_variable(channel, "conference_auto_outcall_timeout");
char *flags = switch_channel_get_variable(channel, "conference_auto_outcall_flags");
char *ann = switch_channel_get_variable(channel, "conference_auto_outcall_announce");
const char *cid_name = switch_channel_get_variable(channel, "conference_auto_outcall_caller_id_name");
const char *cid_num = switch_channel_get_variable(channel, "conference_auto_outcall_caller_id_number");
const char *toval = switch_channel_get_variable(channel, "conference_auto_outcall_timeout");
const char *flags = switch_channel_get_variable(channel, "conference_auto_outcall_flags");
const char *ann = switch_channel_get_variable(channel, "conference_auto_outcall_announce");
int to = 60;
if (ann) {
@@ -3730,7 +3730,7 @@ static void *SWITCH_THREAD_FUNC conference_outcall_run(switch_thread_t * thread,
static switch_status_t conference_outcall_bg(conference_obj_t * conference,
char *conference_name,
switch_core_session_t *session, char *bridgeto, uint32_t timeout, char *flags, char *cid_name, char *cid_num)
switch_core_session_t *session, char *bridgeto, uint32_t timeout, const char *flags, const char *cid_name, const char *cid_num)
{
struct bg_call *call = NULL;
@@ -259,7 +259,7 @@ SWITCH_STANDARD_APP(phrase_function)
assert(channel != NULL);
if ((mydata = switch_core_session_strdup(session, data))) {
char *lang;
const char *lang;
char *macro = mydata;
char *mdata = NULL;
@@ -445,7 +445,8 @@ SWITCH_STANDARD_APP(set_profile_var_function)
SWITCH_STANDARD_APP(export_function)
{
switch_channel_t *channel;
char *exports, *new_exports = NULL, *new_exports_d = NULL, *var, *val = NULL, *var_name = NULL;
const char *exports;
char *new_exports = NULL, *new_exports_d = NULL, *var, *val = NULL, *var_name = NULL;
int local = 1;
channel = switch_core_session_get_channel(session);
@@ -923,9 +924,9 @@ static switch_status_t on_dtmf(switch_core_session_t *session, void *input, swit
case SWITCH_INPUT_TYPE_DTMF:
{
char *dtmf = (char *) input;
char *terminators;
const char *terminators;
switch_channel_t *channel = switch_core_session_get_channel(session);
char *p;
const char *p;
assert(channel);
@@ -965,8 +966,8 @@ SWITCH_STANDARD_APP(speak_function)
char buf[10];
char *argv[4] = { 0 };
int argc;
char *engine = NULL;
char *voice = NULL;
const char *engine = NULL;
const char *voice = NULL;
char *text = NULL;
char *mydata = NULL;
switch_codec_t *codec;
@@ -1211,7 +1212,7 @@ SWITCH_STANDARD_APP(audio_bridge_function)
switch_channel_t *caller_channel;
switch_core_session_t *peer_session = NULL;
unsigned int timelimit = 60;
char *var, *continue_on_fail = NULL;
const char *var, *continue_on_fail = NULL;
uint8_t no_media_bridge = 0;
switch_call_cause_t cause = SWITCH_CAUSE_NORMAL_CLEARING;
+6 -6
View File
@@ -107,8 +107,8 @@ SWITCH_STANDARD_APP(fifo_function)
fifo_node_t *node;
switch_channel_t *channel;
int nowait = 0;
char *moh = NULL;
char *announce = NULL;
const char *moh = NULL;
const char *announce = NULL;
switch_event_t *event = NULL;
char date[80] = "";
switch_time_exp_t tm;
@@ -153,7 +153,7 @@ SWITCH_STANDARD_APP(fifo_function)
}
if (!strcasecmp(argv[1], "in")) {
char *uuid = strdup(switch_core_session_get_uuid(session));
const char *uuid = strdup(switch_core_session_get_uuid(session));
switch_channel_answer(channel);
@@ -178,7 +178,7 @@ SWITCH_STANDARD_APP(fifo_function)
switch_mutex_lock(node->mutex);
node->caller_count++;
switch_core_hash_insert(node->caller_hash, uuid, session);
switch_queue_push(node->fifo, uuid);
switch_queue_push(node->fifo, (void *)uuid);
switch_mutex_unlock(node->mutex);
ts = switch_timestamp_now();
@@ -418,8 +418,8 @@ static int xml_hash(switch_xml_t xml, switch_hash_t *hash, char *container, char
for (hi = switch_hash_first(NULL, hash); hi; hi = switch_hash_next(hi)) {
int c_off = 0, d_off = 0;
char *status;
char *ts;
const char *status;
const char *ts;
switch_hash_this(hi, &var, NULL, &val);
session = (switch_core_session_t *) val;
@@ -872,7 +872,7 @@ static int listen_callback(void *pArg, int argc, char **argv, char **columnNames
}
static void message_count(vm_profile_t *profile, char *myid, char *domain_name, char *myfolder,
static void message_count(vm_profile_t *profile, const char *myid, const char *domain_name, char *myfolder,
int *total_new_messages, int *total_saved_messages, int *total_new_urgent_messages, int *total_saved_urgent_messages)
{
char msg_count[80] = "";
@@ -1083,7 +1083,7 @@ static switch_status_t listen_file(switch_core_session_t *session, vm_profile_t
return status;
}
static void voicemail_check_main(switch_core_session_t *session, char *profile_name, char *domain_name, char *id, int auth)
static void voicemail_check_main(switch_core_session_t *session, const char *profile_name, const char *domain_name, const char *id, int auth)
{
vm_check_state_t vm_check_state = VM_CHECK_START;
switch_channel_t *channel;
@@ -1091,8 +1091,8 @@ static void voicemail_check_main(switch_core_session_t *session, char *profile_n
vm_profile_t *profile;
switch_xml_t x_domain, x_domain_root, x_user, x_params, x_param;
switch_status_t status;
char pass_buf[80] = "", *mypass = NULL, id_buf[80] = "", *myid = id, *myfolder = NULL;
const char *thepass = NULL;
char pass_buf[80] = "", *mypass = NULL, id_buf[80] = "", *myfolder = NULL;
const char *thepass = NULL, *myid = id;
char term = 0;
uint32_t timeout, attempts = 0;
int failed = 0;
@@ -1522,7 +1522,7 @@ static void voicemail_check_main(switch_core_session_t *session, char *profile_n
}
static switch_status_t voicemail_leave_main(switch_core_session_t *session, char *profile_name, char *domain_name, char *id)
static switch_status_t voicemail_leave_main(switch_core_session_t *session, const char *profile_name, const char *domain_name, const char *id)
{
switch_channel_t *channel;
char *myfolder = "inbox";
@@ -1544,7 +1544,8 @@ static switch_status_t voicemail_leave_main(switch_core_session_t *session, char
int email_attach = 1;
int email_delete = 1;
char buf[2];
char *greet_path = NULL, *voicemail_greeting_number = NULL;
char *greet_path = NULL;
const char *voicemail_greeting_number = NULL;
memset(&cbt, 0, sizeof(cbt));
if (!(profile = switch_core_hash_find(globals.profile_hash, profile_name))) {
@@ -1833,10 +1834,10 @@ SWITCH_STANDARD_APP(voicemail_function)
int argc = 0;
char *argv[6] = { 0 };
char *mydata = NULL;
char *profile_name = NULL;
char *domain_name = NULL;
char *id = NULL;
char *auth_var = NULL;
const char *profile_name = NULL;
const char *domain_name = NULL;
const char *id = NULL;
const char *auth_var = NULL;
int x = 0, check = 0, auth = 0;
switch_channel_t *channel;