]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
use more correct const char * for things that should not be modified. This should...
authorMichael Jerris <mike@jerris.com>
Thu, 1 Nov 2007 11:28:26 +0000 (11:28 +0000)
committerMichael Jerris <mike@jerris.com>
Thu, 1 Nov 2007 11:28:26 +0000 (11:28 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6120 d0543943-73ff-0310-b7d9-9358b9ac24b2

52 files changed:
libs/iax/src/iax-client.h
libs/iax/src/iax.c
libs/iax/src/iax2-parser.c
libs/iax/src/iax2-parser.h
libs/libdingaling/src/libdingaling.c
libs/libdingaling/src/libdingaling.h
libs/libteletone/src/libteletone_generate.c
libs/libteletone/src/libteletone_generate.h
src/include/switch_caller.h
src/include/switch_channel.h
src/include/switch_core.h
src/include/switch_cpp.h
src/include/switch_ivr.h
src/include/switch_module_interfaces.h
src/include/switch_types.h
src/include/switch_utils.h
src/include/switch_xml.h
src/mod/applications/mod_commands/mod_commands.c
src/mod/applications/mod_conference/mod_conference.c
src/mod/applications/mod_dptools/mod_dptools.c
src/mod/applications/mod_fifo/mod_fifo.c
src/mod/applications/mod_voicemail/mod_voicemail.c
src/mod/asr_tts/mod_openmrcp/mod_openmrcp.c
src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c
src/mod/endpoints/mod_dingaling/mod_dingaling.c
src/mod/endpoints/mod_portaudio/mod_portaudio.c
src/mod/endpoints/mod_sofia/mod_sofia.c
src/mod/endpoints/mod_sofia/mod_sofia.h
src/mod/endpoints/mod_sofia/sofia.c
src/mod/endpoints/mod_sofia/sofia_glue.c
src/mod/event_handlers/mod_cdr/basecdr.cpp
src/mod/event_handlers/mod_event_socket/mod_event_socket.c
src/mod/formats/mod_local_stream/mod_local_stream.c
src/mod/formats/mod_native_file/mod_native_file.c
src/mod/formats/mod_sndfile/mod_sndfile.c
src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
src/mod/languages/mod_spidermonkey/mod_spidermonkey.h
src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c
src/switch_caller.c
src/switch_channel.c
src/switch_core_file.c
src/switch_core_session.c
src/switch_core_speech.c
src/switch_core_timer.c
src/switch_cpp.cpp
src/switch_ivr.c
src/switch_ivr_async.c
src/switch_ivr_bridge.c
src/switch_ivr_originate.c
src/switch_ivr_play_say.c
src/switch_utils.c
src/switch_xml.c

index 3057eacaf630044c218a3e79034848e32604c792..d72df16d2fa12b0d80444ba1c020281d7340b2ac 100644 (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_ping(struct iax_session *session);
 extern int iax_load_complete(struct iax_session *session);
-extern int iax_reject(struct iax_session *session, char *reason);
+extern int iax_reject(struct iax_session *session, const char *reason);
 int iax_reject_registration(struct iax_session *session, char *reason);
 int iax_ack_registration(struct iax_session *session);
 int iax_auth_registration(struct iax_session *session);
 extern int iax_busy(struct iax_session *session);
 extern int iax_congestion(struct iax_session *session);
 extern int iax_hangup(struct iax_session *session, char *byemsg);
-extern int iax_call(struct iax_session *session, char *cidnum, char *cidname, char *ich, char *lang, int wait, int format, int capability);
+extern int iax_call(struct iax_session *session, const char *cidnum, const char *cidname, char *ich, char *lang, int wait, int format, int capability);
 extern int iax_accept(struct iax_session *session, int format);
 extern int iax_answer(struct iax_session *session);
 extern int iax_sendurl(struct iax_session *session, char *url);
index c60aa2bad88feda43e9d3d9e611e455454682707..984f3e8f9c9bdaf8dd6340f198b204686a13a114 100644 (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);
 }
 
-int iax_reject(struct iax_session *session, char *reason)
+int iax_reject(struct iax_session *session, const char *reason)
 {
        struct iax_ie_data ied;
        memset(&ied, 0, sizeof(ied));
@@ -1986,7 +1986,7 @@ 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 *part1, *part2;
index ab50abae0cedd46758b95f433901f434ef2c3004..67beefbae81d3187e5c78e19802f21c7e3bd5629 100644 (file)
@@ -432,7 +432,7 @@ snprintf(tmp, (int)sizeof(tmp),
                dump_ies(fh->iedata, datalen);
 }
 
-int iax_ie_append_raw(struct iax_ie_data *ied, unsigned char ie, void *data, int datalen)
+int iax_ie_append_raw(struct iax_ie_data *ied, unsigned char ie, const void *data, int datalen)
 {
        char tmp[256];
        if (datalen > ((int)sizeof(ied->buf) - ied->pos)) {
@@ -466,7 +466,7 @@ 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));
 }
 
-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));
 }
index 2384d2de3c0585234e3a4d9a2836214083767755..25b863de00cf47f4c5f21222b8aa193e21499705 100644 (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 int iax_ie_append_raw(struct iax_ie_data *ied, unsigned char ie, void *data, int datalen);
+extern int iax_ie_append_raw(struct iax_ie_data *ied, unsigned char ie, const void *data, int datalen);
 extern int iax_ie_append_addr(struct iax_ie_data *ied, unsigned char ie, struct sockaddr_in *sin);
 extern int iax_ie_append_int(struct iax_ie_data *ied, unsigned char ie, unsigned int value);
 extern int iax_ie_append_short(struct iax_ie_data *ied, unsigned char ie, unsigned short value);
-extern int iax_ie_append_str(struct iax_ie_data *ied, unsigned char ie, unsigned char *str);
+extern int iax_ie_append_str(struct iax_ie_data *ied, unsigned char ie, const unsigned char *str);
 extern int iax_ie_append_byte(struct iax_ie_data *ied, unsigned char ie, unsigned char dat);
 extern int iax_ie_append(struct iax_ie_data *ied, unsigned char ie);
 extern int iax_parse_ies(struct iax_ies *ies, unsigned char *data, int datalen);
index d14d93fc4423f9dfa7455bd3b8bada73d324c6b1..e937bc8ff9321af170ceaf5f175a11ca24879cb4 100644 (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);
 }
 
-void ldl_session_set_value(ldl_session_t *session, char *key, char *val)
+void ldl_session_set_value(ldl_session_t *session, const char *key, const char *val)
 {
        apr_hash_set(session->variables, apr_pstrdup(session->pool, key), APR_HASH_KEY_STRING, apr_pstrdup(session->pool, val));
 }
@@ -1789,18 +1789,19 @@ void ldl_handle_send_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;
        char *t, *e;
        char *bdup = NULL;
        int on = 0;
        int len = 0;
+       char *my_body = strdup(body);
        assert(handle != NULL);
        assert(body != NULL);
        
-       if (strchr(body, '<')) {
-               len = (int) strlen(body);
+       if (strchr(my_body, '<')) {
+               len = (int) strlen(my_body);
                if (!(bdup = malloc(len))) {
                        return;
                }
@@ -1808,7 +1809,7 @@ void ldl_handle_send_msg(ldl_handle_t *handle, char *from, char *to, char *subje
                memset(bdup, 0, len);
                
                e = bdup;
-               for(t = body; *t; t++) {
+               for(t = my_body; *t; t++) {
                        if (*t == '<') {
                                on = 1;
                        } else if (*t == '>') {
@@ -1820,10 +1821,10 @@ void ldl_handle_send_msg(ldl_handle_t *handle, char *from, char *to, char *subje
                                *e++ = *t;
                        }
                }
-               body = bdup;
+               my_body = bdup;
        }
        
-       msg = iks_make_msg(IKS_TYPE_NONE, to, body);
+       msg = iks_make_msg(IKS_TYPE_NONE, to, my_body);
        iks_insert_attrib(msg, "type", "chat");
 
        if (!from) {
@@ -1840,6 +1841,8 @@ void ldl_handle_send_msg(ldl_handle_t *handle, char *from, char *to, char *subje
                free(bdup);
        }
 
+       free(my_body);
+
        apr_queue_push(handle->queue, msg);
        msg = NULL;
        
index cf513cac1eb6c0e0c5355cf54b0400b10cf42d33..cdbd7ac2d8193126198dfe6e4ea702030805c438 100644 (file)
@@ -309,7 +309,7 @@ char *ldl_session_get_value(ldl_session_t *session, char *key);
   \param key the key to set
   \param val the value of the key
 */
-void ldl_session_set_value(ldl_session_t *session, char *key, char *val);
+void ldl_session_set_value(ldl_session_t *session, const char *key, const char *val);
 
 /*!
   \brief Create a Jingle Session
@@ -473,7 +473,7 @@ void ldl_handle_send_vcard(ldl_handle_t *handle, char *from, char *to, char *id,
   \param subject optional subject
   \param body body of the message
 */
-void ldl_handle_send_msg(ldl_handle_t *handle, char *from, char *to, char *subject, char *body);
+void ldl_handle_send_msg(ldl_handle_t *handle, char *from, char *to, const char *subject, const char *body);
 
 /*!
   \brief Offer candidates to a potential session
index bb904b2d68571d39d79cb9ad58670d25054b3a2d..b578c45d3889c7dfa98c55b768965883ba94aa3a 100644 (file)
@@ -314,7 +314,7 @@ static char *my_strdup (const char *s)
        return (char *) memcpy (new, s, len);
 }
 
-int teletone_run(teletone_generation_session_t *ts, char *cmd)
+int teletone_run(teletone_generation_session_t *ts, const char *cmd)
 {
        char *data = NULL, *cur = NULL, *end = NULL;
        int var = 0, LOOPING = 0;
index 8e9cf4abbdd435bf3f14f5bbc67c13a52f763900..fc56405a1356e9637b7f4fadf56a3935912c1443 100644 (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
   \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
 }
index 70e175d2c8d648dcbf8a159e6d3d04956595e118..37498c7e6c69dd5a91edfc977fbe0519bd7be5b3 100644 (file)
@@ -60,25 +60,25 @@ SWITCH_BEGIN_EXTERN_C
  */
        struct switch_caller_profile {
        /*! The Call's User Name */
-       char *username;
+       const char *username;
        /*! The name of the dialplan */
-       char *dialplan;
+       const char *dialplan;
        /*! Caller ID Name */
-       char *caller_id_name;
+       const char *caller_id_name;
        /*! Caller ID Number */
-       char *caller_id_number;
+       const char *caller_id_number;
        uint8_t caller_ton;
        uint8_t caller_numplan;
        /*! Caller Network Address (when applicable) */
-       char *network_addr;
+       const char *network_addr;
        /*! ANI (when applicable) */
-       char *ani;
+       const char *ani;
        uint8_t ani_ton;
        uint8_t ani_numplan;
        /*! ANI II (when applicable) */
-       char *aniii;
+       const char *aniii;
        /*! RDNIS */
-       char *rdnis;
+       const char *rdnis;
        uint8_t rdnis_ton;
        uint8_t rdnis_numplan;
        /*! Destination Number */
@@ -86,13 +86,13 @@ SWITCH_BEGIN_EXTERN_C
        uint8_t destination_number_ton;
        uint8_t destination_number_numplan;
        /*! channel type */
-       char *source;
+       const char *source;
        /*! channel name */
        char *chan_name;
        /*! unique id */
        char *uuid;
        /*! context */
-       char *context;
+       const char *context;
        /*! flags */
        switch_caller_profile_flag_t flags;
        struct switch_caller_profile *originator_caller_profile;
@@ -156,7 +156,7 @@ SWITCH_DECLARE(void) switch_caller_extension_add_application(switch_core_session
   \param name the name
   \note this function is meant for situations where the name paramater is the contents of the variable
 */
-SWITCH_DECLARE(char *) switch_caller_get_field_by_name(switch_caller_profile_t *caller_profile, const char *name);
+SWITCH_DECLARE(const char *) switch_caller_get_field_by_name(switch_caller_profile_t *caller_profile, const char *name);
 
 /*!
   \brief Create a new caller profile object
index f9e0e23d601ad474156e4153c44bed1752acb5a6..1846d819016e0a0b517216faa20c01b6be26a014 100644 (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
   \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.
index 47a4210d288535201ac274280eb1bb794e4ec5d8..93bac7cdef8655200a0af5d8f5fc11b40fb13895 100644 (file)
@@ -69,7 +69,7 @@ struct switch_core_session_message {
        /*! optional numeric arg */
        int numeric_arg;
        /*! optional string arg */
-       char *string_arg;
+       const char *string_arg;
        /*! optional string arg */
        switch_size_t string_arg_size;
        /*! optional arbitrary pointer arg */
@@ -607,7 +607,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_event_send(char *uuid_str, s
 
 SWITCH_DECLARE(switch_app_log_t *) switch_core_session_get_app_log(switch_core_session_t *session);
 SWITCH_DECLARE(switch_status_t) switch_core_session_exec(switch_core_session_t *session,
-                                                                                                                const switch_application_interface_t *application_interface, char *arg);
+                                                                                                                const switch_application_interface_t *application_interface, const char *arg);
 SWITCH_DECLARE(switch_status_t) switch_core_session_execute_exten(switch_core_session_t *session, char *exten, char *dialplan, char *context);
 
 /*! 
@@ -918,7 +918,7 @@ SWITCH_DECLARE(void) switch_hash_this(switch_hash_index_t *hi, const void **key,
   \param pool the memory pool to use for allocation
   \return
 */
-SWITCH_DECLARE(switch_status_t) switch_core_timer_init(switch_timer_t *timer, char *timer_name, int interval, int samples, switch_memory_pool_t *pool);
+SWITCH_DECLARE(switch_status_t) switch_core_timer_init(switch_timer_t *timer, const char *timer_name, int interval, int samples, switch_memory_pool_t *pool);
 
 /*! 
   \brief Wait for one cycle on an existing timer
@@ -1105,7 +1105,7 @@ SWITCH_DECLARE(void) switch_core_db_test_reactive(switch_core_db_t *db, char *te
   \note the loadable module used is chosen based on the file extension
 */
 SWITCH_DECLARE(switch_status_t) switch_core_file_open(switch_file_handle_t *fh,
-                                                                                                         char *file_path, uint8_t channels, uint32_t rate, unsigned int flags, switch_memory_pool_t *pool);
+                                                                                                         const char *file_path, uint8_t channels, uint32_t rate, unsigned int flags, switch_memory_pool_t *pool);
 /*! 
   \brief Read media from a file handle
   \param fh the file handle to read from (must be initilized by you memset all 0 for read, fill in channels and rate for write)
@@ -1176,8 +1176,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_file_close(switch_file_handle_t *fh)
   \return SWITCH_STATUS_SUCCESS if the handle is opened
 */
 SWITCH_DECLARE(switch_status_t) switch_core_speech_open(switch_speech_handle_t *sh,
-                                                                                                               char *module_name,
-                                                                                                               char *voice_name, 
+                                                                                                               const char *module_name,
+                                                                                                               const char *voice_name, 
                                                                                                                unsigned int rate, 
                                                                                                                unsigned int interval, 
                                                                                                                switch_speech_flag_t *flags, switch_memory_pool_t *pool);
@@ -1202,7 +1202,7 @@ SWITCH_DECLARE(void) switch_core_speech_flush_tts(switch_speech_handle_t *sh);
   \param param the parameter
   \param val the value
 */
-SWITCH_DECLARE(void) switch_core_speech_text_param_tts(switch_speech_handle_t *sh, char *param, char *val);
+SWITCH_DECLARE(void) switch_core_speech_text_param_tts(switch_speech_handle_t *sh, char *param, const char *val);
 
 /*! 
   \brief Set a numeric parameter on a TTS handle
index c720617ded84b90b1a28b9c07bcfa7fbb54d87f8..bdf2a35cef25cd20de9431ba9354636e3297f0b8 100644 (file)
@@ -121,7 +121,7 @@ class CoreSession {
        int preAnswer();
        virtual void hangup(char *cause);
        void setVariable(char *var, char *val);
-       char *getVariable(char *var);
+       const char *getVariable(char *var);
 
 
        /** \brief Record to a file
index 22613ba13ee8a2050166500a724fd81bf6c31051..54188285e1fb5c85485699d5c19020562e1aa2e5 100644 (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_displace_session(switch_core_session_t *session, char *file, uint32_t limit, const char *flags);
-SWITCH_DECLARE(switch_status_t) switch_ivr_stop_displace_session(switch_core_session_t *session, char *file);
+SWITCH_DECLARE(switch_status_t) switch_ivr_stop_displace_session(switch_core_session_t *session, const char *file);
 
 /*!
   \brief Stop Recording a session
@@ -211,7 +211,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_stop_displace_session(switch_core_ses
   \param file the path to the file
   \return SWITCH_STATUS_SUCCESS if all is well
 */
-SWITCH_DECLARE(switch_status_t) switch_ivr_stop_record_session(switch_core_session_t *session, char *file);
+SWITCH_DECLARE(switch_status_t) switch_ivr_stop_record_session(switch_core_session_t *session, const char *file);
 
 /*!
   \brief Start looking for DTMF inband
@@ -282,7 +282,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_tone_detect_session(switch_core_sessi
   \param args arguements to pass for callbacks etc
   \return SWITCH_STATUS_SUCCESS if all is well
 */
-SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *session, switch_file_handle_t *fh, char *file, switch_input_args_t *args);
+SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *session, switch_file_handle_t *fh, const char *file, switch_input_args_t *args);
 
 SWITCH_DECLARE(switch_status_t) switch_ivr_gentones(switch_core_session_t *session, char *script, int32_t loops, switch_input_args_t *args);
 
@@ -339,7 +339,7 @@ SWITCH_DECLARE(void) switch_ivr_clear_speech_cache(switch_core_session_t *sessio
   \return SWITCH_STATUS_SUCCESS if all is well
 */
 SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text(switch_core_session_t *session,
-                                                                                                         char *tts_name, char *voice_name, char *text, switch_input_args_t *args);
+                                                                                                         const char *tts_name, const char *voice_name, char *text, switch_input_args_t *args);
 
 /*!
   \brief Make an outgoing call
@@ -358,10 +358,10 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text(switch_core_session_t *ses
 SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *session,
                                                                                                         switch_core_session_t **bleg,
                                                                                                         switch_call_cause_t *cause,
-                                                                                                        char *bridgeto,
+                                                                                                        const char *bridgeto,
                                                                                                         uint32_t timelimit_sec,
                                                                                                         const switch_state_handler_table_t *table,
-                                                                                                        char *cid_name_override, char *cid_num_override, switch_caller_profile_t *caller_profile_override);
+                                                                                                        const char *cid_name_override, const char *cid_num_override, switch_caller_profile_t *caller_profile_override);
 
 /*!
   \brief Bridge Audio from one session to another
@@ -392,7 +392,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_signal_bridge(switch_core_session_t *
   \param dialplan the new dialplan (OPTIONAL, may be NULL)
   \param context the new context (OPTIONAL, may be NULL)
 */
-SWITCH_DECLARE(switch_status_t) switch_ivr_session_transfer(switch_core_session_t *session, char *extension, char *dialplan, char *context);
+SWITCH_DECLARE(switch_status_t) switch_ivr_session_transfer(switch_core_session_t *session, const char *extension, char *dialplan, char *context);
 
 /*!
   \brief Transfer an existing session to another location in the future
@@ -403,7 +403,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_session_transfer(switch_core_session_
   \param context the new context (OPTIONAL, may be NULL)
   \return the id of the task
 */
-SWITCH_DECLARE(uint32_t) switch_ivr_schedule_transfer(time_t runtime, char *uuid, char *extension, char *dialplan, char *context);
+SWITCH_DECLARE(uint32_t) switch_ivr_schedule_transfer(time_t runtime, const char *uuid, char *extension, char *dialplan, char *context);
 
 
 /*!
@@ -414,7 +414,7 @@ SWITCH_DECLARE(uint32_t) switch_ivr_schedule_transfer(time_t runtime, char *uuid
   \param bleg hangup up the B-Leg if possible
   \return the id of the task
 */
-SWITCH_DECLARE(uint32_t) switch_ivr_schedule_hangup(time_t runtime, char *uuid, switch_call_cause_t cause, switch_bool_t bleg);
+SWITCH_DECLARE(uint32_t) switch_ivr_schedule_hangup(time_t runtime, const char *uuid, switch_call_cause_t cause, switch_bool_t bleg);
 
 /*!
   \brief Bridge two existing sessions
@@ -422,7 +422,7 @@ SWITCH_DECLARE(uint32_t) switch_ivr_schedule_hangup(time_t runtime, char *uuid,
   \param originatee_uuid the uuid of the originator
   \return SWITCH_STATUS_SUCCESS if all is well 
 */
-SWITCH_DECLARE(switch_status_t) switch_ivr_uuid_bridge(char *originator_uuid, char *originatee_uuid);
+SWITCH_DECLARE(switch_status_t) switch_ivr_uuid_bridge(const char *originator_uuid, const char *originatee_uuid);
 
 /*!
   \brief Signal a session to request direct media access to it's remote end
@@ -430,7 +430,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_uuid_bridge(char *originator_uuid, ch
   \param flags flags to influence behaviour (SMF_REBRIDGE to rebridge the call in media mode)
   \return SWITCH_STATUS_SUCCESS if all is well
 */
-SWITCH_DECLARE(switch_status_t) switch_ivr_media(char *uuid, switch_media_flag_t flags);
+SWITCH_DECLARE(switch_status_t) switch_ivr_media(const char *uuid, switch_media_flag_t flags);
 
 /*!
   \brief Signal a session to request indirect media allowing it to exchange media directly with another device
@@ -438,21 +438,21 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_media(char *uuid, switch_media_flag_t
   \param flags flags to influence behaviour (SMF_REBRIDGE to rebridge the call in no_media mode)
   \return SWITCH_STATUS_SUCCESS if all is well
 */
-SWITCH_DECLARE(switch_status_t) switch_ivr_nomedia(char *uuid, switch_media_flag_t flags);
+SWITCH_DECLARE(switch_status_t) switch_ivr_nomedia(const char *uuid, switch_media_flag_t flags);
 
 /*!
   \brief Signal the session with a protocol specific hold message.
   \param uuid the uuid of the session to hold
   \return SWITCH_STATUS_SUCCESS if all is well
 */
-SWITCH_DECLARE(switch_status_t) switch_ivr_hold_uuid(char *uuid);
+SWITCH_DECLARE(switch_status_t) switch_ivr_hold_uuid(const char *uuid);
 
 /*!
   \brief Signal the session with a protocol specific unhold message.
   \param uuid the uuid of the session to hold
   \return SWITCH_STATUS_SUCCESS if all is well
 */
-SWITCH_DECLARE(switch_status_t) switch_ivr_unhold_uuid(char *uuid);
+SWITCH_DECLARE(switch_status_t) switch_ivr_unhold_uuid(const char *uuid);
 
 /*!
   \brief Signal the session with a protocol specific hold message.
@@ -485,7 +485,7 @@ SWITCH_DECLARE(uint32_t) switch_ivr_schedule_broadcast(time_t runtime, char *uui
   \param flags flags to send to the request (SMF_ECHO_BRIDGED to send the broadcast to both sides of the call)
   \return SWITCH_STATUS_SUCCESS if all is well
 */
-SWITCH_DECLARE(switch_status_t) switch_ivr_broadcast(char *uuid, char *path, switch_media_flag_t flags);
+SWITCH_DECLARE(switch_status_t) switch_ivr_broadcast(const char *uuid, const char *path, switch_media_flag_t flags);
 
 /*!
   \brief Transfer variables from one session to another 
@@ -712,7 +712,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_menu_stack_xml_add_custom(switch_ivr_
  */
 SWITCH_DECLARE(switch_status_t) switch_ivr_menu_stack_xml_init(switch_ivr_menu_xml_ctx_t ** xml_menu_ctx, switch_memory_pool_t *pool);
 
-SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro(switch_core_session_t *session, char *macro_name, char *data, char *lang,
+SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro(switch_core_session_t *session, const char *macro_name, const char *data, const char *lang,
                                                                                                                switch_input_args_t *args);
 SWITCH_DECLARE(void) switch_ivr_delay_echo(switch_core_session_t *session, uint32_t delay_ms);
 /** @} */
index a4c1fbf696e3fa02c98c822c6159fad09fcdb344..a6be73c3938666323aa02264216df5dc068aa437 100644 (file)
@@ -231,7 +231,7 @@ struct switch_file_interface {
        /*! the name of the interface */
        const char *interface_name;
        /*! function to open the file */
-       switch_status_t (*file_open) (switch_file_handle_t *, char *file_path);
+       switch_status_t (*file_open) (switch_file_handle_t *, const char *file_path);
        /*! function to close the file */
        switch_status_t (*file_close) (switch_file_handle_t *);
        /*! function to read from the file */
@@ -340,7 +340,7 @@ struct switch_speech_interface {
        /*! the name of the interface */
        const char *interface_name;
        /*! function to open the speech interface */
-       switch_status_t (*speech_open) (switch_speech_handle_t *sh, char *voice_name, int rate, switch_speech_flag_t *flags);
+       switch_status_t (*speech_open) (switch_speech_handle_t *sh, const char *voice_name, int rate, switch_speech_flag_t *flags);
        /*! function to close the speech interface */
        switch_status_t (*speech_close) (switch_speech_handle_t *, switch_speech_flag_t *flags);
        /*! function to feed audio to the ASR */
@@ -348,7 +348,7 @@ struct switch_speech_interface {
        /*! function to read audio from the TTS */
        switch_status_t (*speech_read_tts) (switch_speech_handle_t *sh, void *data, switch_size_t *datalen, uint32_t * rate, switch_speech_flag_t *flags);
        void (*speech_flush_tts) (switch_speech_handle_t *sh);
-       void (*speech_text_param_tts) (switch_speech_handle_t *sh, char *param, char *val);
+       void (*speech_text_param_tts) (switch_speech_handle_t *sh, char *param, const char *val);
        void (*speech_numeric_param_tts) (switch_speech_handle_t *sh, char *param, int val);
        void (*speech_float_param_tts) (switch_speech_handle_t *sh, char *param, double val);
 
index 768c438e0357e070e59133c8f7830547c4d53d57..93840c666cbf2f82e1df9a96ea5ef284671da944 100644 (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 switch_bool_t (*switch_media_bug_callback_t) (switch_media_bug_t *, void *, switch_abc_type_t);
 
-typedef void (*switch_application_function_t) (switch_core_session_t *, char *);
-#define SWITCH_STANDARD_APP(name) static void name (switch_core_session_t *session, char *data)
+typedef void (*switch_application_function_t) (switch_core_session_t *, const char *);
+#define SWITCH_STANDARD_APP(name) static void name (switch_core_session_t *session, const char *data)
 
 typedef void (*switch_event_callback_t) (switch_event_t *);
 typedef switch_caller_extension_t *(*switch_dialplan_hunt_function_t) (switch_core_session_t *, void *, switch_caller_profile_t *);
index d7015fef3008534745e32ebcb4fbdee634a51e2f..e1e420143523313811b14318e9cc2a1c410b0f10 100644 (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);
 
 #define SWITCH_READ_ACCEPTABLE(status) (status == SWITCH_STATUS_SUCCESS || status == SWITCH_STATUS_BREAK)
-SWITCH_DECLARE(size_t) switch_url_encode(char *url, char *buf, size_t len);
+SWITCH_DECLARE(size_t) switch_url_encode(const char *url, char *buf, size_t len);
 SWITCH_DECLARE(char *) switch_url_decode(char *s);
 SWITCH_DECLARE(switch_bool_t) switch_simple_email(char *to, char *from, char *headers, char *body, char *file);
 
index 74d0523b59098dc25088c140a5e5f02e9dbec384..842006cb42c8be0bee2421fbefe17c5fb4399128 100644 (file)
@@ -318,13 +318,13 @@ SWITCH_DECLARE(switch_status_t) switch_xml_locate(const char *section,
                                                                                                  const char *key_name, const char *key_value, switch_xml_t * root, switch_xml_t * node,
                                                                                                  const char *params);
 
-SWITCH_DECLARE(switch_status_t) switch_xml_locate_domain(char *domain_name, char *params, switch_xml_t *root, switch_xml_t *domain);
-SWITCH_DECLARE(switch_status_t) switch_xml_locate_user(char *user_name, char *domain_name, 
-                                                                                                          char *ip, 
+SWITCH_DECLARE(switch_status_t) switch_xml_locate_domain(const char *domain_name, char *params, switch_xml_t *root, switch_xml_t *domain);
+SWITCH_DECLARE(switch_status_t) switch_xml_locate_user(const char *user_name, const char *domain_name, 
+                                                                                                          const char *ip, 
                                                                                                           switch_xml_t *root,
                                                                                                           switch_xml_t *domain,
                                                                                                           switch_xml_t *user,
-                                                                                                          char *xtra_params);
+                                                                                                          const char *xtra_params);
 
 ///\brief open a config in the core registry
 ///\param file_path the name of the config section e.g. modules.conf
index dfe27b9a4a10a55b88f2899ca12c8c8ffead0f1a..1df0efbd5005111f8a191d1ff5155ed8a445830d 100644 (file)
@@ -286,7 +286,7 @@ SWITCH_STANDARD_API(transfer_function)
                                        switch_channel_t *channel = switch_core_session_get_channel(tsession);
                                        arg++;
                                        if (!strcasecmp(arg, "bleg")) {
-                                               char *uuid = switch_channel_get_variable(channel, SWITCH_BRIDGE_VARIABLE);
+                                               const char *uuid = switch_channel_get_variable(channel, SWITCH_BRIDGE_VARIABLE);
                                                if (uuid && (other_session = switch_core_session_locate(uuid))) {
                                                        switch_core_session_t *tmp = tsession;
                                                        tsession = other_session;
@@ -294,7 +294,7 @@ SWITCH_STANDARD_API(transfer_function)
                                                        switch_core_session_rwunlock(tmp);
                                                }
                                        } else if (!strcasecmp(arg, "both")) {
-                                               char *uuid = switch_channel_get_variable(channel, SWITCH_BRIDGE_VARIABLE);
+                                               const char *uuid = switch_channel_get_variable(channel, SWITCH_BRIDGE_VARIABLE);
                                                switch_core_session_t *other_session;
                                                if (uuid && (other_session = switch_core_session_locate(uuid))) {
                                                        switch_ivr_session_transfer(other_session, dest, dp, context);
index 5dfa511a783b2271d470d127949fe3a311ed2023..b7120515ef6e4ccaa78f79e0a6776d5b9e074648 100644 (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);
 static switch_status_t conference_outcall_bg(conference_obj_t * conference,
                                                                                         char *conference_name,
-                                                                                        switch_core_session_t *session, char *bridgeto, uint32_t timeout, char *flags, char *cid_name, char *cid_num);
+                                                                                        switch_core_session_t *session, char *bridgeto, uint32_t timeout, const char *flags, const char *cid_name, const char *cid_num);
 SWITCH_STANDARD_APP(conference_function);
 static void launch_conference_thread(conference_obj_t * conference);
 static void *SWITCH_THREAD_FUNC conference_loop_input(switch_thread_t * thread, void *obj);
@@ -1531,11 +1531,11 @@ static void conference_loop_output(conference_member_t * member)
        
 
        if ((call_list = switch_channel_get_private(channel, "_conference_autocall_list_"))) {
-               char *cid_name = switch_channel_get_variable(channel, "conference_auto_outcall_caller_id_name");
-               char *cid_num = switch_channel_get_variable(channel, "conference_auto_outcall_caller_id_number");
-               char *toval = switch_channel_get_variable(channel, "conference_auto_outcall_timeout");
-               char *flags = switch_channel_get_variable(channel, "conference_auto_outcall_flags");
-               char *ann = switch_channel_get_variable(channel, "conference_auto_outcall_announce");
+               const char *cid_name = switch_channel_get_variable(channel, "conference_auto_outcall_caller_id_name");
+               const char *cid_num = switch_channel_get_variable(channel, "conference_auto_outcall_caller_id_number");
+               const char *toval = switch_channel_get_variable(channel, "conference_auto_outcall_timeout");
+               const char *flags = switch_channel_get_variable(channel, "conference_auto_outcall_flags");
+               const char *ann = switch_channel_get_variable(channel, "conference_auto_outcall_announce");
                int to = 60;
                
                if (ann) {
@@ -3730,7 +3730,7 @@ static void *SWITCH_THREAD_FUNC conference_outcall_run(switch_thread_t * thread,
 
 static switch_status_t conference_outcall_bg(conference_obj_t * conference,
                                                                                         char *conference_name,
-                                                                                        switch_core_session_t *session, char *bridgeto, uint32_t timeout, char *flags, char *cid_name, char *cid_num)
+                                                                                        switch_core_session_t *session, char *bridgeto, uint32_t timeout, const char *flags, const char *cid_name, const char *cid_num)
 {
        struct bg_call *call = NULL;
 
index 1a73d697b7ac7edc652123e149884c8b452440fe..bd6e5ca3bad8b6447545c9c7da29f1baaf02e887 100644 (file)
@@ -259,7 +259,7 @@ SWITCH_STANDARD_APP(phrase_function)
        assert(channel != NULL);
 
        if ((mydata = switch_core_session_strdup(session, data))) {
-               char *lang;
+               const char *lang;
                char *macro = mydata;
                char *mdata = NULL;
 
@@ -445,7 +445,8 @@ SWITCH_STANDARD_APP(set_profile_var_function)
 SWITCH_STANDARD_APP(export_function)
 {
        switch_channel_t *channel;
-       char *exports, *new_exports = NULL, *new_exports_d = NULL, *var, *val = NULL, *var_name = NULL;
+       const char *exports;
+       char *new_exports = NULL, *new_exports_d = NULL, *var, *val = NULL, *var_name = NULL;
        int local = 1;
 
        channel = switch_core_session_get_channel(session);
@@ -923,9 +924,9 @@ static switch_status_t on_dtmf(switch_core_session_t *session, void *input, swit
        case SWITCH_INPUT_TYPE_DTMF:
                {
                        char *dtmf = (char *) input;
-                       char *terminators;
+                       const char *terminators;
                        switch_channel_t *channel = switch_core_session_get_channel(session);
-                       char *p;
+                       const char *p;
                        
                        assert(channel);
 
@@ -965,8 +966,8 @@ SWITCH_STANDARD_APP(speak_function)
        char buf[10];
        char *argv[4] = { 0 };
        int argc;
-       char *engine = NULL;
-       char *voice = NULL;
+       const char *engine = NULL;
+       const char *voice = NULL;
        char *text = NULL;
        char *mydata = NULL;
        switch_codec_t *codec;
@@ -1211,7 +1212,7 @@ SWITCH_STANDARD_APP(audio_bridge_function)
        switch_channel_t *caller_channel;
        switch_core_session_t *peer_session = NULL;
        unsigned int timelimit = 60;
-       char *var, *continue_on_fail = NULL;
+       const char *var, *continue_on_fail = NULL;
        uint8_t no_media_bridge = 0;
        switch_call_cause_t cause = SWITCH_CAUSE_NORMAL_CLEARING;
 
index e3334e588e18d13ace36f25b1db59e0d1e4ed39c..114ea30203f96178fab12fa94fb75d8f5ad9608e 100644 (file)
@@ -107,8 +107,8 @@ SWITCH_STANDARD_APP(fifo_function)
     fifo_node_t *node;
     switch_channel_t *channel;
     int nowait = 0;
-    char *moh = NULL;
-    char *announce = NULL;
+    const char *moh = NULL;
+    const char *announce = NULL;
     switch_event_t *event = NULL;
     char date[80] = "";
     switch_time_exp_t tm;
@@ -153,7 +153,7 @@ SWITCH_STANDARD_APP(fifo_function)
     }
 
     if (!strcasecmp(argv[1], "in")) {
-        char *uuid = strdup(switch_core_session_get_uuid(session));
+        const char *uuid = strdup(switch_core_session_get_uuid(session));
 
         switch_channel_answer(channel);
 
@@ -178,7 +178,7 @@ SWITCH_STANDARD_APP(fifo_function)
         switch_mutex_lock(node->mutex);
         node->caller_count++;
         switch_core_hash_insert(node->caller_hash, uuid, session);
-        switch_queue_push(node->fifo, uuid);
+        switch_queue_push(node->fifo, (void *)uuid);
         switch_mutex_unlock(node->mutex);
 
         ts = switch_timestamp_now();
@@ -418,8 +418,8 @@ static int xml_hash(switch_xml_t xml, switch_hash_t *hash, char *container, char
 
     for (hi = switch_hash_first(NULL, hash); hi; hi = switch_hash_next(hi)) {
         int c_off = 0, d_off = 0;
-        char *status;
-        char *ts;
+        const char *status;
+        const char *ts;
 
         switch_hash_this(hi, &var, NULL, &val);
         session = (switch_core_session_t *) val;
index ede0fba58d737a26d8b7062a12a7373920c5dd80..b7eb02ea75153dd9a66e770f69b5a78a6b3f660c 100644 (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)
 {
     char msg_count[80] = "";
@@ -1083,7 +1083,7 @@ static switch_status_t listen_file(switch_core_session_t *session, vm_profile_t
     return status;
 }
 
-static void voicemail_check_main(switch_core_session_t *session, char *profile_name, char *domain_name, char *id, int auth)
+static void voicemail_check_main(switch_core_session_t *session, const char *profile_name, const char *domain_name, const char *id, int auth)
 {
     vm_check_state_t vm_check_state = VM_CHECK_START;
     switch_channel_t *channel;
@@ -1091,8 +1091,8 @@ static void voicemail_check_main(switch_core_session_t *session, char *profile_n
     vm_profile_t *profile;
     switch_xml_t x_domain, x_domain_root, x_user, x_params, x_param;
     switch_status_t status;
-    char pass_buf[80] = "", *mypass = NULL, id_buf[80] = "", *myid = id, *myfolder = NULL;
-    const char *thepass = NULL;
+    char pass_buf[80] = "", *mypass = NULL, id_buf[80] = "", *myfolder = NULL;
+    const char *thepass = NULL, *myid = id;
     char term = 0;
     uint32_t timeout, attempts = 0;
     int failed = 0;
@@ -1522,7 +1522,7 @@ static void voicemail_check_main(switch_core_session_t *session, char *profile_n
 }
     
 
-static switch_status_t voicemail_leave_main(switch_core_session_t *session, char *profile_name, char *domain_name, char *id)
+static switch_status_t voicemail_leave_main(switch_core_session_t *session, const char *profile_name, const char *domain_name, const char *id)
 {
     switch_channel_t *channel;
     char *myfolder = "inbox";
@@ -1544,7 +1544,8 @@ static switch_status_t voicemail_leave_main(switch_core_session_t *session, char
     int email_attach = 1;
     int email_delete = 1;
     char buf[2];
-    char *greet_path = NULL, *voicemail_greeting_number = NULL;
+    char *greet_path = NULL;
+       const char *voicemail_greeting_number = NULL;
 
     memset(&cbt, 0, sizeof(cbt));
     if (!(profile = switch_core_hash_find(globals.profile_hash, profile_name))) {
@@ -1833,10 +1834,10 @@ SWITCH_STANDARD_APP(voicemail_function)
        int argc = 0;
        char *argv[6] = { 0 };
        char *mydata = NULL;
-    char *profile_name = NULL;
-    char *domain_name = NULL;
-    char *id = NULL;
-    char *auth_var = NULL;
+    const char *profile_name = NULL;
+    const char *domain_name = NULL;
+    const char *id = NULL;
+    const char *auth_var = NULL;
     int x = 0, check = 0, auth = 0;
     switch_channel_t *channel;
 
index c2315b59ae4bd2212e8655c7039a14b90c6d206e..c6cabcf2faf32e45af476d2adb1fde79bdd0bdea 100644 (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;
        mrcp_client_channel_t *tts_channel;
@@ -749,7 +749,7 @@ static void openmrcp_flush_tts(switch_speech_handle_t *sh)
        synth_stop(context, tts_session); // TODO
 }
 
-static void openmrcp_text_param_tts(switch_speech_handle_t *sh, char *param, char *val)
+static void openmrcp_text_param_tts(switch_speech_handle_t *sh, char *param, const char *val)
 {
 
 }
index d64222bdbc0e057916ef4efa38cb2c711c7f4842..0d848e127cb498deb2d4ce5d5153a20eb51efbb2 100644 (file)
@@ -59,7 +59,7 @@ static int parse_exten(switch_core_session_t *session, switch_caller_profile_t *
                char *field = NULL;
                char *do_break_a = NULL;
                char *expression = NULL;
-               char *field_data = NULL;
+               const char *field_data = NULL;
                switch_regex_t *re = NULL;
                int ovector[30];
                break_t do_break_i = BREAK_ON_FALSE;
@@ -186,8 +186,8 @@ static switch_status_t dialplan_xml_locate(switch_core_session_t *session, switc
        switch_stream_handle_t stream = { 0 };
        switch_size_t encode_len = 1024, new_len = 0;
        char *encode_buf = NULL;
-       char *prof[12] = { 0 }, *prof_names[12] = {
-       0}, *e = NULL;
+       const char *prof[12] = { 0 }, *prof_names[12] = {0};
+       char *e = NULL;
        switch_event_header_t *hi;
        uint32_t x = 0;
 
index e563a8f4136836a2dfd8d4f06a80c37ed81b0e6d..52d558af85ce852062b7bb754b02f7f193adbb5d 100644 (file)
@@ -1614,9 +1614,8 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
                char sess_id[11] = "";
                char *dnis = NULL;
                char workspace[1024] = "";
-               char *p, *u, ubuf[512] = "", *user = NULL;
-               char *cid_msg = NULL, *f_cid_msg = NULL;
-
+               char *p, *u, ubuf[512] = "", *user = NULL, *f_cid_msg = NULL;
+               const char *cid_msg = NULL;
                switch_copy_string(workspace, outbound_profile->destination_number, sizeof(workspace));
                profile_name = workspace;
 
@@ -1649,7 +1648,7 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
                                user = ldl_handle_get_login(mdl_profile->handle);
                        } else {
                                if (!user) {
-                                       char *id_num;
+                                       const char *id_num;
                                        
                                        if (!(id_num = outbound_profile->caller_id_number)) {
                                                if (!(id_num = outbound_profile->caller_id_name)) {
index 80db60d5cb01c860632bf80e7c54e0a1aca65c9e..b3d7faff63e2de1fd5307d4806797e6d1ce3a2ff 100644 (file)
@@ -170,7 +170,7 @@ static switch_status_t channel_on_init(switch_core_session_t *session)
        switch_time_t last;
        int waitsec = globals.ring_interval * 1000000;
        switch_file_handle_t fh = { 0 };
-       char *val, *ring_file = NULL, *hold_file = NULL;
+       const char *val, *ring_file = NULL, *hold_file = NULL;
        int16_t abuf[2048];
 
        tech_pvt = switch_core_session_get_private(session);
@@ -767,7 +767,7 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
 
                if (outbound_profile) {
                        char name[128];
-                       char *id = !switch_strlen_zero(outbound_profile->caller_id_number) ? outbound_profile->caller_id_number : "na";
+                       const char *id = !switch_strlen_zero(outbound_profile->caller_id_number) ? outbound_profile->caller_id_number : "na";
                        snprintf(name, sizeof(name), "PortAudio/%s", id);
 
                        switch_channel_set_name(channel, name);
@@ -1522,8 +1522,8 @@ static switch_status_t list_calls(char **argv, int argc, switch_stream_handle_t
 {
        private_t *tp;
        int x = 0;
-       char *cid_name = "n/a";
-       char *cid_num = "n/a";
+       const char *cid_name = "n/a";
+       const char *cid_num = "n/a";
 
        switch_mutex_lock(globals.pvt_lock);
        for (tp = globals.call_list; tp; tp = tp->next) {
index b8401c2b7ffd4a7c91e04c51d2bb7343157de9b6..d6c318a423137a42ffc30352f7871c04aa93c469 100644 (file)
@@ -276,7 +276,7 @@ static switch_status_t sofia_answer_channel(switch_core_session_t *session)
        switch_channel_t *channel = NULL;
        switch_status_t status;
        uint32_t session_timeout = 0;
-       char *val;
+       const char *val;
 
        assert(session != NULL);
 
@@ -289,13 +289,13 @@ static switch_status_t sofia_answer_channel(switch_core_session_t *session)
                switch_set_flag_locked(tech_pvt, TFLAG_ANS);
 
                if (switch_channel_test_flag(channel, CF_BYPASS_MEDIA)) {
-                       char *sdp = NULL;
+                       const char *sdp = NULL;
                        if ((sdp = switch_channel_get_variable(channel, SWITCH_B_SDP_VARIABLE))) {
                                tech_pvt->local_sdp_str = switch_core_session_strdup(session, sdp);
                        }
                } else {
                        if (switch_test_flag(tech_pvt, TFLAG_LATE_NEGOTIATION)) {
-                               char *r_sdp = switch_channel_get_variable(channel, SWITCH_R_SDP_VARIABLE);
+                               const char *r_sdp = switch_channel_get_variable(channel, SWITCH_R_SDP_VARIABLE);
                                tech_pvt->num_codecs = 0;
                                sofia_glue_tech_prepare_codecs(tech_pvt);
                                if (sofia_glue_tech_media(tech_pvt, r_sdp) != SWITCH_STATUS_SUCCESS) {
@@ -694,7 +694,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
 
        switch (msg->message_id) {
        case SWITCH_MESSAGE_INDICATE_BROADCAST: {
-               char *ip = NULL, *port = NULL;
+               const char *ip = NULL, *port = NULL;
                ip = switch_channel_get_variable(channel, SWITCH_REMOTE_MEDIA_IP_VARIABLE);
                port = switch_channel_get_variable(channel, SWITCH_REMOTE_MEDIA_PORT_VARIABLE);
                if (ip && port) {
@@ -708,10 +708,10 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
                break;
        case SWITCH_MESSAGE_INDICATE_NOMEDIA: 
                {
-                       char *uuid;
+                       const char *uuid;
                        switch_core_session_t *other_session;
                        switch_channel_t *other_channel;
-                       char *ip = NULL, *port = NULL;
+                       const char *ip = NULL, *port = NULL;
 
                        if (switch_channel_get_state(channel) >= CS_HANGUP) {
                                return SWITCH_STATUS_FALSE;
@@ -894,13 +894,13 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
 
                                /* Transmit 183 Progress with SDP */
                                if (switch_channel_test_flag(channel, CF_BYPASS_MEDIA)) {
-                                       char *sdp = NULL;
+                                       const char *sdp = NULL;
                                        if ((sdp = switch_channel_get_variable(channel, SWITCH_B_SDP_VARIABLE))) {
                                                tech_pvt->local_sdp_str = switch_core_session_strdup(session, sdp);
                                        }
                                } else {
                                        if (switch_test_flag(tech_pvt, TFLAG_LATE_NEGOTIATION)) {
-                                               char *r_sdp = switch_channel_get_variable(channel, SWITCH_R_SDP_VARIABLE);
+                                               const char *r_sdp = switch_channel_get_variable(channel, SWITCH_R_SDP_VARIABLE);
                                                tech_pvt->num_codecs = 0;
                                                sofia_glue_tech_prepare_codecs(tech_pvt);
                                                if (sofia_glue_tech_media(tech_pvt, r_sdp) != SWITCH_STATUS_SUCCESS) {
index e46150c666ad33bc9cd9e12008059834ff7c5cc1..fab9d22bb7fe600e7fd99ef01f34c23ce5acb98b 100644 (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_set_local_sdp(private_object_t *tech_pvt, char *ip, uint32_t port, char *sr, int force);
+void sofia_glue_set_local_sdp(private_object_t *tech_pvt, const char *ip, uint32_t port, const char *sr, int force);
 
 void sofia_glue_tech_prepare_codecs(private_object_t *tech_pvt);
 
@@ -432,7 +432,7 @@ void launch_sofia_profile_thread(sofia_profile_t *profile);
 
 switch_status_t sofia_presence_chat_send(char *proto, char *from, char *to, char *subject, char *body, char *hint);
 void sofia_glue_tech_absorb_sdp(private_object_t *tech_pvt);
-switch_status_t sofia_glue_tech_media(private_object_t *tech_pvt, char *r_sdp);
+switch_status_t sofia_glue_tech_media(private_object_t *tech_pvt, const char *r_sdp);
 char *sofia_reg_find_reg_url(sofia_profile_t *profile, const char *user, const char *host, char *val, switch_size_t len);
 void event_handler(switch_event_t *event);
 void sofia_presence_event_handler(switch_event_t *event);
index fe0f4df473264fbaacba4fbb632af92856fe7256..2220052bd3b952956b7a8ac58b61d4ba5cb58c35 100644 (file)
@@ -1122,7 +1122,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
        switch_channel_t *channel = NULL;
        private_object_t *tech_pvt = NULL;
        const char *replaces_str = NULL;
-       char *uuid;
+       const char *uuid;
        switch_core_session_t *other_session = NULL;
        switch_channel_t *other_channel = NULL;
        char st[80] = "";
@@ -1163,7 +1163,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
        
 
        if (channel && (status == 180 || status == 183) && switch_channel_test_flag(channel, CF_OUTBOUND)) {
-               char *val;
+               const char *val;
                if ((val = switch_channel_get_variable(channel, "sip_auto_answer")) && switch_true(val)) {
                        nua_notify(nh, NUTAG_NEWSUB(1), NUTAG_SUBSTATE(nua_substate_active), SIPTAG_EVENT_STR("talk"), TAG_END());
                }
@@ -1276,7 +1276,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
                                                                }
                                                                
                                                                if ((b_private = nua_handle_magic(bnh))) {
-                                                                       char *br_b = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE);
+                                                                       const char *br_b = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE);
                                                                        char *br_a = b_private->uuid;
                                                                        
                                                                        if (br_b) {
@@ -1544,7 +1544,7 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t
                        char *rep;
 
                        if ((rep = strchr(refer_to->r_url->url_headers, '='))) {
-                               char *br_a = NULL, *br_b = NULL;
+                               const char *br_a = NULL, *br_b = NULL;
                                char *buf;
 
                                rep++;
@@ -1597,7 +1597,7 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t
                                                        } else {
                                                                switch_core_session_t *t_session;
                                                                switch_channel_t *hup_channel;
-                                                               char *ext;
+                                                               const char *ext;
 
                                                                if (br_a && !br_b) {
                                                                        t_session = switch_core_session_locate(br_a);
@@ -1691,7 +1691,7 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t
 
        if (exten) {
                switch_channel_t *channel = switch_core_session_get_channel(session);
-               char *br;
+               const char *br;
 
                if ((br = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))) {
                        switch_core_session_t *b_session;
@@ -2040,7 +2040,7 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_
        }
 
        if (sip->sip_to && sip->sip_to->a_url) {
-               char *val;
+               const char *val;
                char *transport = (my_addrinfo->ai_socktype == SOCK_STREAM) ? "tcp" : "udp";
                
                url_set_chanvars(session, sip->sip_to->a_url, sip_to);
index a575c4648cdf21f9a13943adc6a35f86021a78c1..0eebffc14672e52a828c8946f2b1a3457d67e1e8 100644 (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_set_video_codec(private_object_t *tech_pvt, int force);
 
-void sofia_glue_set_local_sdp(private_object_t *tech_pvt, char *ip, uint32_t port, char *sr, int force)
+void sofia_glue_set_local_sdp(private_object_t *tech_pvt, const char *ip, uint32_t port, const char *sr, int force)
 {
        char buf[2048];
        int ptime = 0;
@@ -256,8 +256,8 @@ void sofia_glue_set_local_sdp(private_object_t *tech_pvt, char *ip, uint32_t por
 
 void sofia_glue_tech_prepare_codecs(private_object_t *tech_pvt)
 {
-       char *abs, *codec_string = NULL;
-       char *ocodec = NULL;
+       const char *abs, *codec_string = NULL;
+       const char *ocodec = NULL;
 
        if (switch_channel_test_flag(tech_pvt->channel, CF_BYPASS_MEDIA)) {
                goto end;
@@ -466,13 +466,13 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
        char *rpid = NULL;
        char *alert_info = NULL;
        char *max_forwards = NULL;
-       char *alertbuf;
-       char *forwardbuf;
+       const char *alertbuf;
+       const char *forwardbuf;
        int forwardval;
        private_object_t *tech_pvt;
        switch_channel_t *channel = NULL;
        switch_caller_profile_t *caller_profile;
-       char *cid_name, *cid_num;
+       const char *cid_name, *cid_num;
        char *e_dest = NULL;
        const char *holdstr = "";
        switch_stream_handle_t stream = { 0 };
@@ -480,8 +480,8 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
        char *extra_headers = NULL;
        switch_status_t status = SWITCH_STATUS_FALSE;
        uint32_t session_timeout = 0;
-       char *val;
-       char *rep;
+       const char *val;
+       const char *rep;
 
        channel = switch_core_session_get_channel(session);
        assert(channel != NULL);
@@ -495,8 +495,8 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
 
        caller_profile = switch_channel_get_caller_profile(channel);
 
-       cid_name = (char *) caller_profile->caller_id_name;
-       cid_num = (char *) caller_profile->caller_id_number;
+       cid_name = caller_profile->caller_id_name;
+       cid_num = caller_profile->caller_id_number;
        sofia_glue_tech_prepare_codecs(tech_pvt);
 
        if (!tech_pvt->from_str) {
@@ -550,7 +550,8 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
                char *d_url = NULL, *url = NULL;
                sofia_private_t *sofia_private;
                char *invite_contact = NULL, *to_str, *use_from_str, *from_str, *url_str;
-               char *transport = "udp", *t_var, *d_contact = NULL;
+               const char *transport = "udp", *t_var;
+               char *d_contact = NULL;
 
                if (switch_strlen_zero(tech_pvt->dest)) {
                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "URL Error! [%s]\n", tech_pvt->dest);
@@ -723,7 +724,7 @@ void sofia_glue_do_xfer_invite(switch_core_session_t *session)
                                                                                                                  (char *) caller_profile->caller_id_number,
                                                                                                                  tech_pvt->profile->extsipip ? tech_pvt->profile->extsipip : tech_pvt->profile->sipip))) {
 
-               char *rep = switch_channel_get_variable(channel, SOFIA_REPLACES_HEADER);
+               const char *rep = switch_channel_get_variable(channel, SOFIA_REPLACES_HEADER);
 
                tech_pvt->nh2 = nua_handle(tech_pvt->profile->nua, NULL,
                                                                   SIPTAG_TO_STR(tech_pvt->dest), SIPTAG_FROM_STR(tech_pvt->from_str), SIPTAG_CONTACT_STR(tech_pvt->profile->url),
@@ -744,8 +745,7 @@ void sofia_glue_do_xfer_invite(switch_core_session_t *session)
 
 void sofia_glue_tech_absorb_sdp(private_object_t *tech_pvt)
 {
-       char *sdp_str;
-
+       const char *sdp_str;
 
        if ((sdp_str = switch_channel_get_variable(tech_pvt->channel, SWITCH_B_SDP_VARIABLE))) {
                sdp_parser_t *parser;
@@ -933,7 +933,7 @@ switch_status_t sofia_glue_activate_rtp(private_object_t *tech_pvt, switch_rtp_f
 {
        int bw, ms;
        const char *err = NULL;
-       char *val = NULL;
+       const char *val = NULL;
        switch_rtp_flag_t flags;
        switch_status_t status;
        char tmp[50];
@@ -1129,7 +1129,7 @@ switch_status_t sofia_glue_activate_rtp(private_object_t *tech_pvt, switch_rtp_f
        return SWITCH_STATUS_SUCCESS;
 }
 
-switch_status_t sofia_glue_tech_media(private_object_t *tech_pvt, char *r_sdp)
+switch_status_t sofia_glue_tech_media(private_object_t *tech_pvt, const char *r_sdp)
 {
        sdp_parser_t *parser = NULL;
        sdp_session_t *sdp;
@@ -1182,7 +1182,7 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, sdp_session_t *
        int sendonly = 0;
        int greedy = 0, x = 0, skip = 0, mine = 0;
        switch_channel_t *channel = NULL;
-       char *val;
+       const char *val;
 
        tech_pvt = switch_core_session_get_private(session);
        assert(tech_pvt != NULL);
@@ -1225,7 +1225,7 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, sdp_session_t *
 
        if (sendonly) {
                if (!switch_test_flag(tech_pvt, TFLAG_SIP_HOLD)) {
-                       char *stream;
+                       const char *stream;
                        switch_set_flag_locked(tech_pvt, TFLAG_SIP_HOLD);
                        if (tech_pvt->max_missed_packets) {
                                switch_rtp_set_max_missed_packets(tech_pvt->rtp_session, tech_pvt->max_missed_packets * 10);
@@ -1557,7 +1557,7 @@ switch_call_cause_t sofia_glue_sip_cause_to_freeswitch(int status)
 
 void sofia_glue_pass_sdp(private_object_t *tech_pvt, char *sdp)
 {
-       char *val;
+       const char *val;
        switch_core_session_t *other_session;
        switch_channel_t *other_channel;
 
index 31a3b3b6ed12babd19f413a86f443f2dba76d35b..f286674879ea3e437fa1f88b926a63e223cdddb8 100644 (file)
@@ -309,7 +309,7 @@ void BaseCDR::process_channel_variables(const std::list<std::string>& stringlist
                tempstringvector.push_back('\0');
                char* tempstring= &tempstringvector[0];
 
-               char *tempvariable;
+               const char *tempvariable;
                tempvariable = switch_channel_get_variable(channel,tempstring);
                
                
@@ -350,7 +350,7 @@ void BaseCDR::process_channel_variables(const std::list<std::string>& stringlist
                        tempstringvector.push_back('\0');
                        char* tempstring= &tempstringvector[0];
 
-                       char *tempvariable;
+                       const char *tempvariable;
                        tempvariable = switch_channel_get_variable(channel,tempstring);
                        if (!switch_strlen_zero(tempvariable))
                                chanvars_supp[*iItr] = tempvariable;
index 7262f18d60694c60c57c9863cc8a1ee59f0a9038..014d8206bbcaf1af979cc07f9c213379244e519a 100644 (file)
@@ -631,7 +631,7 @@ static switch_status_t parse_command(listener_t * listener, switch_event_t *even
                        goto done;
                } else if (!strncasecmp(cmd, "getvar", 6)) {
                        char *arg;
-                       char *val = "";
+                       const char *val = "";
 
                        strip_cr(cmd);
 
index 934f00777ada9b11ba13d5fb860f8f4d77c15214..965e98c485e1cb9797cfdc74ae8c866bb29df5be 100644 (file)
@@ -143,7 +143,7 @@ static void *SWITCH_THREAD_FUNC read_stream_thread(switch_thread_t *thread, void
        return NULL;
 }
 
-static switch_status_t local_stream_file_open(switch_file_handle_t *handle, char *path)
+static switch_status_t local_stream_file_open(switch_file_handle_t *handle, const char *path)
 {
        local_stream_context_t *context;
        local_stream_source_t *source;
index 280c054386423ed389e0c75b1f29384422f61a52..8572a2ce135f0f7268aa45c5cdd66c81a1e14528 100644 (file)
@@ -40,7 +40,7 @@ struct native_file_context {
 
 typedef struct native_file_context native_file_context;
 
-static switch_status_t native_file_file_open(switch_file_handle_t *handle, char *path)
+static switch_status_t native_file_file_open(switch_file_handle_t *handle, const char *path)
 {
        native_file_context *context;
        char *ext;
index b04764fb7fa0b862bb270e1b84fdf97b449811b7..686aa2fba4fa149b51a8193ce0a198f37a32a36f 100644 (file)
@@ -55,7 +55,7 @@ struct sndfile_context {
 
 typedef struct sndfile_context sndfile_context;
 
-static switch_status_t sndfile_file_open(switch_file_handle_t *handle, char *path)
+static switch_status_t sndfile_file_open(switch_file_handle_t *handle, const char *path)
 {
        sndfile_context *context;
        int mode = 0;
index 58628178de1bd36537d6fea9baa2dc8e3132c9d0..d8c9b1fc47907008a3796c7de0fe8e07679ff66d 100644 (file)
@@ -1524,7 +1524,8 @@ static JSBool session_streamfile(JSContext * cx, JSObject * obj, uintN argc, jsv
        switch_file_handle_t fh = { 0 };
        JSFunction *function;
        switch_input_args_t args = { 0 };
-       char *prebuf, posbuf[35] = "";
+       const char *prebuf;
+       char posbuf[35] = "";
        
        METHOD_SANITY_CHECK();
 
@@ -1627,7 +1628,7 @@ static JSBool session_get_variable(JSContext * cx, JSObject * obj, uintN argc, j
        assert(channel != NULL);
 
        if (argc > 0) {
-               char *var, *val;
+               const char *var, *val;
 
                var = JS_GetStringBytes(JS_ValueToString(cx, argv[0]));
                val = switch_channel_get_variable(channel, var);
@@ -2510,16 +2511,16 @@ static JSBool session_originate(JSContext * cx, JSObject * obj, uintN argc, jsva
                JSObject *session_obj;
                switch_core_session_t *session = NULL, *peer_session = NULL;
                switch_caller_profile_t *caller_profile = NULL, *orig_caller_profile = NULL;
-               char *dest = NULL;
-               char *dialplan = NULL;
-               char *cid_name = "";
-               char *cid_num = "";
-               char *network_addr = "";
-               char *ani = "";
-               char *aniii = "";
-               char *rdnis = "";
-               char *context = "";
-               char *username = NULL;
+               const char *dest = NULL;
+               const char *dialplan = NULL;
+               const char *cid_name = "";
+               const char *cid_num = "";
+               const char *network_addr = "";
+               const char *ani = "";
+               const char *aniii = "";
+               const char *rdnis = "";
+               const char *context = "";
+               const char *username = NULL;
                char *to = NULL;
                char *tmp;
                        
@@ -3109,10 +3110,11 @@ static int env_init(JSContext * cx, JSObject * javascript_object)
        return 1;
 }
 
-static void js_parse_and_execute(switch_core_session_t *session, char *input_code, struct request_obj *ro)
+static void js_parse_and_execute(switch_core_session_t *session, const char *input_code, struct request_obj *ro)
 {
        JSObject *javascript_global_object = NULL;
-       char buf[1024], *script, *arg, *argv[512];
+       char buf[1024], *arg, *argv[512];
+       const char *script;
        int argc = 0, x = 0, y = 0;
        unsigned int flags = 0;
        struct js_session jss;
@@ -3172,9 +3174,9 @@ static void js_parse_and_execute(switch_core_session_t *session, char *input_cod
        }
 }
 
-static void js_dp_function(switch_core_session_t *session, char *input_code)
+SWITCH_STANDARD_APP(js_dp_function)
 {
-       js_parse_and_execute(session, input_code, NULL);
+       js_parse_and_execute(session, data, NULL);
 }
 
 static void *SWITCH_THREAD_FUNC js_thread_run(switch_thread_t * thread, void *obj)
index eb2a1cba0635beb7da8a2cd2b2adc54533c61176..cd2ebf1f0e10c879e5c09f6d8d842513e1aabf27 100644 (file)
@@ -71,12 +71,12 @@ SWITCH_BEGIN_EXTERN_C
 #else //not win32
 #define SWITCH_SM_DECLARE(type) type
 #endif
-int eval_some_js(char *code, JSContext * cx, JSObject * obj, jsval * rval)
+int eval_some_js(const char *code, JSContext * cx, JSObject * obj, jsval * rval)
 {
        JSScript *script = NULL;
-       char *cptr;
+       const char *cptr;
        char *path = NULL;
-       char *script_name = NULL;
+       const char *script_name = NULL;
        int result = 0;
 
        JS_ClearPendingException(cx);
index d0645dadf2739752851b9396eb3b7bea7d418705..e7e90fb87c50c88fd012e152f8c4f3d6082b5ac8 100644 (file)
@@ -65,7 +65,7 @@ static switch_status_t my_on_hangup(switch_core_session_t *session)
        char *xml_text = NULL;
        char *path = NULL;
        char *curl_xml_text = NULL;
-       char *logdir = NULL;
+       const char *logdir = NULL;
        char *xml_text_escaped = NULL;
        int fd = -1;
        uint32_t cur_try;
index a8bdc26ca52c353b972f2ada70dc80a41ca14522..789db97f588e9ab49499be6a6a7015a7ae4f0dbd 100644 (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")) {
                return caller_profile->dialplan;
index abd7502f57f8fdd46b8631349635eef4dbf649a4..8a287c705dd150bc78735fb21e56543651767999 100644 (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)
 {
-       char *id = switch_channel_get_variable(channel, "presence_id");
+       const char *id = switch_channel_get_variable(channel, "presence_id");
        switch_event_t *event;
        switch_event_types_t type = SWITCH_EVENT_PRESENCE_IN;
 
@@ -319,9 +319,9 @@ SWITCH_DECLARE(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);
 
        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)
 {
-       char *uuid;
+       const char *uuid;
 
        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)
 {
-       char *uuid;
+       const char *uuid;
 
        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);
 
        if (!switch_channel_test_flag(channel, CF_EARLY_MEDIA)) {
-               char *uuid;
+               const char *uuid;
                switch_core_session_t *other_session;
 
                switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, NULL, SWITCH_LOG_NOTICE, "Pre-Answer %s!\n", channel->name);
@@ -1184,7 +1184,7 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_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_event_t *event;
-       char *uuid;
+       const char *uuid;
        switch_core_session_t *other_session;
 
        assert(channel != NULL);
@@ -1268,7 +1268,8 @@ SWITCH_DECLARE(char *) switch_channel_expand_variables(switch_channel_t *channel
        char *q, *p, *c = NULL;
        char *data, *indup;
        size_t sp = 0, len = 0, olen = 0, vtype = 0, br = 0, cpos, block = 128;
-       char *sub_val = NULL, *func_val = NULL;
+       const char *sub_val = NULL;
+       char *func_val = NULL;
        int nv = 0;
 
        q = in;
index 3c5d68492f405a53c0fc136779aa5f7cb961f33c..3e8b1c9af31db75edd926eb32ec408533b3ad1d8 100644 (file)
@@ -35,7 +35,7 @@
 #include "private/switch_core_pvt.h"
 
 SWITCH_DECLARE(switch_status_t) switch_core_file_open(switch_file_handle_t *fh,
-                                                                                                         char *file_path, uint8_t channels, uint32_t rate, unsigned int flags, switch_memory_pool_t *pool)
+                                                                                                         const char *file_path, uint8_t channels, uint32_t rate, unsigned int flags, switch_memory_pool_t *pool)
 {
        char *ext;
        switch_status_t status;
index 4d125fbdd9987d6564144d5cf55e0475fbd4705b..6f1d66ce7d88e9e98eaed000a113c8d8a6c1bf93 100644 (file)
@@ -194,7 +194,7 @@ SWITCH_DECLARE(switch_call_cause_t) switch_core_session_outgoing_channel(switch_
                if (session) {
                        channel = switch_core_session_get_channel(session);
                        if (caller_profile) {
-                               char *ecaller_id_name = NULL, *ecaller_id_number = NULL;
+                               const char *ecaller_id_name = NULL, *ecaller_id_number = NULL;
 
                                ecaller_id_name = switch_channel_get_variable(channel, "effective_caller_id_name");
                                ecaller_id_number = switch_channel_get_variable(channel, "effective_caller_id_number");
@@ -247,7 +247,7 @@ SWITCH_DECLARE(switch_call_cause_t) switch_core_session_outgoing_channel(switch_
                }
 
                if (channel && peer_channel) {
-                       char *export_vars, *val;
+                       const char *export_vars, *val;
                        switch_codec_t *read_codec = switch_core_session_get_read_codec(session);
 
                        if (read_codec) {
@@ -270,7 +270,7 @@ SWITCH_DECLARE(switch_call_cause_t) switch_core_session_outgoing_channel(switch_
                                        int x;
 
                                        for (x = 0; x < argc; x++) {
-                                               char *val;
+                                               const char *val;
                                                if ((val = switch_channel_get_variable(channel, argv[x]))) {
                                                        char *var = argv[x];
                                                        if (!strncasecmp(var, "nolocal:", 8)) {
@@ -344,7 +344,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_pass_indication(switch_core_
 {
        switch_core_session_message_t msg = {0};
        switch_core_session_t *other_session;
-       char *uuid;
+       const char *uuid;
        switch_channel_t *channel;
        switch_status_t status = SWITCH_STATUS_SUCCESS;
 
@@ -900,7 +900,7 @@ SWITCH_DECLARE(switch_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,
-                                                                                                                const switch_application_interface_t *application_interface, char *arg) {
+                                                                                                                const switch_application_interface_t *application_interface, const char *arg) {
        switch_app_log_t *log, *lp;
        switch_event_t *event;
        switch_channel_t *channel;
index b079d63990b37b877208f9e8b3023fa6497c908c..0fc03584c4ae33cc44c0f066be8e375ee1dc14ee 100644 (file)
@@ -36,8 +36,8 @@
 
 
 SWITCH_DECLARE(switch_status_t) switch_core_speech_open(switch_speech_handle_t *sh,
-                                                                                                               char *module_name,
-                                                                                                               char *voice_name, 
+                                                                                                               const char *module_name,
+                                                                                                               const char *voice_name, 
                                                                                                                unsigned int rate,
                                                                                                                unsigned int interval,
                                                                                                                switch_speech_flag_t *flags, 
@@ -101,7 +101,7 @@ SWITCH_DECLARE(void) switch_core_speech_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);
 
index e28fde59ffffcc1d3e90e0881813abc37c96cdc9..c4f438b79f4cc841485944ccf450044c1a557092 100644 (file)
@@ -34,7 +34,7 @@
 #include <switch.h>
 #include "private/switch_core_pvt.h"
 
-SWITCH_DECLARE(switch_status_t) switch_core_timer_init(switch_timer_t *timer, char *timer_name, int interval, int samples, switch_memory_pool_t *pool)
+SWITCH_DECLARE(switch_status_t) switch_core_timer_init(switch_timer_t *timer, const char *timer_name, int interval, int samples, switch_memory_pool_t *pool)
 {
        switch_timer_interface_t *timer_interface;
        switch_status_t status;
index 81deb425c824909f94252af1ad6ef0c21784af79..d705ab02e208b48482cdf9f44372a2c865dceed5 100644 (file)
@@ -45,7 +45,7 @@
 
 CoreSession::CoreSession()
 {
-       init_vars();
+       do { session = NULL; channel = NULL; uuid = NULL; tts_name = NULL; voice_name = NULL; memset(&args, 0, sizeof(args)); ap = NULL; caller_profile.source = "mod_unknown";  caller_profile.dialplan = ""; caller_profile.context = ""; caller_profile.caller_id_name = ""; caller_profile.caller_id_number = ""; caller_profile.network_addr = ""; caller_profile.ani = ""; caller_profile.aniii = ""; caller_profile.rdnis = "";  caller_profile.username = ""; on_hangup = NULL; cb_state.function = NULL; } while(0);
 }
 
 CoreSession::CoreSession(char *nuuid)
@@ -113,7 +113,7 @@ void CoreSession::setVariable(char *var, char *val)
     switch_channel_set_variable(channel, var, val);
 }
 
-char *CoreSession::getVariable(char *var)
+const char *CoreSession::getVariable(char *var)
 {
        sanity_check(NULL);
     return switch_channel_get_variable(channel, var);
@@ -269,7 +269,7 @@ int CoreSession::streamFile(char *file, int starting_sample_count) {
 
     switch_status_t status;
     switch_file_handle_t fh = { 0 };
-       char *prebuf;
+       const char *prebuf;
 
     sanity_check(-1);
     fh.samples = starting_sample_count;
index 7c91866c35ab0cc43a6e49e933387caef05dc09e..a3710dba73c047aeae20dae613b872b6a777f810 100644 (file)
@@ -696,7 +696,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_hold(switch_core_session_t *session)
        return SWITCH_STATUS_SUCCESS;
 }
 
-SWITCH_DECLARE(switch_status_t) switch_ivr_hold_uuid(char *uuid)
+SWITCH_DECLARE(switch_status_t) switch_ivr_hold_uuid(const char *uuid)
 {
        switch_core_session_t *session;
 
@@ -727,7 +727,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_unhold(switch_core_session_t *session
        return SWITCH_STATUS_SUCCESS;
 }
 
-SWITCH_DECLARE(switch_status_t) switch_ivr_unhold_uuid(char *uuid)
+SWITCH_DECLARE(switch_status_t) switch_ivr_unhold_uuid(const char *uuid)
 {
        switch_core_session_t *session;
 
@@ -739,9 +739,9 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_unhold_uuid(char *uuid)
        return SWITCH_STATUS_SUCCESS;
 }
 
-SWITCH_DECLARE(switch_status_t) switch_ivr_media(char *uuid, switch_media_flag_t flags)
+SWITCH_DECLARE(switch_status_t) switch_ivr_media(const char *uuid, switch_media_flag_t flags)
 {
-       char *other_uuid = NULL;
+       const char *other_uuid = NULL;
        switch_channel_t *channel, *other_channel = NULL;
        switch_core_session_t *session, *other_session;
        switch_core_session_message_t msg = { 0 };
@@ -791,9 +791,9 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_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_core_session_t *session, *other_session = NULL;
        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;
 }
 
-SWITCH_DECLARE(switch_status_t) switch_ivr_session_transfer(switch_core_session_t *session, char *extension, char *dialplan, char *context)
+SWITCH_DECLARE(switch_status_t) switch_ivr_session_transfer(switch_core_session_t *session, const char *extension, char *dialplan, char *context)
 {
        switch_channel_t *channel;
        switch_caller_profile_t *profile, *new_profile;
        switch_core_session_message_t msg = { 0 };
        switch_core_session_t *other_session;
        switch_channel_t *other_channel = NULL;
-       char *uuid = NULL;
+       const char *uuid = NULL;
 
        assert(session != NULL);
        switch_core_session_reset(session);
@@ -941,7 +941,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_transfer_variable(switch_core_session
 {
        switch_channel_t *chana = switch_core_session_get_channel(sessa);
        switch_channel_t *chanb = switch_core_session_get_channel(sessb);
-       char *val = NULL;
+       const char *val = NULL;
        uint8_t prefix = 0;
 
        if (var && *var == '~') {
index 32dddf49987bd3c82a5157bad2a8dbfb98328833..a323eafda3d3ec4216aedca7a49a89ff8911c8b2 100644 (file)
@@ -163,7 +163,7 @@ static switch_bool_t displace_callback(switch_media_bug_t *bug, void *user_data,
        return SWITCH_TRUE;
 }
 
-SWITCH_DECLARE(switch_status_t) switch_ivr_stop_displace_session(switch_core_session_t *session, char *file)
+SWITCH_DECLARE(switch_status_t) switch_ivr_stop_displace_session(switch_core_session_t *session, const char *file)
 {
        switch_media_bug_t *bug;
        switch_channel_t *channel = switch_core_session_get_channel(session);
@@ -277,7 +277,7 @@ static switch_bool_t record_callback(switch_media_bug_t *bug, void *user_data, s
        return SWITCH_TRUE;
 }
 
-SWITCH_DECLARE(switch_status_t) switch_ivr_stop_record_session(switch_core_session_t *session, char *file)
+SWITCH_DECLARE(switch_status_t) switch_ivr_stop_record_session(switch_core_session_t *session, const char *file)
 {
        switch_media_bug_t *bug;
        switch_channel_t *channel = switch_core_session_get_channel(session);
@@ -297,7 +297,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_session(switch_core_session_t
 {
        switch_channel_t *channel;
        switch_codec_t *read_codec;
-       char *p;
+       const char *p;
        const char *vval;
        switch_media_bug_t *bug;
        switch_status_t status;
@@ -1071,7 +1071,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech(switch_core_session_t *
        switch_status_t status;
        switch_asr_flag_t flags = SWITCH_ASR_FLAG_NONE;
        struct speech_thread_handle *sth;
-       char *val;
+       const char *val;
 
        if (!ah) {
                if (!(ah = switch_core_session_alloc(session, sizeof(*ah)))) {
@@ -1145,7 +1145,7 @@ SWITCH_STANDARD_SCHED_FUNC(sch_hangup_callback)
 {
        struct hangup_helper *helper;
        switch_core_session_t *session, *other_session;
-       char *other_uuid;
+       const char *other_uuid;
 
        assert(task);
 
@@ -1170,7 +1170,7 @@ SWITCH_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;
        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;
        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);
 }
 
-SWITCH_DECLARE(switch_status_t) switch_ivr_broadcast(char *uuid, char *path, switch_media_flag_t flags)
+SWITCH_DECLARE(switch_status_t) switch_ivr_broadcast(const char *uuid, const char *path, switch_media_flag_t flags)
 {
        switch_channel_t *channel;
        int nomedia;
        switch_core_session_t *session, *master;
        switch_event_t *event;
        switch_core_session_t *other_session = NULL;
-       char *other_uuid = NULL;
+       const char *other_uuid = NULL;
        char *app = "playback";
 
        assert(path);
index 4e4d5b24fd28f483ad73b0fb77117be35c9024a2..133369ce12ba38f84f747d985d3162bb6e375b6a 100644 (file)
@@ -56,7 +56,7 @@ static void *audio_bridge_thread(switch_thread_t * thread, void *obj)
        switch_frame_t *read_frame;
        switch_core_session_t *session_a, *session_b;
        uint32_t loop_count = 0;
-       char *app_name = NULL, *app_arg = NULL;
+       const char *app_name = NULL, *app_arg = NULL;
 
        session_a = data->session;
        if (!(session_b = switch_core_session_locate(data->b_uuid))) {
@@ -311,7 +311,7 @@ static switch_status_t uuid_bridge_on_transmit(switch_core_session_t *session)
 {
        switch_channel_t *channel = NULL;
        switch_core_session_t *other_session;
-       char *other_uuid = NULL;
+       const char *other_uuid = NULL;
 
        channel = switch_core_session_get_channel(session);
        assert(channel != NULL);
@@ -430,7 +430,7 @@ static switch_status_t signal_bridge_on_hibernate(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_core_session_t *other_session;
        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_core_session_message_t msg = { 0 };
                const switch_application_interface_t *application_interface;
-               char *app, *data;
+               const char *app, *data;
 
                switch_channel_set_state(peer_channel, CS_HOLD);
 
@@ -683,7 +683,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_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_channel_t *originator_channel, *originatee_channel;
index 24fd591bb8c34f0f93cefe4a9a34e4590fb27116..f52f1862c9582ef0f4628aa67e4ebb1b96a2b6e8 100644 (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_core_session_t **bleg,
                                                                                                         switch_call_cause_t *cause,
-                                                                                                        char *bridgeto,
+                                                                                                        const char *bridgeto,
                                                                                                         uint32_t timelimit_sec,
                                                                                                         const switch_state_handler_table_t *table,
-                                                                                                        char *cid_name_override, char *cid_num_override, switch_caller_profile_t *caller_profile_override)
+                                                                                                        const char *cid_name_override, const char *cid_num_override, switch_caller_profile_t *caller_profile_override)
 {
        char *pipe_names[MAX_PEERS] = { 0 };
        char *data = NULL;
@@ -263,7 +263,8 @@ 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;
        switch_call_cause_t reason = SWITCH_CAUSE_UNALLOCATED;
        uint8_t to = 0;
-       char *var_val, *vars = NULL, *ringback_data = NULL;
+       char *var_val, *vars = NULL;
+       const char *ringback_data = NULL;
        switch_codec_t *read_codec = NULL;
        uint8_t sent_ring = 0, early_ok = 1;
        switch_core_session_message_t *message = NULL;
index ad066f50101173659ddaf15b932490849cef693d..b71711cedcbb4b65044a6e7a2fecc70fb0ab7059 100644 (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_xml_t cfg, xml = NULL, language, macros, macro, input, action;
        char *lname = NULL, *mname = NULL, hint_data[1024] = "", enc_hint[1024] = "";
        switch_status_t status = SWITCH_STATUS_GENERR;
-       char *old_sound_prefix = NULL, *sound_path = NULL, *tts_engine = NULL, *tts_voice = NULL, *chan_lang = NULL;
-       const char *module_name = NULL;
+       const char *old_sound_prefix = NULL, *sound_path = NULL, *tts_engine = NULL, *tts_voice = NULL;
+       const char *module_name = NULL, *chan_lang = NULL;
        switch_channel_t *channel;
        uint8_t done = 0;
 
@@ -273,8 +273,8 @@ SWITCH_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);
                                                }
                                        } else if (!strcasecmp(func, "speak-text")) {
-                                               char *my_tts_engine = (char *) switch_xml_attr(action, "tts-engine");
-                                               char *my_tts_voice = (char *) switch_xml_attr(action, "tts-voice");
+                                               const char *my_tts_engine = switch_xml_attr(action, "tts-engine");
+                                               const char *my_tts_voice = switch_xml_attr(action, "tts-voice");
                                                
                                                if (!my_tts_engine) {
                                                        my_tts_engine = tts_engine;
@@ -325,7 +325,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *se
        switch_codec_t codec, *read_codec;
        char *codec_name;
        switch_status_t status = SWITCH_STATUS_SUCCESS;
-       char *p;
+       const char *p;
        const char *vval;
        time_t start = 0;
        uint32_t org_silence_hits = 0;
@@ -357,37 +357,37 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *se
        switch_channel_answer(channel);
 
        if ((p = switch_channel_get_variable(channel, "RECORD_TITLE"))) {
-               vval = (const char *) switch_core_session_strdup(session, p);
+               vval = switch_core_session_strdup(session, p);
                switch_core_file_set_string(fh, SWITCH_AUDIO_COL_STR_TITLE, vval);
                switch_channel_set_variable(channel, "RECORD_TITLE", NULL);
        }
 
        if ((p = switch_channel_get_variable(channel, "RECORD_COPYRIGHT"))) {
-               vval = (const char *) switch_core_session_strdup(session, p);
+               vval = switch_core_session_strdup(session, p);
                switch_core_file_set_string(fh, SWITCH_AUDIO_COL_STR_COPYRIGHT, vval);
                switch_channel_set_variable(channel, "RECORD_COPYRIGHT", NULL);
        }
 
        if ((p = switch_channel_get_variable(channel, "RECORD_SOFTWARE"))) {
-               vval = (const char *) switch_core_session_strdup(session, p);
+               vval = switch_core_session_strdup(session, p);
                switch_core_file_set_string(fh, SWITCH_AUDIO_COL_STR_SOFTWARE, vval);
                switch_channel_set_variable(channel, "RECORD_SOFTWARE", NULL);
        }
 
        if ((p = switch_channel_get_variable(channel, "RECORD_ARTIST"))) {
-               vval = (const char *) switch_core_session_strdup(session, p);
+               vval = switch_core_session_strdup(session, p);
                switch_core_file_set_string(fh, SWITCH_AUDIO_COL_STR_ARTIST, vval);
                switch_channel_set_variable(channel, "RECORD_ARTIST", NULL);
        }
 
        if ((p = switch_channel_get_variable(channel, "RECORD_COMMENT"))) {
-               vval = (const char *) switch_core_session_strdup(session, p);
+               vval = switch_core_session_strdup(session, p);
                switch_core_file_set_string(fh, SWITCH_AUDIO_COL_STR_COMMENT, vval);
                switch_channel_set_variable(channel, "RECORD_COMMENT", NULL);
        }
 
        if ((p = switch_channel_get_variable(channel, "RECORD_DATE"))) {
-               vval = (const char *) switch_core_session_strdup(session, p);
+               vval = switch_core_session_strdup(session, p);
                switch_core_file_set_string(fh, SWITCH_AUDIO_COL_STR_DATE, vval);
                switch_channel_set_variable(channel, "RECORD_DATE", NULL);
        }
@@ -637,7 +637,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_gentones(switch_core_session_t *sessi
 #define FILE_BLOCKSIZE 1024 * 8
 #define FILE_BUFSIZE 1024 * 64
 
-SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *session, switch_file_handle_t *fh, char *file, switch_input_args_t *args)
+SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *session, switch_file_handle_t *fh, const char *file, switch_input_args_t *args)
 {
        switch_channel_t *channel;
        int16_t abuf[FILE_STARTSAMPLES];
@@ -659,9 +659,9 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
        char *title = "", *copyright = "", *software = "", *artist = "", *comment = "", *date = "";
        uint8_t asis = 0;
        char *ext;
-       char *prefix;
-       char *timer_name;
-       char *prebuf;
+       const char *prefix;
+       const char *timer_name;
+       const char *prebuf;
 
        channel = switch_core_session_get_channel(session);
        assert(channel != NULL);
@@ -1199,7 +1199,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text_handle(switch_core_session
        uint32_t rate = 0;
        switch_size_t extra = 0;
        char *p, *tmp = NULL;
-       char *star, *pound;
+       const char *star, *pound;
        switch_size_t starlen, poundlen;
        
        channel = switch_core_session_get_channel(session);
@@ -1467,7 +1467,7 @@ SWITCH_DECLARE(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,
-                                                                                                         char *tts_name, char *voice_name, char *text, switch_input_args_t *args)
+                                                                                                         const char *tts_name, const char *voice_name, char *text, switch_input_args_t *args)
 {
        switch_channel_t *channel;
        uint32_t rate = 0;
@@ -1483,7 +1483,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text(switch_core_session_t *ses
        switch_speech_handle_t lsh, *sh;
        switch_speech_flag_t flags = SWITCH_SPEECH_FLAG_NONE;
        switch_codec_t *read_codec;
-       char *timer_name, *var;
+       const char *timer_name, *var;
        cached_speech_handle_t *cache_obj = NULL;
        int need_create = 1, need_alloc = 1;
        
index 222b1ca5385fda5a112eeaf8ed9662e5d4ec5271..0d250828a54b22fe9efdde07a4169cbd13da704c 100644 (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;
        const char urlunsafe[] = "\r\n \"#%&+:;<=>?@[\\]^`{|}";
        const char hex[] = "0123456789ABCDEF";
index 651fba5408ba9f41dce8f4546f5a2ecf6df58ed6..6824b4c1ea0b15846fcc274e794d35bb40c1b072 100644 (file)
@@ -1229,7 +1229,7 @@ SWITCH_DECLARE(switch_status_t) switch_xml_locate(const char *section,
        return SWITCH_STATUS_FALSE;
 }
 
-SWITCH_DECLARE(switch_status_t) switch_xml_locate_domain(char *domain_name, char *params, switch_xml_t *root, switch_xml_t *domain)
+SWITCH_DECLARE(switch_status_t) switch_xml_locate_domain(const char *domain_name, char *params, switch_xml_t *root, switch_xml_t *domain)
 {
        char my_params[512];
        *domain = NULL;
@@ -1243,13 +1243,13 @@ SWITCH_DECLARE(switch_status_t) switch_xml_locate_domain(char *domain_name, char
 }
 
 
-SWITCH_DECLARE(switch_status_t) switch_xml_locate_user(char *user_name, 
-                                                                                                          char *domain_name, 
-                                                                                                          char *ip, 
+SWITCH_DECLARE(switch_status_t) switch_xml_locate_user(const char *user_name, 
+                                                                                                          const char *domain_name, 
+                                                                                                          const char *ip, 
                                                                                                           switch_xml_t *root,
                                                                                                           switch_xml_t *domain,
                                                                                                           switch_xml_t *user,
-                                                                                                          char *xtra_params)
+                                                                                                          const char *xtra_params)
 {
        char params[1024] = "";
        switch_status_t status;