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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user