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

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

View File

@ -161,14 +161,14 @@ extern int iax_send_url(struct iax_session *session, char *url, int link);
extern int iax_send_text(struct iax_session *session, char *text); extern int iax_send_text(struct iax_session *session, char *text);
extern int iax_send_ping(struct iax_session *session); extern int iax_send_ping(struct iax_session *session);
extern int iax_load_complete(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_reject_registration(struct iax_session *session, char *reason);
int iax_ack_registration(struct iax_session *session); int iax_ack_registration(struct iax_session *session);
int iax_auth_registration(struct iax_session *session); int iax_auth_registration(struct iax_session *session);
extern int iax_busy(struct iax_session *session); extern int iax_busy(struct iax_session *session);
extern int iax_congestion(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_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_accept(struct iax_session *session, int format);
extern int iax_answer(struct iax_session *session); extern int iax_answer(struct iax_session *session);
extern int iax_sendurl(struct iax_session *session, char *url); extern int iax_sendurl(struct iax_session *session, char *url);

View File

@ -1691,7 +1691,7 @@ int iax_auth_registration(struct iax_session *session)
return send_command_final(session, AST_FRAME_IAX, IAX_COMMAND_REGAUTH, 0, NULL, 0, -1); 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; struct iax_ie_data ied;
memset(&ied, 0, sizeof(ied)); memset(&ied, 0, sizeof(ied));
@ -1986,7 +1986,7 @@ void iax_set_samplerate(struct iax_session *session, unsigned short samplemask)
} }
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 tmp[256]="";
char *part1, *part2; char *part1, *part2;

View File

@ -432,7 +432,7 @@ snprintf(tmp, (int)sizeof(tmp),
dump_ies(fh->iedata, datalen); 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]; char tmp[256];
if (datalen > ((int)sizeof(ied->buf) - ied->pos)) { if (datalen > ((int)sizeof(ied->buf) - ied->pos)) {
@ -466,7 +466,7 @@ int iax_ie_append_short(struct iax_ie_data *ied, unsigned char ie, unsigned shor
return iax_ie_append_raw(ied, ie, &newval, (int)sizeof(newval)); 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)); return iax_ie_append_raw(ied, ie, str, (int)strlen((char *) str));
} }

View File

@ -127,11 +127,11 @@ extern void iax_showframe(struct iax_frame *f, struct ast_iax2_full_hdr *fhi, in
extern const char *iax_ie2str(int ie); 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_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_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_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_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_ie_append(struct iax_ie_data *ied, unsigned char ie);
extern int iax_parse_ies(struct iax_ies *ies, unsigned char *data, int datalen); extern int iax_parse_ies(struct iax_ies *ies, unsigned char *data, int datalen);

View File

@ -257,7 +257,7 @@ char *ldl_session_get_value(ldl_session_t *session, char *key)
return apr_hash_get(session->variables, key, APR_HASH_KEY_STRING); 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)); 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_vcard(ldl_handle_t *handle, char *from, char *to, char *id,
} }
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; iks *msg;
char *t, *e; char *t, *e;
char *bdup = NULL; char *bdup = NULL;
int on = 0; int on = 0;
int len = 0; int len = 0;
char *my_body = strdup(body);
assert(handle != NULL); assert(handle != NULL);
assert(body != NULL); assert(body != NULL);
if (strchr(body, '<')) { if (strchr(my_body, '<')) {
len = (int) strlen(body); len = (int) strlen(my_body);
if (!(bdup = malloc(len))) { if (!(bdup = malloc(len))) {
return; return;
} }
@ -1808,7 +1809,7 @@ void ldl_handle_send_msg(ldl_handle_t *handle, char *from, char *to, char *subje
memset(bdup, 0, len); memset(bdup, 0, len);
e = bdup; e = bdup;
for(t = body; *t; t++) { for(t = my_body; *t; t++) {
if (*t == '<') { if (*t == '<') {
on = 1; on = 1;
} else if (*t == '>') { } else if (*t == '>') {
@ -1820,10 +1821,10 @@ void ldl_handle_send_msg(ldl_handle_t *handle, char *from, char *to, char *subje
*e++ = *t; *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"); iks_insert_attrib(msg, "type", "chat");
if (!from) { if (!from) {
@ -1840,6 +1841,8 @@ void ldl_handle_send_msg(ldl_handle_t *handle, char *from, char *to, char *subje
free(bdup); free(bdup);
} }
free(my_body);
apr_queue_push(handle->queue, msg); apr_queue_push(handle->queue, msg);
msg = NULL; msg = NULL;

View File

@ -309,7 +309,7 @@ char *ldl_session_get_value(ldl_session_t *session, char *key);
\param key the key to set \param key the key to set
\param val the value of the key \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 \brief Create a Jingle Session
@ -473,7 +473,7 @@ void ldl_handle_send_vcard(ldl_handle_t *handle, char *from, char *to, char *id,
\param subject optional subject \param subject optional subject
\param body body of the message \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 \brief Offer candidates to a potential session

View File

@ -314,7 +314,7 @@ static char *my_strdup (const char *s)
return (char *) memcpy (new, s, len); 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; char *data = NULL, *cur = NULL, *end = NULL;
int var = 0, LOOPING = 0; int var = 0, LOOPING = 0;

View File

@ -276,7 +276,7 @@ int teletone_mux_tones(teletone_generation_session_t *ts, teletone_tone_map_t *m
\param cmd the script to execute \param cmd the script to execute
\return 0 \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 #ifdef __cplusplus
} }

View File

@ -60,25 +60,25 @@ SWITCH_BEGIN_EXTERN_C
*/ */
struct switch_caller_profile { struct switch_caller_profile {
/*! The Call's User Name */ /*! The Call's User Name */
char *username; const char *username;
/*! The name of the dialplan */ /*! The name of the dialplan */
char *dialplan; const char *dialplan;
/*! Caller ID Name */ /*! Caller ID Name */
char *caller_id_name; const char *caller_id_name;
/*! Caller ID Number */ /*! Caller ID Number */
char *caller_id_number; const char *caller_id_number;
uint8_t caller_ton; uint8_t caller_ton;
uint8_t caller_numplan; uint8_t caller_numplan;
/*! Caller Network Address (when applicable) */ /*! Caller Network Address (when applicable) */
char *network_addr; const char *network_addr;
/*! ANI (when applicable) */ /*! ANI (when applicable) */
char *ani; const char *ani;
uint8_t ani_ton; uint8_t ani_ton;
uint8_t ani_numplan; uint8_t ani_numplan;
/*! ANI II (when applicable) */ /*! ANI II (when applicable) */
char *aniii; const char *aniii;
/*! RDNIS */ /*! RDNIS */
char *rdnis; const char *rdnis;
uint8_t rdnis_ton; uint8_t rdnis_ton;
uint8_t rdnis_numplan; uint8_t rdnis_numplan;
/*! Destination Number */ /*! Destination Number */
@ -86,13 +86,13 @@ SWITCH_BEGIN_EXTERN_C
uint8_t destination_number_ton; uint8_t destination_number_ton;
uint8_t destination_number_numplan; uint8_t destination_number_numplan;
/*! channel type */ /*! channel type */
char *source; const char *source;
/*! channel name */ /*! channel name */
char *chan_name; char *chan_name;
/*! unique id */ /*! unique id */
char *uuid; char *uuid;
/*! context */ /*! context */
char *context; const char *context;
/*! flags */ /*! flags */
switch_caller_profile_flag_t flags; switch_caller_profile_flag_t flags;
struct switch_caller_profile *originator_caller_profile; 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 \param name the name
\note this function is meant for situations where the name paramater is the contents of the variable \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 \brief Create a new caller profile object

View File

@ -209,7 +209,7 @@ SWITCH_DECLARE(switch_status_t) switch_channel_set_variable(switch_channel_t *ch
\param varname the name of the variable \param varname the name of the variable
\return the value of the requested 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. * Start iterating over the entries in the channel variable list.

View File

@ -69,7 +69,7 @@ struct switch_core_session_message {
/*! optional numeric arg */ /*! optional numeric arg */
int numeric_arg; int numeric_arg;
/*! optional string arg */ /*! optional string arg */
char *string_arg; const char *string_arg;
/*! optional string arg */ /*! optional string arg */
switch_size_t string_arg_size; switch_size_t string_arg_size;
/*! optional arbitrary pointer arg */ /*! 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_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, 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); 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 \param pool the memory pool to use for allocation
\return \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 \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 \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, 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 \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) \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 \return SWITCH_STATUS_SUCCESS if the handle is opened
*/ */
SWITCH_DECLARE(switch_status_t) switch_core_speech_open(switch_speech_handle_t *sh, SWITCH_DECLARE(switch_status_t) switch_core_speech_open(switch_speech_handle_t *sh,
char *module_name, const char *module_name,
char *voice_name, const char *voice_name,
unsigned int rate, unsigned int rate,
unsigned int interval, unsigned int interval,
switch_speech_flag_t *flags, switch_memory_pool_t *pool); 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 param the parameter
\param val the value \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 \brief Set a numeric parameter on a TTS handle

View File

@ -121,7 +121,7 @@ class CoreSession {
int preAnswer(); int preAnswer();
virtual void hangup(char *cause); virtual void hangup(char *cause);
void setVariable(char *var, char *val); void setVariable(char *var, char *val);
char *getVariable(char *var); const char *getVariable(char *var);
/** \brief Record to a file /** \brief Record to a file

View File

@ -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_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_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 \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 \param file the path to the file
\return SWITCH_STATUS_SUCCESS if all is well \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 \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 \param args arguements to pass for callbacks etc
\return SWITCH_STATUS_SUCCESS if all is well \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); 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 \return SWITCH_STATUS_SUCCESS if all is well
*/ */
SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text(switch_core_session_t *session, 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 \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_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *session,
switch_core_session_t **bleg, switch_core_session_t **bleg,
switch_call_cause_t *cause, switch_call_cause_t *cause,
char *bridgeto, const char *bridgeto,
uint32_t timelimit_sec, uint32_t timelimit_sec,
const switch_state_handler_table_t *table, 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 \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 dialplan the new dialplan (OPTIONAL, may be NULL)
\param context the new context (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 \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) \param context the new context (OPTIONAL, may be NULL)
\return the id of the task \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 \param bleg hangup up the B-Leg if possible
\return the id of the task \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 \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 \param originatee_uuid the uuid of the originator
\return SWITCH_STATUS_SUCCESS if all is well \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 \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) \param flags flags to influence behaviour (SMF_REBRIDGE to rebridge the call in media mode)
\return SWITCH_STATUS_SUCCESS if all is well \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 \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) \param flags flags to influence behaviour (SMF_REBRIDGE to rebridge the call in no_media mode)
\return SWITCH_STATUS_SUCCESS if all is well \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. \brief Signal the session with a protocol specific hold message.
\param uuid the uuid of the session to hold \param uuid the uuid of the session to hold
\return SWITCH_STATUS_SUCCESS if all is well \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. \brief Signal the session with a protocol specific unhold message.
\param uuid the uuid of the session to hold \param uuid the uuid of the session to hold
\return SWITCH_STATUS_SUCCESS if all is well \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. \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) \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 \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 \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_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_input_args_t *args);
SWITCH_DECLARE(void) switch_ivr_delay_echo(switch_core_session_t *session, uint32_t delay_ms); SWITCH_DECLARE(void) switch_ivr_delay_echo(switch_core_session_t *session, uint32_t delay_ms);
/** @} */ /** @} */

View File

@ -231,7 +231,7 @@ struct switch_file_interface {
/*! the name of the interface */ /*! the name of the interface */
const char *interface_name; const char *interface_name;
/*! function to open the file */ /*! 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 */ /*! function to close the file */
switch_status_t (*file_close) (switch_file_handle_t *); switch_status_t (*file_close) (switch_file_handle_t *);
/*! function to read from the file */ /*! function to read from the file */
@ -340,7 +340,7 @@ struct switch_speech_interface {
/*! the name of the interface */ /*! the name of the interface */
const char *interface_name; const char *interface_name;
/*! function to open the speech interface */ /*! 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 */ /*! function to close the speech interface */
switch_status_t (*speech_close) (switch_speech_handle_t *, switch_speech_flag_t *flags); switch_status_t (*speech_close) (switch_speech_handle_t *, switch_speech_flag_t *flags);
/*! function to feed audio to the ASR */ /*! function to feed audio to the ASR */
@ -348,7 +348,7 @@ struct switch_speech_interface {
/*! function to read audio from the TTS */ /*! 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); 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_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_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); void (*speech_float_param_tts) (switch_speech_handle_t *sh, char *param, double val);

View File

@ -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 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 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 *); 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, char *data) #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 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 *); typedef switch_caller_extension_t *(*switch_dialplan_hunt_function_t) (switch_core_session_t *, void *, switch_caller_profile_t *);

View File

@ -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); 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) #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(char *) switch_url_decode(char *s);
SWITCH_DECLARE(switch_bool_t) switch_simple_email(char *to, char *from, char *headers, char *body, char *file); SWITCH_DECLARE(switch_bool_t) switch_simple_email(char *to, char *from, char *headers, char *body, char *file);

View 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 *key_name, const char *key_value, switch_xml_t * root, switch_xml_t * node,
const char *params); 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_domain(const 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, SWITCH_DECLARE(switch_status_t) switch_xml_locate_user(const char *user_name, const char *domain_name,
char *ip, const char *ip,
switch_xml_t *root, switch_xml_t *root,
switch_xml_t *domain, switch_xml_t *domain,
switch_xml_t *user, switch_xml_t *user,
char *xtra_params); const char *xtra_params);
///\brief open a config in the core registry ///\brief open a config in the core registry
///\param file_path the name of the config section e.g. modules.conf ///\param file_path the name of the config section e.g. modules.conf

View File

@ -286,7 +286,7 @@ SWITCH_STANDARD_API(transfer_function)
switch_channel_t *channel = switch_core_session_get_channel(tsession); switch_channel_t *channel = switch_core_session_get_channel(tsession);
arg++; arg++;
if (!strcasecmp(arg, "bleg")) { 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))) { if (uuid && (other_session = switch_core_session_locate(uuid))) {
switch_core_session_t *tmp = tsession; switch_core_session_t *tmp = tsession;
tsession = other_session; tsession = other_session;
@ -294,7 +294,7 @@ SWITCH_STANDARD_API(transfer_function)
switch_core_session_rwunlock(tmp); switch_core_session_rwunlock(tmp);
} }
} else if (!strcasecmp(arg, "both")) { } 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; switch_core_session_t *other_session;
if (uuid && (other_session = switch_core_session_locate(uuid))) { if (uuid && (other_session = switch_core_session_locate(uuid))) {
switch_ivr_session_transfer(other_session, dest, dp, context); switch_ivr_session_transfer(other_session, dest, dp, context);

View File

@ -312,7 +312,7 @@ static switch_status_t conference_outcall(conference_obj_t * conference,
char *bridgeto, uint32_t timeout, char *flags, char *cid_name, char *cid_num, switch_call_cause_t *cause); 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, static switch_status_t conference_outcall_bg(conference_obj_t * conference,
char *conference_name, 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); SWITCH_STANDARD_APP(conference_function);
static void launch_conference_thread(conference_obj_t * conference); static void launch_conference_thread(conference_obj_t * conference);
static void *SWITCH_THREAD_FUNC conference_loop_input(switch_thread_t * thread, void *obj); static void *SWITCH_THREAD_FUNC conference_loop_input(switch_thread_t * thread, void *obj);
@ -1531,11 +1531,11 @@ static void conference_loop_output(conference_member_t * member)
if ((call_list = switch_channel_get_private(channel, "_conference_autocall_list_"))) { 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"); const 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"); const 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"); const char *toval = switch_channel_get_variable(channel, "conference_auto_outcall_timeout");
char *flags = switch_channel_get_variable(channel, "conference_auto_outcall_flags"); const char *flags = switch_channel_get_variable(channel, "conference_auto_outcall_flags");
char *ann = switch_channel_get_variable(channel, "conference_auto_outcall_announce"); const char *ann = switch_channel_get_variable(channel, "conference_auto_outcall_announce");
int to = 60; int to = 60;
if (ann) { if (ann) {
@ -3730,7 +3730,7 @@ static void *SWITCH_THREAD_FUNC conference_outcall_run(switch_thread_t * thread,
static switch_status_t conference_outcall_bg(conference_obj_t * conference, static switch_status_t conference_outcall_bg(conference_obj_t * conference,
char *conference_name, 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; struct bg_call *call = NULL;

View File

@ -259,7 +259,7 @@ SWITCH_STANDARD_APP(phrase_function)
assert(channel != NULL); assert(channel != NULL);
if ((mydata = switch_core_session_strdup(session, data))) { if ((mydata = switch_core_session_strdup(session, data))) {
char *lang; const char *lang;
char *macro = mydata; char *macro = mydata;
char *mdata = NULL; char *mdata = NULL;
@ -445,7 +445,8 @@ SWITCH_STANDARD_APP(set_profile_var_function)
SWITCH_STANDARD_APP(export_function) SWITCH_STANDARD_APP(export_function)
{ {
switch_channel_t *channel; 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; int local = 1;
channel = switch_core_session_get_channel(session); channel = switch_core_session_get_channel(session);
@ -923,9 +924,9 @@ static switch_status_t on_dtmf(switch_core_session_t *session, void *input, swit
case SWITCH_INPUT_TYPE_DTMF: case SWITCH_INPUT_TYPE_DTMF:
{ {
char *dtmf = (char *) input; char *dtmf = (char *) input;
char *terminators; const char *terminators;
switch_channel_t *channel = switch_core_session_get_channel(session); switch_channel_t *channel = switch_core_session_get_channel(session);
char *p; const char *p;
assert(channel); assert(channel);
@ -965,8 +966,8 @@ SWITCH_STANDARD_APP(speak_function)
char buf[10]; char buf[10];
char *argv[4] = { 0 }; char *argv[4] = { 0 };
int argc; int argc;
char *engine = NULL; const char *engine = NULL;
char *voice = NULL; const char *voice = NULL;
char *text = NULL; char *text = NULL;
char *mydata = NULL; char *mydata = NULL;
switch_codec_t *codec; switch_codec_t *codec;
@ -1211,7 +1212,7 @@ SWITCH_STANDARD_APP(audio_bridge_function)
switch_channel_t *caller_channel; switch_channel_t *caller_channel;
switch_core_session_t *peer_session = NULL; switch_core_session_t *peer_session = NULL;
unsigned int timelimit = 60; unsigned int timelimit = 60;
char *var, *continue_on_fail = NULL; const char *var, *continue_on_fail = NULL;
uint8_t no_media_bridge = 0; uint8_t no_media_bridge = 0;
switch_call_cause_t cause = SWITCH_CAUSE_NORMAL_CLEARING; switch_call_cause_t cause = SWITCH_CAUSE_NORMAL_CLEARING;

View File

@ -107,8 +107,8 @@ SWITCH_STANDARD_APP(fifo_function)
fifo_node_t *node; fifo_node_t *node;
switch_channel_t *channel; switch_channel_t *channel;
int nowait = 0; int nowait = 0;
char *moh = NULL; const char *moh = NULL;
char *announce = NULL; const char *announce = NULL;
switch_event_t *event = NULL; switch_event_t *event = NULL;
char date[80] = ""; char date[80] = "";
switch_time_exp_t tm; switch_time_exp_t tm;
@ -153,7 +153,7 @@ SWITCH_STANDARD_APP(fifo_function)
} }
if (!strcasecmp(argv[1], "in")) { 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); switch_channel_answer(channel);
@ -178,7 +178,7 @@ SWITCH_STANDARD_APP(fifo_function)
switch_mutex_lock(node->mutex); switch_mutex_lock(node->mutex);
node->caller_count++; node->caller_count++;
switch_core_hash_insert(node->caller_hash, uuid, session); 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); switch_mutex_unlock(node->mutex);
ts = switch_timestamp_now(); ts = switch_timestamp_now();
@ -418,8 +418,8 @@ static int xml_hash(switch_xml_t xml, switch_hash_t *hash, char *container, char
for (hi = switch_hash_first(NULL, hash); hi; hi = switch_hash_next(hi)) { for (hi = switch_hash_first(NULL, hash); hi; hi = switch_hash_next(hi)) {
int c_off = 0, d_off = 0; int c_off = 0, d_off = 0;
char *status; const char *status;
char *ts; const char *ts;
switch_hash_this(hi, &var, NULL, &val); switch_hash_this(hi, &var, NULL, &val);
session = (switch_core_session_t *) val; session = (switch_core_session_t *) val;

View File

@ -872,7 +872,7 @@ static int listen_callback(void *pArg, int argc, char **argv, char **columnNames
} }
static void message_count(vm_profile_t *profile, char *myid, char *domain_name, char *myfolder, static void message_count(vm_profile_t *profile, const char *myid, const char *domain_name, char *myfolder,
int *total_new_messages, int *total_saved_messages, int *total_new_urgent_messages, int *total_saved_urgent_messages) int *total_new_messages, int *total_saved_messages, int *total_new_urgent_messages, int *total_saved_urgent_messages)
{ {
char msg_count[80] = ""; char msg_count[80] = "";
@ -1083,7 +1083,7 @@ static switch_status_t listen_file(switch_core_session_t *session, vm_profile_t
return status; 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; vm_check_state_t vm_check_state = VM_CHECK_START;
switch_channel_t *channel; switch_channel_t *channel;
@ -1091,8 +1091,8 @@ static void voicemail_check_main(switch_core_session_t *session, char *profile_n
vm_profile_t *profile; vm_profile_t *profile;
switch_xml_t x_domain, x_domain_root, x_user, x_params, x_param; switch_xml_t x_domain, x_domain_root, x_user, x_params, x_param;
switch_status_t status; switch_status_t status;
char pass_buf[80] = "", *mypass = NULL, id_buf[80] = "", *myid = id, *myfolder = NULL; char pass_buf[80] = "", *mypass = NULL, id_buf[80] = "", *myfolder = NULL;
const char *thepass = NULL; const char *thepass = NULL, *myid = id;
char term = 0; char term = 0;
uint32_t timeout, attempts = 0; uint32_t timeout, attempts = 0;
int failed = 0; int failed = 0;
@ -1522,7 +1522,7 @@ static void voicemail_check_main(switch_core_session_t *session, char *profile_n
} }
static switch_status_t voicemail_leave_main(switch_core_session_t *session, char *profile_name, char *domain_name, char *id) static switch_status_t voicemail_leave_main(switch_core_session_t *session, const char *profile_name, const char *domain_name, const char *id)
{ {
switch_channel_t *channel; switch_channel_t *channel;
char *myfolder = "inbox"; char *myfolder = "inbox";
@ -1544,7 +1544,8 @@ static switch_status_t voicemail_leave_main(switch_core_session_t *session, char
int email_attach = 1; int email_attach = 1;
int email_delete = 1; int email_delete = 1;
char buf[2]; 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)); memset(&cbt, 0, sizeof(cbt));
if (!(profile = switch_core_hash_find(globals.profile_hash, profile_name))) { if (!(profile = switch_core_hash_find(globals.profile_hash, profile_name))) {
@ -1833,10 +1834,10 @@ SWITCH_STANDARD_APP(voicemail_function)
int argc = 0; int argc = 0;
char *argv[6] = { 0 }; char *argv[6] = { 0 };
char *mydata = NULL; char *mydata = NULL;
char *profile_name = NULL; const char *profile_name = NULL;
char *domain_name = NULL; const char *domain_name = NULL;
char *id = NULL; const char *id = NULL;
char *auth_var = NULL; const char *auth_var = NULL;
int x = 0, check = 0, auth = 0; int x = 0, check = 0, auth = 0;
switch_channel_t *channel; switch_channel_t *channel;

View File

@ -603,7 +603,7 @@ static mrcp_status_t synth_stop(mrcp_client_context_t *context, openmrcp_session
} }
static switch_status_t openmrcp_tts_open(switch_speech_handle_t *sh, char *voice_name, int rate, switch_speech_flag_t *flags) static switch_status_t openmrcp_tts_open(switch_speech_handle_t *sh, const char *voice_name, int rate, switch_speech_flag_t *flags)
{ {
openmrcp_session_t *tts_session; openmrcp_session_t *tts_session;
mrcp_client_channel_t *tts_channel; mrcp_client_channel_t *tts_channel;
@ -749,7 +749,7 @@ static void openmrcp_flush_tts(switch_speech_handle_t *sh)
synth_stop(context, tts_session); // TODO 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)
{ {
} }

View File

@ -59,7 +59,7 @@ static int parse_exten(switch_core_session_t *session, switch_caller_profile_t *
char *field = NULL; char *field = NULL;
char *do_break_a = NULL; char *do_break_a = NULL;
char *expression = NULL; char *expression = NULL;
char *field_data = NULL; const char *field_data = NULL;
switch_regex_t *re = NULL; switch_regex_t *re = NULL;
int ovector[30]; int ovector[30];
break_t do_break_i = BREAK_ON_FALSE; break_t do_break_i = BREAK_ON_FALSE;
@ -186,8 +186,8 @@ static switch_status_t dialplan_xml_locate(switch_core_session_t *session, switc
switch_stream_handle_t stream = { 0 }; switch_stream_handle_t stream = { 0 };
switch_size_t encode_len = 1024, new_len = 0; switch_size_t encode_len = 1024, new_len = 0;
char *encode_buf = NULL; char *encode_buf = NULL;
char *prof[12] = { 0 }, *prof_names[12] = { const char *prof[12] = { 0 }, *prof_names[12] = {0};
0}, *e = NULL; char *e = NULL;
switch_event_header_t *hi; switch_event_header_t *hi;
uint32_t x = 0; uint32_t x = 0;

View File

@ -1614,9 +1614,8 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
char sess_id[11] = ""; char sess_id[11] = "";
char *dnis = NULL; char *dnis = NULL;
char workspace[1024] = ""; char workspace[1024] = "";
char *p, *u, ubuf[512] = "", *user = NULL; char *p, *u, ubuf[512] = "", *user = NULL, *f_cid_msg = NULL;
char *cid_msg = NULL, *f_cid_msg = NULL; const char *cid_msg = NULL;
switch_copy_string(workspace, outbound_profile->destination_number, sizeof(workspace)); switch_copy_string(workspace, outbound_profile->destination_number, sizeof(workspace));
profile_name = workspace; profile_name = workspace;
@ -1649,7 +1648,7 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
user = ldl_handle_get_login(mdl_profile->handle); user = ldl_handle_get_login(mdl_profile->handle);
} else { } else {
if (!user) { if (!user) {
char *id_num; const char *id_num;
if (!(id_num = outbound_profile->caller_id_number)) { if (!(id_num = outbound_profile->caller_id_number)) {
if (!(id_num = outbound_profile->caller_id_name)) { if (!(id_num = outbound_profile->caller_id_name)) {

View File

@ -170,7 +170,7 @@ static switch_status_t channel_on_init(switch_core_session_t *session)
switch_time_t last; switch_time_t last;
int waitsec = globals.ring_interval * 1000000; int waitsec = globals.ring_interval * 1000000;
switch_file_handle_t fh = { 0 }; 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]; int16_t abuf[2048];
tech_pvt = switch_core_session_get_private(session); tech_pvt = switch_core_session_get_private(session);
@ -767,7 +767,7 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
if (outbound_profile) { if (outbound_profile) {
char name[128]; 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); snprintf(name, sizeof(name), "PortAudio/%s", id);
switch_channel_set_name(channel, name); switch_channel_set_name(channel, name);
@ -1522,8 +1522,8 @@ static switch_status_t list_calls(char **argv, int argc, switch_stream_handle_t
{ {
private_t *tp; private_t *tp;
int x = 0; int x = 0;
char *cid_name = "n/a"; const char *cid_name = "n/a";
char *cid_num = "n/a"; const char *cid_num = "n/a";
switch_mutex_lock(globals.pvt_lock); switch_mutex_lock(globals.pvt_lock);
for (tp = globals.call_list; tp; tp = tp->next) { for (tp = globals.call_list; tp; tp = tp->next) {

View File

@ -276,7 +276,7 @@ static switch_status_t sofia_answer_channel(switch_core_session_t *session)
switch_channel_t *channel = NULL; switch_channel_t *channel = NULL;
switch_status_t status; switch_status_t status;
uint32_t session_timeout = 0; uint32_t session_timeout = 0;
char *val; const char *val;
assert(session != NULL); assert(session != NULL);
@ -289,13 +289,13 @@ static switch_status_t sofia_answer_channel(switch_core_session_t *session)
switch_set_flag_locked(tech_pvt, TFLAG_ANS); switch_set_flag_locked(tech_pvt, TFLAG_ANS);
if (switch_channel_test_flag(channel, CF_BYPASS_MEDIA)) { 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))) { if ((sdp = switch_channel_get_variable(channel, SWITCH_B_SDP_VARIABLE))) {
tech_pvt->local_sdp_str = switch_core_session_strdup(session, sdp); tech_pvt->local_sdp_str = switch_core_session_strdup(session, sdp);
} }
} else { } else {
if (switch_test_flag(tech_pvt, TFLAG_LATE_NEGOTIATION)) { 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; tech_pvt->num_codecs = 0;
sofia_glue_tech_prepare_codecs(tech_pvt); sofia_glue_tech_prepare_codecs(tech_pvt);
if (sofia_glue_tech_media(tech_pvt, r_sdp) != SWITCH_STATUS_SUCCESS) { if (sofia_glue_tech_media(tech_pvt, r_sdp) != SWITCH_STATUS_SUCCESS) {
@ -694,7 +694,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
switch (msg->message_id) { switch (msg->message_id) {
case SWITCH_MESSAGE_INDICATE_BROADCAST: { 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); ip = switch_channel_get_variable(channel, SWITCH_REMOTE_MEDIA_IP_VARIABLE);
port = switch_channel_get_variable(channel, SWITCH_REMOTE_MEDIA_PORT_VARIABLE); port = switch_channel_get_variable(channel, SWITCH_REMOTE_MEDIA_PORT_VARIABLE);
if (ip && port) { if (ip && port) {
@ -708,10 +708,10 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
break; break;
case SWITCH_MESSAGE_INDICATE_NOMEDIA: case SWITCH_MESSAGE_INDICATE_NOMEDIA:
{ {
char *uuid; const char *uuid;
switch_core_session_t *other_session; switch_core_session_t *other_session;
switch_channel_t *other_channel; switch_channel_t *other_channel;
char *ip = NULL, *port = NULL; const char *ip = NULL, *port = NULL;
if (switch_channel_get_state(channel) >= CS_HANGUP) { if (switch_channel_get_state(channel) >= CS_HANGUP) {
return SWITCH_STATUS_FALSE; return SWITCH_STATUS_FALSE;
@ -894,13 +894,13 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
/* Transmit 183 Progress with SDP */ /* Transmit 183 Progress with SDP */
if (switch_channel_test_flag(channel, CF_BYPASS_MEDIA)) { 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))) { if ((sdp = switch_channel_get_variable(channel, SWITCH_B_SDP_VARIABLE))) {
tech_pvt->local_sdp_str = switch_core_session_strdup(session, sdp); tech_pvt->local_sdp_str = switch_core_session_strdup(session, sdp);
} }
} else { } else {
if (switch_test_flag(tech_pvt, TFLAG_LATE_NEGOTIATION)) { 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; tech_pvt->num_codecs = 0;
sofia_glue_tech_prepare_codecs(tech_pvt); sofia_glue_tech_prepare_codecs(tech_pvt);
if (sofia_glue_tech_media(tech_pvt, r_sdp) != SWITCH_STATUS_SUCCESS) { if (sofia_glue_tech_media(tech_pvt, r_sdp) != SWITCH_STATUS_SUCCESS) {

View File

@ -398,7 +398,7 @@ switch_status_t sofia_glue_activate_rtp(private_object_t *tech_pvt, switch_rtp_f
void sofia_glue_deactivate_rtp(private_object_t *tech_pvt); void sofia_glue_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); void sofia_glue_tech_prepare_codecs(private_object_t *tech_pvt);
@ -432,7 +432,7 @@ void launch_sofia_profile_thread(sofia_profile_t *profile);
switch_status_t sofia_presence_chat_send(char *proto, char *from, char *to, char *subject, char *body, char *hint); 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); 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); 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 event_handler(switch_event_t *event);
void sofia_presence_event_handler(switch_event_t *event); void sofia_presence_event_handler(switch_event_t *event);

View File

@ -1122,7 +1122,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
switch_channel_t *channel = NULL; switch_channel_t *channel = NULL;
private_object_t *tech_pvt = NULL; private_object_t *tech_pvt = NULL;
const char *replaces_str = NULL; const char *replaces_str = NULL;
char *uuid; const char *uuid;
switch_core_session_t *other_session = NULL; switch_core_session_t *other_session = NULL;
switch_channel_t *other_channel = NULL; switch_channel_t *other_channel = NULL;
char st[80] = ""; char st[80] = "";
@ -1163,7 +1163,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
if (channel && (status == 180 || status == 183) && switch_channel_test_flag(channel, CF_OUTBOUND)) { 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)) { 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()); nua_notify(nh, NUTAG_NEWSUB(1), NUTAG_SUBSTATE(nua_substate_active), SIPTAG_EVENT_STR("talk"), TAG_END());
} }
@ -1276,7 +1276,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
} }
if ((b_private = nua_handle_magic(bnh))) { 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; char *br_a = b_private->uuid;
if (br_b) { if (br_b) {
@ -1544,7 +1544,7 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t
char *rep; char *rep;
if ((rep = strchr(refer_to->r_url->url_headers, '='))) { 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; char *buf;
rep++; rep++;
@ -1597,7 +1597,7 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t
} else { } else {
switch_core_session_t *t_session; switch_core_session_t *t_session;
switch_channel_t *hup_channel; switch_channel_t *hup_channel;
char *ext; const char *ext;
if (br_a && !br_b) { if (br_a && !br_b) {
t_session = switch_core_session_locate(br_a); t_session = switch_core_session_locate(br_a);
@ -1691,7 +1691,7 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t
if (exten) { if (exten) {
switch_channel_t *channel = switch_core_session_get_channel(session); 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))) { if ((br = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))) {
switch_core_session_t *b_session; switch_core_session_t *b_session;
@ -2040,7 +2040,7 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_
} }
if (sip->sip_to && sip->sip_to->a_url) { if (sip->sip_to && sip->sip_to->a_url) {
char *val; const char *val;
char *transport = (my_addrinfo->ai_socktype == SOCK_STREAM) ? "tcp" : "udp"; char *transport = (my_addrinfo->ai_socktype == SOCK_STREAM) ? "tcp" : "udp";
url_set_chanvars(session, sip->sip_to->a_url, sip_to); url_set_chanvars(session, sip->sip_to->a_url, sip_to);

View File

@ -38,7 +38,7 @@
switch_status_t sofia_glue_tech_choose_video_port(private_object_t *tech_pvt); 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); 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]; char buf[2048];
int ptime = 0; int ptime = 0;
@ -256,8 +256,8 @@ void sofia_glue_set_local_sdp(private_object_t *tech_pvt, char *ip, uint32_t por
void sofia_glue_tech_prepare_codecs(private_object_t *tech_pvt) void sofia_glue_tech_prepare_codecs(private_object_t *tech_pvt)
{ {
char *abs, *codec_string = NULL; const char *abs, *codec_string = NULL;
char *ocodec = NULL; const char *ocodec = NULL;
if (switch_channel_test_flag(tech_pvt->channel, CF_BYPASS_MEDIA)) { if (switch_channel_test_flag(tech_pvt->channel, CF_BYPASS_MEDIA)) {
goto end; goto end;
@ -466,13 +466,13 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
char *rpid = NULL; char *rpid = NULL;
char *alert_info = NULL; char *alert_info = NULL;
char *max_forwards = NULL; char *max_forwards = NULL;
char *alertbuf; const char *alertbuf;
char *forwardbuf; const char *forwardbuf;
int forwardval; int forwardval;
private_object_t *tech_pvt; private_object_t *tech_pvt;
switch_channel_t *channel = NULL; switch_channel_t *channel = NULL;
switch_caller_profile_t *caller_profile; switch_caller_profile_t *caller_profile;
char *cid_name, *cid_num; const char *cid_name, *cid_num;
char *e_dest = NULL; char *e_dest = NULL;
const char *holdstr = ""; const char *holdstr = "";
switch_stream_handle_t stream = { 0 }; switch_stream_handle_t stream = { 0 };
@ -480,8 +480,8 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
char *extra_headers = NULL; char *extra_headers = NULL;
switch_status_t status = SWITCH_STATUS_FALSE; switch_status_t status = SWITCH_STATUS_FALSE;
uint32_t session_timeout = 0; uint32_t session_timeout = 0;
char *val; const char *val;
char *rep; const char *rep;
channel = switch_core_session_get_channel(session); channel = switch_core_session_get_channel(session);
assert(channel != NULL); assert(channel != NULL);
@ -495,8 +495,8 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
caller_profile = switch_channel_get_caller_profile(channel); caller_profile = switch_channel_get_caller_profile(channel);
cid_name = (char *) caller_profile->caller_id_name; cid_name = caller_profile->caller_id_name;
cid_num = (char *) caller_profile->caller_id_number; cid_num = caller_profile->caller_id_number;
sofia_glue_tech_prepare_codecs(tech_pvt); sofia_glue_tech_prepare_codecs(tech_pvt);
if (!tech_pvt->from_str) { if (!tech_pvt->from_str) {
@ -550,7 +550,8 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
char *d_url = NULL, *url = NULL; char *d_url = NULL, *url = NULL;
sofia_private_t *sofia_private; sofia_private_t *sofia_private;
char *invite_contact = NULL, *to_str, *use_from_str, *from_str, *url_str; 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)) { if (switch_strlen_zero(tech_pvt->dest)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "URL Error! [%s]\n", tech_pvt->dest); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "URL Error! [%s]\n", tech_pvt->dest);
@ -723,7 +724,7 @@ void sofia_glue_do_xfer_invite(switch_core_session_t *session)
(char *) caller_profile->caller_id_number, (char *) caller_profile->caller_id_number,
tech_pvt->profile->extsipip ? tech_pvt->profile->extsipip : tech_pvt->profile->sipip))) { 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, 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), SIPTAG_TO_STR(tech_pvt->dest), SIPTAG_FROM_STR(tech_pvt->from_str), SIPTAG_CONTACT_STR(tech_pvt->profile->url),
@ -744,8 +745,7 @@ void sofia_glue_do_xfer_invite(switch_core_session_t *session)
void sofia_glue_tech_absorb_sdp(private_object_t *tech_pvt) 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))) { if ((sdp_str = switch_channel_get_variable(tech_pvt->channel, SWITCH_B_SDP_VARIABLE))) {
sdp_parser_t *parser; sdp_parser_t *parser;
@ -933,7 +933,7 @@ switch_status_t sofia_glue_activate_rtp(private_object_t *tech_pvt, switch_rtp_f
{ {
int bw, ms; int bw, ms;
const char *err = NULL; const char *err = NULL;
char *val = NULL; const char *val = NULL;
switch_rtp_flag_t flags; switch_rtp_flag_t flags;
switch_status_t status; switch_status_t status;
char tmp[50]; char tmp[50];
@ -1129,7 +1129,7 @@ switch_status_t sofia_glue_activate_rtp(private_object_t *tech_pvt, switch_rtp_f
return SWITCH_STATUS_SUCCESS; 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_parser_t *parser = NULL;
sdp_session_t *sdp; sdp_session_t *sdp;
@ -1182,7 +1182,7 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, sdp_session_t *
int sendonly = 0; int sendonly = 0;
int greedy = 0, x = 0, skip = 0, mine = 0; int greedy = 0, x = 0, skip = 0, mine = 0;
switch_channel_t *channel = NULL; switch_channel_t *channel = NULL;
char *val; const char *val;
tech_pvt = switch_core_session_get_private(session); tech_pvt = switch_core_session_get_private(session);
assert(tech_pvt != NULL); assert(tech_pvt != NULL);
@ -1225,7 +1225,7 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, sdp_session_t *
if (sendonly) { if (sendonly) {
if (!switch_test_flag(tech_pvt, TFLAG_SIP_HOLD)) { if (!switch_test_flag(tech_pvt, TFLAG_SIP_HOLD)) {
char *stream; const char *stream;
switch_set_flag_locked(tech_pvt, TFLAG_SIP_HOLD); switch_set_flag_locked(tech_pvt, TFLAG_SIP_HOLD);
if (tech_pvt->max_missed_packets) { if (tech_pvt->max_missed_packets) {
switch_rtp_set_max_missed_packets(tech_pvt->rtp_session, tech_pvt->max_missed_packets * 10); switch_rtp_set_max_missed_packets(tech_pvt->rtp_session, tech_pvt->max_missed_packets * 10);
@ -1557,7 +1557,7 @@ switch_call_cause_t sofia_glue_sip_cause_to_freeswitch(int status)
void sofia_glue_pass_sdp(private_object_t *tech_pvt, char *sdp) void sofia_glue_pass_sdp(private_object_t *tech_pvt, char *sdp)
{ {
char *val; const char *val;
switch_core_session_t *other_session; switch_core_session_t *other_session;
switch_channel_t *other_channel; switch_channel_t *other_channel;

View File

@ -309,7 +309,7 @@ void BaseCDR::process_channel_variables(const std::list<std::string>& stringlist
tempstringvector.push_back('\0'); tempstringvector.push_back('\0');
char* tempstring= &tempstringvector[0]; char* tempstring= &tempstringvector[0];
char *tempvariable; const char *tempvariable;
tempvariable = switch_channel_get_variable(channel,tempstring); tempvariable = switch_channel_get_variable(channel,tempstring);
@ -350,7 +350,7 @@ void BaseCDR::process_channel_variables(const std::list<std::string>& stringlist
tempstringvector.push_back('\0'); tempstringvector.push_back('\0');
char* tempstring= &tempstringvector[0]; char* tempstring= &tempstringvector[0];
char *tempvariable; const char *tempvariable;
tempvariable = switch_channel_get_variable(channel,tempstring); tempvariable = switch_channel_get_variable(channel,tempstring);
if (!switch_strlen_zero(tempvariable)) if (!switch_strlen_zero(tempvariable))
chanvars_supp[*iItr] = tempvariable; chanvars_supp[*iItr] = tempvariable;

View File

@ -631,7 +631,7 @@ static switch_status_t parse_command(listener_t * listener, switch_event_t *even
goto done; goto done;
} else if (!strncasecmp(cmd, "getvar", 6)) { } else if (!strncasecmp(cmd, "getvar", 6)) {
char *arg; char *arg;
char *val = ""; const char *val = "";
strip_cr(cmd); strip_cr(cmd);

View File

@ -143,7 +143,7 @@ static void *SWITCH_THREAD_FUNC read_stream_thread(switch_thread_t *thread, void
return NULL; 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_context_t *context;
local_stream_source_t *source; local_stream_source_t *source;

View File

@ -40,7 +40,7 @@ struct native_file_context {
typedef struct native_file_context native_file_context; typedef struct native_file_context native_file_context;
static switch_status_t native_file_file_open(switch_file_handle_t *handle, char *path) static switch_status_t native_file_file_open(switch_file_handle_t *handle, const char *path)
{ {
native_file_context *context; native_file_context *context;
char *ext; char *ext;

View File

@ -55,7 +55,7 @@ struct sndfile_context {
typedef struct sndfile_context sndfile_context; typedef struct sndfile_context sndfile_context;
static switch_status_t sndfile_file_open(switch_file_handle_t *handle, char *path) static switch_status_t sndfile_file_open(switch_file_handle_t *handle, const char *path)
{ {
sndfile_context *context; sndfile_context *context;
int mode = 0; int mode = 0;

View File

@ -1524,7 +1524,8 @@ static JSBool session_streamfile(JSContext * cx, JSObject * obj, uintN argc, jsv
switch_file_handle_t fh = { 0 }; switch_file_handle_t fh = { 0 };
JSFunction *function; JSFunction *function;
switch_input_args_t args = { 0 }; switch_input_args_t args = { 0 };
char *prebuf, posbuf[35] = ""; const char *prebuf;
char posbuf[35] = "";
METHOD_SANITY_CHECK(); METHOD_SANITY_CHECK();
@ -1627,7 +1628,7 @@ static JSBool session_get_variable(JSContext * cx, JSObject * obj, uintN argc, j
assert(channel != NULL); assert(channel != NULL);
if (argc > 0) { if (argc > 0) {
char *var, *val; const char *var, *val;
var = JS_GetStringBytes(JS_ValueToString(cx, argv[0])); var = JS_GetStringBytes(JS_ValueToString(cx, argv[0]));
val = switch_channel_get_variable(channel, var); val = switch_channel_get_variable(channel, var);
@ -2510,16 +2511,16 @@ static JSBool session_originate(JSContext * cx, JSObject * obj, uintN argc, jsva
JSObject *session_obj; JSObject *session_obj;
switch_core_session_t *session = NULL, *peer_session = NULL; switch_core_session_t *session = NULL, *peer_session = NULL;
switch_caller_profile_t *caller_profile = NULL, *orig_caller_profile = NULL; switch_caller_profile_t *caller_profile = NULL, *orig_caller_profile = NULL;
char *dest = NULL; const char *dest = NULL;
char *dialplan = NULL; const char *dialplan = NULL;
char *cid_name = ""; const char *cid_name = "";
char *cid_num = ""; const char *cid_num = "";
char *network_addr = ""; const char *network_addr = "";
char *ani = ""; const char *ani = "";
char *aniii = ""; const char *aniii = "";
char *rdnis = ""; const char *rdnis = "";
char *context = ""; const char *context = "";
char *username = NULL; const char *username = NULL;
char *to = NULL; char *to = NULL;
char *tmp; char *tmp;
@ -3109,10 +3110,11 @@ static int env_init(JSContext * cx, JSObject * javascript_object)
return 1; 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; 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; int argc = 0, x = 0, y = 0;
unsigned int flags = 0; unsigned int flags = 0;
struct js_session jss; struct js_session jss;
@ -3172,9 +3174,9 @@ static void js_parse_and_execute(switch_core_session_t *session, char *input_cod
} }
} }
static void js_dp_function(switch_core_session_t *session, char *input_code) SWITCH_STANDARD_APP(js_dp_function)
{ {
js_parse_and_execute(session, input_code, NULL); js_parse_and_execute(session, data, NULL);
} }
static void *SWITCH_THREAD_FUNC js_thread_run(switch_thread_t * thread, void *obj) static void *SWITCH_THREAD_FUNC js_thread_run(switch_thread_t * thread, void *obj)

View File

@ -71,12 +71,12 @@ SWITCH_BEGIN_EXTERN_C
#else //not win32 #else //not win32
#define SWITCH_SM_DECLARE(type) type #define SWITCH_SM_DECLARE(type) type
#endif #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; JSScript *script = NULL;
char *cptr; const char *cptr;
char *path = NULL; char *path = NULL;
char *script_name = NULL; const char *script_name = NULL;
int result = 0; int result = 0;
JS_ClearPendingException(cx); JS_ClearPendingException(cx);

View File

@ -65,7 +65,7 @@ static switch_status_t my_on_hangup(switch_core_session_t *session)
char *xml_text = NULL; char *xml_text = NULL;
char *path = NULL; char *path = NULL;
char *curl_xml_text = NULL; char *curl_xml_text = NULL;
char *logdir = NULL; const char *logdir = NULL;
char *xml_text_escaped = NULL; char *xml_text_escaped = NULL;
int fd = -1; int fd = -1;
uint32_t cur_try; uint32_t cur_try;

View File

@ -126,7 +126,7 @@ SWITCH_DECLARE(switch_caller_profile_t *) switch_caller_profile_clone(switch_cor
} }
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")) { if (!strcasecmp(name, "dialplan")) {
return caller_profile->dialplan; return caller_profile->dialplan;

View File

@ -289,7 +289,7 @@ SWITCH_DECLARE(switch_status_t) switch_channel_init(switch_channel_t *channel, s
SWITCH_DECLARE(void) switch_channel_presence(switch_channel_t *channel, const char *rpid, const char *status) 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_t *event;
switch_event_types_t type = SWITCH_EVENT_PRESENCE_IN; switch_event_types_t type = SWITCH_EVENT_PRESENCE_IN;
@ -319,9 +319,9 @@ SWITCH_DECLARE(void) switch_channel_presence(switch_channel_t *channel, const ch
} }
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); assert(channel != NULL);
switch_mutex_lock(channel->profile_mutex); switch_mutex_lock(channel->profile_mutex);
@ -425,7 +425,7 @@ SWITCH_DECLARE(int) switch_channel_test_flag(switch_channel_t *channel, switch_c
SWITCH_DECLARE(switch_bool_t) switch_channel_set_flag_partner(switch_channel_t *channel, switch_channel_flag_t flags) 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); assert(channel != NULL);
@ -443,7 +443,7 @@ SWITCH_DECLARE(switch_bool_t) switch_channel_set_flag_partner(switch_channel_t *
SWITCH_DECLARE(switch_bool_t) switch_channel_clear_flag_partner(switch_channel_t *channel, switch_channel_flag_t flags) 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); assert(channel != NULL);
@ -1096,7 +1096,7 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_pre_answered(switch_
switch_channel_mark_ring_ready(channel); switch_channel_mark_ring_ready(channel);
if (!switch_channel_test_flag(channel, CF_EARLY_MEDIA)) { if (!switch_channel_test_flag(channel, CF_EARLY_MEDIA)) {
char *uuid; const char *uuid;
switch_core_session_t *other_session; 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); 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_ring_ready(switch_channel
SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_answered(switch_channel_t *channel, const char *file, const char *func, int line) 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; switch_event_t *event;
char *uuid; const char *uuid;
switch_core_session_t *other_session; switch_core_session_t *other_session;
assert(channel != NULL); assert(channel != NULL);
@ -1268,7 +1268,8 @@ SWITCH_DECLARE(char *) switch_channel_expand_variables(switch_channel_t *channel
char *q, *p, *c = NULL; char *q, *p, *c = NULL;
char *data, *indup; char *data, *indup;
size_t sp = 0, len = 0, olen = 0, vtype = 0, br = 0, cpos, block = 128; 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; int nv = 0;
q = in; q = in;

View File

@ -35,7 +35,7 @@
#include "private/switch_core_pvt.h" #include "private/switch_core_pvt.h"
SWITCH_DECLARE(switch_status_t) switch_core_file_open(switch_file_handle_t *fh, 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; char *ext;
switch_status_t status; switch_status_t status;

View File

@ -194,7 +194,7 @@ SWITCH_DECLARE(switch_call_cause_t) switch_core_session_outgoing_channel(switch_
if (session) { if (session) {
channel = switch_core_session_get_channel(session); channel = switch_core_session_get_channel(session);
if (caller_profile) { 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_name = switch_channel_get_variable(channel, "effective_caller_id_name");
ecaller_id_number = switch_channel_get_variable(channel, "effective_caller_id_number"); ecaller_id_number = switch_channel_get_variable(channel, "effective_caller_id_number");
@ -247,7 +247,7 @@ SWITCH_DECLARE(switch_call_cause_t) switch_core_session_outgoing_channel(switch_
} }
if (channel && peer_channel) { 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); switch_codec_t *read_codec = switch_core_session_get_read_codec(session);
if (read_codec) { if (read_codec) {
@ -270,7 +270,7 @@ SWITCH_DECLARE(switch_call_cause_t) switch_core_session_outgoing_channel(switch_
int x; int x;
for (x = 0; x < argc; x++) { for (x = 0; x < argc; x++) {
char *val; const char *val;
if ((val = switch_channel_get_variable(channel, argv[x]))) { if ((val = switch_channel_get_variable(channel, argv[x]))) {
char *var = argv[x]; char *var = argv[x];
if (!strncasecmp(var, "nolocal:", 8)) { if (!strncasecmp(var, "nolocal:", 8)) {
@ -344,7 +344,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_pass_indication(switch_core_
{ {
switch_core_session_message_t msg = {0}; switch_core_session_message_t msg = {0};
switch_core_session_t *other_session; switch_core_session_t *other_session;
char *uuid; const char *uuid;
switch_channel_t *channel; switch_channel_t *channel;
switch_status_t status = SWITCH_STATUS_SUCCESS; switch_status_t status = SWITCH_STATUS_SUCCESS;
@ -900,7 +900,7 @@ SWITCH_DECLARE(switch_app_log_t *) switch_core_session_get_app_log(switch_core_s
} }
SWITCH_DECLARE(switch_status_t) switch_core_session_exec(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_app_log_t *log, *lp; switch_app_log_t *log, *lp;
switch_event_t *event; switch_event_t *event;
switch_channel_t *channel; switch_channel_t *channel;

View File

@ -36,8 +36,8 @@
SWITCH_DECLARE(switch_status_t) switch_core_speech_open(switch_speech_handle_t *sh, SWITCH_DECLARE(switch_status_t) switch_core_speech_open(switch_speech_handle_t *sh,
char *module_name, const char *module_name,
char *voice_name, const char *voice_name,
unsigned int rate, unsigned int rate,
unsigned int interval, unsigned int interval,
switch_speech_flag_t *flags, switch_speech_flag_t *flags,
@ -101,7 +101,7 @@ SWITCH_DECLARE(void) switch_core_speech_flush_tts(switch_speech_handle_t *sh)
} }
} }
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); assert(sh != NULL);

View File

@ -34,7 +34,7 @@
#include <switch.h> #include <switch.h>
#include "private/switch_core_pvt.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_timer_interface_t *timer_interface;
switch_status_t status; switch_status_t status;

View File

@ -45,7 +45,7 @@
CoreSession::CoreSession() 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) CoreSession::CoreSession(char *nuuid)
@ -113,7 +113,7 @@ void CoreSession::setVariable(char *var, char *val)
switch_channel_set_variable(channel, var, val); switch_channel_set_variable(channel, var, val);
} }
char *CoreSession::getVariable(char *var) const char *CoreSession::getVariable(char *var)
{ {
sanity_check(NULL); sanity_check(NULL);
return switch_channel_get_variable(channel, var); return switch_channel_get_variable(channel, var);
@ -269,7 +269,7 @@ int CoreSession::streamFile(char *file, int starting_sample_count) {
switch_status_t status; switch_status_t status;
switch_file_handle_t fh = { 0 }; switch_file_handle_t fh = { 0 };
char *prebuf; const char *prebuf;
sanity_check(-1); sanity_check(-1);
fh.samples = starting_sample_count; fh.samples = starting_sample_count;

View File

@ -696,7 +696,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_hold(switch_core_session_t *session)
return SWITCH_STATUS_SUCCESS; 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; switch_core_session_t *session;
@ -727,7 +727,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_unhold(switch_core_session_t *session
return SWITCH_STATUS_SUCCESS; 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; switch_core_session_t *session;
@ -739,9 +739,9 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_unhold_uuid(char *uuid)
return SWITCH_STATUS_SUCCESS; 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_channel_t *channel, *other_channel = NULL;
switch_core_session_t *session, *other_session; switch_core_session_t *session, *other_session;
switch_core_session_message_t msg = { 0 }; switch_core_session_message_t msg = { 0 };
@ -791,9 +791,9 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_media(char *uuid, switch_media_flag_t
} }
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_channel_t *channel, *other_channel = NULL;
switch_core_session_t *session, *other_session = NULL; switch_core_session_t *session, *other_session = NULL;
switch_core_session_message_t msg = { 0 }; switch_core_session_message_t msg = { 0 };
@ -845,14 +845,14 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_nomedia(char *uuid, switch_media_flag
return status; 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_channel_t *channel;
switch_caller_profile_t *profile, *new_profile; switch_caller_profile_t *profile, *new_profile;
switch_core_session_message_t msg = { 0 }; switch_core_session_message_t msg = { 0 };
switch_core_session_t *other_session; switch_core_session_t *other_session;
switch_channel_t *other_channel = NULL; switch_channel_t *other_channel = NULL;
char *uuid = NULL; const char *uuid = NULL;
assert(session != NULL); assert(session != NULL);
switch_core_session_reset(session); switch_core_session_reset(session);
@ -941,7 +941,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_transfer_variable(switch_core_session
{ {
switch_channel_t *chana = switch_core_session_get_channel(sessa); switch_channel_t *chana = switch_core_session_get_channel(sessa);
switch_channel_t *chanb = switch_core_session_get_channel(sessb); switch_channel_t *chanb = switch_core_session_get_channel(sessb);
char *val = NULL; const char *val = NULL;
uint8_t prefix = 0; uint8_t prefix = 0;
if (var && *var == '~') { if (var && *var == '~') {

View File

@ -163,7 +163,7 @@ static switch_bool_t displace_callback(switch_media_bug_t *bug, void *user_data,
return SWITCH_TRUE; 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_media_bug_t *bug;
switch_channel_t *channel = switch_core_session_get_channel(session); switch_channel_t *channel = switch_core_session_get_channel(session);
@ -277,7 +277,7 @@ static switch_bool_t record_callback(switch_media_bug_t *bug, void *user_data, s
return SWITCH_TRUE; 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_media_bug_t *bug;
switch_channel_t *channel = switch_core_session_get_channel(session); switch_channel_t *channel = switch_core_session_get_channel(session);
@ -297,7 +297,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_session(switch_core_session_t
{ {
switch_channel_t *channel; switch_channel_t *channel;
switch_codec_t *read_codec; switch_codec_t *read_codec;
char *p; const char *p;
const char *vval; const char *vval;
switch_media_bug_t *bug; switch_media_bug_t *bug;
switch_status_t status; switch_status_t status;
@ -1071,7 +1071,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech(switch_core_session_t *
switch_status_t status; switch_status_t status;
switch_asr_flag_t flags = SWITCH_ASR_FLAG_NONE; switch_asr_flag_t flags = SWITCH_ASR_FLAG_NONE;
struct speech_thread_handle *sth; struct speech_thread_handle *sth;
char *val; const char *val;
if (!ah) { if (!ah) {
if (!(ah = switch_core_session_alloc(session, sizeof(*ah)))) { if (!(ah = switch_core_session_alloc(session, sizeof(*ah)))) {
@ -1145,7 +1145,7 @@ SWITCH_STANDARD_SCHED_FUNC(sch_hangup_callback)
{ {
struct hangup_helper *helper; struct hangup_helper *helper;
switch_core_session_t *session, *other_session; switch_core_session_t *session, *other_session;
char *other_uuid; const char *other_uuid;
assert(task); assert(task);
@ -1170,7 +1170,7 @@ SWITCH_STANDARD_SCHED_FUNC(sch_hangup_callback)
} }
} }
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; struct hangup_helper *helper;
size_t len = sizeof(*helper); size_t len = sizeof(*helper);
@ -1207,7 +1207,7 @@ SWITCH_STANDARD_SCHED_FUNC(sch_transfer_callback)
} }
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; struct transfer_helper *helper;
size_t len = sizeof(*helper); size_t len = sizeof(*helper);
@ -1283,14 +1283,14 @@ SWITCH_DECLARE(uint32_t) switch_ivr_schedule_broadcast(time_t runtime, char *uui
return switch_scheduler_add_task(runtime, sch_broadcast_callback, (char *) __SWITCH_FUNC__, uuid, 0, helper, SSHF_FREE_ARG); 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; switch_channel_t *channel;
int nomedia; int nomedia;
switch_core_session_t *session, *master; switch_core_session_t *session, *master;
switch_event_t *event; switch_event_t *event;
switch_core_session_t *other_session = NULL; switch_core_session_t *other_session = NULL;
char *other_uuid = NULL; const char *other_uuid = NULL;
char *app = "playback"; char *app = "playback";
assert(path); assert(path);

View File

@ -56,7 +56,7 @@ static void *audio_bridge_thread(switch_thread_t * thread, void *obj)
switch_frame_t *read_frame; switch_frame_t *read_frame;
switch_core_session_t *session_a, *session_b; switch_core_session_t *session_a, *session_b;
uint32_t loop_count = 0; uint32_t loop_count = 0;
char *app_name = NULL, *app_arg = NULL; const char *app_name = NULL, *app_arg = NULL;
session_a = data->session; session_a = data->session;
if (!(session_b = switch_core_session_locate(data->b_uuid))) { if (!(session_b = switch_core_session_locate(data->b_uuid))) {
@ -311,7 +311,7 @@ static switch_status_t uuid_bridge_on_transmit(switch_core_session_t *session)
{ {
switch_channel_t *channel = NULL; switch_channel_t *channel = NULL;
switch_core_session_t *other_session; switch_core_session_t *other_session;
char *other_uuid = NULL; const char *other_uuid = NULL;
channel = switch_core_session_get_channel(session); channel = switch_core_session_get_channel(session);
assert(channel != NULL); assert(channel != NULL);
@ -430,7 +430,7 @@ static switch_status_t signal_bridge_on_hibernate(switch_core_session_t *session
static switch_status_t signal_bridge_on_hangup(switch_core_session_t *session) static switch_status_t signal_bridge_on_hangup(switch_core_session_t *session)
{ {
char *uuid; const char *uuid;
switch_channel_t *channel = NULL; switch_channel_t *channel = NULL;
switch_core_session_t *other_session; switch_core_session_t *other_session;
switch_event_t *event; switch_event_t *event;
@ -595,7 +595,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_multi_threaded_bridge(switch_core_ses
switch_event_t *event; switch_event_t *event;
switch_core_session_message_t msg = { 0 }; switch_core_session_message_t msg = { 0 };
const switch_application_interface_t *application_interface; const switch_application_interface_t *application_interface;
char *app, *data; const char *app, *data;
switch_channel_set_state(peer_channel, CS_HOLD); switch_channel_set_state(peer_channel, CS_HOLD);
@ -683,7 +683,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_multi_threaded_bridge(switch_core_ses
} }
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_core_session_t *originator_session, *originatee_session;
switch_channel_t *originator_channel, *originatee_channel; switch_channel_t *originator_channel, *originatee_channel;

View File

@ -237,10 +237,10 @@ static int teletone_handler(teletone_generation_session_t * ts, teletone_tone_ma
SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *session, SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *session,
switch_core_session_t **bleg, switch_core_session_t **bleg,
switch_call_cause_t *cause, switch_call_cause_t *cause,
char *bridgeto, const char *bridgeto,
uint32_t timelimit_sec, uint32_t timelimit_sec,
const switch_state_handler_table_t *table, 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 *pipe_names[MAX_PEERS] = { 0 };
char *data = NULL; char *data = NULL;
@ -263,7 +263,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
char key[80] = SWITCH_BLANK_STRING, file[512] = SWITCH_BLANK_STRING, *odata, *var; char key[80] = SWITCH_BLANK_STRING, file[512] = SWITCH_BLANK_STRING, *odata, *var;
switch_call_cause_t reason = SWITCH_CAUSE_UNALLOCATED; switch_call_cause_t reason = SWITCH_CAUSE_UNALLOCATED;
uint8_t to = 0; 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; switch_codec_t *read_codec = NULL;
uint8_t sent_ring = 0, early_ok = 1; uint8_t sent_ring = 0, early_ok = 1;
switch_core_session_message_t *message = NULL; switch_core_session_message_t *message = NULL;

View File

@ -90,14 +90,14 @@ static switch_say_type_t get_say_type_by_name(char *name)
} }
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_input_args_t *args)
{ {
switch_xml_t cfg, xml = NULL, language, macros, macro, input, action; switch_xml_t cfg, xml = NULL, language, macros, macro, input, action;
char *lname = NULL, *mname = NULL, hint_data[1024] = "", enc_hint[1024] = ""; char *lname = NULL, *mname = NULL, hint_data[1024] = "", enc_hint[1024] = "";
switch_status_t status = SWITCH_STATUS_GENERR; 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 *old_sound_prefix = NULL, *sound_path = NULL, *tts_engine = NULL, *tts_voice = NULL;
const char *module_name = NULL; const char *module_name = NULL, *chan_lang = NULL;
switch_channel_t *channel; switch_channel_t *channel;
uint8_t done = 0; uint8_t done = 0;
@ -273,8 +273,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro(switch_core_session_t *s
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid SAY Interface [%s]!\n", module_name); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid SAY Interface [%s]!\n", module_name);
} }
} else if (!strcasecmp(func, "speak-text")) { } else if (!strcasecmp(func, "speak-text")) {
char *my_tts_engine = (char *) switch_xml_attr(action, "tts-engine"); const char *my_tts_engine = switch_xml_attr(action, "tts-engine");
char *my_tts_voice = (char *) switch_xml_attr(action, "tts-voice"); const char *my_tts_voice = switch_xml_attr(action, "tts-voice");
if (!my_tts_engine) { if (!my_tts_engine) {
my_tts_engine = tts_engine; my_tts_engine = tts_engine;
@ -325,7 +325,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *se
switch_codec_t codec, *read_codec; switch_codec_t codec, *read_codec;
char *codec_name; char *codec_name;
switch_status_t status = SWITCH_STATUS_SUCCESS; switch_status_t status = SWITCH_STATUS_SUCCESS;
char *p; const char *p;
const char *vval; const char *vval;
time_t start = 0; time_t start = 0;
uint32_t org_silence_hits = 0; uint32_t org_silence_hits = 0;
@ -357,37 +357,37 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *se
switch_channel_answer(channel); switch_channel_answer(channel);
if ((p = switch_channel_get_variable(channel, "RECORD_TITLE"))) { 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_core_file_set_string(fh, SWITCH_AUDIO_COL_STR_TITLE, vval);
switch_channel_set_variable(channel, "RECORD_TITLE", NULL); switch_channel_set_variable(channel, "RECORD_TITLE", NULL);
} }
if ((p = switch_channel_get_variable(channel, "RECORD_COPYRIGHT"))) { 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_core_file_set_string(fh, SWITCH_AUDIO_COL_STR_COPYRIGHT, vval);
switch_channel_set_variable(channel, "RECORD_COPYRIGHT", NULL); switch_channel_set_variable(channel, "RECORD_COPYRIGHT", NULL);
} }
if ((p = switch_channel_get_variable(channel, "RECORD_SOFTWARE"))) { 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_core_file_set_string(fh, SWITCH_AUDIO_COL_STR_SOFTWARE, vval);
switch_channel_set_variable(channel, "RECORD_SOFTWARE", NULL); switch_channel_set_variable(channel, "RECORD_SOFTWARE", NULL);
} }
if ((p = switch_channel_get_variable(channel, "RECORD_ARTIST"))) { 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_core_file_set_string(fh, SWITCH_AUDIO_COL_STR_ARTIST, vval);
switch_channel_set_variable(channel, "RECORD_ARTIST", NULL); switch_channel_set_variable(channel, "RECORD_ARTIST", NULL);
} }
if ((p = switch_channel_get_variable(channel, "RECORD_COMMENT"))) { 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_core_file_set_string(fh, SWITCH_AUDIO_COL_STR_COMMENT, vval);
switch_channel_set_variable(channel, "RECORD_COMMENT", NULL); switch_channel_set_variable(channel, "RECORD_COMMENT", NULL);
} }
if ((p = switch_channel_get_variable(channel, "RECORD_DATE"))) { 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_core_file_set_string(fh, SWITCH_AUDIO_COL_STR_DATE, vval);
switch_channel_set_variable(channel, "RECORD_DATE", NULL); switch_channel_set_variable(channel, "RECORD_DATE", NULL);
} }
@ -637,7 +637,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_gentones(switch_core_session_t *sessi
#define FILE_BLOCKSIZE 1024 * 8 #define FILE_BLOCKSIZE 1024 * 8
#define FILE_BUFSIZE 1024 * 64 #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; switch_channel_t *channel;
int16_t abuf[FILE_STARTSAMPLES]; int16_t abuf[FILE_STARTSAMPLES];
@ -659,9 +659,9 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
char *title = "", *copyright = "", *software = "", *artist = "", *comment = "", *date = ""; char *title = "", *copyright = "", *software = "", *artist = "", *comment = "", *date = "";
uint8_t asis = 0; uint8_t asis = 0;
char *ext; char *ext;
char *prefix; const char *prefix;
char *timer_name; const char *timer_name;
char *prebuf; const char *prebuf;
channel = switch_core_session_get_channel(session); channel = switch_core_session_get_channel(session);
assert(channel != NULL); assert(channel != NULL);
@ -1199,7 +1199,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text_handle(switch_core_session
uint32_t rate = 0; uint32_t rate = 0;
switch_size_t extra = 0; switch_size_t extra = 0;
char *p, *tmp = NULL; char *p, *tmp = NULL;
char *star, *pound; const char *star, *pound;
switch_size_t starlen, poundlen; switch_size_t starlen, poundlen;
channel = switch_core_session_get_channel(session); channel = switch_core_session_get_channel(session);
@ -1467,7 +1467,7 @@ SWITCH_DECLARE(void) switch_ivr_clear_speech_cache(switch_core_session_t *sessio
SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text(switch_core_session_t *session, 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; switch_channel_t *channel;
uint32_t rate = 0; uint32_t rate = 0;
@ -1483,7 +1483,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text(switch_core_session_t *ses
switch_speech_handle_t lsh, *sh; switch_speech_handle_t lsh, *sh;
switch_speech_flag_t flags = SWITCH_SPEECH_FLAG_NONE; switch_speech_flag_t flags = SWITCH_SPEECH_FLAG_NONE;
switch_codec_t *read_codec; switch_codec_t *read_codec;
char *timer_name, *var; const char *timer_name, *var;
cached_speech_handle_t *cache_obj = NULL; cached_speech_handle_t *cache_obj = NULL;
int need_create = 1, need_alloc = 1; int need_create = 1, need_alloc = 1;

View File

@ -657,9 +657,9 @@ SWITCH_DECLARE(int) switch_socket_waitfor(switch_pollfd_t * poll, int ms)
} }
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; size_t x = 0;
const char urlunsafe[] = "\r\n \"#%&+:;<=>?@[\\]^`{|}"; const char urlunsafe[] = "\r\n \"#%&+:;<=>?@[\\]^`{|}";
const char hex[] = "0123456789ABCDEF"; const char hex[] = "0123456789ABCDEF";

View File

@ -1229,7 +1229,7 @@ SWITCH_DECLARE(switch_status_t) switch_xml_locate(const char *section,
return SWITCH_STATUS_FALSE; 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]; char my_params[512];
*domain = NULL; *domain = NULL;
@ -1243,13 +1243,13 @@ SWITCH_DECLARE(switch_status_t) switch_xml_locate_domain(char *domain_name, char
} }
SWITCH_DECLARE(switch_status_t) switch_xml_locate_user(char *user_name, SWITCH_DECLARE(switch_status_t) switch_xml_locate_user(const char *user_name,
char *domain_name, const char *domain_name,
char *ip, const char *ip,
switch_xml_t *root, switch_xml_t *root,
switch_xml_t *domain, switch_xml_t *domain,
switch_xml_t *user, switch_xml_t *user,
char *xtra_params) const char *xtra_params)
{ {
char params[1024] = ""; char params[1024] = "";
switch_status_t status; switch_status_t status;