SWITCH_DECLARE(switch_status_t) switch_event_create_subclass_detailed(const char *file, const char *func, int line,
switch_event_t **event, switch_event_types_t event_id, const char *subclass_name);
-#define switch_event_create_subclass(_e, _eid, _sn) switch_event_create_subclass_detailed(__FILE__, (char * )__SWITCH_FUNC__, __LINE__, _e, _eid, _sn)
+#define switch_event_create_subclass(_e, _eid, _sn) switch_event_create_subclass_detailed(__FILE__, (const char * )__SWITCH_FUNC__, __LINE__, _e, _eid, _sn)
/*!
\brief Set the priority of an event
SWITCH_DECLARE(switch_status_t) switch_event_fire_detailed(const char *file, const char *func, int line, switch_event_t **event, void *user_data);
SWITCH_DECLARE(void) switch_event_prep_for_delivery_detailed(const char *file, const char *func, int line, switch_event_t *event);
-#define switch_event_prep_for_delivery(_event) switch_event_prep_for_delivery_detailed(__FILE__, (char * )__SWITCH_FUNC__, __LINE__, _event)
+#define switch_event_prep_for_delivery(_event) switch_event_prep_for_delivery_detailed(__FILE__, (const char * )__SWITCH_FUNC__, __LINE__, _event)
/*!
_In_z_ const char *alt_event_type, _In_ int event_count,
_In_z_ const char *unique_id, _In_z_ const char *channel_state,
_In_z_ const char *answer_state, _In_z_ const char *call_direction);
-#define switch_event_create_pres_in(event) switch_event_create_pres_in_detailed(__FILE__, (char * )__SWITCH_FUNC__, __LINE__, \
+#define switch_event_create_pres_in(event) switch_event_create_pres_in_detailed(__FILE__, (const char * )__SWITCH_FUNC__, __LINE__, \
proto, login, from, from_domain, status, event_type, alt_event_type, event_count, \
unique_id, channel_state, answer_state, call_direction)
\return SWITCH_STATUS_SUCCESS if the operation was successful
\note the body supplied by this function will supersede an existing body the event may have
*/
-#define switch_event_fire(event) switch_event_fire_detailed(__FILE__, (char * )__SWITCH_FUNC__, __LINE__, event, NULL)
+#define switch_event_fire(event) switch_event_fire_detailed(__FILE__, (const char * )__SWITCH_FUNC__, __LINE__, event, NULL)
/*!
\brief Fire an event filling in most of the arguements with obvious values and allowing user_data to be sent
\return SWITCH_STATUS_SUCCESS if the operation was successful
\note the body supplied by this function will supersede an existing body the event may have
*/
-#define switch_event_fire_data(event, data) switch_event_fire_detailed(__FILE__, (char * )__SWITCH_FUNC__, __LINE__, event, data)
+#define switch_event_fire_data(event, data) switch_event_fire_detailed(__FILE__, (const char * )__SWITCH_FUNC__, __LINE__, event, data)
SWITCH_DECLARE(char *) switch_event_build_param_string(switch_event_t *event, const char *prefix, switch_hash_t *vars_map);
switch_assert(channel != NULL);
switch_mutex_lock(channel->profile_mutex);
- if (!channel->variables || !(v = switch_event_get_header(channel->variables, (char *) varname))) {
+ if (!channel->variables || !(v = switch_event_get_header(channel->variables, varname))) {
switch_caller_profile_t *cp = channel->caller_profile;
if (cp) {
switch_channel_clear_flag(channel, CF_TAGGED);
if (channel->state >= CS_ROUTING && channel->state <= CS_HANGUP) {
- switch_channel_presence(channel, "unknown", (char *) state_names[state], NULL);
+ switch_channel_presence(channel, "unknown", (const char *) state_names[state], NULL);
}
if (state < CS_HANGUP) {
if (state == CS_ROUTING) {
switch_channel_event_set_data(channel, event);
} else {
- char state_num[25];
- switch_snprintf(state_num, sizeof(state_num), "%d", state);
- switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Channel-State", (char *) switch_channel_state_name(state));
- switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Channel-State-Number", (char *) state_num);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Channel-State", switch_channel_state_name(state));
+ switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Channel-State-Number", "%d", state);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Channel-Name", channel->name);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Unique-ID", switch_core_session_get_uuid(channel->session));
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Call-Direction",