[Freeswitch-svn] [commit] r9308 - freeswitch/trunk/src
Freeswitch SVN
stkn at freeswitch.org
Fri Aug 15 22:17:11 EDT 2008
Author: stkn
Date: Fri Aug 15 22:17:09 2008
New Revision: 9308
Modified:
freeswitch/trunk/src/switch_caller.c
freeswitch/trunk/src/switch_channel.c
freeswitch/trunk/src/switch_console.c
freeswitch/trunk/src/switch_core.c
freeswitch/trunk/src/switch_core_codec.c
freeswitch/trunk/src/switch_core_session.c
freeswitch/trunk/src/switch_event.c
freeswitch/trunk/src/switch_ivr_async.c
freeswitch/trunk/src/switch_ivr_bridge.c
freeswitch/trunk/src/switch_ivr_originate.c
freeswitch/trunk/src/switch_loadable_module.c
freeswitch/trunk/src/switch_log.c
freeswitch/trunk/src/switch_scheduler.c
Log:
Use switch_event_add_header_string() instead of switch_event_add_header(... "%s", ..), core part
Modified: freeswitch/trunk/src/switch_caller.c
==============================================================================
--- freeswitch/trunk/src/switch_caller.c (original)
+++ freeswitch/trunk/src/switch_caller.c Fri Aug 15 22:17:09 2008
@@ -207,59 +207,59 @@
if (!switch_strlen_zero(caller_profile->username)) {
switch_snprintf(header_name, sizeof(header_name), "%s-Username", prefix);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, "%s", caller_profile->username);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->username);
}
if (!switch_strlen_zero(caller_profile->dialplan)) {
switch_snprintf(header_name, sizeof(header_name), "%s-Dialplan", prefix);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, "%s", caller_profile->dialplan);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->dialplan);
}
if (!switch_strlen_zero(caller_profile->caller_id_name)) {
switch_snprintf(header_name, sizeof(header_name), "%s-Caller-ID-Name", prefix);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, "%s", caller_profile->caller_id_name);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->caller_id_name);
}
if (!switch_strlen_zero(caller_profile->caller_id_number)) {
switch_snprintf(header_name, sizeof(header_name), "%s-Caller-ID-Number", prefix);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, "%s", caller_profile->caller_id_number);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->caller_id_number);
}
if (!switch_strlen_zero(caller_profile->network_addr)) {
switch_snprintf(header_name, sizeof(header_name), "%s-Network-Addr", prefix);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, "%s", caller_profile->network_addr);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->network_addr);
}
if (!switch_strlen_zero(caller_profile->ani)) {
switch_snprintf(header_name, sizeof(header_name), "%s-ANI", prefix);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, "%s", caller_profile->ani);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->ani);
}
if (!switch_strlen_zero(caller_profile->aniii)) {
switch_snprintf(header_name, sizeof(header_name), "%s-ANI-II", prefix);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, "%s", caller_profile->aniii);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->aniii);
}
if (!switch_strlen_zero(caller_profile->destination_number)) {
switch_snprintf(header_name, sizeof(header_name), "%s-Destination-Number", prefix);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, "%s", caller_profile->destination_number);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->destination_number);
}
if (!switch_strlen_zero(caller_profile->uuid)) {
switch_snprintf(header_name, sizeof(header_name), "%s-Unique-ID", prefix);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, "%s", caller_profile->uuid);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->uuid);
}
if (!switch_strlen_zero(caller_profile->source)) {
switch_snprintf(header_name, sizeof(header_name), "%s-Source", prefix);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, "%s", caller_profile->source);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->source);
}
if (!switch_strlen_zero(caller_profile->context)) {
switch_snprintf(header_name, sizeof(header_name), "%s-Context", prefix);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, "%s", caller_profile->context);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->context);
}
if (!switch_strlen_zero(caller_profile->rdnis)) {
switch_snprintf(header_name, sizeof(header_name), "%s-RDNIS", prefix);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, "%s", caller_profile->rdnis);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->rdnis);
}
if (!switch_strlen_zero(caller_profile->chan_name)) {
switch_snprintf(header_name, sizeof(header_name), "%s-Channel-Name", prefix);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, "%s", caller_profile->chan_name);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->chan_name);
}
if (!switch_strlen_zero(caller_profile->profile_index)) {
switch_snprintf(header_name, sizeof(header_name), "%s-Profile-Index", prefix);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, "%s", caller_profile->profile_index);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->profile_index);
}
if (caller_profile->times) {
switch_snprintf(header_name, sizeof(header_name), "%s-Channel-Created-Time", prefix);
@@ -273,13 +273,13 @@
}
switch_snprintf(header_name, sizeof(header_name), "%s-Screen-Bit", prefix);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, switch_test_flag(caller_profile, SWITCH_CPF_SCREEN) ? "yes" : "no");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, switch_test_flag(caller_profile, SWITCH_CPF_SCREEN) ? "yes" : "no");
switch_snprintf(header_name, sizeof(header_name), "%s-Privacy-Hide-Name", prefix);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, switch_test_flag(caller_profile, SWITCH_CPF_HIDE_NAME) ? "yes" : "no");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, switch_test_flag(caller_profile, SWITCH_CPF_HIDE_NAME) ? "yes" : "no");
switch_snprintf(header_name, sizeof(header_name), "%s-Privacy-Hide-Number", prefix);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, switch_test_flag(caller_profile, SWITCH_CPF_HIDE_NUMBER) ? "yes" : "no");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, switch_test_flag(caller_profile, SWITCH_CPF_HIDE_NUMBER) ? "yes" : "no");
}
SWITCH_DECLARE(switch_status_t) switch_caller_extension_clone(switch_caller_extension_t **new_ext, switch_caller_extension_t *orig,
Modified: freeswitch/trunk/src/switch_channel.c
==============================================================================
--- freeswitch/trunk/src/switch_channel.c (original)
+++ freeswitch/trunk/src/switch_channel.c Fri Aug 15 22:17:09 2008
@@ -405,18 +405,18 @@
if (switch_event_create(&event, type) == SWITCH_STATUS_SUCCESS) {
switch_channel_event_set_data(channel, event);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", "%s", __FILE__);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", __FILE__);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s", id);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", __FILE__);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", __FILE__);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from", id);
if (type == SWITCH_EVENT_PRESENCE_IN) {
if (!rpid) {
rpid = "unknown";
}
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "rpid", "%s", rpid);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "status", "%s", status);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "rpid", rpid);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "status", status);
}
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event_type", "presence");
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "alt_event_type", "dialog");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event_type", "presence");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "alt_event_type", "dialog");
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event_count", "%d", channel->event_count++);
switch_event_fire(&event);
}
@@ -552,7 +552,7 @@
switch_mutex_lock(channel->profile_mutex);
switch_event_del_header(channel->variables, varname);
if (!switch_strlen_zero(value)) {
- switch_event_add_header(channel->variables, SWITCH_STACK_BOTTOM, varname, "%s", value);
+ switch_event_add_header_string(channel->variables, SWITCH_STACK_BOTTOM, varname, value);
}
switch_mutex_unlock(channel->profile_mutex);
return SWITCH_STATUS_SUCCESS;
@@ -576,7 +576,7 @@
switch_mutex_lock(tchannel->profile_mutex);
switch_event_del_header(tchannel->variables, varname);
if (value) {
- switch_event_add_header(tchannel->variables, SWITCH_STACK_BOTTOM, varname, "%s", value);
+ switch_event_add_header_string(tchannel->variables, SWITCH_STACK_BOTTOM, varname, value);
}
switch_mutex_unlock(tchannel->profile_mutex);
switch_core_session_rwunlock(session);
@@ -794,18 +794,18 @@
} else {
char state_num[25];
switch_snprintf(state_num, sizeof(state_num), "%d", state);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Channel-State", "%s", (char *) switch_channel_state_name(state));
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Channel-State-Number", "%s", (char *) state_num);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Channel-Name", "%s", channel->name);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Unique-ID", "%s", switch_core_session_get_uuid(channel->session));
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Call-Direction", "%s",
+ 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-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",
switch_channel_test_flag(channel, CF_OUTBOUND) ? "outbound" : "inbound");
if (switch_channel_test_flag(channel, CF_ANSWERED)) {
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Answer-State", "answered");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Answer-State", "answered");
} else if (switch_channel_test_flag(channel, CF_EARLY_MEDIA)) {
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Answer-State", "early");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Answer-State", "early");
} else {
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Answer-State", "ringing");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Answer-State", "ringing");
}
}
switch_event_fire(&event);
@@ -1043,28 +1043,28 @@
originatee_caller_profile = caller_profile->originatee_caller_profile;
}
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Channel-State", "%s", switch_channel_state_name(channel->state));
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Channel-State", switch_channel_state_name(channel->state));
switch_snprintf(state_num, sizeof(state_num), "%d", channel->state);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Channel-State-Number", "%s", state_num);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Channel-Name", "%s", switch_channel_get_name(channel));
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Unique-ID", "%s", switch_core_session_get_uuid(channel->session));
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Channel-State-Number", state_num);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Channel-Name", switch_channel_get_name(channel));
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Unique-ID", switch_core_session_get_uuid(channel->session));
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Call-Direction", "%s", switch_channel_test_flag(channel, CF_OUTBOUND) ? "outbound" : "inbound");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Call-Direction", switch_channel_test_flag(channel, CF_OUTBOUND) ? "outbound" : "inbound");
if (switch_channel_test_flag(channel, CF_ANSWERED)) {
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Answer-State", "answered");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Answer-State", "answered");
} else if (switch_channel_test_flag(channel, CF_EARLY_MEDIA)) {
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Answer-State", "early");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Answer-State", "early");
} else {
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Answer-State", "ringing");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Answer-State", "ringing");
}
if ((codec = switch_core_session_get_read_codec(channel->session)) && codec->implementation) {
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Channel-Read-Codec-Name", "%s", switch_str_nil(codec->implementation->iananame));
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Channel-Read-Codec-Name", switch_str_nil(codec->implementation->iananame));
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Channel-Read-Codec-Rate", "%u", codec->implementation->actual_samples_per_second);
}
if ((codec = switch_core_session_get_write_codec(channel->session)) && codec->implementation) {
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Channel-Write-Codec-Name", "%s", switch_str_nil(codec->implementation->iananame));
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Channel-Write-Codec-Name", switch_str_nil(codec->implementation->iananame));
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Channel-Write-Codec-Rate", "%u", codec->implementation->actual_samples_per_second);
}
@@ -1100,7 +1100,7 @@
switch_assert(vvar && vval);
switch_snprintf(buf, sizeof(buf), "variable_%s", vvar);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, buf, "%s", vval);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, buf, vval);
}
}
switch_mutex_unlock(channel->profile_mutex);
@@ -1354,7 +1354,7 @@
switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, NULL, SWITCH_LOG_NOTICE, "Hangup %s [%s] [%s]\n",
channel->name, state_names[last_state], switch_channel_cause2str(channel->hangup_cause));
if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_HANGUP) == SWITCH_STATUS_SUCCESS) {
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Hangup-Cause", "%s", switch_channel_cause2str(channel->hangup_cause));
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Hangup-Cause", switch_channel_cause2str(channel->hangup_cause));
switch_channel_event_set_data(channel, event);
switch_event_fire(&event);
}
Modified: freeswitch/trunk/src/switch_console.c
==============================================================================
--- freeswitch/trunk/src/switch_console.c (original)
+++ freeswitch/trunk/src/switch_console.c Fri Aug 15 22:17:09 2008
@@ -291,9 +291,9 @@
if (channel == SWITCH_CHANNEL_ID_EVENT &&
switch_event_running() == SWITCH_STATUS_SUCCESS && switch_event_create(&event, SWITCH_EVENT_LOG) == SWITCH_STATUS_SUCCESS) {
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Log-Data", "%s", data);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Log-File", "%s", filep);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Log-Function", "%s", func);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Log-Data", data);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Log-File", filep);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Log-Function", func);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Log-Line", "%d", line);
switch_event_fire(&event);
}
Modified: freeswitch/trunk/src/switch_core.c
==============================================================================
--- freeswitch/trunk/src/switch_core.c (original)
+++ freeswitch/trunk/src/switch_core.c Fri Aug 15 22:17:09 2008
@@ -111,10 +111,10 @@
if (switch_event_create(&event, SWITCH_EVENT_TRAP) == SWITCH_STATUS_SUCCESS) {
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "condition", "network-address-change");
if (!ok4) {
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "network-address-change-v4", "%s", main_ip4);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "network-address-change-v4", main_ip4);
}
if (!ok6) {
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "network-address-change-v6", "%s", main_ip6);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "network-address-change-v6", main_ip6);
}
switch_event_fire(&event);
}
Modified: freeswitch/trunk/src/switch_core_codec.c
==============================================================================
--- freeswitch/trunk/src/switch_core_codec.c (original)
+++ freeswitch/trunk/src/switch_core_codec.c Fri Aug 15 22:17:09 2008
@@ -81,7 +81,7 @@
if (session->read_codec && session->read_codec->implementation) {
if (switch_event_create(&event, SWITCH_EVENT_CODEC) == SWITCH_STATUS_SUCCESS) {
switch_channel_event_set_data(session->channel, event);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-read-codec-name", "%s", session->read_codec->implementation->iananame);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "channel-read-codec-name", session->read_codec->implementation->iananame);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-read-codec-rate", "%d", session->read_codec->implementation->actual_samples_per_second);
if (session->read_codec->implementation->actual_samples_per_second != session->read_codec->implementation->samples_per_second) {
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-reported-read-codec-rate", "%d", session->read_codec->implementation->samples_per_second);
@@ -148,7 +148,7 @@
if (switch_event_create(&event, SWITCH_EVENT_CODEC) == SWITCH_STATUS_SUCCESS) {
switch_channel_event_set_data(session->channel, event);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-write-codec-name", "%s", session->write_codec->implementation->iananame);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "channel-write-codec-name", session->write_codec->implementation->iananame);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-write-codec-rate", "%d", session->write_codec->implementation->actual_samples_per_second);
if (session->write_codec->implementation->actual_samples_per_second != session->write_codec->implementation->samples_per_second) {
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-reported-write-codec-rate", "%d",
@@ -185,7 +185,7 @@
if (switch_event_create(&event, SWITCH_EVENT_CODEC) == SWITCH_STATUS_SUCCESS) {
switch_channel_event_set_data(session->channel, event);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-video-read-codec-name", "%s", codec->implementation->iananame);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "channel-video-read-codec-name", codec->implementation->iananame);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-video-read-codec-rate", "%d", codec->implementation->actual_samples_per_second);
switch_event_fire(&event);
}
@@ -212,7 +212,7 @@
if (switch_event_create(&event, SWITCH_EVENT_CODEC) == SWITCH_STATUS_SUCCESS) {
switch_channel_event_set_data(session->channel, event);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-video-write-codec-name", "%s", codec->implementation->iananame);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "channel-video-write-codec-name", codec->implementation->iananame);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-video-write-codec-rate", "%d", codec->implementation->actual_samples_per_second);
switch_event_fire(&event);
}
Modified: freeswitch/trunk/src/switch_core_session.c
==============================================================================
--- freeswitch/trunk/src/switch_core_session.c (original)
+++ freeswitch/trunk/src/switch_core_session.c Fri Aug 15 22:17:09 2008
@@ -1110,8 +1110,8 @@
if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_EXECUTE) == SWITCH_STATUS_SUCCESS) {
switch_channel_event_set_data(session->channel, event);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Application", "%s", application_interface->interface_name);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Application-Data", "%s", arg);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application", application_interface->interface_name);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application-Data", arg);
switch_event_fire(&event);
}
@@ -1127,8 +1127,8 @@
if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_EXECUTE_COMPLETE) == SWITCH_STATUS_SUCCESS) {
switch_channel_event_set_data(session->channel, event);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Application", "%s", application_interface->interface_name);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Application-Data", "%s", arg);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application", application_interface->interface_name);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application-Data", arg);
switch_event_fire(&event);
}
Modified: freeswitch/trunk/src/switch_event.c
==============================================================================
--- freeswitch/trunk/src/switch_event.c (original)
+++ freeswitch/trunk/src/switch_event.c Fri Aug 15 22:17:09 2008
@@ -554,7 +554,7 @@
SWITCH_DECLARE(switch_status_t) switch_event_set_priority(switch_event_t *event, switch_priority_t priority)
{
event->priority = priority;
- switch_event_add_header(event, SWITCH_STACK_TOP, "priority", "%s", switch_priority_name(priority));
+ switch_event_add_header_string(event, SWITCH_STACK_TOP, "priority", switch_priority_name(priority));
return SWITCH_STATUS_SUCCESS;
}
Modified: freeswitch/trunk/src/switch_ivr_async.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr_async.c (original)
+++ freeswitch/trunk/src/switch_ivr_async.c Fri Aug 15 22:17:09 2008
@@ -1178,9 +1178,9 @@
if (cont->list[i].app) {
if (switch_event_create(&event, SWITCH_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) {
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "call-command", "execute");
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "execute-app-name", "%s", cont->list[i].app);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "execute-app-arg", "%s", cont->list[i].data);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "call-command", "execute");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "execute-app-name", cont->list[i].app);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "execute-app-arg", cont->list[i].data);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "lead-frames", "%d", 5);
switch_core_session_queue_private_event(cont->session, &event);
}
@@ -1188,7 +1188,7 @@
if (switch_event_create(&event, SWITCH_EVENT_DETECTED_TONE) == SWITCH_STATUS_SUCCESS) {
switch_event_t *dup;
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Detected-Tone", "%s", cont->list[i].key);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Detected-Tone", cont->list[i].key);
if (switch_event_dup(&dup, event) == SWITCH_STATUS_SUCCESS) {
switch_event_fire(&dup);
@@ -1196,7 +1196,7 @@
if (switch_core_session_queue_event(cont->session, &event) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Event queue failed!\n");
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "delivery-failure", "true");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "delivery-failure", "true");
switch_event_fire(&event);
}
}
@@ -1579,10 +1579,10 @@
if (switch_event_create(&event, SWITCH_EVENT_DETECTED_SPEECH) == SWITCH_STATUS_SUCCESS) {
if (status == SWITCH_STATUS_SUCCESS) {
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Speech-Type", "detected-speech");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Speech-Type", "detected-speech");
switch_event_add_body(event, "%s", xmlstr);
} else {
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Speech-Type", "begin-speaking");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Speech-Type", "begin-speaking");
}
if (switch_test_flag(sth->ah, SWITCH_ASR_FLAG_FIRE_EVENTS)) {
@@ -1596,7 +1596,7 @@
if (switch_core_session_queue_event(sth->session, &event) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Event queue failed!\n");
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "delivery-failure", "true");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "delivery-failure", "true");
switch_event_fire(&event);
}
}
@@ -2014,16 +2014,16 @@
if ((flags & SMF_ECHO_BLEG) && (other_uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))
&& (other_session = switch_core_session_locate(other_uuid))) {
if (switch_event_create(&event, SWITCH_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) {
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "call-command", "execute");
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "execute-app-name", "%s", app);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "execute-app-arg", "%s", path);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "call-command", "execute");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "execute-app-name", app);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "execute-app-arg", path);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "lead-frames", "%d", 5);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event-lock", "%s", "true");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event-lock", "true");
if ((flags & SMF_LOOP)) {
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "loops", "%d", -1);
}
if ((flags & SMF_HOLD_BLEG)) {
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "hold-bleg", "%s", "true");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "hold-bleg", "true");
}
switch_core_session_queue_private_event(other_session, &event);
@@ -2036,16 +2036,16 @@
if ((flags & SMF_ECHO_ALEG)) {
if (switch_event_create(&event, SWITCH_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) {
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "call-command", "execute");
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "execute-app-name", "%s", app);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "execute-app-arg", "%s", path);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "call-command", "execute");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "execute-app-name", app);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "execute-app-arg", path);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "lead-frames", "%d", 5);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event-lock", "%s", "true");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event-lock", "true");
if ((flags & SMF_LOOP)) {
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "loops", "%d", -1);
}
if ((flags & SMF_HOLD_BLEG)) {
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "hold-bleg", "%s", "true");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "hold-bleg", "true");
}
switch_core_session_queue_private_event(session, &event);
@@ -2055,19 +2055,19 @@
if (nomedia) {
if (switch_event_create(&event, SWITCH_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) {
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "call-command", "nomedia");
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "nomedia-uuid", "%s", uuid);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event-lock", "%s", "true");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "call-command", "nomedia");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "nomedia-uuid", uuid);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event-lock", "true");
switch_core_session_queue_private_event(master, &event);
}
}
if (cause) {
if (switch_event_create(&event, SWITCH_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) {
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "call-command", "execute");
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "execute-app-name", "hangup");
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "execute-app-arg", "%s", cause);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event-lock", "%s", "true");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "call-command", "execute");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "execute-app-name", "hangup");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "execute-app-arg", cause);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event-lock", "true");
switch_core_session_queue_private_event(session, &event);
}
}
Modified: freeswitch/trunk/src/switch_ivr_bridge.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr_bridge.c (original)
+++ freeswitch/trunk/src/switch_ivr_bridge.c Fri Aug 15 22:17:09 2008
@@ -511,15 +511,15 @@
/* fire events that will change the data table from "show channels" */
if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_EXECUTE) == SWITCH_STATUS_SUCCESS) {
switch_channel_event_set_data(channel, event);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Application", "uuid_bridge");
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Application-Data", "%s", switch_core_session_get_uuid(other_session));
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application", "uuid_bridge");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application-Data", switch_core_session_get_uuid(other_session));
switch_event_fire(&event);
}
if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_EXECUTE) == SWITCH_STATUS_SUCCESS) {
switch_channel_event_set_data(other_channel, event);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Application", "uuid_bridge");
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Application-Data", "%s", switch_core_session_get_uuid(session));
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application", "uuid_bridge");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application-Data", switch_core_session_get_uuid(session));
switch_event_fire(&event);
}
@@ -638,15 +638,15 @@
/* fire events that will change the data table from "show channels" */
if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_EXECUTE) == SWITCH_STATUS_SUCCESS) {
switch_channel_event_set_data(caller_channel, event);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Application", "signal_bridge");
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Application-Data", "%s", switch_core_session_get_uuid(peer_session));
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application", "signal_bridge");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application-Data", switch_core_session_get_uuid(peer_session));
switch_event_fire(&event);
}
if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_EXECUTE) == SWITCH_STATUS_SUCCESS) {
switch_channel_event_set_data(peer_channel, event);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Application", "signal_bridge");
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Application-Data", "%s", switch_core_session_get_uuid(session));
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application", "signal_bridge");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application-Data", switch_core_session_get_uuid(session));
switch_event_fire(&event);
}
Modified: freeswitch/trunk/src/switch_ivr_originate.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr_originate.c (original)
+++ freeswitch/trunk/src/switch_ivr_originate.c Fri Aug 15 22:17:09 2008
@@ -628,7 +628,7 @@
}
if (ok) {
- switch_event_add_header(var_event, SWITCH_STACK_BOTTOM, (char *) hi->name, "%s", (char *) hi->value);
+ switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, (char *) hi->name, (char *) hi->value);
}
}
switch_channel_variable_last(caller_channel);
@@ -638,7 +638,7 @@
for (; hi; hi = switch_hash_next(hi)) {
switch_hash_this(hi, &vvar, NULL, &vval);
if (vvar && vval) {
- switch_event_add_header(var_event, SWITCH_STACK_BOTTOM, (void *) vvar, "%s", (char *) vval);
+ switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, (void *) vvar, (char *) vval);
}
}
switch_channel_variable_last(caller_channel);
@@ -658,7 +658,7 @@
if ((inner_var_count =
switch_separate_string(var_array[x], '=', inner_var_array, (sizeof(inner_var_array) / sizeof(inner_var_array[0])))) == 2) {
- switch_event_add_header(var_event, SWITCH_STACK_BOTTOM, inner_var_array[0], "%s", inner_var_array[1]);
+ switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, inner_var_array[0], inner_var_array[1]);
}
}
}
Modified: freeswitch/trunk/src/switch_loadable_module.c
==============================================================================
--- freeswitch/trunk/src/switch_loadable_module.c (original)
+++ freeswitch/trunk/src/switch_loadable_module.c Fri Aug 15 22:17:09 2008
@@ -139,8 +139,8 @@
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Adding Endpoint '%s'\n", ptr->interface_name);
switch_core_hash_insert(loadable_modules.endpoint_hash, ptr->interface_name, (const void *) ptr);
if (switch_event_create(&event, SWITCH_EVENT_MODULE_LOAD) == SWITCH_STATUS_SUCCESS) {
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "type", "%s", "endpoint");
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "name", "%s", ptr->interface_name);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "endpoint");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "name", ptr->interface_name);
switch_event_fire(&event);
}
}
@@ -182,8 +182,8 @@
}
}
if (switch_event_create(&event, SWITCH_EVENT_MODULE_LOAD) == SWITCH_STATUS_SUCCESS) {
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "type", "%s", "codec");
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "name", "%s", ptr->interface_name);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "codec");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "name", ptr->interface_name);
switch_event_fire(&event);
}
}
@@ -200,8 +200,8 @@
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Adding Dialplan '%s'\n", ptr->interface_name);
if (switch_event_create(&event, SWITCH_EVENT_MODULE_LOAD) == SWITCH_STATUS_SUCCESS) {
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "type", "%s", "dialplan");
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "name", "%s", ptr->interface_name);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "dialplan");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "name", ptr->interface_name);
switch_event_fire(&event);
}
switch_core_hash_insert(loadable_modules.dialplan_hash, ptr->interface_name, (const void *) ptr);
@@ -218,8 +218,8 @@
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Adding Timer '%s'\n", ptr->interface_name);
if (switch_event_create(&event, SWITCH_EVENT_MODULE_LOAD) == SWITCH_STATUS_SUCCESS) {
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "type", "%s", "timer");
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "name", "%s", ptr->interface_name);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "timer");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "name", ptr->interface_name);
switch_event_fire(&event);
}
switch_core_hash_insert(loadable_modules.timer_hash, ptr->interface_name, (const void *) ptr);
@@ -236,10 +236,10 @@
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Adding Application '%s'\n", ptr->interface_name);
if (switch_event_create(&event, SWITCH_EVENT_MODULE_LOAD) == SWITCH_STATUS_SUCCESS) {
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "type", "%s", "application");
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "name", "%s", ptr->interface_name);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "description", "%s", switch_str_nil(ptr->short_desc));
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "syntax", "%s", switch_str_nil(ptr->syntax));
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "application");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "name", ptr->interface_name);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "description", switch_str_nil(ptr->short_desc));
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "syntax", switch_str_nil(ptr->syntax));
switch_event_fire(&event);
}
switch_core_hash_insert(loadable_modules.application_hash, ptr->interface_name, (const void *) ptr);
@@ -256,10 +256,10 @@
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Adding API Function '%s'\n", ptr->interface_name);
if (switch_event_create(&event, SWITCH_EVENT_MODULE_LOAD) == SWITCH_STATUS_SUCCESS) {
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "type", "%s", "api");
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "name", "%s", ptr->interface_name);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "description", "%s", switch_str_nil(ptr->desc));
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "syntax", "%s", switch_str_nil(ptr->syntax));
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "api");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "name", ptr->interface_name);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "description", switch_str_nil(ptr->desc));
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "syntax", switch_str_nil(ptr->syntax));
switch_event_fire(&event);
}
switch_core_hash_insert(loadable_modules.api_hash, ptr->interface_name, (const void *) ptr);
@@ -278,8 +278,8 @@
for (i = 0; ptr->extens[i]; i++) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Adding File Format '%s'\n", ptr->extens[i]);
if (switch_event_create(&event, SWITCH_EVENT_MODULE_LOAD) == SWITCH_STATUS_SUCCESS) {
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "type", "%s", "file");
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "name", "%s", ptr->extens[i]);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "file");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "name", ptr->extens[i]);
switch_event_fire(&event);
}
switch_core_hash_insert(loadable_modules.file_hash, ptr->extens[i], (const void *) ptr);
@@ -297,8 +297,8 @@
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Adding Speech interface '%s'\n", ptr->interface_name);
if (switch_event_create(&event, SWITCH_EVENT_MODULE_LOAD) == SWITCH_STATUS_SUCCESS) {
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "type", "%s", "speech");
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "name", "%s", ptr->interface_name);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "speech");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "name", ptr->interface_name);
switch_event_fire(&event);
}
switch_core_hash_insert(loadable_modules.speech_hash, ptr->interface_name, (const void *) ptr);
@@ -315,8 +315,8 @@
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Adding ASR interface '%s'\n", ptr->interface_name);
if (switch_event_create(&event, SWITCH_EVENT_MODULE_LOAD) == SWITCH_STATUS_SUCCESS) {
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "type", "%s", "asr");
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "name", "%s", ptr->interface_name);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "asr");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "name", ptr->interface_name);
switch_event_fire(&event);
}
switch_core_hash_insert(loadable_modules.asr_hash, ptr->interface_name, (const void *) ptr);
@@ -333,8 +333,8 @@
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Adding Directory interface '%s'\n", ptr->interface_name);
if (switch_event_create(&event, SWITCH_EVENT_MODULE_LOAD) == SWITCH_STATUS_SUCCESS) {
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "type", "%s", "directory");
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "name", "%s", ptr->interface_name);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "directory");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "name", ptr->interface_name);
switch_event_fire(&event);
}
switch_core_hash_insert(loadable_modules.directory_hash, ptr->interface_name, (const void *) ptr);
@@ -351,8 +351,8 @@
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Adding Chat interface '%s'\n", ptr->interface_name);
if (switch_event_create(&event, SWITCH_EVENT_MODULE_LOAD) == SWITCH_STATUS_SUCCESS) {
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "type", "%s", "chat");
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "name", "%s", ptr->interface_name);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "chat");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "name", ptr->interface_name);
switch_event_fire(&event);
}
switch_core_hash_insert(loadable_modules.chat_hash, ptr->interface_name, (const void *) ptr);
@@ -369,8 +369,8 @@
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Adding Say interface '%s'\n", ptr->interface_name);
if (switch_event_create(&event, SWITCH_EVENT_MODULE_LOAD) == SWITCH_STATUS_SUCCESS) {
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "type", "%s", "say");
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "name", "%s", ptr->interface_name);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "say");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "name", ptr->interface_name);
switch_event_fire(&event);
}
switch_core_hash_insert(loadable_modules.say_hash, ptr->interface_name, (const void *) ptr);
@@ -393,8 +393,8 @@
"Adding Management interface '%s' OID[%s.%s]\n", key, FREESWITCH_OID_PREFIX, ptr->relative_oid);
switch_core_hash_insert(loadable_modules.management_hash, ptr->relative_oid, (const void *) ptr);
if (switch_event_create(&event, SWITCH_EVENT_MODULE_LOAD) == SWITCH_STATUS_SUCCESS) {
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "type", "%s", "management");
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "name", "%s", ptr->relative_oid);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "management");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "name", ptr->relative_oid);
switch_event_fire(&event);
}
}
@@ -456,8 +456,8 @@
}
}
if (switch_event_create(&event, SWITCH_EVENT_MODULE_UNLOAD) == SWITCH_STATUS_SUCCESS) {
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "type", "%s", "codec");
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "name", "%s", ptr->interface_name);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "codec");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "name", ptr->interface_name);
switch_event_fire(&event);
}
}
@@ -472,8 +472,8 @@
if (ptr->interface_name) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Deleting Dialplan '%s'\n", ptr->interface_name);
if (switch_event_create(&event, SWITCH_EVENT_MODULE_UNLOAD) == SWITCH_STATUS_SUCCESS) {
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "type", "%s", "dialplan");
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "name", "%s", ptr->interface_name);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "dialplan");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "name", ptr->interface_name);
switch_event_fire(&event);
}
switch_core_hash_delete(loadable_modules.dialplan_hash, ptr->interface_name);
@@ -488,8 +488,8 @@
if (ptr->interface_name) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Deleting Timer '%s'\n", ptr->interface_name);
if (switch_event_create(&event, SWITCH_EVENT_MODULE_UNLOAD) == SWITCH_STATUS_SUCCESS) {
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "type", "%s", "timer");
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "name", "%s", ptr->interface_name);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "timer");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "name", ptr->interface_name);
switch_event_fire(&event);
}
switch_core_hash_delete(loadable_modules.timer_hash, ptr->interface_name);
@@ -508,10 +508,10 @@
switch_thread_rwlock_unlock(ptr->rwlock);
if (switch_event_create(&event, SWITCH_EVENT_MODULE_UNLOAD) == SWITCH_STATUS_SUCCESS) {
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "type", "%s", "application");
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "name", "%s", ptr->interface_name);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "description", "%s", switch_str_nil(ptr->short_desc));
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "syntax", "%s", switch_str_nil(ptr->syntax));
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "application");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "name", ptr->interface_name);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "description", switch_str_nil(ptr->short_desc));
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "syntax", switch_str_nil(ptr->syntax));
switch_event_fire(&event);
}
switch_core_hash_delete(loadable_modules.application_hash, ptr->interface_name);
@@ -531,10 +531,10 @@
switch_thread_rwlock_unlock(ptr->rwlock);
if (switch_event_create(&event, SWITCH_EVENT_MODULE_UNLOAD) == SWITCH_STATUS_SUCCESS) {
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "type", "%s", "api");
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "name", "%s", ptr->interface_name);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "description", "%s", switch_str_nil(ptr->desc));
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "syntax", "%s", switch_str_nil(ptr->syntax));
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "api");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "name", ptr->interface_name);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "description", switch_str_nil(ptr->desc));
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "syntax", switch_str_nil(ptr->syntax));
switch_event_fire(&event);
}
switch_core_hash_delete(loadable_modules.api_hash, ptr->interface_name);
@@ -551,8 +551,8 @@
for (i = 0; ptr->extens[i]; i++) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Deleting File Format '%s'\n", ptr->extens[i]);
if (switch_event_create(&event, SWITCH_EVENT_MODULE_UNLOAD) == SWITCH_STATUS_SUCCESS) {
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "type", "%s", "file");
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "name", "%s", ptr->extens[i]);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "file");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "name", ptr->extens[i]);
switch_event_fire(&event);
}
switch_core_hash_delete(loadable_modules.file_hash, ptr->extens[i]);
@@ -568,8 +568,8 @@
if (ptr->interface_name) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Deleting Speech interface '%s'\n", ptr->interface_name);
if (switch_event_create(&event, SWITCH_EVENT_MODULE_UNLOAD) == SWITCH_STATUS_SUCCESS) {
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "type", "%s", "speech");
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "name", "%s", ptr->interface_name);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "speech");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "name", ptr->interface_name);
switch_event_fire(&event);
}
switch_core_hash_delete(loadable_modules.speech_hash, ptr->interface_name);
@@ -584,8 +584,8 @@
if (ptr->interface_name) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Deleting Asr interface '%s'\n", ptr->interface_name);
if (switch_event_create(&event, SWITCH_EVENT_MODULE_UNLOAD) == SWITCH_STATUS_SUCCESS) {
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "type", "%s", "asr");
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "name", "%s", ptr->interface_name);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "asr");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "name", ptr->interface_name);
switch_event_fire(&event);
}
switch_core_hash_delete(loadable_modules.asr_hash, ptr->interface_name);
@@ -600,8 +600,8 @@
if (ptr->interface_name) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Deleting Directory interface '%s'\n", ptr->interface_name);
if (switch_event_create(&event, SWITCH_EVENT_MODULE_UNLOAD) == SWITCH_STATUS_SUCCESS) {
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "type", "%s", "directory");
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "name", "%s", ptr->interface_name);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "directory");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "name", ptr->interface_name);
switch_event_fire(&event);
}
switch_core_hash_delete(loadable_modules.directory_hash, ptr->interface_name);
@@ -617,8 +617,8 @@
if (ptr->interface_name) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Deleting Chat interface '%s'\n", ptr->interface_name);
if (switch_event_create(&event, SWITCH_EVENT_MODULE_UNLOAD) == SWITCH_STATUS_SUCCESS) {
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "type", "%s", "chat");
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "name", "%s", ptr->interface_name);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "chat");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "name", ptr->interface_name);
switch_event_fire(&event);
}
switch_core_hash_delete(loadable_modules.chat_hash, ptr->interface_name);
@@ -633,8 +633,8 @@
if (ptr->interface_name) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Deleting Say interface '%s'\n", ptr->interface_name);
if (switch_event_create(&event, SWITCH_EVENT_MODULE_UNLOAD) == SWITCH_STATUS_SUCCESS) {
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "type", "%s", "say");
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "name", "%s", ptr->interface_name);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "say");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "name", ptr->interface_name);
switch_event_fire(&event);
}
switch_core_hash_delete(loadable_modules.say_hash, ptr->interface_name);
@@ -651,8 +651,8 @@
"Deleting Management interface '%s' OID[%s.%s]\n", old_module->key, FREESWITCH_OID_PREFIX, ptr->relative_oid);
switch_core_hash_delete(loadable_modules.management_hash, ptr->relative_oid);
if (switch_event_create(&event, SWITCH_EVENT_MODULE_UNLOAD) == SWITCH_STATUS_SUCCESS) {
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "type", "%s", "management");
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "name", "%s", ptr->relative_oid);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "management");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "name", ptr->relative_oid);
switch_event_fire(&event);
}
}
@@ -1389,10 +1389,10 @@
if (stream->param_event) {
if (cmd) {
- switch_event_add_header(stream->param_event, SWITCH_STACK_BOTTOM, "API-Command", "%s", cmd);
+ switch_event_add_header_string(stream->param_event, SWITCH_STACK_BOTTOM, "API-Command", cmd);
}
if (arg) {
- switch_event_add_header(stream->param_event, SWITCH_STACK_BOTTOM, "API-Command-Argument", "%s", arg);
+ switch_event_add_header_string(stream->param_event, SWITCH_STACK_BOTTOM, "API-Command-Argument", arg);
}
}
Modified: freeswitch/trunk/src/switch_log.c
==============================================================================
--- freeswitch/trunk/src/switch_log.c (original)
+++ freeswitch/trunk/src/switch_log.c Fri Aug 15 22:17:09 2008
@@ -293,9 +293,9 @@
if (channel == SWITCH_CHANNEL_ID_EVENT) {
switch_event_t *event;
if (switch_event_running() == SWITCH_STATUS_SUCCESS && switch_event_create(&event, SWITCH_EVENT_LOG) == SWITCH_STATUS_SUCCESS) {
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Log-Data", "%s", data);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Log-File", "%s", filep);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Log-Function", "%s", funcp);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Log-Data", data);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Log-File", filep);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Log-Function", funcp);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Log-Line", "%d", line);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Log-Level", "%d", (int) level);
switch_event_fire(&event);
Modified: freeswitch/trunk/src/switch_scheduler.c
==============================================================================
--- freeswitch/trunk/src/switch_scheduler.c (original)
+++ freeswitch/trunk/src/switch_scheduler.c Fri Aug 15 22:17:09 2008
@@ -64,16 +64,16 @@
tp->executed = 0;
if (switch_event_create(&event, SWITCH_EVENT_RE_SCHEDULE) == SWITCH_STATUS_SUCCESS) {
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Task-ID", "%u", tp->task.task_id);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Task-Desc", "%s", tp->desc);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Task-Group", "%s", switch_str_nil(tp->task.group));
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Task-Desc", tp->desc);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Task-Group", switch_str_nil(tp->task.group));
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Task-Runtime", "%" SWITCH_INT64_T_FMT, tp->task.runtime);
switch_event_fire(&event);
}
} else {
if (switch_event_create(&event, SWITCH_EVENT_DEL_SCHEDULE) == SWITCH_STATUS_SUCCESS) {
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Task-ID", "%u", tp->task.task_id);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Task-Desc", "%s", tp->desc);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Task-Group", "%s", switch_str_nil(tp->task.group));
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Task-Desc", tp->desc);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Task-Group", switch_str_nil(tp->task.group));
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Task-Runtime", "%" SWITCH_INT64_T_FMT, tp->task.runtime);
switch_event_fire(&event);
}
@@ -216,8 +216,8 @@
if (switch_event_create(&event, SWITCH_EVENT_ADD_SCHEDULE) == SWITCH_STATUS_SUCCESS) {
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Task-ID", "%u", tp->task.task_id);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Task-Desc", "%s", tp->desc);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Task-Group", "%s", switch_str_nil(tp->task.group));
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Task-Desc", tp->desc);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Task-Group", switch_str_nil(tp->task.group));
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Task-Runtime", "%" SWITCH_INT64_T_FMT, tp->task.runtime);
switch_event_fire(&event);
}
@@ -241,8 +241,8 @@
tp->destroyed++;
if (switch_event_create(&event, SWITCH_EVENT_DEL_SCHEDULE) == SWITCH_STATUS_SUCCESS) {
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Task-ID", "%u", tp->task.task_id);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Task-Desc", "%s", tp->desc);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Task-Group", "%s", switch_str_nil(tp->task.group));
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Task-Desc", tp->desc);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Task-Group", switch_str_nil(tp->task.group));
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Task-Runtime", "%" SWITCH_INT64_T_FMT, tp->task.runtime);
switch_event_fire(&event);
}
@@ -271,8 +271,8 @@
}
if (switch_event_create(&event, SWITCH_EVENT_DEL_SCHEDULE) == SWITCH_STATUS_SUCCESS) {
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Task-ID", "%u", tp->task.task_id);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Task-Desc", "%s", tp->desc);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Task-Group", "%s", switch_str_nil(tp->task.group));
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Task-Desc", tp->desc);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Task-Group", switch_str_nil(tp->task.group));
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Task-Runtime", "%" SWITCH_INT64_T_FMT, tp->task.runtime);
switch_event_fire(&event);
}
More information about the Freeswitch-svn
mailing list