mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-23 04:31:50 +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:
+11
-11
@@ -60,25 +60,25 @@ SWITCH_BEGIN_EXTERN_C
|
||||
*/
|
||||
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 @@ SWITCH_BEGIN_EXTERN_C
|
||||
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 @@ SWITCH_DECLARE(void) switch_caller_extension_add_application(switch_core_session
|
||||
\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
|
||||
|
||||
@@ -209,7 +209,7 @@ SWITCH_DECLARE(switch_status_t) switch_channel_set_variable(switch_channel_t *ch
|
||||
\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.
|
||||
|
||||
@@ -69,7 +69,7 @@ struct switch_core_session_message {
|
||||
/*! 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_status_t) switch_core_session_event_send(char *uuid_str, s
|
||||
|
||||
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 @@ SWITCH_DECLARE(void) switch_hash_this(switch_hash_index_t *hi, const void **key,
|
||||
\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 @@ SWITCH_DECLARE(void) switch_core_db_test_reactive(switch_core_db_t *db, char *te
|
||||
\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 @@ SWITCH_DECLARE(switch_status_t) switch_core_file_close(switch_file_handle_t *fh)
|
||||
\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 @@ SWITCH_DECLARE(void) switch_core_speech_flush_tts(switch_speech_handle_t *sh);
|
||||
\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
|
||||
|
||||
@@ -121,7 +121,7 @@ class CoreSession {
|
||||
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
|
||||
|
||||
+16
-16
@@ -203,7 +203,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_unload_grammar(switch_c
|
||||
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 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_stop_displace_session(switch_core_ses
|
||||
\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 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_tone_detect_session(switch_core_sessi
|
||||
\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 @@ SWITCH_DECLARE(void) switch_ivr_clear_speech_cache(switch_core_session_t *sessio
|
||||
\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_speak_text(switch_core_session_t *ses
|
||||
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 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_signal_bridge(switch_core_session_t *
|
||||
\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 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_session_transfer(switch_core_session_
|
||||
\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 @@ SWITCH_DECLARE(uint32_t) switch_ivr_schedule_transfer(time_t runtime, char *uuid
|
||||
\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 @@ SWITCH_DECLARE(uint32_t) switch_ivr_schedule_hangup(time_t runtime, char *uuid,
|
||||
\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 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_uuid_bridge(char *originator_uuid, ch
|
||||
\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 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_media(char *uuid, switch_media_flag_t
|
||||
\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 @@ SWITCH_DECLARE(uint32_t) switch_ivr_schedule_broadcast(time_t runtime, char *uui
|
||||
\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_add_custom(switch_ivr_
|
||||
*/
|
||||
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);
|
||||
/** @} */
|
||||
|
||||
@@ -231,7 +231,7 @@ struct switch_file_interface {
|
||||
/*! 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 @@ struct switch_speech_interface {
|
||||
/*! 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 @@ struct switch_speech_interface {
|
||||
/*! 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);
|
||||
|
||||
|
||||
@@ -1070,8 +1070,8 @@ typedef struct switch_core_port_allocator switch_core_port_allocator_t;
|
||||
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 *);
|
||||
|
||||
@@ -328,7 +328,7 @@ SWITCH_DECLARE(char *) switch_string_replace(const char *string, const char *sea
|
||||
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);
|
||||
|
||||
|
||||
@@ -318,13 +318,13 @@ SWITCH_DECLARE(switch_status_t) switch_xml_locate(const char *section,
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user