[Freeswitch-trunk] [commit] r6120 - in freeswitch/trunk: libs/iax/src libs/libdingaling/src libs/libteletone/src src src/include src/mod/applications/mod_commands src/mod/applications/mod_conference src/mod/applications/mod_dptools src/mod/applications/mod_fifo src/mod/applications/mod_voicemail src/mod/asr_tts/mod_openmrcp src/mod/dialplans/mod_dialplan_xml src/mod/endpoints/mod_dingaling src/mod/endpoints/mod_portaudio src/mod/endpoints/mod_sofia src/mod/event_handlers/mod_cdr src/mod/event_handlers/mod_event_socket src/mod/formats/mod_local_stream src/mod/formats/mod_native_file src/mod/formats/mod_sndfile src/mod/languages/mod_spidermonkey src/mod/xml_int/mod_xml_cdr
Freeswitch SVN
mikej at freeswitch.org
Thu Nov 1 07:28:28 EDT 2007
Author: mikej
Date: Thu Nov 1 07:28:26 2007
New Revision: 6120
Modified:
freeswitch/trunk/libs/iax/src/iax-client.h
freeswitch/trunk/libs/iax/src/iax.c
freeswitch/trunk/libs/iax/src/iax2-parser.c
freeswitch/trunk/libs/iax/src/iax2-parser.h
freeswitch/trunk/libs/libdingaling/src/libdingaling.c
freeswitch/trunk/libs/libdingaling/src/libdingaling.h
freeswitch/trunk/libs/libteletone/src/libteletone_generate.c
freeswitch/trunk/libs/libteletone/src/libteletone_generate.h
freeswitch/trunk/src/include/switch_caller.h
freeswitch/trunk/src/include/switch_channel.h
freeswitch/trunk/src/include/switch_core.h
freeswitch/trunk/src/include/switch_cpp.h
freeswitch/trunk/src/include/switch_ivr.h
freeswitch/trunk/src/include/switch_module_interfaces.h
freeswitch/trunk/src/include/switch_types.h
freeswitch/trunk/src/include/switch_utils.h
freeswitch/trunk/src/include/switch_xml.h
freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c
freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c
freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c
freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c
freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c
freeswitch/trunk/src/mod/asr_tts/mod_openmrcp/mod_openmrcp.c
freeswitch/trunk/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c
freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c
freeswitch/trunk/src/mod/endpoints/mod_portaudio/mod_portaudio.c
freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h
freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c
freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c
freeswitch/trunk/src/mod/event_handlers/mod_cdr/basecdr.cpp
freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c
freeswitch/trunk/src/mod/formats/mod_local_stream/mod_local_stream.c
freeswitch/trunk/src/mod/formats/mod_native_file/mod_native_file.c
freeswitch/trunk/src/mod/formats/mod_sndfile/mod_sndfile.c
freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.h
freeswitch/trunk/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c
freeswitch/trunk/src/switch_caller.c
freeswitch/trunk/src/switch_channel.c
freeswitch/trunk/src/switch_core_file.c
freeswitch/trunk/src/switch_core_session.c
freeswitch/trunk/src/switch_core_speech.c
freeswitch/trunk/src/switch_core_timer.c
freeswitch/trunk/src/switch_cpp.cpp
freeswitch/trunk/src/switch_ivr.c
freeswitch/trunk/src/switch_ivr_async.c
freeswitch/trunk/src/switch_ivr_bridge.c
freeswitch/trunk/src/switch_ivr_originate.c
freeswitch/trunk/src/switch_ivr_play_say.c
freeswitch/trunk/src/switch_utils.c
freeswitch/trunk/src/switch_xml.c
Log:
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.
Modified: freeswitch/trunk/libs/iax/src/iax-client.h
==============================================================================
--- freeswitch/trunk/libs/iax/src/iax-client.h (original)
+++ freeswitch/trunk/libs/iax/src/iax-client.h Thu Nov 1 07:28:26 2007
@@ -161,14 +161,14 @@
extern int iax_send_text(struct iax_session *session, char *text);
extern int iax_send_ping(struct iax_session *session);
extern int iax_load_complete(struct iax_session *session);
-extern int iax_reject(struct iax_session *session, char *reason);
+extern int iax_reject(struct iax_session *session, const char *reason);
int iax_reject_registration(struct iax_session *session, char *reason);
int iax_ack_registration(struct iax_session *session);
int iax_auth_registration(struct iax_session *session);
extern int iax_busy(struct iax_session *session);
extern int iax_congestion(struct iax_session *session);
extern int iax_hangup(struct iax_session *session, char *byemsg);
-extern int iax_call(struct iax_session *session, char *cidnum, char *cidname, char *ich, char *lang, int wait, int format, int capability);
+extern int iax_call(struct iax_session *session, const char *cidnum, const char *cidname, char *ich, char *lang, int wait, int format, int capability);
extern int iax_accept(struct iax_session *session, int format);
extern int iax_answer(struct iax_session *session);
extern int iax_sendurl(struct iax_session *session, char *url);
Modified: freeswitch/trunk/libs/iax/src/iax.c
==============================================================================
--- freeswitch/trunk/libs/iax/src/iax.c (original)
+++ freeswitch/trunk/libs/iax/src/iax.c Thu Nov 1 07:28:26 2007
@@ -1691,7 +1691,7 @@
return send_command_final(session, AST_FRAME_IAX, IAX_COMMAND_REGAUTH, 0, NULL, 0, -1);
}
-int iax_reject(struct iax_session *session, char *reason)
+int iax_reject(struct iax_session *session, const char *reason)
{
struct iax_ie_data ied;
memset(&ied, 0, sizeof(ied));
@@ -1986,7 +1986,7 @@
}
-int iax_call(struct iax_session *session, char *cidnum, char *cidname, char *ich, char *lang, int wait, int formats, int capabilities)
+int iax_call(struct iax_session *session, const char *cidnum, const char *cidname, char *ich, char *lang, int wait, int formats, int capabilities)
{
char tmp[256]="";
char *part1, *part2;
Modified: freeswitch/trunk/libs/iax/src/iax2-parser.c
==============================================================================
--- freeswitch/trunk/libs/iax/src/iax2-parser.c (original)
+++ freeswitch/trunk/libs/iax/src/iax2-parser.c Thu Nov 1 07:28:26 2007
@@ -432,7 +432,7 @@
dump_ies(fh->iedata, datalen);
}
-int iax_ie_append_raw(struct iax_ie_data *ied, unsigned char ie, void *data, int datalen)
+int iax_ie_append_raw(struct iax_ie_data *ied, unsigned char ie, const void *data, int datalen)
{
char tmp[256];
if (datalen > ((int)sizeof(ied->buf) - ied->pos)) {
@@ -466,7 +466,7 @@
return iax_ie_append_raw(ied, ie, &newval, (int)sizeof(newval));
}
-int iax_ie_append_str(struct iax_ie_data *ied, unsigned char ie, unsigned char *str)
+int iax_ie_append_str(struct iax_ie_data *ied, unsigned char ie, const unsigned char *str)
{
return iax_ie_append_raw(ied, ie, str, (int)strlen((char *) str));
}
Modified: freeswitch/trunk/libs/iax/src/iax2-parser.h
==============================================================================
--- freeswitch/trunk/libs/iax/src/iax2-parser.h (original)
+++ freeswitch/trunk/libs/iax/src/iax2-parser.h Thu Nov 1 07:28:26 2007
@@ -127,11 +127,11 @@
extern const char *iax_ie2str(int ie);
-extern int iax_ie_append_raw(struct iax_ie_data *ied, unsigned char ie, void *data, int datalen);
+extern int iax_ie_append_raw(struct iax_ie_data *ied, unsigned char ie, const void *data, int datalen);
extern int iax_ie_append_addr(struct iax_ie_data *ied, unsigned char ie, struct sockaddr_in *sin);
extern int iax_ie_append_int(struct iax_ie_data *ied, unsigned char ie, unsigned int value);
extern int iax_ie_append_short(struct iax_ie_data *ied, unsigned char ie, unsigned short value);
-extern int iax_ie_append_str(struct iax_ie_data *ied, unsigned char ie, unsigned char *str);
+extern int iax_ie_append_str(struct iax_ie_data *ied, unsigned char ie, const unsigned char *str);
extern int iax_ie_append_byte(struct iax_ie_data *ied, unsigned char ie, unsigned char dat);
extern int iax_ie_append(struct iax_ie_data *ied, unsigned char ie);
extern int iax_parse_ies(struct iax_ies *ies, unsigned char *data, int datalen);
Modified: freeswitch/trunk/libs/libdingaling/src/libdingaling.c
==============================================================================
--- freeswitch/trunk/libs/libdingaling/src/libdingaling.c (original)
+++ freeswitch/trunk/libs/libdingaling/src/libdingaling.c Thu Nov 1 07:28:26 2007
@@ -257,7 +257,7 @@
return apr_hash_get(session->variables, key, APR_HASH_KEY_STRING);
}
-void ldl_session_set_value(ldl_session_t *session, char *key, char *val)
+void ldl_session_set_value(ldl_session_t *session, const char *key, const char *val)
{
apr_hash_set(session->variables, apr_pstrdup(session->pool, key), APR_HASH_KEY_STRING, apr_pstrdup(session->pool, val));
}
@@ -1789,18 +1789,19 @@
}
-void ldl_handle_send_msg(ldl_handle_t *handle, char *from, char *to, char *subject, char *body)
+void ldl_handle_send_msg(ldl_handle_t *handle, char *from, char *to, const char *subject, const char *body)
{
iks *msg;
char *t, *e;
char *bdup = NULL;
int on = 0;
int len = 0;
+ char *my_body = strdup(body);
assert(handle != NULL);
assert(body != NULL);
- if (strchr(body, '<')) {
- len = (int) strlen(body);
+ if (strchr(my_body, '<')) {
+ len = (int) strlen(my_body);
if (!(bdup = malloc(len))) {
return;
}
@@ -1808,7 +1809,7 @@
memset(bdup, 0, len);
e = bdup;
- for(t = body; *t; t++) {
+ for(t = my_body; *t; t++) {
if (*t == '<') {
on = 1;
} else if (*t == '>') {
@@ -1820,10 +1821,10 @@
*e++ = *t;
}
}
- body = bdup;
+ my_body = bdup;
}
- msg = iks_make_msg(IKS_TYPE_NONE, to, body);
+ msg = iks_make_msg(IKS_TYPE_NONE, to, my_body);
iks_insert_attrib(msg, "type", "chat");
if (!from) {
@@ -1840,6 +1841,8 @@
free(bdup);
}
+ free(my_body);
+
apr_queue_push(handle->queue, msg);
msg = NULL;
Modified: freeswitch/trunk/libs/libdingaling/src/libdingaling.h
==============================================================================
--- freeswitch/trunk/libs/libdingaling/src/libdingaling.h (original)
+++ freeswitch/trunk/libs/libdingaling/src/libdingaling.h Thu Nov 1 07:28:26 2007
@@ -309,7 +309,7 @@
\param key the key to set
\param val the value of the key
*/
-void ldl_session_set_value(ldl_session_t *session, char *key, char *val);
+void ldl_session_set_value(ldl_session_t *session, const char *key, const char *val);
/*!
\brief Create a Jingle Session
@@ -473,7 +473,7 @@
\param subject optional subject
\param body body of the message
*/
-void ldl_handle_send_msg(ldl_handle_t *handle, char *from, char *to, char *subject, char *body);
+void ldl_handle_send_msg(ldl_handle_t *handle, char *from, char *to, const char *subject, const char *body);
/*!
\brief Offer candidates to a potential session
Modified: freeswitch/trunk/libs/libteletone/src/libteletone_generate.c
==============================================================================
--- freeswitch/trunk/libs/libteletone/src/libteletone_generate.c (original)
+++ freeswitch/trunk/libs/libteletone/src/libteletone_generate.c Thu Nov 1 07:28:26 2007
@@ -314,7 +314,7 @@
return (char *) memcpy (new, s, len);
}
-int teletone_run(teletone_generation_session_t *ts, char *cmd)
+int teletone_run(teletone_generation_session_t *ts, const char *cmd)
{
char *data = NULL, *cur = NULL, *end = NULL;
int var = 0, LOOPING = 0;
Modified: freeswitch/trunk/libs/libteletone/src/libteletone_generate.h
==============================================================================
--- freeswitch/trunk/libs/libteletone/src/libteletone_generate.h (original)
+++ freeswitch/trunk/libs/libteletone/src/libteletone_generate.h Thu Nov 1 07:28:26 2007
@@ -276,7 +276,7 @@
\param cmd the script to execute
\return 0
*/
-int teletone_run(teletone_generation_session_t *ts, char *cmd);
+int teletone_run(teletone_generation_session_t *ts, const char *cmd);
#ifdef __cplusplus
}
Modified: freeswitch/trunk/src/include/switch_caller.h
==============================================================================
--- freeswitch/trunk/src/include/switch_caller.h (original)
+++ freeswitch/trunk/src/include/switch_caller.h Thu Nov 1 07:28:26 2007
@@ -60,25 +60,25 @@
*/
struct switch_caller_profile {
/*! The Call's User Name */
- char *username;
+ const char *username;
/*! The name of the dialplan */
- char *dialplan;
+ const char *dialplan;
/*! Caller ID Name */
- char *caller_id_name;
+ const char *caller_id_name;
/*! Caller ID Number */
- char *caller_id_number;
+ const char *caller_id_number;
uint8_t caller_ton;
uint8_t caller_numplan;
/*! Caller Network Address (when applicable) */
- char *network_addr;
+ const char *network_addr;
/*! ANI (when applicable) */
- char *ani;
+ const char *ani;
uint8_t ani_ton;
uint8_t ani_numplan;
/*! ANI II (when applicable) */
- char *aniii;
+ const char *aniii;
/*! RDNIS */
- char *rdnis;
+ const char *rdnis;
uint8_t rdnis_ton;
uint8_t rdnis_numplan;
/*! Destination Number */
@@ -86,13 +86,13 @@
uint8_t destination_number_ton;
uint8_t destination_number_numplan;
/*! channel type */
- char *source;
+ const char *source;
/*! channel name */
char *chan_name;
/*! unique id */
char *uuid;
/*! context */
- char *context;
+ const char *context;
/*! flags */
switch_caller_profile_flag_t flags;
struct switch_caller_profile *originator_caller_profile;
@@ -156,7 +156,7 @@
\param name the name
\note this function is meant for situations where the name paramater is the contents of the variable
*/
-SWITCH_DECLARE(char *) switch_caller_get_field_by_name(switch_caller_profile_t *caller_profile, const char *name);
+SWITCH_DECLARE(const char *) switch_caller_get_field_by_name(switch_caller_profile_t *caller_profile, const char *name);
/*!
\brief Create a new caller profile object
Modified: freeswitch/trunk/src/include/switch_channel.h
==============================================================================
--- freeswitch/trunk/src/include/switch_channel.h (original)
+++ freeswitch/trunk/src/include/switch_channel.h Thu Nov 1 07:28:26 2007
@@ -209,7 +209,7 @@
\param varname the name of the variable
\return the value of the requested variable
*/
-SWITCH_DECLARE(char *) switch_channel_get_variable(switch_channel_t *channel, const char *varname);
+SWITCH_DECLARE(const char *) switch_channel_get_variable(switch_channel_t *channel, const char *varname);
/*!
* Start iterating over the entries in the channel variable list.
Modified: freeswitch/trunk/src/include/switch_core.h
==============================================================================
--- freeswitch/trunk/src/include/switch_core.h (original)
+++ freeswitch/trunk/src/include/switch_core.h Thu Nov 1 07:28:26 2007
@@ -69,7 +69,7 @@
/*! optional numeric arg */
int numeric_arg;
/*! optional string arg */
- char *string_arg;
+ const char *string_arg;
/*! optional string arg */
switch_size_t string_arg_size;
/*! optional arbitrary pointer arg */
@@ -607,7 +607,7 @@
SWITCH_DECLARE(switch_app_log_t *) switch_core_session_get_app_log(switch_core_session_t *session);
SWITCH_DECLARE(switch_status_t) switch_core_session_exec(switch_core_session_t *session,
- const switch_application_interface_t *application_interface, char *arg);
+ const switch_application_interface_t *application_interface, const char *arg);
SWITCH_DECLARE(switch_status_t) switch_core_session_execute_exten(switch_core_session_t *session, char *exten, char *dialplan, char *context);
/*!
@@ -918,7 +918,7 @@
\param pool the memory pool to use for allocation
\return
*/
-SWITCH_DECLARE(switch_status_t) switch_core_timer_init(switch_timer_t *timer, char *timer_name, int interval, int samples, switch_memory_pool_t *pool);
+SWITCH_DECLARE(switch_status_t) switch_core_timer_init(switch_timer_t *timer, const char *timer_name, int interval, int samples, switch_memory_pool_t *pool);
/*!
\brief Wait for one cycle on an existing timer
@@ -1105,7 +1105,7 @@
\note the loadable module used is chosen based on the file extension
*/
SWITCH_DECLARE(switch_status_t) switch_core_file_open(switch_file_handle_t *fh,
- char *file_path, uint8_t channels, uint32_t rate, unsigned int flags, switch_memory_pool_t *pool);
+ const char *file_path, uint8_t channels, uint32_t rate, unsigned int flags, switch_memory_pool_t *pool);
/*!
\brief Read media from a file handle
\param fh the file handle to read from (must be initilized by you memset all 0 for read, fill in channels and rate for write)
@@ -1176,8 +1176,8 @@
\return SWITCH_STATUS_SUCCESS if the handle is opened
*/
SWITCH_DECLARE(switch_status_t) switch_core_speech_open(switch_speech_handle_t *sh,
- char *module_name,
- char *voice_name,
+ const char *module_name,
+ const char *voice_name,
unsigned int rate,
unsigned int interval,
switch_speech_flag_t *flags, switch_memory_pool_t *pool);
@@ -1202,7 +1202,7 @@
\param param the parameter
\param val the value
*/
-SWITCH_DECLARE(void) switch_core_speech_text_param_tts(switch_speech_handle_t *sh, char *param, char *val);
+SWITCH_DECLARE(void) switch_core_speech_text_param_tts(switch_speech_handle_t *sh, char *param, const char *val);
/*!
\brief Set a numeric parameter on a TTS handle
Modified: freeswitch/trunk/src/include/switch_cpp.h
==============================================================================
--- freeswitch/trunk/src/include/switch_cpp.h (original)
+++ freeswitch/trunk/src/include/switch_cpp.h Thu Nov 1 07:28:26 2007
@@ -121,7 +121,7 @@
int preAnswer();
virtual void hangup(char *cause);
void setVariable(char *var, char *val);
- char *getVariable(char *var);
+ const char *getVariable(char *var);
/** \brief Record to a file
Modified: freeswitch/trunk/src/include/switch_ivr.h
==============================================================================
--- freeswitch/trunk/src/include/switch_ivr.h (original)
+++ freeswitch/trunk/src/include/switch_ivr.h Thu Nov 1 07:28:26 2007
@@ -203,7 +203,7 @@
SWITCH_DECLARE(switch_status_t) switch_ivr_record_session(switch_core_session_t *session, char *file, uint32_t limit, switch_file_handle_t *fh);
SWITCH_DECLARE(switch_status_t) switch_ivr_displace_session(switch_core_session_t *session, char *file, uint32_t limit, const char *flags);
-SWITCH_DECLARE(switch_status_t) switch_ivr_stop_displace_session(switch_core_session_t *session, char *file);
+SWITCH_DECLARE(switch_status_t) switch_ivr_stop_displace_session(switch_core_session_t *session, const char *file);
/*!
\brief Stop Recording a session
@@ -211,7 +211,7 @@
\param file the path to the file
\return SWITCH_STATUS_SUCCESS if all is well
*/
-SWITCH_DECLARE(switch_status_t) switch_ivr_stop_record_session(switch_core_session_t *session, char *file);
+SWITCH_DECLARE(switch_status_t) switch_ivr_stop_record_session(switch_core_session_t *session, const char *file);
/*!
\brief Start looking for DTMF inband
@@ -282,7 +282,7 @@
\param args arguements to pass for callbacks etc
\return SWITCH_STATUS_SUCCESS if all is well
*/
-SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *session, switch_file_handle_t *fh, char *file, switch_input_args_t *args);
+SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *session, switch_file_handle_t *fh, const char *file, switch_input_args_t *args);
SWITCH_DECLARE(switch_status_t) switch_ivr_gentones(switch_core_session_t *session, char *script, int32_t loops, switch_input_args_t *args);
@@ -339,7 +339,7 @@
\return SWITCH_STATUS_SUCCESS if all is well
*/
SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text(switch_core_session_t *session,
- char *tts_name, char *voice_name, char *text, switch_input_args_t *args);
+ const char *tts_name, const char *voice_name, char *text, switch_input_args_t *args);
/*!
\brief Make an outgoing call
@@ -358,10 +358,10 @@
SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *session,
switch_core_session_t **bleg,
switch_call_cause_t *cause,
- char *bridgeto,
+ const char *bridgeto,
uint32_t timelimit_sec,
const switch_state_handler_table_t *table,
- char *cid_name_override, char *cid_num_override, switch_caller_profile_t *caller_profile_override);
+ const char *cid_name_override, const char *cid_num_override, switch_caller_profile_t *caller_profile_override);
/*!
\brief Bridge Audio from one session to another
@@ -392,7 +392,7 @@
\param dialplan the new dialplan (OPTIONAL, may be NULL)
\param context the new context (OPTIONAL, may be NULL)
*/
-SWITCH_DECLARE(switch_status_t) switch_ivr_session_transfer(switch_core_session_t *session, char *extension, char *dialplan, char *context);
+SWITCH_DECLARE(switch_status_t) switch_ivr_session_transfer(switch_core_session_t *session, const char *extension, char *dialplan, char *context);
/*!
\brief Transfer an existing session to another location in the future
@@ -403,7 +403,7 @@
\param context the new context (OPTIONAL, may be NULL)
\return the id of the task
*/
-SWITCH_DECLARE(uint32_t) switch_ivr_schedule_transfer(time_t runtime, char *uuid, char *extension, char *dialplan, char *context);
+SWITCH_DECLARE(uint32_t) switch_ivr_schedule_transfer(time_t runtime, const char *uuid, char *extension, char *dialplan, char *context);
/*!
@@ -414,7 +414,7 @@
\param bleg hangup up the B-Leg if possible
\return the id of the task
*/
-SWITCH_DECLARE(uint32_t) switch_ivr_schedule_hangup(time_t runtime, char *uuid, switch_call_cause_t cause, switch_bool_t bleg);
+SWITCH_DECLARE(uint32_t) switch_ivr_schedule_hangup(time_t runtime, const char *uuid, switch_call_cause_t cause, switch_bool_t bleg);
/*!
\brief Bridge two existing sessions
@@ -422,7 +422,7 @@
\param originatee_uuid the uuid of the originator
\return SWITCH_STATUS_SUCCESS if all is well
*/
-SWITCH_DECLARE(switch_status_t) switch_ivr_uuid_bridge(char *originator_uuid, char *originatee_uuid);
+SWITCH_DECLARE(switch_status_t) switch_ivr_uuid_bridge(const char *originator_uuid, const char *originatee_uuid);
/*!
\brief Signal a session to request direct media access to it's remote end
@@ -430,7 +430,7 @@
\param flags flags to influence behaviour (SMF_REBRIDGE to rebridge the call in media mode)
\return SWITCH_STATUS_SUCCESS if all is well
*/
-SWITCH_DECLARE(switch_status_t) switch_ivr_media(char *uuid, switch_media_flag_t flags);
+SWITCH_DECLARE(switch_status_t) switch_ivr_media(const char *uuid, switch_media_flag_t flags);
/*!
\brief Signal a session to request indirect media allowing it to exchange media directly with another device
@@ -438,21 +438,21 @@
\param flags flags to influence behaviour (SMF_REBRIDGE to rebridge the call in no_media mode)
\return SWITCH_STATUS_SUCCESS if all is well
*/
-SWITCH_DECLARE(switch_status_t) switch_ivr_nomedia(char *uuid, switch_media_flag_t flags);
+SWITCH_DECLARE(switch_status_t) switch_ivr_nomedia(const char *uuid, switch_media_flag_t flags);
/*!
\brief Signal the session with a protocol specific hold message.
\param uuid the uuid of the session to hold
\return SWITCH_STATUS_SUCCESS if all is well
*/
-SWITCH_DECLARE(switch_status_t) switch_ivr_hold_uuid(char *uuid);
+SWITCH_DECLARE(switch_status_t) switch_ivr_hold_uuid(const char *uuid);
/*!
\brief Signal the session with a protocol specific unhold message.
\param uuid the uuid of the session to hold
\return SWITCH_STATUS_SUCCESS if all is well
*/
-SWITCH_DECLARE(switch_status_t) switch_ivr_unhold_uuid(char *uuid);
+SWITCH_DECLARE(switch_status_t) switch_ivr_unhold_uuid(const char *uuid);
/*!
\brief Signal the session with a protocol specific hold message.
@@ -485,7 +485,7 @@
\param flags flags to send to the request (SMF_ECHO_BRIDGED to send the broadcast to both sides of the call)
\return SWITCH_STATUS_SUCCESS if all is well
*/
-SWITCH_DECLARE(switch_status_t) switch_ivr_broadcast(char *uuid, char *path, switch_media_flag_t flags);
+SWITCH_DECLARE(switch_status_t) switch_ivr_broadcast(const char *uuid, const char *path, switch_media_flag_t flags);
/*!
\brief Transfer variables from one session to another
@@ -712,7 +712,7 @@
*/
SWITCH_DECLARE(switch_status_t) switch_ivr_menu_stack_xml_init(switch_ivr_menu_xml_ctx_t ** xml_menu_ctx, switch_memory_pool_t *pool);
-SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro(switch_core_session_t *session, char *macro_name, char *data, char *lang,
+SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro(switch_core_session_t *session, const char *macro_name, const char *data, const char *lang,
switch_input_args_t *args);
SWITCH_DECLARE(void) switch_ivr_delay_echo(switch_core_session_t *session, uint32_t delay_ms);
/** @} */
Modified: freeswitch/trunk/src/include/switch_module_interfaces.h
==============================================================================
--- freeswitch/trunk/src/include/switch_module_interfaces.h (original)
+++ freeswitch/trunk/src/include/switch_module_interfaces.h Thu Nov 1 07:28:26 2007
@@ -231,7 +231,7 @@
/*! the name of the interface */
const char *interface_name;
/*! function to open the file */
- switch_status_t (*file_open) (switch_file_handle_t *, char *file_path);
+ switch_status_t (*file_open) (switch_file_handle_t *, const char *file_path);
/*! function to close the file */
switch_status_t (*file_close) (switch_file_handle_t *);
/*! function to read from the file */
@@ -340,7 +340,7 @@
/*! the name of the interface */
const char *interface_name;
/*! function to open the speech interface */
- switch_status_t (*speech_open) (switch_speech_handle_t *sh, char *voice_name, int rate, switch_speech_flag_t *flags);
+ switch_status_t (*speech_open) (switch_speech_handle_t *sh, const char *voice_name, int rate, switch_speech_flag_t *flags);
/*! function to close the speech interface */
switch_status_t (*speech_close) (switch_speech_handle_t *, switch_speech_flag_t *flags);
/*! function to feed audio to the ASR */
@@ -348,7 +348,7 @@
/*! function to read audio from the TTS */
switch_status_t (*speech_read_tts) (switch_speech_handle_t *sh, void *data, switch_size_t *datalen, uint32_t * rate, switch_speech_flag_t *flags);
void (*speech_flush_tts) (switch_speech_handle_t *sh);
- void (*speech_text_param_tts) (switch_speech_handle_t *sh, char *param, char *val);
+ void (*speech_text_param_tts) (switch_speech_handle_t *sh, char *param, const char *val);
void (*speech_numeric_param_tts) (switch_speech_handle_t *sh, char *param, int val);
void (*speech_float_param_tts) (switch_speech_handle_t *sh, char *param, double val);
Modified: freeswitch/trunk/src/include/switch_types.h
==============================================================================
--- freeswitch/trunk/src/include/switch_types.h (original)
+++ freeswitch/trunk/src/include/switch_types.h Thu Nov 1 07:28:26 2007
@@ -1070,8 +1070,8 @@
typedef struct switch_media_bug switch_media_bug_t;
typedef switch_bool_t (*switch_media_bug_callback_t) (switch_media_bug_t *, void *, switch_abc_type_t);
-typedef void (*switch_application_function_t) (switch_core_session_t *, char *);
-#define SWITCH_STANDARD_APP(name) static void name (switch_core_session_t *session, char *data)
+typedef void (*switch_application_function_t) (switch_core_session_t *, const char *);
+#define SWITCH_STANDARD_APP(name) static void name (switch_core_session_t *session, const char *data)
typedef void (*switch_event_callback_t) (switch_event_t *);
typedef switch_caller_extension_t *(*switch_dialplan_hunt_function_t) (switch_core_session_t *, void *, switch_caller_profile_t *);
Modified: freeswitch/trunk/src/include/switch_utils.h
==============================================================================
--- freeswitch/trunk/src/include/switch_utils.h (original)
+++ freeswitch/trunk/src/include/switch_utils.h Thu Nov 1 07:28:26 2007
@@ -328,7 +328,7 @@
SWITCH_DECLARE(switch_status_t) switch_string_match(const char *string, size_t string_len, const char *search, size_t search_len);
#define SWITCH_READ_ACCEPTABLE(status) (status == SWITCH_STATUS_SUCCESS || status == SWITCH_STATUS_BREAK)
-SWITCH_DECLARE(size_t) switch_url_encode(char *url, char *buf, size_t len);
+SWITCH_DECLARE(size_t) switch_url_encode(const char *url, char *buf, size_t len);
SWITCH_DECLARE(char *) switch_url_decode(char *s);
SWITCH_DECLARE(switch_bool_t) switch_simple_email(char *to, char *from, char *headers, char *body, char *file);
Modified: freeswitch/trunk/src/include/switch_xml.h
==============================================================================
--- freeswitch/trunk/src/include/switch_xml.h (original)
+++ freeswitch/trunk/src/include/switch_xml.h Thu Nov 1 07:28:26 2007
@@ -318,13 +318,13 @@
const char *key_name, const char *key_value, switch_xml_t * root, switch_xml_t * node,
const char *params);
-SWITCH_DECLARE(switch_status_t) switch_xml_locate_domain(char *domain_name, char *params, switch_xml_t *root, switch_xml_t *domain);
-SWITCH_DECLARE(switch_status_t) switch_xml_locate_user(char *user_name, char *domain_name,
- char *ip,
+SWITCH_DECLARE(switch_status_t) switch_xml_locate_domain(const char *domain_name, char *params, switch_xml_t *root, switch_xml_t *domain);
+SWITCH_DECLARE(switch_status_t) switch_xml_locate_user(const char *user_name, const char *domain_name,
+ const char *ip,
switch_xml_t *root,
switch_xml_t *domain,
switch_xml_t *user,
- char *xtra_params);
+ const char *xtra_params);
///\brief open a config in the core registry
///\param file_path the name of the config section e.g. modules.conf
Modified: freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c (original)
+++ freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c Thu Nov 1 07:28:26 2007
@@ -286,7 +286,7 @@
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_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);
Modified: freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c (original)
+++ freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c Thu Nov 1 07:28:26 2007
@@ -312,7 +312,7 @@
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 @@
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 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;
Modified: freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c (original)
+++ freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c Thu Nov 1 07:28:26 2007
@@ -259,7 +259,7 @@
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(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 @@
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 @@
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_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;
Modified: freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c (original)
+++ freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c Thu Nov 1 07:28:26 2007
@@ -107,8 +107,8 @@
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 @@
}
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_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 @@
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;
Modified: freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c (original)
+++ freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c Thu Nov 1 07:28:26 2007
@@ -872,7 +872,7 @@
}
-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 @@
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 @@
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 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 @@
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 @@
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;
Modified: freeswitch/trunk/src/mod/asr_tts/mod_openmrcp/mod_openmrcp.c
==============================================================================
--- freeswitch/trunk/src/mod/asr_tts/mod_openmrcp/mod_openmrcp.c (original)
+++ freeswitch/trunk/src/mod/asr_tts/mod_openmrcp/mod_openmrcp.c Thu Nov 1 07:28:26 2007
@@ -603,7 +603,7 @@
}
-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 @@
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)
{
}
Modified: freeswitch/trunk/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c
==============================================================================
--- freeswitch/trunk/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c (original)
+++ freeswitch/trunk/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c Thu Nov 1 07:28:26 2007
@@ -59,7 +59,7 @@
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 @@
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;
Modified: freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c Thu Nov 1 07:28:26 2007
@@ -1614,9 +1614,8 @@
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 @@
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)) {
Modified: freeswitch/trunk/src/mod/endpoints/mod_portaudio/mod_portaudio.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_portaudio/mod_portaudio.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_portaudio/mod_portaudio.c Thu Nov 1 07:28:26 2007
@@ -170,7 +170,7 @@
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 @@
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 @@
{
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) {
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c Thu Nov 1 07:28:26 2007
@@ -276,7 +276,7 @@
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 @@
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 @@
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 @@
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 @@
/* 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) {
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h Thu Nov 1 07:28:26 2007
@@ -398,7 +398,7 @@
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 @@
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);
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c Thu Nov 1 07:28:26 2007
@@ -1122,7 +1122,7 @@
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 @@
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 @@
}
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 @@
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 @@
} 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 @@
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 @@
}
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);
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c Thu Nov 1 07:28:26 2007
@@ -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_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 @@
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 @@
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 @@
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 @@
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 @@
(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_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 @@
{
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 @@
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 @@
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 @@
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 @@
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;
Modified: freeswitch/trunk/src/mod/event_handlers/mod_cdr/basecdr.cpp
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_cdr/basecdr.cpp (original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_cdr/basecdr.cpp Thu Nov 1 07:28:26 2007
@@ -309,7 +309,7 @@
tempstringvector.push_back('\0');
char* tempstring= &tempstringvector[0];
- char *tempvariable;
+ const char *tempvariable;
tempvariable = switch_channel_get_variable(channel,tempstring);
@@ -350,7 +350,7 @@
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;
Modified: freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c (original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c Thu Nov 1 07:28:26 2007
@@ -631,7 +631,7 @@
goto done;
} else if (!strncasecmp(cmd, "getvar", 6)) {
char *arg;
- char *val = "";
+ const char *val = "";
strip_cr(cmd);
Modified: freeswitch/trunk/src/mod/formats/mod_local_stream/mod_local_stream.c
==============================================================================
--- freeswitch/trunk/src/mod/formats/mod_local_stream/mod_local_stream.c (original)
+++ freeswitch/trunk/src/mod/formats/mod_local_stream/mod_local_stream.c Thu Nov 1 07:28:26 2007
@@ -143,7 +143,7 @@
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;
Modified: freeswitch/trunk/src/mod/formats/mod_native_file/mod_native_file.c
==============================================================================
--- freeswitch/trunk/src/mod/formats/mod_native_file/mod_native_file.c (original)
+++ freeswitch/trunk/src/mod/formats/mod_native_file/mod_native_file.c Thu Nov 1 07:28:26 2007
@@ -40,7 +40,7 @@
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;
Modified: freeswitch/trunk/src/mod/formats/mod_sndfile/mod_sndfile.c
==============================================================================
--- freeswitch/trunk/src/mod/formats/mod_sndfile/mod_sndfile.c (original)
+++ freeswitch/trunk/src/mod/formats/mod_sndfile/mod_sndfile.c Thu Nov 1 07:28:26 2007
@@ -55,7 +55,7 @@
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;
Modified: freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c (original)
+++ freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c Thu Nov 1 07:28:26 2007
@@ -1524,7 +1524,8 @@
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 @@
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 @@
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 @@
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_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)
Modified: freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.h
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.h (original)
+++ freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.h Thu Nov 1 07:28:26 2007
@@ -71,12 +71,12 @@
#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);
Modified: freeswitch/trunk/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c
==============================================================================
--- freeswitch/trunk/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c (original)
+++ freeswitch/trunk/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c Thu Nov 1 07:28:26 2007
@@ -65,7 +65,7 @@
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;
Modified: freeswitch/trunk/src/switch_caller.c
==============================================================================
--- freeswitch/trunk/src/switch_caller.c (original)
+++ freeswitch/trunk/src/switch_caller.c Thu Nov 1 07:28:26 2007
@@ -126,7 +126,7 @@
}
-SWITCH_DECLARE(char *) switch_caller_get_field_by_name(switch_caller_profile_t *caller_profile, const char *name)
+SWITCH_DECLARE(const char *) switch_caller_get_field_by_name(switch_caller_profile_t *caller_profile, const char *name)
{
if (!strcasecmp(name, "dialplan")) {
return caller_profile->dialplan;
Modified: freeswitch/trunk/src/switch_channel.c
==============================================================================
--- freeswitch/trunk/src/switch_channel.c (original)
+++ freeswitch/trunk/src/switch_channel.c Thu Nov 1 07:28:26 2007
@@ -289,7 +289,7 @@
SWITCH_DECLARE(void) switch_channel_presence(switch_channel_t *channel, const char *rpid, const char *status)
{
- char *id = switch_channel_get_variable(channel, "presence_id");
+ const char *id = switch_channel_get_variable(channel, "presence_id");
switch_event_t *event;
switch_event_types_t type = SWITCH_EVENT_PRESENCE_IN;
@@ -319,9 +319,9 @@
}
-SWITCH_DECLARE(char *) switch_channel_get_variable(switch_channel_t *channel, const char *varname)
+SWITCH_DECLARE(const char *) switch_channel_get_variable(switch_channel_t *channel, const char *varname)
{
- char *v = NULL;
+ const char *v = NULL;
assert(channel != NULL);
switch_mutex_lock(channel->profile_mutex);
@@ -425,7 +425,7 @@
SWITCH_DECLARE(switch_bool_t) switch_channel_set_flag_partner(switch_channel_t *channel, switch_channel_flag_t flags)
{
- char *uuid;
+ const char *uuid;
assert(channel != NULL);
@@ -443,7 +443,7 @@
SWITCH_DECLARE(switch_bool_t) switch_channel_clear_flag_partner(switch_channel_t *channel, switch_channel_flag_t flags)
{
- char *uuid;
+ const char *uuid;
assert(channel != NULL);
@@ -1096,7 +1096,7 @@
switch_channel_mark_ring_ready(channel);
if (!switch_channel_test_flag(channel, CF_EARLY_MEDIA)) {
- char *uuid;
+ const char *uuid;
switch_core_session_t *other_session;
switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, NULL, SWITCH_LOG_NOTICE, "Pre-Answer %s!\n", channel->name);
@@ -1184,7 +1184,7 @@
SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_answered(switch_channel_t *channel, const char *file, const char *func, int line)
{
switch_event_t *event;
- char *uuid;
+ const char *uuid;
switch_core_session_t *other_session;
assert(channel != NULL);
@@ -1268,7 +1268,8 @@
char *q, *p, *c = NULL;
char *data, *indup;
size_t sp = 0, len = 0, olen = 0, vtype = 0, br = 0, cpos, block = 128;
- char *sub_val = NULL, *func_val = NULL;
+ const char *sub_val = NULL;
+ char *func_val = NULL;
int nv = 0;
q = in;
Modified: freeswitch/trunk/src/switch_core_file.c
==============================================================================
--- freeswitch/trunk/src/switch_core_file.c (original)
+++ freeswitch/trunk/src/switch_core_file.c Thu Nov 1 07:28:26 2007
@@ -35,7 +35,7 @@
#include "private/switch_core_pvt.h"
SWITCH_DECLARE(switch_status_t) switch_core_file_open(switch_file_handle_t *fh,
- char *file_path, uint8_t channels, uint32_t rate, unsigned int flags, switch_memory_pool_t *pool)
+ const char *file_path, uint8_t channels, uint32_t rate, unsigned int flags, switch_memory_pool_t *pool)
{
char *ext;
switch_status_t status;
Modified: freeswitch/trunk/src/switch_core_session.c
==============================================================================
--- freeswitch/trunk/src/switch_core_session.c (original)
+++ freeswitch/trunk/src/switch_core_session.c Thu Nov 1 07:28:26 2007
@@ -194,7 +194,7 @@
if (session) {
channel = switch_core_session_get_channel(session);
if (caller_profile) {
- char *ecaller_id_name = NULL, *ecaller_id_number = NULL;
+ const char *ecaller_id_name = NULL, *ecaller_id_number = NULL;
ecaller_id_name = switch_channel_get_variable(channel, "effective_caller_id_name");
ecaller_id_number = switch_channel_get_variable(channel, "effective_caller_id_number");
@@ -247,7 +247,7 @@
}
if (channel && peer_channel) {
- char *export_vars, *val;
+ const char *export_vars, *val;
switch_codec_t *read_codec = switch_core_session_get_read_codec(session);
if (read_codec) {
@@ -270,7 +270,7 @@
int x;
for (x = 0; x < argc; x++) {
- char *val;
+ const char *val;
if ((val = switch_channel_get_variable(channel, argv[x]))) {
char *var = argv[x];
if (!strncasecmp(var, "nolocal:", 8)) {
@@ -344,7 +344,7 @@
{
switch_core_session_message_t msg = {0};
switch_core_session_t *other_session;
- char *uuid;
+ const char *uuid;
switch_channel_t *channel;
switch_status_t status = SWITCH_STATUS_SUCCESS;
@@ -900,7 +900,7 @@
}
SWITCH_DECLARE(switch_status_t) switch_core_session_exec(switch_core_session_t *session,
- const switch_application_interface_t *application_interface, char *arg) {
+ const switch_application_interface_t *application_interface, const char *arg) {
switch_app_log_t *log, *lp;
switch_event_t *event;
switch_channel_t *channel;
Modified: freeswitch/trunk/src/switch_core_speech.c
==============================================================================
--- freeswitch/trunk/src/switch_core_speech.c (original)
+++ freeswitch/trunk/src/switch_core_speech.c Thu Nov 1 07:28:26 2007
@@ -36,8 +36,8 @@
SWITCH_DECLARE(switch_status_t) switch_core_speech_open(switch_speech_handle_t *sh,
- char *module_name,
- char *voice_name,
+ const char *module_name,
+ const char *voice_name,
unsigned int rate,
unsigned int interval,
switch_speech_flag_t *flags,
@@ -101,7 +101,7 @@
}
}
-SWITCH_DECLARE(void) switch_core_speech_text_param_tts(switch_speech_handle_t *sh, char *param, char *val)
+SWITCH_DECLARE(void) switch_core_speech_text_param_tts(switch_speech_handle_t *sh, char *param, const char *val)
{
assert(sh != NULL);
Modified: freeswitch/trunk/src/switch_core_timer.c
==============================================================================
--- freeswitch/trunk/src/switch_core_timer.c (original)
+++ freeswitch/trunk/src/switch_core_timer.c Thu Nov 1 07:28:26 2007
@@ -34,7 +34,7 @@
#include <switch.h>
#include "private/switch_core_pvt.h"
-SWITCH_DECLARE(switch_status_t) switch_core_timer_init(switch_timer_t *timer, char *timer_name, int interval, int samples, switch_memory_pool_t *pool)
+SWITCH_DECLARE(switch_status_t) switch_core_timer_init(switch_timer_t *timer, const char *timer_name, int interval, int samples, switch_memory_pool_t *pool)
{
switch_timer_interface_t *timer_interface;
switch_status_t status;
Modified: freeswitch/trunk/src/switch_cpp.cpp
==============================================================================
--- freeswitch/trunk/src/switch_cpp.cpp (original)
+++ freeswitch/trunk/src/switch_cpp.cpp Thu Nov 1 07:28:26 2007
@@ -45,7 +45,7 @@
CoreSession::CoreSession()
{
- init_vars();
+ do { session = NULL; channel = NULL; uuid = NULL; tts_name = NULL; voice_name = NULL; memset(&args, 0, sizeof(args)); ap = NULL; caller_profile.source = "mod_unknown"; caller_profile.dialplan = ""; caller_profile.context = ""; caller_profile.caller_id_name = ""; caller_profile.caller_id_number = ""; caller_profile.network_addr = ""; caller_profile.ani = ""; caller_profile.aniii = ""; caller_profile.rdnis = ""; caller_profile.username = ""; on_hangup = NULL; cb_state.function = NULL; } while(0);
}
CoreSession::CoreSession(char *nuuid)
@@ -113,7 +113,7 @@
switch_channel_set_variable(channel, var, val);
}
-char *CoreSession::getVariable(char *var)
+const char *CoreSession::getVariable(char *var)
{
sanity_check(NULL);
return switch_channel_get_variable(channel, var);
@@ -269,7 +269,7 @@
switch_status_t status;
switch_file_handle_t fh = { 0 };
- char *prebuf;
+ const char *prebuf;
sanity_check(-1);
fh.samples = starting_sample_count;
Modified: freeswitch/trunk/src/switch_ivr.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr.c (original)
+++ freeswitch/trunk/src/switch_ivr.c Thu Nov 1 07:28:26 2007
@@ -696,7 +696,7 @@
return SWITCH_STATUS_SUCCESS;
}
-SWITCH_DECLARE(switch_status_t) switch_ivr_hold_uuid(char *uuid)
+SWITCH_DECLARE(switch_status_t) switch_ivr_hold_uuid(const char *uuid)
{
switch_core_session_t *session;
@@ -727,7 +727,7 @@
return SWITCH_STATUS_SUCCESS;
}
-SWITCH_DECLARE(switch_status_t) switch_ivr_unhold_uuid(char *uuid)
+SWITCH_DECLARE(switch_status_t) switch_ivr_unhold_uuid(const char *uuid)
{
switch_core_session_t *session;
@@ -739,9 +739,9 @@
return SWITCH_STATUS_SUCCESS;
}
-SWITCH_DECLARE(switch_status_t) switch_ivr_media(char *uuid, switch_media_flag_t flags)
+SWITCH_DECLARE(switch_status_t) switch_ivr_media(const char *uuid, switch_media_flag_t flags)
{
- char *other_uuid = NULL;
+ const char *other_uuid = NULL;
switch_channel_t *channel, *other_channel = NULL;
switch_core_session_t *session, *other_session;
switch_core_session_message_t msg = { 0 };
@@ -791,9 +791,9 @@
}
-SWITCH_DECLARE(switch_status_t) switch_ivr_nomedia(char *uuid, switch_media_flag_t flags)
+SWITCH_DECLARE(switch_status_t) switch_ivr_nomedia(const char *uuid, switch_media_flag_t flags)
{
- char *other_uuid;
+ const char *other_uuid;
switch_channel_t *channel, *other_channel = NULL;
switch_core_session_t *session, *other_session = NULL;
switch_core_session_message_t msg = { 0 };
@@ -845,14 +845,14 @@
return status;
}
-SWITCH_DECLARE(switch_status_t) switch_ivr_session_transfer(switch_core_session_t *session, char *extension, char *dialplan, char *context)
+SWITCH_DECLARE(switch_status_t) switch_ivr_session_transfer(switch_core_session_t *session, const char *extension, char *dialplan, char *context)
{
switch_channel_t *channel;
switch_caller_profile_t *profile, *new_profile;
switch_core_session_message_t msg = { 0 };
switch_core_session_t *other_session;
switch_channel_t *other_channel = NULL;
- char *uuid = NULL;
+ const char *uuid = NULL;
assert(session != NULL);
switch_core_session_reset(session);
@@ -941,7 +941,7 @@
{
switch_channel_t *chana = switch_core_session_get_channel(sessa);
switch_channel_t *chanb = switch_core_session_get_channel(sessb);
- char *val = NULL;
+ const char *val = NULL;
uint8_t prefix = 0;
if (var && *var == '~') {
Modified: freeswitch/trunk/src/switch_ivr_async.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr_async.c (original)
+++ freeswitch/trunk/src/switch_ivr_async.c Thu Nov 1 07:28:26 2007
@@ -163,7 +163,7 @@
return SWITCH_TRUE;
}
-SWITCH_DECLARE(switch_status_t) switch_ivr_stop_displace_session(switch_core_session_t *session, char *file)
+SWITCH_DECLARE(switch_status_t) switch_ivr_stop_displace_session(switch_core_session_t *session, const char *file)
{
switch_media_bug_t *bug;
switch_channel_t *channel = switch_core_session_get_channel(session);
@@ -277,7 +277,7 @@
return SWITCH_TRUE;
}
-SWITCH_DECLARE(switch_status_t) switch_ivr_stop_record_session(switch_core_session_t *session, char *file)
+SWITCH_DECLARE(switch_status_t) switch_ivr_stop_record_session(switch_core_session_t *session, const char *file)
{
switch_media_bug_t *bug;
switch_channel_t *channel = switch_core_session_get_channel(session);
@@ -297,7 +297,7 @@
{
switch_channel_t *channel;
switch_codec_t *read_codec;
- char *p;
+ const char *p;
const char *vval;
switch_media_bug_t *bug;
switch_status_t status;
@@ -1071,7 +1071,7 @@
switch_status_t status;
switch_asr_flag_t flags = SWITCH_ASR_FLAG_NONE;
struct speech_thread_handle *sth;
- char *val;
+ const char *val;
if (!ah) {
if (!(ah = switch_core_session_alloc(session, sizeof(*ah)))) {
@@ -1145,7 +1145,7 @@
{
struct hangup_helper *helper;
switch_core_session_t *session, *other_session;
- char *other_uuid;
+ const char *other_uuid;
assert(task);
@@ -1170,7 +1170,7 @@
}
}
-SWITCH_DECLARE(uint32_t) switch_ivr_schedule_hangup(time_t runtime, char *uuid, switch_call_cause_t cause, switch_bool_t bleg)
+SWITCH_DECLARE(uint32_t) switch_ivr_schedule_hangup(time_t runtime, const char *uuid, switch_call_cause_t cause, switch_bool_t bleg)
{
struct hangup_helper *helper;
size_t len = sizeof(*helper);
@@ -1207,7 +1207,7 @@
}
-SWITCH_DECLARE(uint32_t) switch_ivr_schedule_transfer(time_t runtime, char *uuid, char *extension, char *dialplan, char *context)
+SWITCH_DECLARE(uint32_t) switch_ivr_schedule_transfer(time_t runtime, const char *uuid, char *extension, char *dialplan, char *context)
{
struct transfer_helper *helper;
size_t len = sizeof(*helper);
@@ -1283,14 +1283,14 @@
return switch_scheduler_add_task(runtime, sch_broadcast_callback, (char *) __SWITCH_FUNC__, uuid, 0, helper, SSHF_FREE_ARG);
}
-SWITCH_DECLARE(switch_status_t) switch_ivr_broadcast(char *uuid, char *path, switch_media_flag_t flags)
+SWITCH_DECLARE(switch_status_t) switch_ivr_broadcast(const char *uuid, const char *path, switch_media_flag_t flags)
{
switch_channel_t *channel;
int nomedia;
switch_core_session_t *session, *master;
switch_event_t *event;
switch_core_session_t *other_session = NULL;
- char *other_uuid = NULL;
+ const char *other_uuid = NULL;
char *app = "playback";
assert(path);
Modified: freeswitch/trunk/src/switch_ivr_bridge.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr_bridge.c (original)
+++ freeswitch/trunk/src/switch_ivr_bridge.c Thu Nov 1 07:28:26 2007
@@ -56,7 +56,7 @@
switch_frame_t *read_frame;
switch_core_session_t *session_a, *session_b;
uint32_t loop_count = 0;
- char *app_name = NULL, *app_arg = NULL;
+ const char *app_name = NULL, *app_arg = NULL;
session_a = data->session;
if (!(session_b = switch_core_session_locate(data->b_uuid))) {
@@ -311,7 +311,7 @@
{
switch_channel_t *channel = NULL;
switch_core_session_t *other_session;
- char *other_uuid = NULL;
+ const char *other_uuid = NULL;
channel = switch_core_session_get_channel(session);
assert(channel != NULL);
@@ -430,7 +430,7 @@
static switch_status_t signal_bridge_on_hangup(switch_core_session_t *session)
{
- char *uuid;
+ const char *uuid;
switch_channel_t *channel = NULL;
switch_core_session_t *other_session;
switch_event_t *event;
@@ -595,7 +595,7 @@
switch_event_t *event;
switch_core_session_message_t msg = { 0 };
const switch_application_interface_t *application_interface;
- char *app, *data;
+ const char *app, *data;
switch_channel_set_state(peer_channel, CS_HOLD);
@@ -683,7 +683,7 @@
}
-SWITCH_DECLARE(switch_status_t) switch_ivr_uuid_bridge(char *originator_uuid, char *originatee_uuid)
+SWITCH_DECLARE(switch_status_t) switch_ivr_uuid_bridge(const char *originator_uuid, const char *originatee_uuid)
{
switch_core_session_t *originator_session, *originatee_session;
switch_channel_t *originator_channel, *originatee_channel;
Modified: freeswitch/trunk/src/switch_ivr_originate.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr_originate.c (original)
+++ freeswitch/trunk/src/switch_ivr_originate.c Thu Nov 1 07:28:26 2007
@@ -237,10 +237,10 @@
SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *session,
switch_core_session_t **bleg,
switch_call_cause_t *cause,
- char *bridgeto,
+ const char *bridgeto,
uint32_t timelimit_sec,
const switch_state_handler_table_t *table,
- char *cid_name_override, char *cid_num_override, switch_caller_profile_t *caller_profile_override)
+ const char *cid_name_override, const char *cid_num_override, switch_caller_profile_t *caller_profile_override)
{
char *pipe_names[MAX_PEERS] = { 0 };
char *data = NULL;
@@ -263,7 +263,8 @@
char key[80] = SWITCH_BLANK_STRING, file[512] = SWITCH_BLANK_STRING, *odata, *var;
switch_call_cause_t reason = SWITCH_CAUSE_UNALLOCATED;
uint8_t to = 0;
- char *var_val, *vars = NULL, *ringback_data = NULL;
+ char *var_val, *vars = NULL;
+ const char *ringback_data = NULL;
switch_codec_t *read_codec = NULL;
uint8_t sent_ring = 0, early_ok = 1;
switch_core_session_message_t *message = NULL;
Modified: freeswitch/trunk/src/switch_ivr_play_say.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr_play_say.c (original)
+++ freeswitch/trunk/src/switch_ivr_play_say.c Thu Nov 1 07:28:26 2007
@@ -90,14 +90,14 @@
}
-SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro(switch_core_session_t *session, char *macro_name, char *data, char *lang,
+SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro(switch_core_session_t *session, const char *macro_name, const char *data, const char *lang,
switch_input_args_t *args)
{
switch_xml_t cfg, xml = NULL, language, macros, macro, input, action;
char *lname = NULL, *mname = NULL, hint_data[1024] = "", enc_hint[1024] = "";
switch_status_t status = SWITCH_STATUS_GENERR;
- char *old_sound_prefix = NULL, *sound_path = NULL, *tts_engine = NULL, *tts_voice = NULL, *chan_lang = NULL;
- const char *module_name = NULL;
+ const char *old_sound_prefix = NULL, *sound_path = NULL, *tts_engine = NULL, *tts_voice = NULL;
+ const char *module_name = NULL, *chan_lang = NULL;
switch_channel_t *channel;
uint8_t done = 0;
@@ -273,8 +273,8 @@
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid SAY Interface [%s]!\n", module_name);
}
} else if (!strcasecmp(func, "speak-text")) {
- char *my_tts_engine = (char *) switch_xml_attr(action, "tts-engine");
- char *my_tts_voice = (char *) switch_xml_attr(action, "tts-voice");
+ const char *my_tts_engine = switch_xml_attr(action, "tts-engine");
+ const char *my_tts_voice = switch_xml_attr(action, "tts-voice");
if (!my_tts_engine) {
my_tts_engine = tts_engine;
@@ -325,7 +325,7 @@
switch_codec_t codec, *read_codec;
char *codec_name;
switch_status_t status = SWITCH_STATUS_SUCCESS;
- char *p;
+ const char *p;
const char *vval;
time_t start = 0;
uint32_t org_silence_hits = 0;
@@ -357,37 +357,37 @@
switch_channel_answer(channel);
if ((p = switch_channel_get_variable(channel, "RECORD_TITLE"))) {
- vval = (const char *) switch_core_session_strdup(session, p);
+ vval = switch_core_session_strdup(session, p);
switch_core_file_set_string(fh, SWITCH_AUDIO_COL_STR_TITLE, vval);
switch_channel_set_variable(channel, "RECORD_TITLE", NULL);
}
if ((p = switch_channel_get_variable(channel, "RECORD_COPYRIGHT"))) {
- vval = (const char *) switch_core_session_strdup(session, p);
+ vval = switch_core_session_strdup(session, p);
switch_core_file_set_string(fh, SWITCH_AUDIO_COL_STR_COPYRIGHT, vval);
switch_channel_set_variable(channel, "RECORD_COPYRIGHT", NULL);
}
if ((p = switch_channel_get_variable(channel, "RECORD_SOFTWARE"))) {
- vval = (const char *) switch_core_session_strdup(session, p);
+ vval = switch_core_session_strdup(session, p);
switch_core_file_set_string(fh, SWITCH_AUDIO_COL_STR_SOFTWARE, vval);
switch_channel_set_variable(channel, "RECORD_SOFTWARE", NULL);
}
if ((p = switch_channel_get_variable(channel, "RECORD_ARTIST"))) {
- vval = (const char *) switch_core_session_strdup(session, p);
+ vval = switch_core_session_strdup(session, p);
switch_core_file_set_string(fh, SWITCH_AUDIO_COL_STR_ARTIST, vval);
switch_channel_set_variable(channel, "RECORD_ARTIST", NULL);
}
if ((p = switch_channel_get_variable(channel, "RECORD_COMMENT"))) {
- vval = (const char *) switch_core_session_strdup(session, p);
+ vval = switch_core_session_strdup(session, p);
switch_core_file_set_string(fh, SWITCH_AUDIO_COL_STR_COMMENT, vval);
switch_channel_set_variable(channel, "RECORD_COMMENT", NULL);
}
if ((p = switch_channel_get_variable(channel, "RECORD_DATE"))) {
- vval = (const char *) switch_core_session_strdup(session, p);
+ vval = switch_core_session_strdup(session, p);
switch_core_file_set_string(fh, SWITCH_AUDIO_COL_STR_DATE, vval);
switch_channel_set_variable(channel, "RECORD_DATE", NULL);
}
@@ -637,7 +637,7 @@
#define FILE_BLOCKSIZE 1024 * 8
#define FILE_BUFSIZE 1024 * 64
-SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *session, switch_file_handle_t *fh, char *file, switch_input_args_t *args)
+SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *session, switch_file_handle_t *fh, const char *file, switch_input_args_t *args)
{
switch_channel_t *channel;
int16_t abuf[FILE_STARTSAMPLES];
@@ -659,9 +659,9 @@
char *title = "", *copyright = "", *software = "", *artist = "", *comment = "", *date = "";
uint8_t asis = 0;
char *ext;
- char *prefix;
- char *timer_name;
- char *prebuf;
+ const char *prefix;
+ const char *timer_name;
+ const char *prebuf;
channel = switch_core_session_get_channel(session);
assert(channel != NULL);
@@ -1199,7 +1199,7 @@
uint32_t rate = 0;
switch_size_t extra = 0;
char *p, *tmp = NULL;
- char *star, *pound;
+ const char *star, *pound;
switch_size_t starlen, poundlen;
channel = switch_core_session_get_channel(session);
@@ -1467,7 +1467,7 @@
SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text(switch_core_session_t *session,
- char *tts_name, char *voice_name, char *text, switch_input_args_t *args)
+ const char *tts_name, const char *voice_name, char *text, switch_input_args_t *args)
{
switch_channel_t *channel;
uint32_t rate = 0;
@@ -1483,7 +1483,7 @@
switch_speech_handle_t lsh, *sh;
switch_speech_flag_t flags = SWITCH_SPEECH_FLAG_NONE;
switch_codec_t *read_codec;
- char *timer_name, *var;
+ const char *timer_name, *var;
cached_speech_handle_t *cache_obj = NULL;
int need_create = 1, need_alloc = 1;
Modified: freeswitch/trunk/src/switch_utils.c
==============================================================================
--- freeswitch/trunk/src/switch_utils.c (original)
+++ freeswitch/trunk/src/switch_utils.c Thu Nov 1 07:28:26 2007
@@ -657,9 +657,9 @@
}
-SWITCH_DECLARE(size_t) switch_url_encode(char *url, char *buf, size_t len)
+SWITCH_DECLARE(size_t) switch_url_encode(const char *url, char *buf, size_t len)
{
- char *p;
+ const char *p;
size_t x = 0;
const char urlunsafe[] = "\r\n \"#%&+:;<=>?@[\\]^`{|}";
const char hex[] = "0123456789ABCDEF";
Modified: freeswitch/trunk/src/switch_xml.c
==============================================================================
--- freeswitch/trunk/src/switch_xml.c (original)
+++ freeswitch/trunk/src/switch_xml.c Thu Nov 1 07:28:26 2007
@@ -1229,7 +1229,7 @@
return SWITCH_STATUS_FALSE;
}
-SWITCH_DECLARE(switch_status_t) switch_xml_locate_domain(char *domain_name, char *params, switch_xml_t *root, switch_xml_t *domain)
+SWITCH_DECLARE(switch_status_t) switch_xml_locate_domain(const char *domain_name, char *params, switch_xml_t *root, switch_xml_t *domain)
{
char my_params[512];
*domain = NULL;
@@ -1243,13 +1243,13 @@
}
-SWITCH_DECLARE(switch_status_t) switch_xml_locate_user(char *user_name,
- char *domain_name,
- char *ip,
+SWITCH_DECLARE(switch_status_t) switch_xml_locate_user(const char *user_name,
+ const char *domain_name,
+ const char *ip,
switch_xml_t *root,
switch_xml_t *domain,
switch_xml_t *user,
- char *xtra_params)
+ const char *xtra_params)
{
char params[1024] = "";
switch_status_t status;
More information about the Freeswitch-trunk
mailing list