[Freeswitch-svn] [commit] r3107 - in freeswitch/trunk/src: . mod/endpoints/mod_dingaling mod/endpoints/mod_sofia

Freeswitch SVN mikej at freeswitch.org
Thu Oct 19 12:42:42 EDT 2006


Author: mikej
Date: Thu Oct 19 12:42:41 2006
New Revision: 3107

Modified:
   freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c
   freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
   freeswitch/trunk/src/switch_core.c

Log:
change to switch_mprintf

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	Thu Oct 19 12:42:41 2006
@@ -264,7 +264,7 @@
 		*p = '\0';
 	}
 	
-	sql = switch_core_db_mprintf("select *,'%q','%q' from subscriptions where sub_to='%q'", type ? type : "", status ? status : "unavailable", from);
+	sql = switch_mprintf("select *,'%q','%q' from subscriptions where sub_to='%q'", type ? type : "", status ? status : "unavailable", from);
 	for (hi = switch_hash_first(apr_hash_pool_get(globals.profile_hash), globals.profile_hash); hi; hi = switch_hash_next(hi)) {
 		char *errmsg;
         switch_hash_this(hi, NULL, NULL, &val);
@@ -346,7 +346,7 @@
 		event_type="presence";
 	}
 
-	sql = switch_core_db_mprintf("select *,'%q' from subscriptions", show ? show : "unavilable");
+	sql = switch_mprintf("select *,'%q' from subscriptions", show ? show : "unavilable");
 
 	for (hi = switch_hash_first(apr_hash_pool_get(globals.profile_hash), globals.profile_hash); hi; hi = switch_hash_next(hi)) {
 		char *errmsg;
@@ -1805,7 +1805,7 @@
 		case LDL_SIGNAL_UNSUBSCRIBE:
 			if ((profile->user_flags & LDL_FLAG_COMPONENT)) {
 
-				if ((sql = switch_core_db_mprintf("delete from subscriptions where sub_from='%q' and sub_to='%q';", from, to))) {
+				if ((sql = switch_mprintf("delete from subscriptions where sub_from='%q' and sub_to='%q';", from, to))) {
 					execute_sql(profile->dbname, sql, profile->mutex);
 					switch_core_db_free(sql);
 				}
@@ -1815,7 +1815,7 @@
 		case LDL_SIGNAL_SUBSCRIBE:
 			if ((profile->user_flags & LDL_FLAG_COMPONENT)) {
 
-				if ((sql = switch_core_db_mprintf("insert into subscriptions values('%q','%q')", from, to))) {
+				if ((sql = switch_mprintf("insert into subscriptions values('%q','%q')", from, to))) {
 					execute_sql(profile->dbname, sql, profile->mutex);
 					switch_core_db_free(sql);
 				}

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	Thu Oct 19 12:42:41 2006
@@ -893,8 +893,8 @@
 static void do_invite(switch_core_session_t *session)
 {
 	char rpid[1024] = { 0 };
-	char alert_info[1024] = { 0 };
-	char *alertbuf;
+	char alert_info[1024] = { 0 };
+	char *alertbuf;
 	private_object_t *tech_pvt;
     switch_channel_t *channel = NULL;
 	switch_caller_profile_t *caller_profile;
@@ -923,11 +923,11 @@
 													 ))) {
 
 		char *rep = switch_channel_get_variable(channel, SOFIA_REPLACES_HEADER);
-
-		if ((alertbuf = switch_channel_get_variable(channel, "alert_info"))) {
-			snprintf(alert_info, sizeof(alert_info) - 1, "Alert-Info: %s", alertbuf);
-		}
 
+		if ((alertbuf = switch_channel_get_variable(channel, "alert_info"))) {
+			snprintf(alert_info, sizeof(alert_info) - 1, "Alert-Info: %s", alertbuf);
+		}
+
 		tech_choose_port(tech_pvt);
 		set_local_sdp(tech_pvt);
 
@@ -981,7 +981,7 @@
 
 		nua_invite(tech_pvt->nh,
 				   TAG_IF(rpid, SIPTAG_HEADER_STR(rpid)),
-					TAG_IF(alert_info, SIPTAG_HEADER_STR(alert_info)),
+					TAG_IF(alert_info, SIPTAG_HEADER_STR(alert_info)),
 				   SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str),
 				   SOATAG_RTP_SORT(SOA_RTP_SORT_REMOTE),
 				   SOATAG_RTP_SELECT(SOA_RTP_SELECT_ALL),

Modified: freeswitch/trunk/src/switch_core.c
==============================================================================
--- freeswitch/trunk/src/switch_core.c	(original)
+++ freeswitch/trunk/src/switch_core.c	Thu Oct 19 12:42:41 2006
@@ -3402,10 +3402,10 @@
 
 	switch (event->event_id) {
 	case SWITCH_EVENT_CHANNEL_DESTROY:
-		sql = switch_core_db_mprintf("delete from channels where uuid='%s'", switch_event_get_header(event, "unique-id"));
+		sql = switch_mprintf("delete from channels where uuid='%s'", switch_event_get_header(event, "unique-id"));
 		break;
 	case SWITCH_EVENT_CHANNEL_CREATE:
-		sql = switch_core_db_mprintf("insert into channels (uuid,created,name,state) values('%q','%q','%q','%q')",
+		sql = switch_mprintf("insert into channels (uuid,created,name,state) values('%q','%q','%q','%q')",
 									 switch_event_get_header(event, "unique-id"),
 									 switch_event_get_header(event, "event-date-local"),
 									 switch_event_get_header(event, "channel-name"),
@@ -3413,7 +3413,7 @@
 									 );
 		break;
 	case SWITCH_EVENT_CODEC:
-		sql = switch_core_db_mprintf("update channels set read_codec='%q',read_rate='%q',write_codec='%q',write_rate='%q' where uuid='%q'",
+		sql = switch_mprintf("update channels set read_codec='%q',read_rate='%q',write_codec='%q',write_rate='%q' where uuid='%q'",
 									 switch_event_get_header(event, "channel-read-codec-name"),
 									 switch_event_get_header(event, "channel-read-codec-rate"),
 									 switch_event_get_header(event, "channel-write-codec-name"),
@@ -3421,7 +3421,7 @@
 									 switch_event_get_header(event, "unique-id"));
 		break;
 	case SWITCH_EVENT_CHANNEL_EXECUTE:
-		sql = switch_core_db_mprintf("update channels set application='%q',application_data='%q' where uuid='%q'",
+		sql = switch_mprintf("update channels set application='%q',application_data='%q' where uuid='%q'",
 									 switch_event_get_header(event, "application"),
 									 switch_event_get_header(event, "application-data"),
 									 switch_event_get_header(event, "unique-id")
@@ -3437,7 +3437,7 @@
 			case CS_DONE:
 				break;
 			case CS_RING:
-				sql = switch_core_db_mprintf("update channels set state='%s',cid_name='%q',cid_num='%q',ip_addr='%s',dest='%q'"
+				sql = switch_mprintf("update channels set state='%s',cid_name='%q',cid_num='%q',ip_addr='%s',dest='%q'"
 											 "where uuid='%s'",
 											 switch_event_get_header(event, "channel-state"),
 											 switch_event_get_header(event, "caller-caller-id-name"),
@@ -3448,7 +3448,7 @@
 											 );
 				break;
 			default:
-				sql = switch_core_db_mprintf("update channels set state='%s' where uuid='%s'", 
+				sql = switch_mprintf("update channels set state='%s' where uuid='%s'", 
 											 switch_event_get_header(event, "channel-state"),
 											 switch_event_get_header(event, "unique-id")
 											 );
@@ -3458,7 +3458,7 @@
 		}
 		break;
 	case SWITCH_EVENT_CHANNEL_BRIDGE:
-		sql = switch_core_db_mprintf("insert into calls values ('%s','%q','%q','%q','%q','%s','%q','%q','%q','%q','%s')",
+		sql = switch_mprintf("insert into calls values ('%s','%q','%q','%q','%q','%s','%q','%q','%q','%q','%s')",
 									 switch_event_get_header(event, "event-calling-function"),
 									 switch_event_get_header(event, "caller-caller-id-name"),
 									 switch_event_get_header(event, "caller-caller-id-number"),
@@ -3473,15 +3473,15 @@
 									 );
 		break;
 	case SWITCH_EVENT_CHANNEL_UNBRIDGE:
-		sql = switch_core_db_mprintf("delete from calls where caller_uuid='%s'", switch_event_get_header(event, "caller-unique-id"));
+		sql = switch_mprintf("delete from calls where caller_uuid='%s'", switch_event_get_header(event, "caller-unique-id"));
 		break;
 	case SWITCH_EVENT_SHUTDOWN:
-		sql = switch_core_db_mprintf("delete from channels;delete from interfaces;delete from calls");
+		sql = switch_mprintf("delete from channels;delete from interfaces;delete from calls");
 		break;
 	case SWITCH_EVENT_LOG:
 		return;
 	case SWITCH_EVENT_MODULE_LOAD:
-		sql = switch_core_db_mprintf("insert into interfaces (type,name,description,syntax) values('%q','%q','%q','%q')",
+		sql = switch_mprintf("insert into interfaces (type,name,description,syntax) values('%q','%q','%q','%q')",
 									 switch_event_get_header(event, "type"),
 									 switch_event_get_header(event, "name"),
 									 switch_event_get_header(event, "description"),



More information about the Freeswitch-svn mailing list