[Freeswitch-svn] [commit] r6707 - in freeswitch/trunk/src: . mod/applications/mod_commands mod/applications/mod_conference mod/applications/mod_dptools mod/applications/mod_enum mod/applications/mod_expr mod/applications/mod_fifo mod/applications/mod_limit mod/applications/mod_rss mod/applications/mod_voicemail mod/asr_tts/mod_cepstral mod/codecs/mod_amr mod/dialplans/mod_dialplan_directory mod/endpoints/mod_dingaling mod/endpoints/mod_iax mod/endpoints/mod_portaudio mod/endpoints/mod_sofia mod/endpoints/mod_woomera mod/event_handlers/mod_cdr_csv mod/event_handlers/mod_event_multicast mod/event_handlers/mod_event_socket mod/event_handlers/mod_zeroconf mod/formats/mod_local_stream mod/languages/mod_spidermonkey mod/languages/mod_spidermonkey_core_db mod/languages/mod_spidermonkey_odbc mod/loggers/mod_logfile mod/say/mod_say_en mod/xml_int/mod_xml_curl mod/xml_int/mod_xml_rpc
Freeswitch SVN
mikej at freeswitch.org
Wed Dec 12 16:53:33 EST 2007
Author: mikej
Date: Wed Dec 12 16:53:32 2007
New Revision: 6707
Modified:
freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c
freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c
freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c
freeswitch/trunk/src/mod/applications/mod_enum/mod_enum.c
freeswitch/trunk/src/mod/applications/mod_expr/mod_expr.c
freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c
freeswitch/trunk/src/mod/applications/mod_limit/mod_limit.c
freeswitch/trunk/src/mod/applications/mod_rss/mod_rss.c
freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c
freeswitch/trunk/src/mod/asr_tts/mod_cepstral/mod_cepstral.c
freeswitch/trunk/src/mod/codecs/mod_amr/mod_amr.c
freeswitch/trunk/src/mod/dialplans/mod_dialplan_directory/mod_dialplan_directory.c
freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c
freeswitch/trunk/src/mod/endpoints/mod_iax/mod_iax.c
freeswitch/trunk/src/mod/endpoints/mod_portaudio/mod_portaudio.c
freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c
freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c
freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c
freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c
freeswitch/trunk/src/mod/endpoints/mod_woomera/mod_woomera.c
freeswitch/trunk/src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.c
freeswitch/trunk/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c
freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c
freeswitch/trunk/src/mod/event_handlers/mod_zeroconf/mod_zeroconf.c
freeswitch/trunk/src/mod/formats/mod_local_stream/mod_local_stream.c
freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
freeswitch/trunk/src/mod/languages/mod_spidermonkey_core_db/mod_spidermonkey_core_db.c
freeswitch/trunk/src/mod/languages/mod_spidermonkey_odbc/mod_spidermonkey_odbc.c
freeswitch/trunk/src/mod/loggers/mod_logfile/mod_logfile.c
freeswitch/trunk/src/mod/say/mod_say_en/mod_say_en.c
freeswitch/trunk/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c
freeswitch/trunk/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c
freeswitch/trunk/src/switch_caller.c
freeswitch/trunk/src/switch_channel.c
freeswitch/trunk/src/switch_config.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_db.c
freeswitch/trunk/src/switch_core_session.c
freeswitch/trunk/src/switch_event.c
freeswitch/trunk/src/switch_ivr.c
freeswitch/trunk/src/switch_ivr_play_say.c
freeswitch/trunk/src/switch_loadable_module.c
freeswitch/trunk/src/switch_log.c
freeswitch/trunk/src/switch_rtp.c
freeswitch/trunk/src/switch_utils.c
freeswitch/trunk/src/switch_xml.cpp
Log:
use switch_snprintf instead of snprintf becuase in insures null termination of strings.
Modified: freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c (original)
+++ freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c Wed Dec 12 16:53:32 2007
@@ -1610,7 +1610,7 @@
return -1;
}
- snprintf(id, sizeof(id), "%d", holder->rows);
+ switch_snprintf(id, sizeof(id), "%d", holder->rows);
switch_xml_set_attr(switch_xml_set_flag(row, SWITCH_XML_DUP), strdup("row_id"), strdup(id));
@@ -1743,9 +1743,9 @@
holder.print_title = 0;
if ((cmdname = strchr(command, ' ')) != 0) {
*cmdname++ = '\0';
- snprintf(sql, sizeof(sql) - 1, "select name, syntax, description from interfaces where type = 'api' and name = '%s'", cmdname);
+ switch_snprintf(sql, sizeof(sql) - 1, "select name, syntax, description from interfaces where type = 'api' and name = '%s'", cmdname);
} else {
- snprintf(sql, sizeof(sql) - 1, "select name, syntax, description from interfaces where type = 'api'");
+ switch_snprintf(sql, sizeof(sql) - 1, "select name, syntax, description from interfaces where type = 'api'");
}
} else {
stream->write_function(stream, "-USAGE: %s\n", SHOW_SYNTAX);
@@ -1791,7 +1791,7 @@
if (holder.xml) {
char count[50];
char *xmlstr;
- snprintf(count, sizeof(count), "%d", holder.count);
+ switch_snprintf(count, sizeof(count), "%d", holder.count);
switch_xml_set_attr(switch_xml_set_flag(holder.xml, SWITCH_XML_DUP), strdup("row_count"), strdup(count));
xmlstr = switch_xml_toxml(holder.xml, SWITCH_FALSE);
@@ -1817,7 +1817,7 @@
SWITCH_STANDARD_API(version_function)
{
char version_string[1024];
- snprintf(version_string, sizeof(version_string) - 1, "FreeSwitch Version %s\n", SWITCH_VERSION_FULL);
+ switch_snprintf(version_string, sizeof(version_string) - 1, "FreeSwitch Version %s\n", SWITCH_VERSION_FULL);
stream->write_function(stream, version_string);
return SWITCH_STATUS_SUCCESS;
@@ -1831,7 +1831,7 @@
sprintf(showcmd, "help");
all = 1;
} else {
- snprintf(showcmd, sizeof(showcmd) - 1, "help %s", cmd);
+ switch_snprintf(showcmd, sizeof(showcmd) - 1, "help %s", cmd);
}
if (all) {
Modified: freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c (original)
+++ freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c Wed Dec 12 16:53:32 2007
@@ -560,19 +560,19 @@
if (call_list) {
char saymsg[1024];
- snprintf(saymsg, sizeof(saymsg), "Auto Calling %d parties", call_list->itteration);
+ switch_snprintf(saymsg, sizeof(saymsg), "Auto Calling %d parties", call_list->itteration);
conference_member_say(member, saymsg, 0);
} else {
if (switch_strlen_zero(conference->special_announce)) {
/* anounce the total number of members in the conference */
if (conference->count >= conference->anounce_count && conference->anounce_count > 1) {
- snprintf(msg, sizeof(msg), "There are %d callers", conference->count);
+ switch_snprintf(msg, sizeof(msg), "There are %d callers", conference->count);
conference_member_say(member, msg, CONF_DEFAULT_LEADIN);
} else if (conference->count == 1 && !conference->perpetual_sound) {
if (conference->alone_sound) {
conference_play_file(conference, conference->alone_sound, CONF_DEFAULT_LEADIN, switch_core_session_get_channel(member->session), 0);
} else {
- snprintf(msg, sizeof(msg), "You are currently the only person in this conference.");
+ switch_snprintf(msg, sizeof(msg), "You are currently the only person in this conference.");
conference_member_say(member, msg, CONF_DEFAULT_LEADIN);
}
}
@@ -1093,7 +1093,7 @@
}
switch_mutex_unlock(member->flag_mutex);
- snprintf(msg, sizeof(msg), "Energy level %d", member->energy_level);
+ switch_snprintf(msg, sizeof(msg), "Energy level %d", member->energy_level);
conference_member_say(member, msg, 0);
@@ -1117,7 +1117,7 @@
}
switch_mutex_unlock(member->flag_mutex);
- snprintf(msg, sizeof(msg), "Energy level %d", member->energy_level);
+ switch_snprintf(msg, sizeof(msg), "Energy level %d", member->energy_level);
conference_member_say(member, msg, 0);
}
@@ -1143,7 +1143,7 @@
}
switch_mutex_unlock(member->flag_mutex);
- snprintf(msg, sizeof(msg), "Energy level %d", member->energy_level);
+ switch_snprintf(msg, sizeof(msg), "Energy level %d", member->energy_level);
conference_member_say(member, msg, 0);
@@ -1171,7 +1171,7 @@
switch_mutex_unlock(member->flag_mutex);
- snprintf(msg, sizeof(msg), "Volume level %d", member->volume_out_level);
+ switch_snprintf(msg, sizeof(msg), "Volume level %d", member->volume_out_level);
conference_member_say(member, msg, 0);
}
@@ -1196,7 +1196,7 @@
switch_mutex_unlock(member->flag_mutex);
- snprintf(msg, sizeof(msg), "Volume level %d", member->volume_out_level);
+ switch_snprintf(msg, sizeof(msg), "Volume level %d", member->volume_out_level);
conference_member_say(member, msg, 0);
@@ -1221,7 +1221,7 @@
}
switch_mutex_unlock(member->flag_mutex);
- snprintf(msg, sizeof(msg), "Volume level %d", member->volume_out_level);
+ switch_snprintf(msg, sizeof(msg), "Volume level %d", member->volume_out_level);
conference_member_say(member, msg, 0);
@@ -1248,7 +1248,7 @@
switch_mutex_unlock(member->flag_mutex);
- snprintf(msg, sizeof(msg), "Gain level %d", member->volume_in_level);
+ switch_snprintf(msg, sizeof(msg), "Gain level %d", member->volume_in_level);
conference_member_say(member, msg, 0);
@@ -1273,7 +1273,7 @@
}
switch_mutex_unlock(member->flag_mutex);
- snprintf(msg, sizeof(msg), "Gain level %d", member->volume_in_level);
+ switch_snprintf(msg, sizeof(msg), "Gain level %d", member->volume_in_level);
conference_member_say(member, msg, 0);
@@ -1301,7 +1301,7 @@
switch_mutex_unlock(member->flag_mutex);
- snprintf(msg, sizeof(msg), "Gain level %d", member->volume_in_level);
+ switch_snprintf(msg, sizeof(msg), "Gain level %d", member->volume_in_level);
conference_member_say(member, msg, 0);
@@ -2493,7 +2493,7 @@
} else {
char msg[512];
- snprintf(msg, sizeof(msg), "Muted");
+ switch_snprintf(msg, sizeof(msg), "Muted");
conference_member_say(member, msg, 0);
}
if (stream != NULL) {
@@ -2527,7 +2527,7 @@
} else {
char msg[512];
- snprintf(msg, sizeof(msg), "Un-Muted");
+ switch_snprintf(msg, sizeof(msg), "Un-Muted");
conference_member_say(member, msg, 0);
}
if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
@@ -3692,7 +3692,7 @@
}
/* add them to the conference */
if (flags && !strcasecmp(flags, "none")) {
- snprintf(appdata, sizeof(appdata), "%s+flags{%s}", conference_name, flags);
+ switch_snprintf(appdata, sizeof(appdata), "%s+flags{%s}", conference_name, flags);
switch_caller_extension_add_application(peer_session, extension, (char *) global_app_name, appdata);
} else {
switch_caller_extension_add_application(peer_session, extension, (char *) global_app_name, conference_name);
Modified: freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c (original)
+++ freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c Wed Dec 12 16:53:32 2007
@@ -1387,7 +1387,7 @@
char cause_num[35] = "";
cause_str = switch_channel_cause2str(cause);
- snprintf(cause_num, sizeof(cause_num), "%u", cause);
+ switch_snprintf(cause_num, sizeof(cause_num), "%u", cause);
if (switch_true(continue_on_fail) || switch_stristr(cause_str, continue_on_fail) || strstr(cause_num, continue_on_fail)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Continue on fail [%s]: Cause: %s\n", continue_on_fail, cause_str);
Modified: freeswitch/trunk/src/mod/applications/mod_enum/mod_enum.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_enum/mod_enum.c (original)
+++ freeswitch/trunk/src/mod/applications/mod_enum/mod_enum.c Wed Dec 12 16:53:32 2007
@@ -624,17 +624,17 @@
for (rtp = globals.route_order; rtp; rtp = rtp->next) {
for (rp = results; rp; rp = rp->next) {
if (!strcasecmp(rtp->service, rp->service)) {
- snprintf(vbuf, sizeof(vbuf), "enum_route_%d", cnt++);
+ switch_snprintf(vbuf, sizeof(vbuf), "enum_route_%d", cnt++);
switch_channel_set_variable(channel, vbuf, rp->route);
- snprintf(rbp, rbl, "%s|", rp->route);
+ switch_snprintf(rbp, rbl, "%s|", rp->route);
l = strlen(rp->route) + 1;
rbp += l;
rbl -= l;
}
}
}
- snprintf(vbuf, sizeof(vbuf), "%d", cnt);
+ switch_snprintf(vbuf, sizeof(vbuf), "%d", cnt);
switch_channel_set_variable(channel, "enum_route_count", vbuf);
*(rbuf + strlen(rbuf) - 1) = '\0';
switch_channel_set_variable(channel, "enum_auto_route", rbuf);
Modified: freeswitch/trunk/src/mod/applications/mod_expr/mod_expr.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_expr/mod_expr.c (original)
+++ freeswitch/trunk/src/mod/applications/mod_expr/mod_expr.c Wed Dec 12 16:53:32 2007
@@ -128,7 +128,7 @@
err = exprEval(e, &last_expr);
} while (err);
- snprintf(val, sizeof(val), "%0.10f", last_expr);
+ switch_snprintf(val, sizeof(val), "%0.10f", last_expr);
for (p = (val + strlen(val) - 1); p != val; p--) {
if (*p != '0') {
*(p+1) = '\0';
Modified: freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c (original)
+++ freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c Wed Dec 12 16:53:32 2007
@@ -471,9 +471,9 @@
switch_assert(x_fifo);
switch_xml_set_attr_d(x_fifo, "name", node->name);
- snprintf(tmp, sizeof(buffer), "%d", node->consumer_count);
+ switch_snprintf(tmp, sizeof(buffer), "%d", node->consumer_count);
switch_xml_set_attr_d(x_fifo, "consumer_count", tmp);
- snprintf(tmp, sizeof(buffer), "%d", node->caller_count);
+ switch_snprintf(tmp, sizeof(buffer), "%d", node->caller_count);
switch_xml_set_attr_d(x_fifo, "caller_count", tmp);
cc_off = xml_hash(x_fifo, node->caller_hash, "callers", "caller", cc_off, verbose);
Modified: freeswitch/trunk/src/mod/applications/mod_limit/mod_limit.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_limit/mod_limit.c (original)
+++ freeswitch/trunk/src/mod/applications/mod_limit/mod_limit.c Wed Dec 12 16:53:32 2007
@@ -325,7 +325,7 @@
static int group_callback(void *pArg, int argc, char **argv, char **columnNames)
{
callback_t *cbt = (callback_t *) pArg;
- snprintf(cbt->buf + strlen(cbt->buf), cbt->len - strlen(cbt->buf), "%s%c", argv[0], *argv[1]);
+ switch_snprintf(cbt->buf + strlen(cbt->buf), cbt->len - strlen(cbt->buf), "%s%c", argv[0], *argv[1]);
cbt->matches++;
return 0;
}
Modified: freeswitch/trunk/src/mod/applications/mod_rss/mod_rss.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_rss/mod_rss.c (original)
+++ freeswitch/trunk/src/mod/applications/mod_rss/mod_rss.c Wed Dec 12 16:53:32 2007
@@ -73,7 +73,7 @@
uint32_t len = (uint32_t) strlen(str);
for (x = 0; x < max; x++) {
- snprintf(tstr, sizeof(tstr), "%u", x);
+ switch_snprintf(tstr, sizeof(tstr), "%u", x);
if (!strncasecmp(str, tstr, len)) {
matches++;
}
@@ -316,28 +316,28 @@
title_txt = description_txt = rights_txt = "";
if (jumpto > -1) {
- snprintf(cmd, sizeof(cmd), "%d", jumpto);
+ switch_snprintf(cmd, sizeof(cmd), "%d", jumpto);
jumpto = -1;
} else {
switch_core_speech_flush_tts(&sh);
#ifdef MATCH_COUNT
- snprintf(buf + len, sizeof(buf) - len,
+ switch_snprintf(buf + len, sizeof(buf) - len,
",<break time=\"500ms\"/>Main Menu. <break time=\"600ms\"/> "
"Select one of the following news sources, or press 0 to exit. " ",<break time=\"600ms\"/>");
#else
- snprintf(buf + len, sizeof(buf) - len,
+ switch_snprintf(buf + len, sizeof(buf) - len,
",<break time=\"500ms\"/>Main Menu. <break time=\"600ms\"/> "
"Select one of the following news sources, followed by the pound key or press 0 to exit. " ",<break time=\"600ms\"/>");
#endif
len = (int32_t) strlen(buf);
for (idx = 0; idx < feed_index; idx++) {
- snprintf(buf + len, sizeof(buf) - len, "%d: %s. <break time=\"600ms\"/>", idx + 1, feed_names[idx]);
+ switch_snprintf(buf + len, sizeof(buf) - len, "%d: %s. <break time=\"600ms\"/>", idx + 1, feed_names[idx]);
len = (int32_t) strlen(buf);
}
- snprintf(buf + len, sizeof(buf) - len, "<break time=\"2000ms\"/>");
+ switch_snprintf(buf + len, sizeof(buf) - len, "<break time=\"2000ms\"/>");
len = (int32_t) strlen(buf);
args.input_callback = NULL;
@@ -497,7 +497,7 @@
switch_strftime(date, &retsize, sizeof(date), "%I:%M %p", &tm);
- snprintf(buf, sizeof(buf),
+ switch_snprintf(buf, sizeof(buf),
",<break time=\"500ms\"/>%s. %s. %s. local time: %s, Press 0 for options, 5 to change voice, or pound to return to the main menu. ",
title_txt, description_txt, rights_txt, date);
args.input_callback = NULL;
@@ -555,14 +555,14 @@
}
if (switch_test_flag(&dtb, SFLAG_INFO)) {
switch_clear_flag(&dtb, SFLAG_INFO);
- snprintf(buf + len, sizeof(buf) - len, "%s %s. I am speaking at %u words per minute. ", sh.engine, sh.voice, dtb.speed);
+ switch_snprintf(buf + len, sizeof(buf) - len, "%s %s. I am speaking at %u words per minute. ", sh.engine, sh.voice, dtb.speed);
len = (uint32_t) strlen(buf);
}
if (switch_test_flag(&dtb, SFLAG_INSTRUCT)) {
switch_clear_flag(&dtb, SFLAG_INSTRUCT);
cont = 1;
- snprintf(buf + len, sizeof(buf) - len,
+ switch_snprintf(buf + len, sizeof(buf) - len,
"Press star to pause or resume speech. "
"To go to the next item, press six. "
"To go back, press 4. "
@@ -570,21 +570,21 @@
"To change voices, press five. To restore the original voice press 9. "
"To hear these options again, press zero or press pound to return to the main menu. ");
} else {
- snprintf(buf + len, sizeof(buf) - len, "Story %d. ", dtb.index + 1);
+ switch_snprintf(buf + len, sizeof(buf) - len, "Story %d. ", dtb.index + 1);
len = (uint32_t) strlen(buf);
if (entries[dtb.index].subject_txt) {
- snprintf(buf + len, sizeof(buf) - len, "Subject: %s. ", entries[dtb.index].subject_txt);
+ switch_snprintf(buf + len, sizeof(buf) - len, "Subject: %s. ", entries[dtb.index].subject_txt);
len = (uint32_t) strlen(buf);
}
if (entries[dtb.index].dept_txt) {
- snprintf(buf + len, sizeof(buf) - len, "From the %s department. ", entries[dtb.index].dept_txt);
+ switch_snprintf(buf + len, sizeof(buf) - len, "From the %s department. ", entries[dtb.index].dept_txt);
len = (uint32_t) strlen(buf);
}
if (entries[dtb.index].title_txt) {
- snprintf(buf + len, sizeof(buf) - len, "%s", entries[dtb.index].title_txt);
+ switch_snprintf(buf + len, sizeof(buf) - len, "%s", entries[dtb.index].title_txt);
len = (uint32_t) strlen(buf);
}
}
Modified: freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c (original)
+++ freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c Wed Dec 12 16:53:32 2007
@@ -893,7 +893,7 @@
while(switch_channel_ready(channel)) {
- snprintf(key_buf, sizeof(key_buf), "%s:%s:%s",
+ switch_snprintf(key_buf, sizeof(key_buf), "%s:%s:%s",
profile->listen_file_key,
profile->save_file_key,
profile->record_file_key);
@@ -1007,7 +1007,7 @@
cbt.len = sizeof(msg_count);
- snprintf(sql, sizeof(sql),
+ switch_snprintf(sql, sizeof(sql),
"select count(*) from voicemail_data where user='%s' and domain='%s' and in_folder='%s' and read_epoch=0",
myid,
domain_name,
@@ -1015,7 +1015,7 @@
vm_execute_sql_callback(profile, profile->mutex, sql, sql2str_callback, &cbt);
*total_new_messages = atoi(msg_count);
- snprintf(sql, sizeof(sql),
+ switch_snprintf(sql, sizeof(sql),
"select count(*) from voicemail_data where user='%s' and domain='%s' and in_folder='%s' and read_epoch=0 and read_flags='%s'",
myid,
domain_name,
@@ -1024,7 +1024,7 @@
vm_execute_sql_callback(profile, profile->mutex, sql, sql2str_callback, &cbt);
*total_new_urgent_messages = atoi(msg_count);
- snprintf(sql, sizeof(sql),
+ switch_snprintf(sql, sizeof(sql),
"select count(*) from voicemail_data where user='%s' and domain='%s' and in_folder='%s' and read_epoch!=0",
myid,
domain_name,
@@ -1033,7 +1033,7 @@
*total_saved_messages = atoi(msg_count);
- snprintf(sql, sizeof(sql),
+ switch_snprintf(sql, sizeof(sql),
"select count(*) from voicemail_data where user='%s' and domain='%s' and in_folder='%s' and read_epoch!=0 and read_flags='%s'",
myid,
domain_name,
@@ -1063,7 +1063,7 @@
args.input_callback = cancel_on_dtmf;
- snprintf(key_buf, sizeof(key_buf), "%s:%s:%s:%s:%s",
+ switch_snprintf(key_buf, sizeof(key_buf), "%s:%s:%s:%s:%s",
profile->listen_file_key,
profile->save_file_key,
profile->delete_file_key,
@@ -1071,7 +1071,7 @@
profile->callback_key);
- snprintf(input, sizeof(input), "%s:%d", cbt->type == MSG_NEW ? "new" : "saved", cbt->want+1);
+ switch_snprintf(input, sizeof(input), "%s:%d", cbt->type == MSG_NEW ? "new" : "saved", cbt->want+1);
memset(&cc, 0, sizeof(cc));
cc.profile = profile;
args.buf = &cc;
@@ -1141,13 +1141,13 @@
switch_time_exp_lt(&tm, atoi(cbt->created_epoch) * 1000000);
switch_strftime(date, &retsize, sizeof(date), profile->date_fmt, &tm);
- snprintf(tmp,sizeof(tmp), "%d", total_new_messages);
+ switch_snprintf(tmp,sizeof(tmp), "%d", total_new_messages);
switch_channel_set_variable(channel, "voicemail_total_new_messages", tmp);
- snprintf(tmp,sizeof(tmp), "%d", total_saved_messages);
+ switch_snprintf(tmp,sizeof(tmp), "%d", total_saved_messages);
switch_channel_set_variable(channel, "voicemail_total_saved_messages", tmp);
- snprintf(tmp,sizeof(tmp), "%d", total_new_urgent_messages);
+ switch_snprintf(tmp,sizeof(tmp), "%d", total_new_urgent_messages);
switch_channel_set_variable(channel, "voicemail_urgent_new_messages", tmp);
- snprintf(tmp,sizeof(tmp), "%d", total_saved_urgent_messages);
+ switch_snprintf(tmp,sizeof(tmp), "%d", total_saved_urgent_messages);
switch_channel_set_variable(channel, "voicemail_urgent_saved_messages", tmp);
switch_channel_set_variable(channel, "voicemail_current_folder", cbt->in_folder);
switch_channel_set_variable(channel, "voicemail_account", cbt->user);
@@ -1157,7 +1157,7 @@
switch_channel_set_variable(channel, "voicemail_file_path", cbt->file_path);
switch_channel_set_variable(channel, "voicemail_read_flags", cbt->read_flags);
switch_channel_set_variable(channel, "voicemail_time", date);
- snprintf(tmp,sizeof(tmp), "%d", priority);
+ switch_snprintf(tmp,sizeof(tmp), "%d", priority);
switch_channel_set_variable(channel, "voicemail_priority", tmp);
message_len = atoi(cbt->message_len);
@@ -1166,7 +1166,7 @@
duration.day += duration.yr * 365;
duration.hr += duration.day * 24;
- snprintf(duration_str, sizeof(duration_str), "%.2u:%.2u:%.2u",
+ switch_snprintf(duration_str, sizeof(duration_str), "%.2u:%.2u:%.2u",
duration.hr,
duration.min,
duration.sec
@@ -1310,12 +1310,12 @@
if (total_new_urgent_messages > 0) {
- snprintf(msg_count, sizeof(msg_count), "%d:urgent-new", total_new_urgent_messages);
+ switch_snprintf(msg_count, sizeof(msg_count), "%d:urgent-new", total_new_urgent_messages);
TRY_CODE(switch_ivr_phrase_macro(session, VM_MESSAGE_COUNT_MACRO, msg_count, NULL, NULL));
informed++;
}
if (total_new_messages > 0 && total_new_messages != total_new_urgent_messages) {
- snprintf(msg_count, sizeof(msg_count), "%d:new", total_new_messages);
+ switch_snprintf(msg_count, sizeof(msg_count), "%d:new", total_new_messages);
TRY_CODE(switch_ivr_phrase_macro(session, VM_MESSAGE_COUNT_MACRO, msg_count, NULL, NULL));
informed++;
}
@@ -1328,13 +1328,13 @@
}
if (total_saved_urgent_messages > 0) {
- snprintf(msg_count, sizeof(msg_count), "%d:urgent-saved", total_saved_urgent_messages);
+ switch_snprintf(msg_count, sizeof(msg_count), "%d:urgent-saved", total_saved_urgent_messages);
TRY_CODE(switch_ivr_phrase_macro(session, VM_MESSAGE_COUNT_MACRO, msg_count, NULL, NULL));
informed++;
}
if (total_saved_messages > 0 && total_saved_messages != total_saved_urgent_messages) {
- snprintf(msg_count, sizeof(msg_count), "%d:saved", total_saved_messages);
+ switch_snprintf(msg_count, sizeof(msg_count), "%d:saved", total_saved_messages);
TRY_CODE(switch_ivr_phrase_macro(session, VM_MESSAGE_COUNT_MACRO, msg_count, NULL, NULL));
informed++;
}
@@ -1347,7 +1347,7 @@
}
if (!informed) {
- snprintf(msg_count, sizeof(msg_count), "0:new");
+ switch_snprintf(msg_count, sizeof(msg_count), "0:new");
TRY_CODE(switch_ivr_phrase_macro(session, VM_MESSAGE_COUNT_MACRO, msg_count, NULL, NULL));
informed++;
}
@@ -1368,7 +1368,7 @@
switch(play_msg_type) {
case MSG_NEW:
{
- snprintf(sql, sizeof(sql),
+ switch_snprintf(sql, sizeof(sql),
"select * from voicemail_data where user='%s' and domain='%s' and read_epoch=0 order by read_flags", myid, domain_name);
total_messages = total_new_messages;
heard_auto_new = heard_auto_saved = 1;
@@ -1377,7 +1377,7 @@
case MSG_SAVED:
default:
{
- snprintf(sql, sizeof(sql),
+ switch_snprintf(sql, sizeof(sql),
"select * from voicemail_data where user='%s' and domain='%s' and read_epoch !=0 order by read_flags", myid, domain_name);
total_messages = total_saved_messages;
heard_auto_new = heard_auto_saved = 1;
@@ -1394,12 +1394,12 @@
break;
}
}
- snprintf(sql, sizeof(sql), "update voicemail_data set read_epoch=%ld where user='%s' and domain='%s' and flags='save'",
+ switch_snprintf(sql, sizeof(sql), "update voicemail_data set read_epoch=%ld where user='%s' and domain='%s' and flags='save'",
(long)time(NULL), myid, domain_name);
vm_execute_sql(profile, sql, profile->mutex);
- snprintf(sql, sizeof(sql), "select file_path from voicemail_data where user='%s' and domain='%s' and flags='delete'", myid, domain_name);
+ switch_snprintf(sql, sizeof(sql), "select file_path from voicemail_data where user='%s' and domain='%s' and flags='delete'", myid, domain_name);
vm_execute_sql_callback(profile, profile->mutex, sql, unlink_callback, NULL);
- snprintf(sql, sizeof(sql), "delete from voicemail_data where user='%s' and domain='%s' and flags='delete'", myid, domain_name);
+ switch_snprintf(sql, sizeof(sql), "delete from voicemail_data where user='%s' and domain='%s' and flags='delete'", myid, domain_name);
vm_execute_sql(profile, sql, profile->mutex);
vm_check_state = VM_CHECK_FOLDER_SUMMARY;
}
@@ -1425,7 +1425,7 @@
switch_safe_free(sql);
}
- snprintf(key_buf, sizeof(key_buf), "%s:%s:%s:%s",
+ switch_snprintf(key_buf, sizeof(key_buf), "%s:%s:%s:%s",
profile->record_greeting_key,
profile->choose_greeting_key,
profile->record_name_key,
@@ -1506,7 +1506,7 @@
char key_buf[80] = "";
play_msg_type = MSG_NONE;
- snprintf(key_buf, sizeof(key_buf), "%s:%s:%s:%s",
+ switch_snprintf(key_buf, sizeof(key_buf), "%s:%s:%s:%s",
profile->play_new_messages_key,
profile->play_saved_messages_key,
profile->config_menu_key,
@@ -1789,7 +1789,7 @@
}
}
- snprintf(sql, sizeof(sql),
+ switch_snprintf(sql, sizeof(sql),
"select * from voicemail_prefs where user='%s' and domain='%s'",
id,
domain_name);
@@ -1874,7 +1874,7 @@
if ((status == SWITCH_STATUS_SUCCESS || status == SWITCH_STATUS_BREAK) && switch_channel_ready(channel)) {
char input[10] = "", key_buf[80] = "", term = 0;
- snprintf(key_buf, sizeof(key_buf), "%s:%s",
+ switch_snprintf(key_buf, sizeof(key_buf), "%s:%s",
profile->urgent_key,
profile->terminator_key);
@@ -1946,13 +1946,13 @@
switch_strftime(date, &retsize, sizeof(date), profile->date_fmt, &tm);
switch_channel_set_variable(channel, "voicemail_current_folder", myfolder);
- snprintf(tmp,sizeof(tmp), "%d", total_new_messages);
+ switch_snprintf(tmp,sizeof(tmp), "%d", total_new_messages);
switch_channel_set_variable(channel, "voicemail_total_new_messages", tmp);
- snprintf(tmp,sizeof(tmp), "%d", total_saved_messages);
+ switch_snprintf(tmp,sizeof(tmp), "%d", total_saved_messages);
switch_channel_set_variable(channel, "voicemail_total_saved_messages", tmp);
- snprintf(tmp,sizeof(tmp), "%d", total_new_urgent_messages);
+ switch_snprintf(tmp,sizeof(tmp), "%d", total_new_urgent_messages);
switch_channel_set_variable(channel, "voicemail_urgent_new_messages", tmp);
- snprintf(tmp,sizeof(tmp), "%d", total_saved_urgent_messages);
+ switch_snprintf(tmp,sizeof(tmp), "%d", total_saved_urgent_messages);
switch_channel_set_variable(channel, "voicemail_urgent_saved_messages", tmp);
switch_channel_set_variable(channel, "voicemail_account", id);
switch_channel_set_variable(channel, "voicemail_domain", domain_name);
@@ -1961,7 +1961,7 @@
switch_channel_set_variable(channel, "voicemail_file_path", file_path);
switch_channel_set_variable(channel, "voicemail_read_flags", read_flags);
switch_channel_set_variable(channel, "voicemail_time", date);
- snprintf(tmp,sizeof(tmp), "%d", priority);
+ switch_snprintf(tmp,sizeof(tmp), "%d", priority);
switch_channel_set_variable(channel, "voicemail_priority", tmp);
switch_channel_set_variable(channel, "voicemail_email", email_vm);
@@ -1971,7 +1971,7 @@
switch_core_measure_time(l_duration, &duration);
duration.day += duration.yr * 365;
duration.hr += duration.day * 24;
- snprintf(duration_str, sizeof(duration_str), "%.2u:%.2u:%.2u",
+ switch_snprintf(duration_str, sizeof(duration_str), "%.2u:%.2u:%.2u",
duration.hr,
duration.min,
duration.sec
@@ -2366,7 +2366,7 @@
duration.day += duration.yr * 365;
duration.hr += duration.day * 24;
- snprintf(duration_str, sizeof(duration_str), "%.2u:%.2u:%.2u",
+ switch_snprintf(duration_str, sizeof(duration_str), "%.2u:%.2u:%.2u",
duration.hr,
duration.min,
duration.sec
@@ -2383,7 +2383,7 @@
switch_strftime(read_date, &retsize, sizeof(read_date), fmt, &tm);
}
- snprintf(heard, sizeof(heard), *read_date == '\0' ? "never" : read_date);
+ switch_snprintf(heard, sizeof(heard), *read_date == '\0' ? "never" : read_date);
get = switch_mprintf("http://%s:%s%s/get/%s", holder->host, holder->port, holder->uri, fname);
del = switch_mprintf("http://%s:%s%s/del/%s", holder->host, holder->port, holder->uri, fname);
@@ -2397,7 +2397,7 @@
//"<a href=%s>Delete This Message</a><br><hr noshade size=1>",
strcmp(argv[10], URGENT_FLAG_STRING) ? "normal" : "urgent", create_date, heard, duration_str);
- snprintf(title_b4, sizeof(title_b4), "%s <%s> %s", argv[5], argv[6], rss_date);
+ switch_snprintf(title_b4, sizeof(title_b4), "%s <%s> %s", argv[5], argv[6], rss_date);
switch_url_encode(title_b4, title_aft, sizeof(title_aft)-1);
@@ -2455,7 +2455,7 @@
duration.day += duration.yr * 365;
duration.hr += duration.day * 24;
- snprintf(duration_str, sizeof(duration_str), "%.2u:%.2u:%.2u",
+ switch_snprintf(duration_str, sizeof(duration_str), "%.2u:%.2u:%.2u",
duration.hr,
duration.min,
duration.sec
@@ -2481,7 +2481,7 @@
x_tmp = switch_xml_add_child_d(holder->x_item, "description", 0);
- snprintf(heard, sizeof(heard), *read_date == '\0' ? "never" : read_date);
+ switch_snprintf(heard, sizeof(heard), *read_date == '\0' ? "never" : read_date);
if ((fname = strrchr(argv[8], '/'))) {
fname++;
Modified: freeswitch/trunk/src/mod/asr_tts/mod_cepstral/mod_cepstral.c
==============================================================================
--- freeswitch/trunk/src/mod/asr_tts/mod_cepstral/mod_cepstral.c (original)
+++ freeswitch/trunk/src/mod/asr_tts/mod_cepstral/mod_cepstral.c Wed Dec 12 16:53:32 2007
@@ -134,7 +134,7 @@
cepstral->params = swift_params_new(NULL);
swift_params_set_string(cepstral->params, "audio/encoding", "pcm16");
- snprintf(srate, sizeof(srate), "%d", rate);
+ switch_snprintf(srate, sizeof(srate), "%d", rate);
swift_params_set_string(cepstral->params, "audio/sampling-rate", srate);
Modified: freeswitch/trunk/src/mod/codecs/mod_amr/mod_amr.c
==============================================================================
--- freeswitch/trunk/src/mod/codecs/mod_amr/mod_amr.c (original)
+++ freeswitch/trunk/src/mod/codecs/mod_amr/mod_amr.c Wed Dec 12 16:53:32 2007
@@ -203,7 +203,7 @@
context->enc_mode = globals.default_bitrate;
}
- snprintf(fmtptmp, sizeof(fmtptmp), "octet-align=%d; mode-set=%d", switch_test_flag(context, AMR_OPT_OCTET_ALIGN) ? 1 : 0, context->enc_mode);
+ switch_snprintf(fmtptmp, sizeof(fmtptmp), "octet-align=%d; mode-set=%d", switch_test_flag(context, AMR_OPT_OCTET_ALIGN) ? 1 : 0, context->enc_mode);
codec->fmtp_out = switch_core_strdup(codec->memory_pool, fmtptmp);
context->enc_mode = AMR_DEFAULT_BITRATE;
Modified: freeswitch/trunk/src/mod/dialplans/mod_dialplan_directory/mod_dialplan_directory.c
==============================================================================
--- freeswitch/trunk/src/mod/dialplans/mod_dialplan_directory/mod_dialplan_directory.c (original)
+++ freeswitch/trunk/src/mod/dialplans/mod_dialplan_directory/mod_dialplan_directory.c Wed Dec 12 16:53:32 2007
@@ -113,9 +113,9 @@
return NULL;
}
- snprintf(filter, sizeof(filter), "exten=%s", caller_profile->destination_number);
+ switch_snprintf(filter, sizeof(filter), "exten=%s", caller_profile->destination_number);
if (caller_profile->context) {
- snprintf(filter + strlen(filter), sizeof(filter) - strlen(filter), "context=%s", caller_profile->context);
+ switch_snprintf(filter + strlen(filter), sizeof(filter) - strlen(filter), "context=%s", caller_profile->context);
}
Modified: freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c Wed Dec 12 16:53:32 2007
@@ -1643,7 +1643,7 @@
*p++ = '\0';
u = profile_name;
profile_name = p;
- snprintf(ubuf, sizeof(ubuf), "%s@%s/talk", u, profile_name);
+ switch_snprintf(ubuf, sizeof(ubuf), "%s@%s/talk", u, profile_name);
user = ubuf;
}
@@ -1661,10 +1661,10 @@
}
if (strchr(id_num, '@')) {
- snprintf(ubuf, sizeof(ubuf), "%s/talk", id_num);
+ switch_snprintf(ubuf, sizeof(ubuf), "%s/talk", id_num);
user = ubuf;
} else {
- snprintf(ubuf, sizeof(ubuf), "%s@%s/talk", id_num, profile_name);
+ switch_snprintf(ubuf, sizeof(ubuf), "%s@%s/talk", id_num, profile_name);
user = ubuf;
}
}
@@ -1713,7 +1713,7 @@
if (outbound_profile) {
char name[128];
- snprintf(name, sizeof(name), "DingaLing/%s", outbound_profile->destination_number);
+ switch_snprintf(name, sizeof(name), "DingaLing/%s", outbound_profile->destination_number);
switch_channel_set_name(channel, name);
caller_profile = switch_caller_profile_clone(*new_session, outbound_profile);
@@ -2198,7 +2198,7 @@
profile->message = "";
profile->user_flags |= LDL_FLAG_COMPONENT;
switch_mutex_init(&profile->mutex, SWITCH_MUTEX_NESTED, module_pool);
- snprintf(dbname, sizeof(dbname), "dingaling_%s", profile->name);
+ switch_snprintf(dbname, sizeof(dbname), "dingaling_%s", profile->name);
profile->dbname = switch_core_strdup(module_pool, dbname);
@@ -2670,7 +2670,7 @@
context,
exten)) != 0) {
char name[128];
- snprintf(name, sizeof(name), "DingaLing/%s", tech_pvt->caller_profile->destination_number);
+ switch_snprintf(name, sizeof(name), "DingaLing/%s", tech_pvt->caller_profile->destination_number);
switch_channel_set_name(channel, name);
switch_channel_set_caller_profile(channel, tech_pvt->caller_profile);
}
Modified: freeswitch/trunk/src/mod/endpoints/mod_iax/mod_iax.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_iax/mod_iax.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_iax/mod_iax.c Wed Dec 12 16:53:32 2007
@@ -810,7 +810,7 @@
if (outbound_profile) {
char name[128];
- snprintf(name, sizeof(name), "IAX/%s-%04x", outbound_profile->destination_number, rand() & 0xffff);
+ switch_snprintf(name, sizeof(name), "IAX/%s-%04x", outbound_profile->destination_number, rand() & 0xffff);
switch_channel_set_name(channel, name);
caller_profile = switch_caller_profile_clone(*new_session, outbound_profile);
@@ -1131,7 +1131,7 @@
iaxevent->ies.called_context,
iaxevent->ies.called_number)) != 0) {
char name[128];
- snprintf(name, sizeof(name), "IAX/%s-%04x", tech_pvt->caller_profile->destination_number, rand() & 0xffff);
+ switch_snprintf(name, sizeof(name), "IAX/%s-%04x", tech_pvt->caller_profile->destination_number, rand() & 0xffff);
switch_channel_set_name(channel, name);
switch_channel_set_caller_profile(channel, tech_pvt->caller_profile);
Modified: freeswitch/trunk/src/mod/endpoints/mod_portaudio/mod_portaudio.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_portaudio/mod_portaudio.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_portaudio/mod_portaudio.c Wed Dec 12 16:53:32 2007
@@ -249,7 +249,7 @@
char buf[512];
switch_event_t *event;
- snprintf(buf, sizeof(buf), "BRRRRING! BRRRRING! call %s\n", tech_pvt->call_id);
+ switch_snprintf(buf, sizeof(buf), "BRRRRING! BRRRRING! call %s\n", tech_pvt->call_id);
if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, MY_EVENT_RINGING) == SWITCH_STATUS_SUCCESS) {
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event_info", "%s", buf);
@@ -365,7 +365,7 @@
switch_mutex_lock(globals.pvt_lock);
if (switch_strlen_zero(tech_pvt->call_id)) {
- snprintf(tech_pvt->call_id, sizeof(tech_pvt->call_id), "%d", ++globals.call_id);
+ switch_snprintf(tech_pvt->call_id, sizeof(tech_pvt->call_id), "%d", ++globals.call_id);
switch_core_hash_insert(globals.call_hash, tech_pvt->call_id, tech_pvt);
switch_core_session_set_read_codec(tech_pvt->session, &globals.read_codec);
switch_core_session_set_write_codec(tech_pvt->session, &globals.write_codec);
@@ -766,7 +766,7 @@
if (outbound_profile) {
char name[128];
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_snprintf(name, sizeof(name), "PortAudio/%s", id);
switch_channel_set_name(channel, name);
@@ -1611,7 +1611,7 @@
ip, NULL, NULL, NULL, modname, NULL,
dest)) != 0) {
char name[128];
- snprintf(name, sizeof(name), "PortAudio/%s",
+ switch_snprintf(name, sizeof(name), "PortAudio/%s",
tech_pvt->caller_profile->destination_number ? tech_pvt->caller_profile->destination_number : modname);
switch_channel_set_name(channel, name);
@@ -1689,19 +1689,19 @@
if (action) {
if (strlen(action) == 1) {
- snprintf(cmd_buf, sizeof(cmd_buf), "dtmf %s", action);
+ switch_snprintf(cmd_buf, sizeof(cmd_buf), "dtmf %s", action);
cmd = cmd_buf;
} else if (!strcmp(action, "mute")) {
- snprintf(cmd_buf, sizeof(cmd_buf), "flags off mouth");
+ switch_snprintf(cmd_buf, sizeof(cmd_buf), "flags off mouth");
cmd = cmd_buf;
} else if (!strcmp(action, "unmute")) {
- snprintf(cmd_buf, sizeof(cmd_buf), "flags on mouth");
+ switch_snprintf(cmd_buf, sizeof(cmd_buf), "flags on mouth");
cmd = cmd_buf;
} else if (!strcmp(action, "switch")) {
- snprintf(cmd_buf, sizeof(cmd_buf), "switch %s", wcmd);
+ switch_snprintf(cmd_buf, sizeof(cmd_buf), "switch %s", wcmd);
cmd = cmd_buf;
} else if (!strcmp(action, "call")) {
- snprintf(cmd_buf, sizeof(cmd_buf), "call %s", wcmd);
+ switch_snprintf(cmd_buf, sizeof(cmd_buf), "call %s", wcmd);
cmd = cmd_buf;
} else if (!strcmp(action, "hangup") || !strcmp(action, "list") || !strcmp(action, "answer")) {
cmd = action;
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c Wed Dec 12 16:53:32 2007
@@ -1524,7 +1524,7 @@
if ((dest_to = strchr(dest, '^'))) {
*dest_to++ = '\0';
tech_pvt->dest_to = switch_core_session_alloc(nsession, strlen(dest_to) + 5);
- snprintf(tech_pvt->dest_to, strlen(dest_to) + 5, "sip:%s", dest_to);
+ switch_snprintf(tech_pvt->dest_to, strlen(dest_to) + 5, "sip:%s", dest_to);
}
if ((host = strchr(dest, '%'))) {
@@ -1557,7 +1557,7 @@
}
} else {
tech_pvt->dest = switch_core_session_alloc(nsession, strlen(dest) + 5);
- snprintf(tech_pvt->dest, strlen(dest) + 5, "sip:%s", dest);
+ switch_snprintf(tech_pvt->dest, strlen(dest) + 5, "sip:%s", dest);
}
}
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c Wed Dec 12 16:53:32 2007
@@ -741,7 +741,7 @@
return status;
}
- snprintf(url, sizeof(url), "profile=%s", switch_str_nil(profile_name));
+ switch_snprintf(url, sizeof(url), "profile=%s", switch_str_nil(profile_name));
if (!(xml = switch_xml_open_cfg(cf, &cfg, url))) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "open of %s failed\n", cf);
@@ -796,7 +796,7 @@
profile->user_agent = SOFIA_USER_AGENT;
profile->name = switch_core_strdup(profile->pool, xprofilename);
- snprintf(url, sizeof(url), "sofia_reg_%s", xprofilename);
+ switch_snprintf(url, sizeof(url), "sofia_reg_%s", xprofilename);
profile->dbname = switch_core_strdup(profile->pool, url);
switch_core_hash_init(&profile->chat_hash, profile->pool);
@@ -1457,7 +1457,7 @@
if (switch_test_flag(tech_pvt, TFLAG_NOHUP)) {
switch_clear_flag_locked(tech_pvt, TFLAG_NOHUP);
} else {
- snprintf(st, sizeof(st), "%d", status);
+ switch_snprintf(st, sizeof(st), "%d", status);
switch_channel_set_variable(channel, "sip_term_status", st);
switch_channel_hangup(channel, sofia_glue_sip_cause_to_freeswitch(status));
}
@@ -2034,7 +2034,7 @@
if (sip->sip_max_forwards) {
char max_forwards[32];
- snprintf(max_forwards, sizeof(max_forwards), "%lu", sip->sip_max_forwards->mf_count);
+ switch_snprintf(max_forwards, sizeof(max_forwards), "%lu", sip->sip_max_forwards->mf_count);
switch_channel_set_variable(channel, SWITCH_MAX_FORWARDS_VARIABLE, max_forwards);
}
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c Wed Dec 12 16:53:32 2007
@@ -81,7 +81,7 @@
tech_pvt->session_id++;
- snprintf(buf, sizeof(buf),
+ switch_snprintf(buf, sizeof(buf),
"v=0\n"
"o=FreeSWITCH %010u %010u IN IP4 %s\n"
"s=FreeSWITCH\n"
@@ -90,7 +90,7 @@
"m=audio %d RTP/AVP", tech_pvt->owner_id, tech_pvt->session_id, ip, ip, sr, port);
if (tech_pvt->rm_encoding) {
- snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), " %d", tech_pvt->pt);
+ switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), " %d", tech_pvt->pt);
} else if (tech_pvt->num_codecs) {
int i;
int already_did[128] = { 0 };
@@ -109,7 +109,7 @@
already_did[imp->ianacode] = 1;
}
- snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), " %d", imp->ianacode);
+ switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), " %d", imp->ianacode);
if (!ptime) {
ptime = imp->microseconds_per_frame / 1000;
}
@@ -117,20 +117,20 @@
}
if (tech_pvt->te > 95) {
- snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), " %d", tech_pvt->te);
+ switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), " %d", tech_pvt->te);
}
if (tech_pvt->cng_pt && use_cng) {
- snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), " %d", tech_pvt->cng_pt);
+ switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), " %d", tech_pvt->cng_pt);
}
- snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "\n");
+ switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "\n");
if (tech_pvt->rm_encoding) {
rate = tech_pvt->rm_rate;
- snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "a=rtpmap:%d %s/%d\n", tech_pvt->pt, tech_pvt->rm_encoding, rate);
+ switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "a=rtpmap:%d %s/%d\n", tech_pvt->pt, tech_pvt->rm_encoding, rate);
if (tech_pvt->fmtp_out) {
- snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "a=fmtp:%d %s\n", tech_pvt->pt, tech_pvt->fmtp_out);
+ switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "a=fmtp:%d %s\n", tech_pvt->pt, tech_pvt->fmtp_out);
}
if (tech_pvt->read_codec.implementation && !ptime) {
ptime = tech_pvt->read_codec.implementation->microseconds_per_frame / 1000;
@@ -159,38 +159,38 @@
if (ptime && ptime != imp->microseconds_per_frame / 1000) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "ptime %u != advertised ptime %u\n", imp->microseconds_per_frame / 1000, ptime);
}
- snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "a=rtpmap:%d %s/%d\n", imp->ianacode, imp->iananame, rate);
+ switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "a=rtpmap:%d %s/%d\n", imp->ianacode, imp->iananame, rate);
if (imp->fmtp) {
- snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "a=fmtp:%d %s\n", imp->ianacode, imp->fmtp);
+ switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "a=fmtp:%d %s\n", imp->ianacode, imp->fmtp);
}
}
}
if (tech_pvt->te > 95) {
- snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "a=rtpmap:%d telephone-event/8000\na=fmtp:%d 0-16\n", tech_pvt->te, tech_pvt->te);
+ switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "a=rtpmap:%d telephone-event/8000\na=fmtp:%d 0-16\n", tech_pvt->te, tech_pvt->te);
}
if (tech_pvt->cng_pt && use_cng) {
- snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "a=rtpmap:%d CN/8000\n", tech_pvt->cng_pt);
+ switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "a=rtpmap:%d CN/8000\n", tech_pvt->cng_pt);
if (!tech_pvt->rm_encoding) {
tech_pvt->cng_pt = 0;
}
} else {
- snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "a=silenceSupp:off - - - -\n");
+ switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "a=silenceSupp:off - - - -\n");
}
if (ptime) {
- snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "a=ptime:%d\n", ptime);
+ switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "a=ptime:%d\n", ptime);
}
if (switch_test_flag(tech_pvt, TFLAG_VIDEO) && tech_pvt->video_rm_encoding) {
sofia_glue_tech_choose_video_port(tech_pvt);
if ((v_port = tech_pvt->adv_sdp_video_port)) {
- snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "m=video %d RTP/AVP", v_port);
+ switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "m=video %d RTP/AVP", v_port);
sofia_glue_tech_set_video_codec(tech_pvt, 0);
/*****************************/
if (tech_pvt->video_rm_encoding) {
- snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), " %d", tech_pvt->video_pt);
+ switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), " %d", tech_pvt->video_pt);
} else if (tech_pvt->num_codecs) {
int i;
int already_did[128] = { 0 };
@@ -208,20 +208,20 @@
already_did[imp->ianacode] = 1;
}
- snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), " %d", imp->ianacode);
+ switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), " %d", imp->ianacode);
if (!ptime) {
ptime = imp->microseconds_per_frame / 1000;
}
}
}
- snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "\n");
+ switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "\n");
if (tech_pvt->rm_encoding) {
rate = tech_pvt->video_rm_rate;
- snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "a=rtpmap:%d %s/%ld\n", tech_pvt->video_pt, tech_pvt->video_rm_encoding, tech_pvt->video_rm_rate);
+ switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "a=rtpmap:%d %s/%ld\n", tech_pvt->video_pt, tech_pvt->video_rm_encoding, tech_pvt->video_rm_rate);
if (tech_pvt->video_fmtp_out) {
- snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "a=fmtp:%d %s\n", tech_pvt->video_pt, tech_pvt->video_fmtp_out);
+ switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "a=fmtp:%d %s\n", tech_pvt->video_pt, tech_pvt->video_fmtp_out);
}
} else if (tech_pvt->num_codecs) {
int i;
@@ -244,9 +244,9 @@
rate = imp->samples_per_second;
}
- snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "a=rtpmap:%d %s/%d\n", imp->ianacode, imp->iananame, imp->samples_per_second);
+ switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "a=rtpmap:%d %s/%d\n", imp->ianacode, imp->iananame, imp->samples_per_second);
if (imp->fmtp) {
- snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "a=fmtp:%d %s\n", imp->ianacode, imp->fmtp);
+ switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "a=fmtp:%d %s\n", imp->ianacode, imp->fmtp);
}
}
}
@@ -358,7 +358,7 @@
switch_core_session_set_private(session, tech_pvt);
- snprintf(name, sizeof(name), "sofia/%s/%s", profile->name, channame);
+ switch_snprintf(name, sizeof(name), "sofia/%s/%s", profile->name, channame);
switch_channel_set_name(tech_pvt->channel, name);
}
@@ -414,7 +414,7 @@
tech_pvt->adv_sdp_audio_ip = switch_core_session_strdup(tech_pvt->session, ip);
tech_pvt->adv_sdp_audio_port = sdp_port;
- snprintf(tmp, sizeof(tmp), "%d", sdp_port);
+ switch_snprintf(tmp, sizeof(tmp), "%d", sdp_port);
switch_channel_set_variable(tech_pvt->channel, SWITCH_LOCAL_MEDIA_IP_VARIABLE, tech_pvt->adv_sdp_audio_ip);
switch_channel_set_variable(tech_pvt->channel, SWITCH_LOCAL_MEDIA_PORT_VARIABLE, tmp);
@@ -446,7 +446,7 @@
tech_pvt->adv_sdp_video_port = sdp_port;
- snprintf(tmp, sizeof(tmp), "%d", sdp_port);
+ switch_snprintf(tmp, sizeof(tmp), "%d", sdp_port);
switch_channel_set_variable(tech_pvt->channel, SWITCH_LOCAL_VIDEO_IP_VARIABLE, tech_pvt->adv_sdp_audio_ip);
switch_channel_set_variable(tech_pvt->channel, SWITCH_LOCAL_VIDEO_PORT_VARIABLE, tmp);
@@ -660,7 +660,7 @@
if ((host = strchr(user, '@'))) {
*host++ = '\0';
}
- snprintf(hash_key, sizeof(hash_key), "%s%s%s", user, host, cid_num);
+ switch_snprintf(hash_key, sizeof(hash_key), "%s%s%s", user, host, cid_num);
tech_pvt->chat_from = tech_pvt->from_str;
tech_pvt->chat_to = tech_pvt->dest;
@@ -991,7 +991,7 @@
tech_pvt->agreed_pt,
tech_pvt->read_codec.implementation->microseconds_per_frame / 1000);
- snprintf(tmp, sizeof(tmp), "%d", tech_pvt->remote_sdp_audio_port);
+ switch_snprintf(tmp, sizeof(tmp), "%d", tech_pvt->remote_sdp_audio_port);
switch_channel_set_variable(tech_pvt->channel, SWITCH_LOCAL_MEDIA_IP_VARIABLE, tech_pvt->adv_sdp_audio_ip);
switch_channel_set_variable(tech_pvt->channel, SWITCH_LOCAL_MEDIA_PORT_VARIABLE, tmp);
@@ -1358,7 +1358,7 @@
char tmp[80];
int num;
- snprintf(tmp, sizeof(tmp), "%s@%uk@%ui", near_match->iananame, near_match->samples_per_second, ptime);
+ switch_snprintf(tmp, sizeof(tmp), "%s@%uk@%ui", near_match->iananame, near_match->samples_per_second, ptime);
prefs[0] = tmp;
num = switch_loadable_module_get_codecs_sorted(search, 1, prefs, 1);
@@ -1385,7 +1385,7 @@
tech_pvt->rm_fmtp = switch_core_session_strdup(session, (char *) map->rm_fmtp);
tech_pvt->remote_sdp_audio_port = (switch_port_t) m->m_port;
tech_pvt->agreed_pt = (switch_payload_t) map->rm_pt;
- snprintf(tmp, sizeof(tmp), "%d", tech_pvt->remote_sdp_audio_port);
+ switch_snprintf(tmp, sizeof(tmp), "%d", tech_pvt->remote_sdp_audio_port);
switch_channel_set_variable(tech_pvt->channel, SWITCH_REMOTE_MEDIA_IP_VARIABLE, tech_pvt->remote_sdp_audio_ip);
switch_channel_set_variable(tech_pvt->channel, SWITCH_REMOTE_MEDIA_PORT_VARIABLE, tmp);
@@ -1467,7 +1467,7 @@
tech_pvt->video_rm_fmtp = switch_core_session_strdup(session, (char *) map->rm_fmtp);
tech_pvt->remote_sdp_video_port = (switch_port_t) m->m_port;
tech_pvt->video_agreed_pt = (switch_payload_t) map->rm_pt;
- snprintf(tmp, sizeof(tmp), "%d", tech_pvt->remote_sdp_video_port);
+ switch_snprintf(tmp, sizeof(tmp), "%d", tech_pvt->remote_sdp_video_port);
switch_channel_set_variable(tech_pvt->channel, SWITCH_REMOTE_VIDEO_IP_VARIABLE, tech_pvt->remote_sdp_audio_ip);
switch_channel_set_variable(tech_pvt->channel, SWITCH_REMOTE_VIDEO_PORT_VARIABLE, tmp);
} else {
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c Wed Dec 12 16:53:32 2007
@@ -958,7 +958,7 @@
{
url_t *to = sip->sip_to->a_url;
url_t *from = sip->sip_from->a_url;
- snprintf(hash_key, len, "%s%s%s", from->url_user, from->url_host, to->url_user);
+ switch_snprintf(hash_key, len, "%s%s%s", from->url_user, from->url_host, to->url_user);
}
void sofia_presence_handle_sip_i_message(int status,
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c Wed Dec 12 16:53:32 2007
@@ -159,7 +159,7 @@
char *contact = NULL;
char to[128] = "";
- snprintf(to, sizeof(to), "%s@%s", argv[1], argv[2]);
+ switch_snprintf(to, sizeof(to), "%s@%s", argv[1], argv[2]);
contact = sofia_glue_get_url_from_contact(argv[3], 1);
nh = nua_handle(profile->nua, NULL, SIPTAG_FROM_STR(profile->url), SIPTAG_TO_STR(to), NUTAG_URL(contact), SIPTAG_CONTACT_STR(profile->url), TAG_END());
@@ -211,9 +211,9 @@
#endif
if (now) {
- snprintf(sql, sizeof(sql), "select '%s',* from sip_registrations where expires > 0 and expires <= %ld", profile->name, (long) now);
+ switch_snprintf(sql, sizeof(sql), "select '%s',* from sip_registrations where expires > 0 and expires <= %ld", profile->name, (long) now);
} else {
- snprintf(sql, sizeof(sql), "select '%s',* from sip_registrations where expires > 0", profile->name);
+ switch_snprintf(sql, sizeof(sql), "select '%s',* from sip_registrations where expires > 0", profile->name);
}
switch_mutex_lock(profile->ireg_mutex);
@@ -224,26 +224,26 @@
sofia_reg_del_callback,
NULL);
if (now) {
- snprintf(sql, sizeof(sql), "delete from sip_registrations where expires > 0 and expires <= %ld", (long) now);
+ switch_snprintf(sql, sizeof(sql), "delete from sip_registrations where expires > 0 and expires <= %ld", (long) now);
} else {
- snprintf(sql, sizeof(sql), "delete from sip_registrations where expires > 0");
+ switch_snprintf(sql, sizeof(sql), "delete from sip_registrations where expires > 0");
}
sofia_glue_execute_sql(profile, SWITCH_TRUE, sql, NULL);
if (now) {
- snprintf(sql, sizeof(sql), "delete from sip_authentication where expires > 0 and expires <= %ld", (long) now);
+ switch_snprintf(sql, sizeof(sql), "delete from sip_authentication where expires > 0 and expires <= %ld", (long) now);
} else {
- snprintf(sql, sizeof(sql), "delete from sip_authentication where expires > 0");
+ switch_snprintf(sql, sizeof(sql), "delete from sip_authentication where expires > 0");
}
sofia_glue_execute_sql(profile, SWITCH_TRUE, sql, NULL);
if (now) {
- snprintf(sql, sizeof(sql), "delete from sip_subscriptions where expires > 0 and expires <= %ld", (long) now);
+ switch_snprintf(sql, sizeof(sql), "delete from sip_subscriptions where expires > 0 and expires <= %ld", (long) now);
} else {
- snprintf(sql, sizeof(sql), "delete from sip_subscriptions where expires > 0");
+ switch_snprintf(sql, sizeof(sql), "delete from sip_subscriptions where expires > 0");
}
sofia_glue_execute_sql(profile, SWITCH_TRUE, sql, NULL);
if (now) {
- snprintf(sql, sizeof(sql), "select * from sip_registrations where status like '%%NATHACK%%'");
+ switch_snprintf(sql, sizeof(sql), "select * from sip_registrations where status like '%%NATHACK%%'");
sofia_glue_execute_sql_callback(profile,
SWITCH_TRUE,
NULL,
@@ -269,9 +269,9 @@
cbt.len = len;
if (host) {
- snprintf(val, len, "select contact from sip_registrations where sip_user='%s' and sip_host='%s'", user, host);
+ switch_snprintf(val, len, "select contact from sip_registrations where sip_user='%s' and sip_host='%s'", user, host);
} else {
- snprintf(val, len, "select contact from sip_registrations where sip_user='%s'", user);
+ switch_snprintf(val, len, "select contact from sip_registrations where sip_user='%s'", user);
}
@@ -385,10 +385,10 @@
}
if (contact->m_url->url_params) {
- snprintf(contact_str, sizeof(contact_str), "%s <sip:%s@%s:%s;%s>",
+ switch_snprintf(contact_str, sizeof(contact_str), "%s <sip:%s@%s:%s;%s>",
display, contact->m_url->url_user, contact->m_url->url_host, port, contact->m_url->url_params);
} else {
- snprintf(contact_str, sizeof(contact_str), "%s <sip:%s@%s:%s>", display, contact->m_url->url_user, contact->m_url->url_host, port);
+ switch_snprintf(contact_str, sizeof(contact_str), "%s <sip:%s@%s:%s>", display, contact->m_url->url_user, contact->m_url->url_host, port);
}
}
@@ -423,10 +423,10 @@
if ((v_contact_str = switch_event_get_header(*v_event, "sip-force-contact"))) {
if (!strcasecmp(v_contact_str, "nat-connectile-dysfunction") || !strcasecmp(v_contact_str, "NDLB-connectile-dysfunction")) {
if (contact->m_url->url_params) {
- snprintf(contact_str, sizeof(contact_str), "%s <sip:%s@%s:%d;%s>",
+ switch_snprintf(contact_str, sizeof(contact_str), "%s <sip:%s@%s:%d;%s>",
display, contact->m_url->url_user, network_ip, network_port, contact->m_url->url_params);
} else {
- snprintf(contact_str, sizeof(contact_str), "%s <sip:%s@%s:%d>", display, contact->m_url->url_user, network_ip, network_port);
+ switch_snprintf(contact_str, sizeof(contact_str), "%s <sip:%s@%s:%d>", display, contact->m_url->url_user, network_ip, network_port);
}
cd = 1;
exptime = 20;
@@ -709,7 +709,7 @@
goto cancel;
}
- snprintf(authentication, sizeof(authentication), "%s:%s:%s:%s", scheme, realm, gateway->register_username, gateway->register_password);
+ switch_snprintf(authentication, sizeof(authentication), "%s:%s:%s:%s", scheme, realm, gateway->register_username, gateway->register_password);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Authenticating '%s' with '%s'.\n", profile->username, authentication);
Modified: freeswitch/trunk/src/mod/endpoints/mod_woomera/mod_woomera.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_woomera/mod_woomera.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_woomera/mod_woomera.c Wed Dec 12 16:53:32 2007
@@ -506,7 +506,7 @@
char name[128];
switch_caller_profile_t *caller_profile;
- snprintf(name, sizeof(name), "Woomera/%s-%04x", outbound_profile->destination_number, rand() & 0xffff);
+ switch_snprintf(name, sizeof(name), "Woomera/%s-%04x", outbound_profile->destination_number, rand() & 0xffff);
switch_channel_set_name(channel, name);
caller_profile = switch_caller_profile_clone(*new_session, outbound_profile);
@@ -1089,7 +1089,7 @@
NULL,
exten)) != 0) {
char name[128];
- snprintf(name, sizeof(name), "Woomera/%s-%04x", tech_pvt->caller_profile->destination_number, rand() & 0xffff);
+ switch_snprintf(name, sizeof(name), "Woomera/%s-%04x", tech_pvt->caller_profile->destination_number, rand() & 0xffff);
switch_channel_set_name(channel, name);
switch_channel_set_caller_profile(channel, tech_pvt->caller_profile);
Modified: freeswitch/trunk/src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.c
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.c (original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.c Wed Dec 12 16:53:32 2007
@@ -217,24 +217,24 @@
tt_created = (time_t) (caller_profile->times->created / 1000000);
mtt_created = (time_t) (caller_profile->times->created / 1000);
- snprintf(tmp, sizeof(tmp), "%" TIME_T_FMT, tt_created);
+ switch_snprintf(tmp, sizeof(tmp), "%" TIME_T_FMT, tt_created);
switch_channel_set_variable(channel, "start_epoch", tmp);
- snprintf(tmp, sizeof(tmp), "%" SWITCH_TIME_T_FMT, caller_profile->times->created);
+ switch_snprintf(tmp, sizeof(tmp), "%" SWITCH_TIME_T_FMT, caller_profile->times->created);
switch_channel_set_variable(channel, "start_uepoch", tmp);
tt_answered = (time_t) (caller_profile->times->answered / 1000000);
mtt_answered = (time_t) (caller_profile->times->answered / 1000);
- snprintf(tmp, sizeof(tmp), "%" TIME_T_FMT, tt_answered);
+ switch_snprintf(tmp, sizeof(tmp), "%" TIME_T_FMT, tt_answered);
switch_channel_set_variable(channel, "answer_epoch", tmp);
- snprintf(tmp, sizeof(tmp), "%" SWITCH_TIME_T_FMT, caller_profile->times->answered);
+ switch_snprintf(tmp, sizeof(tmp), "%" SWITCH_TIME_T_FMT, caller_profile->times->answered);
switch_channel_set_variable(channel, "answer_uepoch", tmp);
tt_hungup = (time_t) (caller_profile->times->hungup / 1000000);
mtt_hungup = (time_t) (caller_profile->times->hungup / 1000);
- snprintf(tmp, sizeof(tmp), "%" TIME_T_FMT, tt_hungup);
+ switch_snprintf(tmp, sizeof(tmp), "%" TIME_T_FMT, tt_hungup);
switch_channel_set_variable(channel, "end_epoch", tmp);
- snprintf(tmp, sizeof(tmp), "%" SWITCH_TIME_T_FMT, caller_profile->times->hungup);
+ switch_snprintf(tmp, sizeof(tmp), "%" SWITCH_TIME_T_FMT, caller_profile->times->hungup);
switch_channel_set_variable(channel, "end_uepoch", tmp);
uduration = caller_profile->times->hungup - caller_profile->times->created;
@@ -253,22 +253,22 @@
switch_channel_set_variable(channel, "last_arg", last_arg);
switch_channel_set_variable(channel, "caller_id", cid_buf);
- snprintf(tmp, sizeof(tmp), "%d", duration);
+ switch_snprintf(tmp, sizeof(tmp), "%d", duration);
switch_channel_set_variable(channel, "duration", tmp);
- snprintf(tmp, sizeof(tmp), "%d", billsec);
+ switch_snprintf(tmp, sizeof(tmp), "%d", billsec);
switch_channel_set_variable(channel, "billsec", tmp);
- snprintf(tmp, sizeof(tmp), "%d", mduration);
+ switch_snprintf(tmp, sizeof(tmp), "%d", mduration);
switch_channel_set_variable(channel, "mduration", tmp);
- snprintf(tmp, sizeof(tmp), "%d", billmsec);
+ switch_snprintf(tmp, sizeof(tmp), "%d", billmsec);
switch_channel_set_variable(channel, "billmsec", tmp);
- snprintf(tmp, sizeof(tmp), "%" SWITCH_TIME_T_FMT, uduration);
+ switch_snprintf(tmp, sizeof(tmp), "%" SWITCH_TIME_T_FMT, uduration);
switch_channel_set_variable(channel, "uduration", tmp);
- snprintf(tmp, sizeof(tmp), "%" SWITCH_TIME_T_FMT, billusec);
+ switch_snprintf(tmp, sizeof(tmp), "%" SWITCH_TIME_T_FMT, billusec);
switch_channel_set_variable(channel, "billusec", tmp);
if (globals.debug) {
@@ -395,7 +395,7 @@
size_t len = strlen(param->txt) + 2;
if (end_of(param->txt) != '\n') {
tpl = switch_core_alloc(pool, len);
- snprintf(tpl, len, "%s\n", param->txt);
+ switch_snprintf(tpl, len, "%s\n", param->txt);
} else {
tpl = switch_core_strdup(pool, param->txt);
}
Modified: freeswitch/trunk/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c (original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c Wed Dec 12 16:53:32 2007
@@ -290,7 +290,7 @@
term++;
}
}
- snprintf(tmpname, sizeof(tmpname), "Orig-%s", var);
+ switch_snprintf(tmpname, sizeof(tmpname), "Orig-%s", var);
switch_event_add_header(local_event, SWITCH_STACK_BOTTOM, tmpname, "%s", val);
var = term + 1;
} else {
Modified: freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c (original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c Wed Dec 12 16:53:32 2007
@@ -450,7 +450,7 @@
if (data) {
- snprintf(buf, sizeof(buf), "Content-Type: log/data\nContent-Length: %" SWITCH_SSIZE_T_FMT "\n\n", strlen(data));
+ switch_snprintf(buf, sizeof(buf), "Content-Type: log/data\nContent-Length: %" SWITCH_SSIZE_T_FMT "\n\n", strlen(data));
len = strlen(buf);
switch_socket_send(listener->sock, buf, &len);
len = strlen(data);
@@ -487,7 +487,7 @@
len = strlen(listener->ebuf);
- snprintf(hbuf, sizeof(hbuf), "Content-Length: %" SWITCH_SSIZE_T_FMT "\n" "Content-Type: text/event-%s\n" "\n", len, etype);
+ switch_snprintf(hbuf, sizeof(hbuf), "Content-Length: %" SWITCH_SSIZE_T_FMT "\n" "Content-Type: text/event-%s\n" "\n", len, etype);
len = strlen(hbuf);
switch_socket_send(listener->sock, hbuf, &len);
@@ -558,7 +558,7 @@
switch_size_t rlen, blen;
char buf[1024] = "";
rlen = strlen(reply);
- snprintf(buf, sizeof(buf), "Content-Type: api/response\nContent-Length: %" SWITCH_SSIZE_T_FMT "\n\n", rlen);
+ switch_snprintf(buf, sizeof(buf), "Content-Type: api/response\nContent-Length: %" SWITCH_SSIZE_T_FMT "\n\n", rlen);
blen = strlen(buf);
switch_socket_send(acs->listener->sock, buf, &blen);
switch_socket_send(acs->listener->sock, reply, &rlen);
@@ -590,7 +590,7 @@
if (!strncasecmp(cmd, "exit", 4)) {
switch_clear_flag_locked(listener, LFLAG_RUNNING);
- snprintf(reply, reply_len, "+OK bye");
+ switch_snprintf(reply, reply_len, "+OK bye");
goto done;
}
@@ -603,9 +603,9 @@
if (!strcmp(prefs.password, pass)) {
switch_set_flag_locked(listener, LFLAG_AUTHED);
- snprintf(reply, reply_len, "+OK accepted");
+ switch_snprintf(reply, reply_len, "+OK accepted");
} else {
- snprintf(reply, reply_len, "-ERR invalid");
+ switch_snprintf(reply, reply_len, "-ERR invalid");
switch_clear_flag_locked(listener, LFLAG_RUNNING);
}
@@ -621,18 +621,18 @@
assert(channel != NULL);
if (!strncasecmp(cmd, "connect", 7)) {
- snprintf(reply, reply_len, "+OK");
+ switch_snprintf(reply, reply_len, "+OK");
goto done;
} else if (!strncasecmp(cmd, "sendmsg", 7)) {
if (switch_test_flag(listener, LFLAG_ASYNC)) {
if ((status = switch_core_session_queue_private_event(listener->session, &event)) == SWITCH_STATUS_SUCCESS) {
- snprintf(reply, reply_len, "+OK");
+ switch_snprintf(reply, reply_len, "+OK");
} else {
- snprintf(reply, reply_len, "-ERR memory error");
+ switch_snprintf(reply, reply_len, "-ERR memory error");
}
} else {
switch_ivr_parse_event(listener->session, event);
- snprintf(reply, reply_len, "+OK");
+ switch_snprintf(reply, reply_len, "+OK");
}
goto done;
} else if (!strncasecmp(cmd, "getvar", 6)) {
@@ -648,7 +648,7 @@
}
}
- snprintf(reply, reply_len, "%s", val);
+ switch_snprintf(reply, reply_len, "%s", val);
goto done;
} else if (!strncasecmp(cmd, "myevents", 8)) {
listener->event_list[SWITCH_EVENT_CHANNEL_CREATE] = 1;
@@ -674,7 +674,7 @@
if (strstr(cmd, "xml") || strstr(cmd, "XML")) {
listener->format = EVENT_FORMAT_XML;
}
- snprintf(reply, reply_len, "+OK Events Enabled");
+ switch_snprintf(reply, reply_len, "+OK Events Enabled");
goto done;
}
@@ -705,7 +705,7 @@
}
switch_event_fire(&event);
- snprintf(reply, reply_len, "+OK");
+ switch_snprintf(reply, reply_len, "+OK");
goto done;
} else if (!strncasecmp(cmd, "sendmsg", 7)) {
switch_core_session_t *session;
@@ -737,13 +737,13 @@
if (session) {
if ((status = switch_core_session_queue_private_event(session, &event)) == SWITCH_STATUS_SUCCESS) {
- snprintf(reply, reply_len, "+OK");
+ switch_snprintf(reply, reply_len, "+OK");
} else {
- snprintf(reply, reply_len, "-ERR memory error");
+ switch_snprintf(reply, reply_len, "-ERR memory error");
}
switch_core_session_rwunlock(session);
} else {
- snprintf(reply, reply_len, "-ERR invalid session id [%s]", uuid);
+ switch_snprintf(reply, reply_len, "-ERR invalid session id [%s]", uuid);
}
goto done;
@@ -764,7 +764,7 @@
acs.bg = 0;
api_exec(NULL, (void *) &acs);
- //snprintf(reply, reply_len, "+OK");
+ //switch_snprintf(reply, reply_len, "+OK");
return SWITCH_STATUS_SUCCESS;
} else if (!strncasecmp(cmd, "bgapi ", 6)) {
@@ -805,7 +805,7 @@
switch_uuid_get(&uuid);
switch_uuid_format(acs->uuid_str, &uuid);
}
- snprintf(reply, reply_len, "+OK Job-UUID: %s", acs->uuid_str);
+ switch_snprintf(reply, reply_len, "+OK Job-UUID: %s", acs->uuid_str);
return SWITCH_STATUS_SUCCESS;
} else if (!strncasecmp(cmd, "log", 3)) {
@@ -832,9 +832,9 @@
if (ltype && ltype != SWITCH_LOG_INVALID) {
listener->level = ltype;
switch_set_flag(listener, LFLAG_LOG);
- snprintf(reply, reply_len, "+OK log level %s [%d]", level_s, listener->level);
+ switch_snprintf(reply, reply_len, "+OK log level %s [%d]", level_s, listener->level);
} else {
- snprintf(reply, reply_len, "-ERR invalid log level");
+ switch_snprintf(reply, reply_len, "-ERR invalid log level");
}
} else if (!strncasecmp(cmd, "nolog", 5)) {
void *pop;
@@ -842,9 +842,9 @@
if (switch_test_flag(listener, LFLAG_LOG)) {
switch_clear_flag_locked(listener, LFLAG_LOG);
- snprintf(reply, reply_len, "+OK no longer logging");
+ switch_snprintf(reply, reply_len, "+OK no longer logging");
} else {
- snprintf(reply, reply_len, "-ERR not loging");
+ switch_snprintf(reply, reply_len, "-ERR not loging");
}
} else if (!strncasecmp(cmd, "event", 5)) {
char *next, *cur;
@@ -894,7 +894,7 @@
}
if (!key_count) {
- snprintf(reply, reply_len, "-ERR no keywords supplied");
+ switch_snprintf(reply, reply_len, "-ERR no keywords supplied");
goto done;
}
@@ -902,7 +902,7 @@
switch_set_flag_locked(listener, LFLAG_EVENTS);
}
- snprintf(reply, reply_len, "+OK event listener enabled %s", listener->format == EVENT_FORMAT_XML ? "xml" : "plain");
+ switch_snprintf(reply, reply_len, "+OK event listener enabled %s", listener->format == EVENT_FORMAT_XML ? "xml" : "plain");
} else if (!strncasecmp(cmd, "nixevent", 8)) {
char *next, *cur;
@@ -948,7 +948,7 @@
}
if (!key_count) {
- snprintf(reply, reply_len, "-ERR no keywords supplied");
+ switch_snprintf(reply, reply_len, "-ERR no keywords supplied");
goto done;
}
@@ -956,7 +956,7 @@
switch_set_flag_locked(listener, LFLAG_EVENTS);
}
- snprintf(reply, reply_len, "+OK events nixed");
+ switch_snprintf(reply, reply_len, "+OK events nixed");
} else if (!strncasecmp(cmd, "noevents", 8)) {
void *pop;
@@ -971,9 +971,9 @@
/* wipe the hash */
switch_core_hash_destroy(&listener->event_hash);
switch_core_hash_init(&listener->event_hash, listener->pool);
- snprintf(reply, reply_len, "+OK no longer listening for events");
+ switch_snprintf(reply, reply_len, "+OK no longer listening for events");
} else {
- snprintf(reply, reply_len, "-ERR not listening for events");
+ switch_snprintf(reply, reply_len, "-ERR not listening for events");
}
}
@@ -983,7 +983,7 @@
}
if (switch_strlen_zero(reply)) {
- snprintf(reply, reply_len, "-ERR command not found");
+ switch_snprintf(reply, reply_len, "-ERR command not found");
}
return status;
@@ -1060,7 +1060,7 @@
switch_safe_free(event_str);
} else {
- snprintf(buf, sizeof(buf), "Content-Type: auth/request\n\n");
+ switch_snprintf(buf, sizeof(buf), "Content-Type: auth/request\n\n");
len = strlen(buf);
switch_socket_send(listener->sock, buf, &len);
@@ -1079,7 +1079,7 @@
goto done;
}
if (*reply != '\0') {
- snprintf(buf, sizeof(buf), "Content-Type: command/reply\nReply-Text: %s\n\n", reply);
+ switch_snprintf(buf, sizeof(buf), "Content-Type: command/reply\nReply-Text: %s\n\n", reply);
len = strlen(buf);
switch_socket_send(listener->sock, buf, &len);
}
@@ -1108,7 +1108,7 @@
}
if (*reply != '\0') {
- snprintf(buf, sizeof(buf), "Content-Type: command/reply\nReply-Text: %s\n\n", reply);
+ switch_snprintf(buf, sizeof(buf), "Content-Type: command/reply\nReply-Text: %s\n\n", reply);
len = strlen(buf);
switch_socket_send(listener->sock, buf, &len);
}
Modified: freeswitch/trunk/src/mod/event_handlers/mod_zeroconf/mod_zeroconf.c
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_zeroconf/mod_zeroconf.c (original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_zeroconf/mod_zeroconf.c Wed Dec 12 16:53:32 2007
@@ -145,7 +145,7 @@
return;
}
- snprintf(data, len, "%s=%s", hp->name, hp->value);
+ switch_snprintf(data, len, "%s=%s", hp->name, hp->value);
if (sw_text_record_add_string(text_record, data) != SW_OKAY) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "unable to add service text: %s\n", data);
free(data);
Modified: freeswitch/trunk/src/mod/formats/mod_local_stream/mod_local_stream.c
==============================================================================
--- freeswitch/trunk/src/mod/formats/mod_local_stream/mod_local_stream.c (original)
+++ freeswitch/trunk/src/mod/formats/mod_local_stream/mod_local_stream.c Wed Dec 12 16:53:32 2007
@@ -119,7 +119,7 @@
break;
}
- snprintf(path_buf, sizeof(path_buf), "%s%s%s", source->location, SWITCH_PATH_SEPARATOR, fname);
+ switch_snprintf(path_buf, sizeof(path_buf), "%s%s%s", source->location, SWITCH_PATH_SEPARATOR, fname);
if (switch_stristr(".loc", path_buf)) {
if ((fd = open(path_buf, O_RDONLY)) < 0) {
Modified: freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c (original)
+++ freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c Wed Dec 12 16:53:32 2007
@@ -880,13 +880,13 @@
len += strlen(file);
len += 4;
path = (char *) switch_core_alloc(module_manager.pool, len);
- snprintf(path, len, "%s%s%s", dir, SWITCH_PATH_SEPARATOR, file);
+ switch_snprintf(path, len, "%s%s%s", dir, SWITCH_PATH_SEPARATOR, file);
} else {
len = strlen(dir);
len += strlen(file);
len += 8;
path = (char *) switch_core_alloc(module_manager.pool, len);
- snprintf(path, len, "%s%s%s%s", dir, SWITCH_PATH_SEPARATOR, file, ext);
+ switch_snprintf(path, len, "%s%s%s%s", dir, SWITCH_PATH_SEPARATOR, file, ext);
}
}
@@ -1592,7 +1592,7 @@
JS_ResumeRequest(cx, cb_state.saveDepth);
*rval = cb_state.ret;
- snprintf(posbuf, sizeof(posbuf), "%u", fh.offset_pos);
+ switch_snprintf(posbuf, sizeof(posbuf), "%u", fh.offset_pos);
switch_channel_set_variable(channel, "last_file_position", posbuf);
return JS_TRUE;
@@ -2175,7 +2175,7 @@
for (p = val + strlen(val) - 1; *p == ' '; p--)
*p = '\0';
- snprintf(code, sizeof(code), "~%s[\"%s\"] = \"%s\"", config_data->name, line, val);
+ switch_snprintf(code, sizeof(code), "~%s[\"%s\"] = \"%s\"", config_data->name, line, val);
eval_some_js(code, config_data->cx, config_data->obj, &rval);
}
@@ -2374,7 +2374,7 @@
*rval = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, config_data.buffer));
} else {
char errmsg[256];
- snprintf(errmsg, 256, "~throw new Error(\"Curl returned error %u.\");", (unsigned)code);
+ switch_snprintf(errmsg, 256, "~throw new Error(\"Curl returned error %u.\");", (unsigned)code);
eval_some_js(errmsg, cx, obj, rval);
}
@@ -2974,7 +2974,7 @@
char *supplied_error, code_buf[256] = "";
if (argc > 0 && (supplied_error = JS_GetStringBytes(JS_ValueToString(cx, argv[0])))) {
- snprintf(code_buf, sizeof(code_buf), "~throw new Error(\"%s\");", supplied_error);
+ switch_snprintf(code_buf, sizeof(code_buf), "~throw new Error(\"%s\");", supplied_error);
eval_some_js(code_buf, cx, obj, rval);
}
@@ -3271,7 +3271,7 @@
/* Emaculent conception of session object into the script if one is available */
if (!(session && new_js_session(cx, javascript_global_object, session, &jss, "session", flags))) {
- snprintf(buf, sizeof(buf), "~var session = false;");
+ switch_snprintf(buf, sizeof(buf), "~var session = false;");
eval_some_js(buf, cx, javascript_global_object, &rval);
}
if (ro) {
@@ -3291,17 +3291,17 @@
}
if (!argc) {
- snprintf(buf, sizeof(buf), "~var argv = new Array();");
+ switch_snprintf(buf, sizeof(buf), "~var argv = new Array();");
eval_some_js(buf, cx, javascript_global_object, &rval);
} else {
/* create a js doppleganger of this argc/argv */
- snprintf(buf, sizeof(buf), "~var argv = new Array(%d);", argc);
+ switch_snprintf(buf, sizeof(buf), "~var argv = new Array(%d);", argc);
eval_some_js(buf, cx, javascript_global_object, &rval);
- snprintf(buf, sizeof(buf), "~var argc = %d", argc);
+ switch_snprintf(buf, sizeof(buf), "~var argc = %d", argc);
eval_some_js(buf, cx, javascript_global_object, &rval);
for (y = 0; y < argc; y++) {
- snprintf(buf, sizeof(buf), "~argv[%d] = \"%s\";", x++, argv[y]);
+ switch_snprintf(buf, sizeof(buf), "~argv[%d] = \"%s\";", x++, argv[y]);
eval_some_js(buf, cx, javascript_global_object, &rval);
}
}
Modified: freeswitch/trunk/src/mod/languages/mod_spidermonkey_core_db/mod_spidermonkey_core_db.c
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_spidermonkey_core_db/mod_spidermonkey_core_db.c (original)
+++ freeswitch/trunk/src/mod/languages/mod_spidermonkey_core_db/mod_spidermonkey_core_db.c Wed Dec 12 16:53:32 2007
@@ -113,18 +113,18 @@
jsval rval;
int x = 0;
- snprintf(code, sizeof(code), "~var _Db_RoW_ = {}");
+ switch_snprintf(code, sizeof(code), "~var _Db_RoW_ = {}");
eval_some_js(code, dbo->cx, dbo->obj, &rval);
for (x = 0; x < argc; x++) {
- snprintf(code, sizeof(code), "~_Db_RoW_[\"%s\"] = \"%s\"", columnNames[x], argv[x]);
+ switch_snprintf(code, sizeof(code), "~_Db_RoW_[\"%s\"] = \"%s\"", columnNames[x], argv[x]);
eval_some_js(code, dbo->cx, dbo->obj, &rval);
}
- snprintf(code, sizeof(code), "~%s(_Db_RoW_)", dbo->code_buffer);
+ switch_snprintf(code, sizeof(code), "~%s(_Db_RoW_)", dbo->code_buffer);
eval_some_js(code, dbo->cx, dbo->obj, &rval);
- snprintf(code, sizeof(code), "~delete _Db_RoW_");
+ switch_snprintf(code, sizeof(code), "~delete _Db_RoW_");
eval_some_js(code, dbo->cx, dbo->obj, &rval);
return 0;
@@ -208,13 +208,13 @@
return JS_FALSE;
}
- snprintf(code, sizeof(code), "~var _dB_RoW_DaTa_ = {}");
+ switch_snprintf(code, sizeof(code), "~var _dB_RoW_DaTa_ = {}");
eval_some_js(code, dbo->cx, dbo->obj, rval);
if (*rval == JS_FALSE) {
return JS_TRUE;
}
for (x = 0; x < colcount; x++) {
- snprintf(code, sizeof(code), "~_dB_RoW_DaTa_[\"%s\"] = \"%s\"",
+ switch_snprintf(code, sizeof(code), "~_dB_RoW_DaTa_[\"%s\"] = \"%s\"",
(char *) switch_core_db_column_name(dbo->stmt, x), (char *) switch_core_db_column_text(dbo->stmt, x));
eval_some_js(code, dbo->cx, dbo->obj, rval);
Modified: freeswitch/trunk/src/mod/languages/mod_spidermonkey_odbc/mod_spidermonkey_odbc.c
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_spidermonkey_odbc/mod_spidermonkey_odbc.c (original)
+++ freeswitch/trunk/src/mod/languages/mod_spidermonkey_odbc/mod_spidermonkey_odbc.c Wed Dec 12 16:53:32 2007
@@ -359,7 +359,7 @@
SQLLEN m = 0;
char code[66560];
- snprintf(code, sizeof(code), "~var _oDbC_dB_RoW_DaTa_ = {}");
+ switch_snprintf(code, sizeof(code), "~var _oDbC_dB_RoW_DaTa_ = {}");
eval_some_js(code, cx, obj, rval);
if (*rval == JS_FALSE) {
return JS_TRUE;
@@ -383,7 +383,7 @@
data = esc;
}
- snprintf((char *) odbc_obj->code, odbc_obj->codelen, "~_oDbC_dB_RoW_DaTa_[\"%s\"] = \"%s\"", name, data);
+ switch_snprintf((char *) odbc_obj->code, odbc_obj->codelen, "~_oDbC_dB_RoW_DaTa_[\"%s\"] = \"%s\"", name, data);
switch_safe_free(esc);
eval_some_js((char *) odbc_obj->code, cx, obj, rval);
Modified: freeswitch/trunk/src/mod/loggers/mod_logfile/mod_logfile.c
==============================================================================
--- freeswitch/trunk/src/mod/loggers/mod_logfile/mod_logfile.c (original)
+++ freeswitch/trunk/src/mod/loggers/mod_logfile/mod_logfile.c Wed Dec 12 16:53:32 2007
@@ -283,7 +283,7 @@
if (switch_strlen_zero(new_profile->logfile)) {
char logfile[512];
- snprintf(logfile, sizeof(logfile), "%s%s%s", SWITCH_GLOBAL_dirs.log_dir, SWITCH_PATH_SEPARATOR, "freeswitch.log");
+ switch_snprintf(logfile, sizeof(logfile), "%s%s%s", SWITCH_GLOBAL_dirs.log_dir, SWITCH_PATH_SEPARATOR, "freeswitch.log");
new_profile->logfile = strdup(logfile);
}
Modified: freeswitch/trunk/src/mod/say/mod_say_en/mod_say_en.c
==============================================================================
--- freeswitch/trunk/src/mod/say/mod_say_en/mod_say_en.c (original)
+++ freeswitch/trunk/src/mod/say/mod_say_en/mod_say_en.c Wed Dec 12 16:53:32 2007
@@ -54,7 +54,7 @@
#define say_num(num, t) { \
char tmp[80];\
switch_status_t status;\
- snprintf(tmp, sizeof(tmp), "%u", (unsigned)num); \
+ switch_snprintf(tmp, sizeof(tmp), "%u", (unsigned)num); \
if ((status = en_say_general_count(session, tmp, SST_ITEMS, t, args)) != SWITCH_STATUS_SUCCESS) {\
return status;\
}}\
@@ -62,7 +62,7 @@
#define say_file(...) {\
char tmp[80];\
switch_status_t status;\
- snprintf(tmp, sizeof(tmp), __VA_ARGS__);\
+ switch_snprintf(tmp, sizeof(tmp), __VA_ARGS__);\
if ((status = switch_ivr_play_file(session, NULL, tmp, args)) != SWITCH_STATUS_SUCCESS){ \
return status;\
}\
Modified: freeswitch/trunk/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c
==============================================================================
--- freeswitch/trunk/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c (original)
+++ freeswitch/trunk/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c Wed Dec 12 16:53:32 2007
@@ -138,7 +138,7 @@
switch_uuid_get(&uuid);
switch_uuid_format(uuid_str, &uuid);
- snprintf(filename, sizeof(filename), "%s%s.tmp.xml", SWITCH_GLOBAL_dirs.temp_dir, uuid_str);
+ switch_snprintf(filename, sizeof(filename), "%s%s.tmp.xml", SWITCH_GLOBAL_dirs.temp_dir, uuid_str);
curl_handle = curl_easy_init();
headers = curl_slist_append(headers, "Content-Type: application/x-www-form-urlencoded");
Modified: freeswitch/trunk/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c
==============================================================================
--- freeswitch/trunk/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c (original)
+++ freeswitch/trunk/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c Wed Dec 12 16:53:32 2007
@@ -190,7 +190,7 @@
goto fail;
}
- snprintf(z, sizeof(z), "%s:%s", globals.user, globals.pass);
+ switch_snprintf(z, sizeof(z), "%s:%s", globals.user, globals.pass);
Base64Encode(z, t);
if (!strcmp(p, t)) {
@@ -241,9 +241,9 @@
} else {
if (mypass1) {
if (at) {
- snprintf(z, sizeof(z), "%s@%s:%s", user, domain_name, mypass1);
+ switch_snprintf(z, sizeof(z), "%s@%s:%s", user, domain_name, mypass1);
} else {
- snprintf(z, sizeof(z), "%s:%s", user, mypass1);
+ switch_snprintf(z, sizeof(z), "%s:%s", user, mypass1);
}
Base64Encode(z, t);
@@ -255,9 +255,9 @@
if (mypass2) {
if (at) {
- snprintf(z, sizeof(z), "%s@%s:%s", user, domain_name, mypass2);
+ switch_snprintf(z, sizeof(z), "%s@%s:%s", user, domain_name, mypass2);
} else {
- snprintf(z, sizeof(z), "%s:%s", user, mypass2);
+ switch_snprintf(z, sizeof(z), "%s:%s", user, mypass2);
}
Base64Encode(z, t);
@@ -270,9 +270,9 @@
if (box) {
if (mypass1) {
if (at) {
- snprintf(z, sizeof(z), "%s@%s:%s", box, domain_name, mypass1);
+ switch_snprintf(z, sizeof(z), "%s@%s:%s", box, domain_name, mypass1);
} else {
- snprintf(z, sizeof(z), "%s:%s", box, mypass1);
+ switch_snprintf(z, sizeof(z), "%s:%s", box, mypass1);
}
Base64Encode(z, t);
@@ -284,9 +284,9 @@
if (mypass2) {
if (at) {
- snprintf(z, sizeof(z), "%s@%s:%s", box, domain_name, mypass2);
+ switch_snprintf(z, sizeof(z), "%s@%s:%s", box, domain_name, mypass2);
} else {
- snprintf(z, sizeof(z), "%s:%s", box, mypass2);
+ switch_snprintf(z, sizeof(z), "%s:%s", box, mypass2);
}
Base64Encode(z, t);
@@ -321,7 +321,7 @@
switch_xml_free(x_domain_root);
}
- snprintf(z, sizeof(z), "Basic realm=\"%s\"", domain_name ? domain_name : globals.realm);
+ switch_snprintf(z, sizeof(z), "Basic realm=\"%s\"", domain_name ? domain_name : globals.realm);
ResponseAddField(r, "WWW-Authenticate", z);
ResponseStatus(r, 401);
return FALSE;
@@ -362,7 +362,7 @@
new_uri = "/";
}
- snprintf(tmp, sizeof(tmp), "%s%s",
+ switch_snprintf(tmp, sizeof(tmp), "%s%s",
SWITCH_GLOBAL_dirs.htdocs_dir,
new_uri
);
@@ -370,7 +370,7 @@
if (switch_directory_exists(tmp, NULL) == SWITCH_STATUS_SUCCESS) {
for (x = 0; x < 2; x++) {
- snprintf(tmp, sizeof(tmp), "%s%s%s%s",
+ switch_snprintf(tmp, sizeof(tmp), "%s%s%s%s",
SWITCH_GLOBAL_dirs.htdocs_dir,
new_uri,
end_of(new_uri) == *SWITCH_PATH_SEPARATOR ? "" : SWITCH_PATH_SEPARATOR,
@@ -378,7 +378,7 @@
);
if (switch_file_exists(tmp, NULL) == SWITCH_STATUS_SUCCESS) {
- snprintf(tmp, sizeof(tmp), "%s%s%s",
+ switch_snprintf(tmp, sizeof(tmp), "%s%s%s",
new_uri,
end_of(new_uri) == '/' ? "" : "/",
list[x]
@@ -624,7 +624,7 @@
}
- snprintf(buf, sizeof(buf), "Connection: close\r\n");
+ switch_snprintf(buf, sizeof(buf), "Connection: close\r\n");
ConnWrite(r->conn, buf, (uint32_t) strlen(buf));
if (html) {
@@ -712,16 +712,16 @@
if (switch_core_management_exec(relative_oid, action, buf, sizeof(buf)) == SWITCH_STATUS_SUCCESS) {
if (action == SMA_SET) {
if (*buf != '\0') {
- snprintf(buf, sizeof(buf), "OK\n");
+ switch_snprintf(buf, sizeof(buf), "OK\n");
}
}
} else {
if (*buf != '\0') {
- snprintf(buf, sizeof(buf), "ERROR\n");
+ switch_snprintf(buf, sizeof(buf), "ERROR\n");
}
}
} else {
- snprintf(buf, sizeof(buf), "Invalid Action %s\n", s_action);
+ switch_snprintf(buf, sizeof(buf), "Invalid Action %s\n", s_action);
}
/* Return our result. */
@@ -765,7 +765,7 @@
}
}
- snprintf(logfile, sizeof(logfile), "%s%s%s", SWITCH_GLOBAL_dirs.log_dir, SWITCH_PATH_SEPARATOR, "freeswitch_http.log");
+ switch_snprintf(logfile, sizeof(logfile), "%s%s%s", SWITCH_GLOBAL_dirs.log_dir, SWITCH_PATH_SEPARATOR, "freeswitch_http.log");
ServerCreate(&globals.abyssServer, "XmlRpcServer", globals.port, SWITCH_GLOBAL_dirs.htdocs_dir, logfile);
xmlrpc_server_abyss_set_handler(&env, &globals.abyssServer, "/RPC2", registryP);
Modified: freeswitch/trunk/src/switch_caller.c
==============================================================================
--- freeswitch/trunk/src/switch_caller.c (original)
+++ freeswitch/trunk/src/switch_caller.c Wed Dec 12 16:53:32 2007
@@ -200,75 +200,75 @@
if (!switch_strlen_zero(caller_profile->username)) {
- snprintf(header_name, sizeof(header_name), "%s-Username", prefix);
+ switch_snprintf(header_name, sizeof(header_name), "%s-Username", prefix);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, "%s", caller_profile->username);
}
if (!switch_strlen_zero(caller_profile->dialplan)) {
- snprintf(header_name, sizeof(header_name), "%s-Dialplan", prefix);
+ switch_snprintf(header_name, sizeof(header_name), "%s-Dialplan", prefix);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, "%s", caller_profile->dialplan);
}
if (!switch_strlen_zero(caller_profile->caller_id_name)) {
- snprintf(header_name, sizeof(header_name), "%s-Caller-ID-Name", prefix);
+ 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);
}
if (!switch_strlen_zero(caller_profile->caller_id_number)) {
- snprintf(header_name, sizeof(header_name), "%s-Caller-ID-Number", prefix);
+ 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);
}
if (!switch_strlen_zero(caller_profile->network_addr)) {
- snprintf(header_name, sizeof(header_name), "%s-Network-Addr", prefix);
+ 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);
}
if (!switch_strlen_zero(caller_profile->ani)) {
- snprintf(header_name, sizeof(header_name), "%s-ANI", prefix);
+ switch_snprintf(header_name, sizeof(header_name), "%s-ANI", prefix);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, "%s", caller_profile->ani);
}
if (!switch_strlen_zero(caller_profile->aniii)) {
- snprintf(header_name, sizeof(header_name), "%s-ANI-II", prefix);
+ 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);
}
if (!switch_strlen_zero(caller_profile->destination_number)) {
- snprintf(header_name, sizeof(header_name), "%s-Destination-Number", prefix);
+ 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);
}
if (!switch_strlen_zero(caller_profile->uuid)) {
- snprintf(header_name, sizeof(header_name), "%s-Unique-ID", prefix);
+ 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);
}
if (!switch_strlen_zero(caller_profile->source)) {
- snprintf(header_name, sizeof(header_name), "%s-Source", prefix);
+ switch_snprintf(header_name, sizeof(header_name), "%s-Source", prefix);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, "%s", caller_profile->source);
}
if (!switch_strlen_zero(caller_profile->context)) {
- snprintf(header_name, sizeof(header_name), "%s-Context", prefix);
+ switch_snprintf(header_name, sizeof(header_name), "%s-Context", prefix);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, "%s", caller_profile->context);
}
if (!switch_strlen_zero(caller_profile->rdnis)) {
- snprintf(header_name, sizeof(header_name), "%s-RDNIS", prefix);
+ switch_snprintf(header_name, sizeof(header_name), "%s-RDNIS", prefix);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, "%s", caller_profile->rdnis);
}
if (!switch_strlen_zero(caller_profile->chan_name)) {
- snprintf(header_name, sizeof(header_name), "%s-Channel-Name", prefix);
+ 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);
}
if (caller_profile->times) {
- snprintf(header_name, sizeof(header_name), "%s-Channel-Created-Time", prefix);
+ switch_snprintf(header_name, sizeof(header_name), "%s-Channel-Created-Time", prefix);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, "%" SWITCH_TIME_T_FMT, caller_profile->times->created);
- snprintf(header_name, sizeof(header_name), "%s-Channel-Answered-Time", prefix);
+ switch_snprintf(header_name, sizeof(header_name), "%s-Channel-Answered-Time", prefix);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, "%" SWITCH_TIME_T_FMT, caller_profile->times->answered);
- snprintf(header_name, sizeof(header_name), "%s-Channel-Hangup-Time", prefix);
+ switch_snprintf(header_name, sizeof(header_name), "%s-Channel-Hangup-Time", prefix);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, "%" SWITCH_TIME_T_FMT, caller_profile->times->hungup);
- snprintf(header_name, sizeof(header_name), "%s-Channel-Transfer-Time", prefix);
+ switch_snprintf(header_name, sizeof(header_name), "%s-Channel-Transfer-Time", prefix);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, "%" SWITCH_TIME_T_FMT, caller_profile->times->transferred);
}
- snprintf(header_name, sizeof(header_name), "%s-Screen-Bit", prefix);
+ 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");
- snprintf(header_name, sizeof(header_name), "%s-Privacy-Hide-Name", prefix);
+ 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");
- snprintf(header_name, sizeof(header_name), "%s-Privacy-Hide-Number", prefix);
+ 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");
Modified: freeswitch/trunk/src/switch_channel.c
==============================================================================
--- freeswitch/trunk/src/switch_channel.c (original)
+++ freeswitch/trunk/src/switch_channel.c Wed Dec 12 16:53:32 2007
@@ -595,7 +595,7 @@
switch_channel_event_set_data(channel, event);
} else {
char state_num[25];
- snprintf(state_num, sizeof(state_num), "%d", channel->state);
+ switch_snprintf(state_num, sizeof(state_num), "%d", channel->state);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Channel-State", "%s", (char *) switch_channel_state_name(channel->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);
@@ -830,7 +830,7 @@
}
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Channel-State", "%s", switch_channel_state_name(channel->state));
- snprintf(state_num, sizeof(state_num), "%d", 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));
@@ -870,7 +870,7 @@
x++;
switch_assert(vvar && vval);
- snprintf(buf, sizeof(buf), "variable_%s", vvar);
+ switch_snprintf(buf, sizeof(buf), "variable_%s", vvar);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, buf, "%s", vval);
}
Modified: freeswitch/trunk/src/switch_config.c
==============================================================================
--- freeswitch/trunk/src/switch_config.c (original)
+++ freeswitch/trunk/src/switch_config.c Wed Dec 12 16:53:32 2007
@@ -41,7 +41,7 @@
if (switch_is_file_path(file_path)) {
path = file_path;
} else {
- snprintf(path_buf, sizeof(path_buf), "%s%s%s", SWITCH_GLOBAL_dirs.conf_dir, SWITCH_PATH_SEPARATOR, file_path);
+ switch_snprintf(path_buf, sizeof(path_buf), "%s%s%s", SWITCH_GLOBAL_dirs.conf_dir, SWITCH_PATH_SEPARATOR, file_path);
path = path_buf;
}
@@ -57,7 +57,7 @@
int last = -1;
char *var, *val;
- snprintf(path_buf, sizeof(path_buf), "%s%sfreeswitch.conf", SWITCH_GLOBAL_dirs.conf_dir, SWITCH_PATH_SEPARATOR);
+ switch_snprintf(path_buf, sizeof(path_buf), "%s%sfreeswitch.conf", SWITCH_GLOBAL_dirs.conf_dir, SWITCH_PATH_SEPARATOR);
path = path_buf;
if ((f = fopen(path, "r")) == 0) {
Modified: freeswitch/trunk/src/switch_console.c
==============================================================================
--- freeswitch/trunk/src/switch_console.c (original)
+++ freeswitch/trunk/src/switch_console.c Wed Dec 12 16:53:32 2007
@@ -94,7 +94,7 @@
ret = -1;
} else {
ret = 0;
- snprintf(end, remaining, "%s", data);
+ switch_snprintf(end, remaining, "%s", data);
handle->data_len = strlen(buf);
handle->end = (uint8_t *) (handle->data) + handle->data_len;
}
@@ -204,7 +204,7 @@
char * prompt(EditLine *e) {
if (*prompt_str == '\0') {
gethostname(hostname, sizeof(hostname));
- snprintf(prompt_str, sizeof(prompt_str), "freeswitch@%s> ", hostname);
+ switch_snprintf(prompt_str, sizeof(prompt_str), "freeswitch@%s> ", hostname);
}
return prompt_str;
Modified: freeswitch/trunk/src/switch_core.c
==============================================================================
--- freeswitch/trunk/src/switch_core.c (original)
+++ freeswitch/trunk/src/switch_core.c Wed Dec 12 16:53:32 2007
@@ -534,7 +534,7 @@
if (bg) {
bg = 0;
#ifdef WIN32
- snprintf(path, sizeof(path), "Global\\Freeswitch.%d", getpid());
+ switch_snprintf(path, sizeof(path), "Global\\Freeswitch.%d", getpid());
shutdown_event = CreateEvent(NULL, FALSE, FALSE, path);
if (shutdown_event) {
WaitForSingleObject(shutdown_event, INFINITE);
Modified: freeswitch/trunk/src/switch_core_codec.c
==============================================================================
--- freeswitch/trunk/src/switch_core_codec.c (original)
+++ freeswitch/trunk/src/switch_core_codec.c Wed Dec 12 16:53:32 2007
@@ -54,7 +54,7 @@
}
switch_channel_set_variable(channel, "read_codec", codec->implementation->iananame);
- snprintf(tmp, sizeof(tmp), "%d", codec->implementation->actual_samples_per_second);
+ switch_snprintf(tmp, sizeof(tmp), "%d", codec->implementation->actual_samples_per_second);
switch_channel_set_variable(channel, "read_rate", tmp);
session->read_codec = codec;
@@ -92,7 +92,7 @@
}
switch_channel_set_variable(channel, "write_codec", codec->implementation->iananame);
- snprintf(tmp, sizeof(tmp), "%d", codec->implementation->actual_samples_per_second);
+ switch_snprintf(tmp, sizeof(tmp), "%d", codec->implementation->actual_samples_per_second);
switch_channel_set_variable(channel, "write_rate", tmp);
session->write_codec = codec;
Modified: freeswitch/trunk/src/switch_core_db.c
==============================================================================
--- freeswitch/trunk/src/switch_core_db.c (original)
+++ freeswitch/trunk/src/switch_core_db.c Wed Dec 12 16:53:32 2007
@@ -42,7 +42,7 @@
if (switch_is_file_path(dbname)) {
strncpy(buf, dbname, size);
} else {
- snprintf(buf, size, "%s%s%s.db", SWITCH_GLOBAL_dirs.db_dir, SWITCH_PATH_SEPARATOR, dbname);
+ switch_snprintf(buf, size, "%s%s%s.db", SWITCH_GLOBAL_dirs.db_dir, SWITCH_PATH_SEPARATOR, dbname);
}
}
Modified: freeswitch/trunk/src/switch_core_session.c
==============================================================================
--- freeswitch/trunk/src/switch_core_session.c (original)
+++ freeswitch/trunk/src/switch_core_session.c Wed Dec 12 16:53:32 2007
@@ -806,7 +806,7 @@
switch_queue_create(&session->event_queue, SWITCH_EVENT_QUEUE_LEN, session->pool);
switch_queue_create(&session->private_event_queue, SWITCH_EVENT_QUEUE_LEN, session->pool);
- snprintf(session->name, sizeof(session->name), "%"SWITCH_SIZE_T_FMT, session->id);
+ switch_snprintf(session->name, sizeof(session->name), "%"SWITCH_SIZE_T_FMT, session->id);
switch_mutex_lock(runtime.throttle_mutex);
session->id = session_manager.session_id++;
switch_core_hash_insert(session_manager.session_table, session->uuid_str, session);
Modified: freeswitch/trunk/src/switch_event.c
==============================================================================
--- freeswitch/trunk/src/switch_event.c (original)
+++ freeswitch/trunk/src/switch_event.c Wed Dec 12 16:53:32 2007
@@ -761,7 +761,7 @@
if (encode) {
switch_url_encode(hp->value, encode_buf, encode_len - 1);
} else {
- snprintf(encode_buf, encode_len, "[%s]", hp->value);
+ switch_snprintf(encode_buf, encode_len, "[%s]", hp->value);
}
llen = strlen(hp->name) + strlen(encode_buf) + 8;
@@ -779,7 +779,7 @@
}
}
- snprintf(buf + len, dlen - len, "%s: %s\n", hp->name, switch_strlen_zero(encode_buf) ? "_undef_" : encode_buf);
+ switch_snprintf(buf + len, dlen - len, "%s: %s\n", hp->name, switch_strlen_zero(encode_buf) ? "_undef_" : encode_buf);
len = strlen(buf);
}
@@ -809,12 +809,12 @@
}
if (blen) {
- snprintf(buf + len, dlen - len, "Content-Length: %d\n\n%s", blen, event->body);
+ switch_snprintf(buf + len, dlen - len, "Content-Length: %d\n\n%s", blen, event->body);
} else {
- snprintf(buf + len, dlen - len, "\n");
+ switch_snprintf(buf + len, dlen - len, "\n");
}
} else {
- snprintf(buf + len, dlen - len, "\n");
+ switch_snprintf(buf + len, dlen - len, "\n");
}
*str = buf;
@@ -877,7 +877,7 @@
if (body) {
int blen = (int) strlen(body);
char blena[25];
- snprintf(blena, sizeof(blena), "%d", blen);
+ switch_snprintf(blena, sizeof(blena), "%d", blen);
if (blen) {
switch_xml_t xbody = NULL;
Modified: freeswitch/trunk/src/switch_ivr.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr.c (original)
+++ freeswitch/trunk/src/switch_ivr.c Wed Dec 12 16:53:32 2007
@@ -1456,25 +1456,25 @@
if (!(time_tag = switch_xml_add_child_d(x_times, "created_time", t_off++))) {
goto error;
}
- snprintf(tmp, sizeof(tmp), "%" SWITCH_TIME_T_FMT, caller_profile->times->created);
+ switch_snprintf(tmp, sizeof(tmp), "%" SWITCH_TIME_T_FMT, caller_profile->times->created);
switch_xml_set_txt_d(time_tag, tmp);
if (!(time_tag = switch_xml_add_child_d(x_times, "answered_time", t_off++))) {
goto error;
}
- snprintf(tmp, sizeof(tmp), "%" SWITCH_TIME_T_FMT, caller_profile->times->answered);
+ switch_snprintf(tmp, sizeof(tmp), "%" SWITCH_TIME_T_FMT, caller_profile->times->answered);
switch_xml_set_txt_d(time_tag, tmp);
if (!(time_tag = switch_xml_add_child_d(x_times, "hangup_time", t_off++))) {
goto error;
}
- snprintf(tmp, sizeof(tmp), "%" SWITCH_TIME_T_FMT, caller_profile->times->hungup);
+ switch_snprintf(tmp, sizeof(tmp), "%" SWITCH_TIME_T_FMT, caller_profile->times->hungup);
switch_xml_set_txt_d(time_tag, tmp);
if (!(time_tag = switch_xml_add_child_d(x_times, "transfer_time", t_off++))) {
goto error;
}
- snprintf(tmp, sizeof(tmp), "%" SWITCH_TIME_T_FMT, caller_profile->times->transferred);
+ switch_snprintf(tmp, sizeof(tmp), "%" SWITCH_TIME_T_FMT, caller_profile->times->transferred);
switch_xml_set_txt_d(time_tag, tmp);
}
Modified: freeswitch/trunk/src/switch_ivr_play_say.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr_play_say.c (original)
+++ freeswitch/trunk/src/switch_ivr_play_say.c Wed Dec 12 16:53:32 2007
@@ -127,7 +127,7 @@
}
switch_url_encode(data, enc_hint, sizeof(enc_hint));
- snprintf(hint_data, sizeof(hint_data), "macro_name=%s&lang=%s&data=%s&destination_number=%s", macro_name, chan_lang, enc_hint, switch_channel_get_variable(channel,"destination_number"));
+ switch_snprintf(hint_data, sizeof(hint_data), "macro_name=%s&lang=%s&data=%s&destination_number=%s", macro_name, chan_lang, enc_hint, switch_channel_get_variable(channel,"destination_number"));
if (switch_xml_locate("phrases", NULL, NULL, NULL, &xml, &cfg, hint_data) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "open of phrases failed.\n");
Modified: freeswitch/trunk/src/switch_loadable_module.c
==============================================================================
--- freeswitch/trunk/src/switch_loadable_module.c (original)
+++ freeswitch/trunk/src/switch_loadable_module.c Wed Dec 12 16:53:32 2007
@@ -784,7 +784,7 @@
len += strlen(file);
len += 8;
path = (char *) switch_core_alloc(loadable_modules.pool, len);
- snprintf(path, len, "%s%s%s%s", dir, SWITCH_PATH_SEPARATOR, file, ext);
+ switch_snprintf(path, len, "%s%s%s%s", dir, SWITCH_PATH_SEPARATOR, file, ext);
}
switch_mutex_lock(loadable_modules.mutex);
Modified: freeswitch/trunk/src/switch_log.c
==============================================================================
--- freeswitch/trunk/src/switch_log.c (original)
+++ freeswitch/trunk/src/switch_log.c Wed Dec 12 16:53:32 2007
@@ -222,7 +222,7 @@
len = (uint32_t) (strlen(extra_fmt) + strlen(date) + strlen(filep) + 32 + strlen(funcp) + strlen(fmt));
new_fmt = malloc(len + 1);
switch_assert(new_fmt);
- snprintf(new_fmt, len, extra_fmt, date, switch_log_level2str(level), filep, line, funcp, 128, fmt);
+ switch_snprintf(new_fmt, len, extra_fmt, date, switch_log_level2str(level), filep, line, funcp, 128, fmt);
fmt = new_fmt;
}
Modified: freeswitch/trunk/src/switch_rtp.c
==============================================================================
--- freeswitch/trunk/src/switch_rtp.c (original)
+++ freeswitch/trunk/src/switch_rtp.c Wed Dec 12 16:53:32 2007
@@ -652,8 +652,8 @@
char ice_user[80];
char user_ice[80];
- snprintf(ice_user, sizeof(ice_user), "%s%s", login, rlogin);
- snprintf(user_ice, sizeof(user_ice), "%s%s", rlogin, login);
+ switch_snprintf(ice_user, sizeof(ice_user), "%s%s", login, rlogin);
+ switch_snprintf(user_ice, sizeof(user_ice), "%s%s", rlogin, login);
rtp_session->ice_user = switch_core_strdup(rtp_session->pool, ice_user);
rtp_session->user_ice = switch_core_strdup(rtp_session->pool, user_ice);
Modified: freeswitch/trunk/src/switch_utils.c
==============================================================================
--- freeswitch/trunk/src/switch_utils.c (original)
+++ freeswitch/trunk/src/switch_utils.c Wed Dec 12 16:53:32 2007
@@ -229,7 +229,7 @@
unsigned char in[B64BUFFLEN];
unsigned char out[B64BUFFLEN + 512];
- snprintf(filename, 80, "%smail.%d%04x", SWITCH_GLOBAL_dirs.temp_dir, (int)time(NULL), rand() & 0xffff);
+ switch_snprintf(filename, 80, "%smail.%d%04x", SWITCH_GLOBAL_dirs.temp_dir, (int)time(NULL), rand() & 0xffff);
if ((fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0644))) {
if (file) {
@@ -237,7 +237,7 @@
return SWITCH_FALSE;
}
- snprintf(buf, B64BUFFLEN, "MIME-Version: 1.0\nContent-Type: multipart/mixed; boundary=\"%s\"\n", bound);
+ switch_snprintf(buf, B64BUFFLEN, "MIME-Version: 1.0\nContent-Type: multipart/mixed; boundary=\"%s\"\n", bound);
if (!write_buf(fd, buf)) {
return SWITCH_FALSE;
}
@@ -251,9 +251,9 @@
if (file) {
if (body && switch_stristr("content-type", body)) {
- snprintf(buf, B64BUFFLEN, "--%s\n", bound);
+ switch_snprintf(buf, B64BUFFLEN, "--%s\n", bound);
} else {
- snprintf(buf, B64BUFFLEN, "--%s\nContent-Type: text/plain\n\n", bound);
+ switch_snprintf(buf, B64BUFFLEN, "--%s\nContent-Type: text/plain\n\n", bound);
}
if (!write_buf(fd, buf))
return SWITCH_FALSE;
@@ -277,7 +277,7 @@
}
}
- snprintf(buf, B64BUFFLEN,
+ switch_snprintf(buf, B64BUFFLEN,
"\n\n--%s\nContent-Type: %s; name=\"%s\"\n"
"Content-ID: <ATTACHED at freeswitch.org>\n"
"Content-Transfer-Encoding: base64\n"
@@ -322,7 +322,7 @@
if (file) {
- snprintf(buf, B64BUFFLEN, "\n\n--%s--\n.\n", bound);
+ switch_snprintf(buf, B64BUFFLEN, "\n\n--%s--\n.\n", bound);
if (!write_buf(fd, buf))
return SWITCH_FALSE;
}
@@ -334,7 +334,7 @@
if (ifd) {
close(ifd);
}
- snprintf(buf, B64BUFFLEN, "/bin/cat %s | %s %s %s", filename, runtime.mailer_app, runtime.mailer_app_args, to);
+ switch_snprintf(buf, B64BUFFLEN, "/bin/cat %s | %s %s %s", filename, runtime.mailer_app, runtime.mailer_app_args, to);
if(system(buf)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unable to execute command: %s\n", buf);
}
@@ -826,7 +826,7 @@
static const char fmt[] = "%u.%u.%u.%u";
char tmp[sizeof "255.255.255.255"];
- if (snprintf(tmp, sizeof tmp, fmt,
+ if (switch_snprintf(tmp, sizeof tmp, fmt,
src[0], src[1], src[2], src[3]) >= (int)size) {
return NULL;
}
Modified: freeswitch/trunk/src/switch_xml.cpp
==============================================================================
--- freeswitch/trunk/src/switch_xml.cpp (original)
+++ freeswitch/trunk/src/switch_xml.cpp Wed Dec 12 16:53:32 2007
@@ -294,7 +294,7 @@
for (t = root->s; t && t < s; t++)
if (*t == '\n')
line++;
- snprintf(fmt, SWITCH_XML_ERRL, "[error near line %d]: %s", line, err);
+ switch_snprintf(fmt, SWITCH_XML_ERRL, "[error near line %d]: %s", line, err);
va_start(ap, err);
vsnprintf(root->err, SWITCH_XML_ERRL, fmt, ap);
@@ -1288,7 +1288,7 @@
*domain = NULL;
if (!params) {
- snprintf(my_params, sizeof(my_params), "domain=%s", domain_name);
+ switch_snprintf(my_params, sizeof(my_params), "domain=%s", domain_name);
params = my_params;
}
@@ -1312,10 +1312,10 @@
*domain = NULL;
if (!switch_strlen_zero(xtra_params)) {
- snprintf(params, sizeof(params), "key=%s&user=%s&domain=%s&ip=%s&%s", key,
+ switch_snprintf(params, sizeof(params), "key=%s&user=%s&domain=%s&ip=%s&%s", key,
switch_str_nil(user_name), switch_str_nil(domain_name), switch_str_nil(ip), xtra_params);
} else {
- snprintf(params, sizeof(params), "key=%s&user=%s&domain=%s&ip=%s", key,
+ switch_snprintf(params, sizeof(params), "key=%s&user=%s&domain=%s&ip=%s", key,
switch_str_nil(user_name), switch_str_nil(domain_name), switch_str_nil(ip));
xtra_params = "";
}
@@ -1374,7 +1374,7 @@
switch_thread_rwlock_wrlock(RWLOCK);
}
- snprintf(path_buf, sizeof(path_buf), "%s%s%s", SWITCH_GLOBAL_dirs.conf_dir, SWITCH_PATH_SEPARATOR, "freeswitch.xml");
+ switch_snprintf(path_buf, sizeof(path_buf), "%s%s%s", SWITCH_GLOBAL_dirs.conf_dir, SWITCH_PATH_SEPARATOR, "freeswitch.xml");
if ((new_main = switch_xml_parse_file(path_buf))) {
*err = switch_xml_error(new_main);
switch_copy_string(not_so_threadsafe_error_buffer, *err, sizeof(not_so_threadsafe_error_buffer));
More information about the Freeswitch-svn
mailing list