mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-23 12:42:02 +00:00
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:
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -603,7 +603,7 @@ static mrcp_status_t synth_stop(mrcp_client_context_t *context, openmrcp_session
|
||||
}
|
||||
|
||||
|
||||
static switch_status_t openmrcp_tts_open(switch_speech_handle_t *sh, char *voice_name, int rate, switch_speech_flag_t *flags)
|
||||
static switch_status_t openmrcp_tts_open(switch_speech_handle_t *sh, const char *voice_name, int rate, switch_speech_flag_t *flags)
|
||||
{
|
||||
openmrcp_session_t *tts_session;
|
||||
mrcp_client_channel_t *tts_channel;
|
||||
@@ -749,7 +749,7 @@ static void openmrcp_flush_tts(switch_speech_handle_t *sh)
|
||||
synth_stop(context, tts_session); // TODO
|
||||
}
|
||||
|
||||
static void openmrcp_text_param_tts(switch_speech_handle_t *sh, char *param, char *val)
|
||||
static void openmrcp_text_param_tts(switch_speech_handle_t *sh, char *param, const char *val)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ static int parse_exten(switch_core_session_t *session, switch_caller_profile_t *
|
||||
char *field = NULL;
|
||||
char *do_break_a = NULL;
|
||||
char *expression = NULL;
|
||||
char *field_data = NULL;
|
||||
const char *field_data = NULL;
|
||||
switch_regex_t *re = NULL;
|
||||
int ovector[30];
|
||||
break_t do_break_i = BREAK_ON_FALSE;
|
||||
@@ -186,8 +186,8 @@ static switch_status_t dialplan_xml_locate(switch_core_session_t *session, switc
|
||||
switch_stream_handle_t stream = { 0 };
|
||||
switch_size_t encode_len = 1024, new_len = 0;
|
||||
char *encode_buf = NULL;
|
||||
char *prof[12] = { 0 }, *prof_names[12] = {
|
||||
0}, *e = NULL;
|
||||
const char *prof[12] = { 0 }, *prof_names[12] = {0};
|
||||
char *e = NULL;
|
||||
switch_event_header_t *hi;
|
||||
uint32_t x = 0;
|
||||
|
||||
|
||||
@@ -1614,9 +1614,8 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
|
||||
char sess_id[11] = "";
|
||||
char *dnis = NULL;
|
||||
char workspace[1024] = "";
|
||||
char *p, *u, ubuf[512] = "", *user = NULL;
|
||||
char *cid_msg = NULL, *f_cid_msg = NULL;
|
||||
|
||||
char *p, *u, ubuf[512] = "", *user = NULL, *f_cid_msg = NULL;
|
||||
const char *cid_msg = NULL;
|
||||
switch_copy_string(workspace, outbound_profile->destination_number, sizeof(workspace));
|
||||
profile_name = workspace;
|
||||
|
||||
@@ -1649,7 +1648,7 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
|
||||
user = ldl_handle_get_login(mdl_profile->handle);
|
||||
} else {
|
||||
if (!user) {
|
||||
char *id_num;
|
||||
const char *id_num;
|
||||
|
||||
if (!(id_num = outbound_profile->caller_id_number)) {
|
||||
if (!(id_num = outbound_profile->caller_id_name)) {
|
||||
|
||||
@@ -170,7 +170,7 @@ static switch_status_t channel_on_init(switch_core_session_t *session)
|
||||
switch_time_t last;
|
||||
int waitsec = globals.ring_interval * 1000000;
|
||||
switch_file_handle_t fh = { 0 };
|
||||
char *val, *ring_file = NULL, *hold_file = NULL;
|
||||
const char *val, *ring_file = NULL, *hold_file = NULL;
|
||||
int16_t abuf[2048];
|
||||
|
||||
tech_pvt = switch_core_session_get_private(session);
|
||||
@@ -767,7 +767,7 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
|
||||
|
||||
if (outbound_profile) {
|
||||
char name[128];
|
||||
char *id = !switch_strlen_zero(outbound_profile->caller_id_number) ? outbound_profile->caller_id_number : "na";
|
||||
const char *id = !switch_strlen_zero(outbound_profile->caller_id_number) ? outbound_profile->caller_id_number : "na";
|
||||
snprintf(name, sizeof(name), "PortAudio/%s", id);
|
||||
|
||||
switch_channel_set_name(channel, name);
|
||||
@@ -1522,8 +1522,8 @@ static switch_status_t list_calls(char **argv, int argc, switch_stream_handle_t
|
||||
{
|
||||
private_t *tp;
|
||||
int x = 0;
|
||||
char *cid_name = "n/a";
|
||||
char *cid_num = "n/a";
|
||||
const char *cid_name = "n/a";
|
||||
const char *cid_num = "n/a";
|
||||
|
||||
switch_mutex_lock(globals.pvt_lock);
|
||||
for (tp = globals.call_list; tp; tp = tp->next) {
|
||||
|
||||
@@ -276,7 +276,7 @@ static switch_status_t sofia_answer_channel(switch_core_session_t *session)
|
||||
switch_channel_t *channel = NULL;
|
||||
switch_status_t status;
|
||||
uint32_t session_timeout = 0;
|
||||
char *val;
|
||||
const char *val;
|
||||
|
||||
assert(session != NULL);
|
||||
|
||||
@@ -289,13 +289,13 @@ static switch_status_t sofia_answer_channel(switch_core_session_t *session)
|
||||
switch_set_flag_locked(tech_pvt, TFLAG_ANS);
|
||||
|
||||
if (switch_channel_test_flag(channel, CF_BYPASS_MEDIA)) {
|
||||
char *sdp = NULL;
|
||||
const char *sdp = NULL;
|
||||
if ((sdp = switch_channel_get_variable(channel, SWITCH_B_SDP_VARIABLE))) {
|
||||
tech_pvt->local_sdp_str = switch_core_session_strdup(session, sdp);
|
||||
}
|
||||
} else {
|
||||
if (switch_test_flag(tech_pvt, TFLAG_LATE_NEGOTIATION)) {
|
||||
char *r_sdp = switch_channel_get_variable(channel, SWITCH_R_SDP_VARIABLE);
|
||||
const char *r_sdp = switch_channel_get_variable(channel, SWITCH_R_SDP_VARIABLE);
|
||||
tech_pvt->num_codecs = 0;
|
||||
sofia_glue_tech_prepare_codecs(tech_pvt);
|
||||
if (sofia_glue_tech_media(tech_pvt, r_sdp) != SWITCH_STATUS_SUCCESS) {
|
||||
@@ -694,7 +694,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
|
||||
|
||||
switch (msg->message_id) {
|
||||
case SWITCH_MESSAGE_INDICATE_BROADCAST: {
|
||||
char *ip = NULL, *port = NULL;
|
||||
const char *ip = NULL, *port = NULL;
|
||||
ip = switch_channel_get_variable(channel, SWITCH_REMOTE_MEDIA_IP_VARIABLE);
|
||||
port = switch_channel_get_variable(channel, SWITCH_REMOTE_MEDIA_PORT_VARIABLE);
|
||||
if (ip && port) {
|
||||
@@ -708,10 +708,10 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
|
||||
break;
|
||||
case SWITCH_MESSAGE_INDICATE_NOMEDIA:
|
||||
{
|
||||
char *uuid;
|
||||
const char *uuid;
|
||||
switch_core_session_t *other_session;
|
||||
switch_channel_t *other_channel;
|
||||
char *ip = NULL, *port = NULL;
|
||||
const char *ip = NULL, *port = NULL;
|
||||
|
||||
if (switch_channel_get_state(channel) >= CS_HANGUP) {
|
||||
return SWITCH_STATUS_FALSE;
|
||||
@@ -894,13 +894,13 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
|
||||
|
||||
/* Transmit 183 Progress with SDP */
|
||||
if (switch_channel_test_flag(channel, CF_BYPASS_MEDIA)) {
|
||||
char *sdp = NULL;
|
||||
const char *sdp = NULL;
|
||||
if ((sdp = switch_channel_get_variable(channel, SWITCH_B_SDP_VARIABLE))) {
|
||||
tech_pvt->local_sdp_str = switch_core_session_strdup(session, sdp);
|
||||
}
|
||||
} else {
|
||||
if (switch_test_flag(tech_pvt, TFLAG_LATE_NEGOTIATION)) {
|
||||
char *r_sdp = switch_channel_get_variable(channel, SWITCH_R_SDP_VARIABLE);
|
||||
const char *r_sdp = switch_channel_get_variable(channel, SWITCH_R_SDP_VARIABLE);
|
||||
tech_pvt->num_codecs = 0;
|
||||
sofia_glue_tech_prepare_codecs(tech_pvt);
|
||||
if (sofia_glue_tech_media(tech_pvt, r_sdp) != SWITCH_STATUS_SUCCESS) {
|
||||
|
||||
@@ -398,7 +398,7 @@ switch_status_t sofia_glue_activate_rtp(private_object_t *tech_pvt, switch_rtp_f
|
||||
|
||||
void sofia_glue_deactivate_rtp(private_object_t *tech_pvt);
|
||||
|
||||
void sofia_glue_set_local_sdp(private_object_t *tech_pvt, char *ip, uint32_t port, char *sr, int force);
|
||||
void sofia_glue_set_local_sdp(private_object_t *tech_pvt, const char *ip, uint32_t port, const char *sr, int force);
|
||||
|
||||
void sofia_glue_tech_prepare_codecs(private_object_t *tech_pvt);
|
||||
|
||||
@@ -432,7 +432,7 @@ void launch_sofia_profile_thread(sofia_profile_t *profile);
|
||||
|
||||
switch_status_t sofia_presence_chat_send(char *proto, char *from, char *to, char *subject, char *body, char *hint);
|
||||
void sofia_glue_tech_absorb_sdp(private_object_t *tech_pvt);
|
||||
switch_status_t sofia_glue_tech_media(private_object_t *tech_pvt, char *r_sdp);
|
||||
switch_status_t sofia_glue_tech_media(private_object_t *tech_pvt, const char *r_sdp);
|
||||
char *sofia_reg_find_reg_url(sofia_profile_t *profile, const char *user, const char *host, char *val, switch_size_t len);
|
||||
void event_handler(switch_event_t *event);
|
||||
void sofia_presence_event_handler(switch_event_t *event);
|
||||
|
||||
@@ -1122,7 +1122,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
|
||||
switch_channel_t *channel = NULL;
|
||||
private_object_t *tech_pvt = NULL;
|
||||
const char *replaces_str = NULL;
|
||||
char *uuid;
|
||||
const char *uuid;
|
||||
switch_core_session_t *other_session = NULL;
|
||||
switch_channel_t *other_channel = NULL;
|
||||
char st[80] = "";
|
||||
@@ -1163,7 +1163,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
|
||||
|
||||
|
||||
if (channel && (status == 180 || status == 183) && switch_channel_test_flag(channel, CF_OUTBOUND)) {
|
||||
char *val;
|
||||
const char *val;
|
||||
if ((val = switch_channel_get_variable(channel, "sip_auto_answer")) && switch_true(val)) {
|
||||
nua_notify(nh, NUTAG_NEWSUB(1), NUTAG_SUBSTATE(nua_substate_active), SIPTAG_EVENT_STR("talk"), TAG_END());
|
||||
}
|
||||
@@ -1276,7 +1276,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
|
||||
}
|
||||
|
||||
if ((b_private = nua_handle_magic(bnh))) {
|
||||
char *br_b = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE);
|
||||
const char *br_b = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE);
|
||||
char *br_a = b_private->uuid;
|
||||
|
||||
if (br_b) {
|
||||
@@ -1544,7 +1544,7 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t
|
||||
char *rep;
|
||||
|
||||
if ((rep = strchr(refer_to->r_url->url_headers, '='))) {
|
||||
char *br_a = NULL, *br_b = NULL;
|
||||
const char *br_a = NULL, *br_b = NULL;
|
||||
char *buf;
|
||||
|
||||
rep++;
|
||||
@@ -1597,7 +1597,7 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t
|
||||
} else {
|
||||
switch_core_session_t *t_session;
|
||||
switch_channel_t *hup_channel;
|
||||
char *ext;
|
||||
const char *ext;
|
||||
|
||||
if (br_a && !br_b) {
|
||||
t_session = switch_core_session_locate(br_a);
|
||||
@@ -1691,7 +1691,7 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t
|
||||
|
||||
if (exten) {
|
||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||
char *br;
|
||||
const char *br;
|
||||
|
||||
if ((br = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))) {
|
||||
switch_core_session_t *b_session;
|
||||
@@ -2040,7 +2040,7 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_
|
||||
}
|
||||
|
||||
if (sip->sip_to && sip->sip_to->a_url) {
|
||||
char *val;
|
||||
const char *val;
|
||||
char *transport = (my_addrinfo->ai_socktype == SOCK_STREAM) ? "tcp" : "udp";
|
||||
|
||||
url_set_chanvars(session, sip->sip_to->a_url, sip_to);
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
switch_status_t sofia_glue_tech_choose_video_port(private_object_t *tech_pvt);
|
||||
switch_status_t sofia_glue_tech_set_video_codec(private_object_t *tech_pvt, int force);
|
||||
|
||||
void sofia_glue_set_local_sdp(private_object_t *tech_pvt, char *ip, uint32_t port, char *sr, int force)
|
||||
void sofia_glue_set_local_sdp(private_object_t *tech_pvt, const char *ip, uint32_t port, const char *sr, int force)
|
||||
{
|
||||
char buf[2048];
|
||||
int ptime = 0;
|
||||
@@ -256,8 +256,8 @@ void sofia_glue_set_local_sdp(private_object_t *tech_pvt, char *ip, uint32_t por
|
||||
|
||||
void sofia_glue_tech_prepare_codecs(private_object_t *tech_pvt)
|
||||
{
|
||||
char *abs, *codec_string = NULL;
|
||||
char *ocodec = NULL;
|
||||
const char *abs, *codec_string = NULL;
|
||||
const char *ocodec = NULL;
|
||||
|
||||
if (switch_channel_test_flag(tech_pvt->channel, CF_BYPASS_MEDIA)) {
|
||||
goto end;
|
||||
@@ -466,13 +466,13 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
|
||||
char *rpid = NULL;
|
||||
char *alert_info = NULL;
|
||||
char *max_forwards = NULL;
|
||||
char *alertbuf;
|
||||
char *forwardbuf;
|
||||
const char *alertbuf;
|
||||
const char *forwardbuf;
|
||||
int forwardval;
|
||||
private_object_t *tech_pvt;
|
||||
switch_channel_t *channel = NULL;
|
||||
switch_caller_profile_t *caller_profile;
|
||||
char *cid_name, *cid_num;
|
||||
const char *cid_name, *cid_num;
|
||||
char *e_dest = NULL;
|
||||
const char *holdstr = "";
|
||||
switch_stream_handle_t stream = { 0 };
|
||||
@@ -480,8 +480,8 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
|
||||
char *extra_headers = NULL;
|
||||
switch_status_t status = SWITCH_STATUS_FALSE;
|
||||
uint32_t session_timeout = 0;
|
||||
char *val;
|
||||
char *rep;
|
||||
const char *val;
|
||||
const char *rep;
|
||||
|
||||
channel = switch_core_session_get_channel(session);
|
||||
assert(channel != NULL);
|
||||
@@ -495,8 +495,8 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
|
||||
|
||||
caller_profile = switch_channel_get_caller_profile(channel);
|
||||
|
||||
cid_name = (char *) caller_profile->caller_id_name;
|
||||
cid_num = (char *) caller_profile->caller_id_number;
|
||||
cid_name = caller_profile->caller_id_name;
|
||||
cid_num = caller_profile->caller_id_number;
|
||||
sofia_glue_tech_prepare_codecs(tech_pvt);
|
||||
|
||||
if (!tech_pvt->from_str) {
|
||||
@@ -550,7 +550,8 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
|
||||
char *d_url = NULL, *url = NULL;
|
||||
sofia_private_t *sofia_private;
|
||||
char *invite_contact = NULL, *to_str, *use_from_str, *from_str, *url_str;
|
||||
char *transport = "udp", *t_var, *d_contact = NULL;
|
||||
const char *transport = "udp", *t_var;
|
||||
char *d_contact = NULL;
|
||||
|
||||
if (switch_strlen_zero(tech_pvt->dest)) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "URL Error! [%s]\n", tech_pvt->dest);
|
||||
@@ -723,7 +724,7 @@ void sofia_glue_do_xfer_invite(switch_core_session_t *session)
|
||||
(char *) caller_profile->caller_id_number,
|
||||
tech_pvt->profile->extsipip ? tech_pvt->profile->extsipip : tech_pvt->profile->sipip))) {
|
||||
|
||||
char *rep = switch_channel_get_variable(channel, SOFIA_REPLACES_HEADER);
|
||||
const char *rep = switch_channel_get_variable(channel, SOFIA_REPLACES_HEADER);
|
||||
|
||||
tech_pvt->nh2 = nua_handle(tech_pvt->profile->nua, NULL,
|
||||
SIPTAG_TO_STR(tech_pvt->dest), SIPTAG_FROM_STR(tech_pvt->from_str), SIPTAG_CONTACT_STR(tech_pvt->profile->url),
|
||||
@@ -744,8 +745,7 @@ void sofia_glue_do_xfer_invite(switch_core_session_t *session)
|
||||
|
||||
void sofia_glue_tech_absorb_sdp(private_object_t *tech_pvt)
|
||||
{
|
||||
char *sdp_str;
|
||||
|
||||
const char *sdp_str;
|
||||
|
||||
if ((sdp_str = switch_channel_get_variable(tech_pvt->channel, SWITCH_B_SDP_VARIABLE))) {
|
||||
sdp_parser_t *parser;
|
||||
@@ -933,7 +933,7 @@ switch_status_t sofia_glue_activate_rtp(private_object_t *tech_pvt, switch_rtp_f
|
||||
{
|
||||
int bw, ms;
|
||||
const char *err = NULL;
|
||||
char *val = NULL;
|
||||
const char *val = NULL;
|
||||
switch_rtp_flag_t flags;
|
||||
switch_status_t status;
|
||||
char tmp[50];
|
||||
@@ -1129,7 +1129,7 @@ switch_status_t sofia_glue_activate_rtp(private_object_t *tech_pvt, switch_rtp_f
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
switch_status_t sofia_glue_tech_media(private_object_t *tech_pvt, char *r_sdp)
|
||||
switch_status_t sofia_glue_tech_media(private_object_t *tech_pvt, const char *r_sdp)
|
||||
{
|
||||
sdp_parser_t *parser = NULL;
|
||||
sdp_session_t *sdp;
|
||||
@@ -1182,7 +1182,7 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, sdp_session_t *
|
||||
int sendonly = 0;
|
||||
int greedy = 0, x = 0, skip = 0, mine = 0;
|
||||
switch_channel_t *channel = NULL;
|
||||
char *val;
|
||||
const char *val;
|
||||
|
||||
tech_pvt = switch_core_session_get_private(session);
|
||||
assert(tech_pvt != NULL);
|
||||
@@ -1225,7 +1225,7 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, sdp_session_t *
|
||||
|
||||
if (sendonly) {
|
||||
if (!switch_test_flag(tech_pvt, TFLAG_SIP_HOLD)) {
|
||||
char *stream;
|
||||
const char *stream;
|
||||
switch_set_flag_locked(tech_pvt, TFLAG_SIP_HOLD);
|
||||
if (tech_pvt->max_missed_packets) {
|
||||
switch_rtp_set_max_missed_packets(tech_pvt->rtp_session, tech_pvt->max_missed_packets * 10);
|
||||
@@ -1557,7 +1557,7 @@ switch_call_cause_t sofia_glue_sip_cause_to_freeswitch(int status)
|
||||
|
||||
void sofia_glue_pass_sdp(private_object_t *tech_pvt, char *sdp)
|
||||
{
|
||||
char *val;
|
||||
const char *val;
|
||||
switch_core_session_t *other_session;
|
||||
switch_channel_t *other_channel;
|
||||
|
||||
|
||||
@@ -309,7 +309,7 @@ void BaseCDR::process_channel_variables(const std::list<std::string>& stringlist
|
||||
tempstringvector.push_back('\0');
|
||||
char* tempstring= &tempstringvector[0];
|
||||
|
||||
char *tempvariable;
|
||||
const char *tempvariable;
|
||||
tempvariable = switch_channel_get_variable(channel,tempstring);
|
||||
|
||||
|
||||
@@ -350,7 +350,7 @@ void BaseCDR::process_channel_variables(const std::list<std::string>& stringlist
|
||||
tempstringvector.push_back('\0');
|
||||
char* tempstring= &tempstringvector[0];
|
||||
|
||||
char *tempvariable;
|
||||
const char *tempvariable;
|
||||
tempvariable = switch_channel_get_variable(channel,tempstring);
|
||||
if (!switch_strlen_zero(tempvariable))
|
||||
chanvars_supp[*iItr] = tempvariable;
|
||||
|
||||
@@ -631,7 +631,7 @@ static switch_status_t parse_command(listener_t * listener, switch_event_t *even
|
||||
goto done;
|
||||
} else if (!strncasecmp(cmd, "getvar", 6)) {
|
||||
char *arg;
|
||||
char *val = "";
|
||||
const char *val = "";
|
||||
|
||||
strip_cr(cmd);
|
||||
|
||||
|
||||
@@ -143,7 +143,7 @@ static void *SWITCH_THREAD_FUNC read_stream_thread(switch_thread_t *thread, void
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static switch_status_t local_stream_file_open(switch_file_handle_t *handle, char *path)
|
||||
static switch_status_t local_stream_file_open(switch_file_handle_t *handle, const char *path)
|
||||
{
|
||||
local_stream_context_t *context;
|
||||
local_stream_source_t *source;
|
||||
|
||||
@@ -40,7 +40,7 @@ struct native_file_context {
|
||||
|
||||
typedef struct native_file_context native_file_context;
|
||||
|
||||
static switch_status_t native_file_file_open(switch_file_handle_t *handle, char *path)
|
||||
static switch_status_t native_file_file_open(switch_file_handle_t *handle, const char *path)
|
||||
{
|
||||
native_file_context *context;
|
||||
char *ext;
|
||||
|
||||
@@ -55,7 +55,7 @@ struct sndfile_context {
|
||||
|
||||
typedef struct sndfile_context sndfile_context;
|
||||
|
||||
static switch_status_t sndfile_file_open(switch_file_handle_t *handle, char *path)
|
||||
static switch_status_t sndfile_file_open(switch_file_handle_t *handle, const char *path)
|
||||
{
|
||||
sndfile_context *context;
|
||||
int mode = 0;
|
||||
|
||||
@@ -1524,7 +1524,8 @@ static JSBool session_streamfile(JSContext * cx, JSObject * obj, uintN argc, jsv
|
||||
switch_file_handle_t fh = { 0 };
|
||||
JSFunction *function;
|
||||
switch_input_args_t args = { 0 };
|
||||
char *prebuf, posbuf[35] = "";
|
||||
const char *prebuf;
|
||||
char posbuf[35] = "";
|
||||
|
||||
METHOD_SANITY_CHECK();
|
||||
|
||||
@@ -1627,7 +1628,7 @@ static JSBool session_get_variable(JSContext * cx, JSObject * obj, uintN argc, j
|
||||
assert(channel != NULL);
|
||||
|
||||
if (argc > 0) {
|
||||
char *var, *val;
|
||||
const char *var, *val;
|
||||
|
||||
var = JS_GetStringBytes(JS_ValueToString(cx, argv[0]));
|
||||
val = switch_channel_get_variable(channel, var);
|
||||
@@ -2510,16 +2511,16 @@ static JSBool session_originate(JSContext * cx, JSObject * obj, uintN argc, jsva
|
||||
JSObject *session_obj;
|
||||
switch_core_session_t *session = NULL, *peer_session = NULL;
|
||||
switch_caller_profile_t *caller_profile = NULL, *orig_caller_profile = NULL;
|
||||
char *dest = NULL;
|
||||
char *dialplan = NULL;
|
||||
char *cid_name = "";
|
||||
char *cid_num = "";
|
||||
char *network_addr = "";
|
||||
char *ani = "";
|
||||
char *aniii = "";
|
||||
char *rdnis = "";
|
||||
char *context = "";
|
||||
char *username = NULL;
|
||||
const char *dest = NULL;
|
||||
const char *dialplan = NULL;
|
||||
const char *cid_name = "";
|
||||
const char *cid_num = "";
|
||||
const char *network_addr = "";
|
||||
const char *ani = "";
|
||||
const char *aniii = "";
|
||||
const char *rdnis = "";
|
||||
const char *context = "";
|
||||
const char *username = NULL;
|
||||
char *to = NULL;
|
||||
char *tmp;
|
||||
|
||||
@@ -3109,10 +3110,11 @@ static int env_init(JSContext * cx, JSObject * javascript_object)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void js_parse_and_execute(switch_core_session_t *session, char *input_code, struct request_obj *ro)
|
||||
static void js_parse_and_execute(switch_core_session_t *session, const char *input_code, struct request_obj *ro)
|
||||
{
|
||||
JSObject *javascript_global_object = NULL;
|
||||
char buf[1024], *script, *arg, *argv[512];
|
||||
char buf[1024], *arg, *argv[512];
|
||||
const char *script;
|
||||
int argc = 0, x = 0, y = 0;
|
||||
unsigned int flags = 0;
|
||||
struct js_session jss;
|
||||
@@ -3172,9 +3174,9 @@ static void js_parse_and_execute(switch_core_session_t *session, char *input_cod
|
||||
}
|
||||
}
|
||||
|
||||
static void js_dp_function(switch_core_session_t *session, char *input_code)
|
||||
SWITCH_STANDARD_APP(js_dp_function)
|
||||
{
|
||||
js_parse_and_execute(session, input_code, NULL);
|
||||
js_parse_and_execute(session, data, NULL);
|
||||
}
|
||||
|
||||
static void *SWITCH_THREAD_FUNC js_thread_run(switch_thread_t * thread, void *obj)
|
||||
|
||||
@@ -71,12 +71,12 @@ SWITCH_BEGIN_EXTERN_C
|
||||
#else //not win32
|
||||
#define SWITCH_SM_DECLARE(type) type
|
||||
#endif
|
||||
int eval_some_js(char *code, JSContext * cx, JSObject * obj, jsval * rval)
|
||||
int eval_some_js(const char *code, JSContext * cx, JSObject * obj, jsval * rval)
|
||||
{
|
||||
JSScript *script = NULL;
|
||||
char *cptr;
|
||||
const char *cptr;
|
||||
char *path = NULL;
|
||||
char *script_name = NULL;
|
||||
const char *script_name = NULL;
|
||||
int result = 0;
|
||||
|
||||
JS_ClearPendingException(cx);
|
||||
|
||||
@@ -65,7 +65,7 @@ static switch_status_t my_on_hangup(switch_core_session_t *session)
|
||||
char *xml_text = NULL;
|
||||
char *path = NULL;
|
||||
char *curl_xml_text = NULL;
|
||||
char *logdir = NULL;
|
||||
const char *logdir = NULL;
|
||||
char *xml_text_escaped = NULL;
|
||||
int fd = -1;
|
||||
uint32_t cur_try;
|
||||
|
||||
Reference in New Issue
Block a user