[Freeswitch-svn] [commit] r9966 - in freeswitch/trunk/src/mod/applications: mod_enum mod_esf mod_fifo mod_limit
Freeswitch SVN
brian at freeswitch.org
Sat Oct 11 16:01:45 EDT 2008
Author: brian
Date: Sat Oct 11 16:01:44 2008
New Revision: 9966
Modified:
freeswitch/trunk/src/mod/applications/mod_enum/mod_enum.c
freeswitch/trunk/src/mod/applications/mod_esf/mod_esf.c
freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c
freeswitch/trunk/src/mod/applications/mod_limit/mod_limit.c
Log:
man am I OCD about this stuff or what
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 Sat Oct 11 16:01:44 2008
@@ -42,7 +42,6 @@
static switch_mutex_t *MUTEX = NULL;
-
struct enum_record {
int order;
int preference;
@@ -108,7 +107,6 @@
switch_mutex_unlock(MUTEX);
}
-
static switch_status_t load_config(void)
{
char *cf = "enum.conf";
@@ -168,10 +166,8 @@
}
return status;
-
}
-
static char *reverse_number(char *in, char *root)
{
switch_size_t len;
@@ -210,7 +206,6 @@
q->errs++;
}
-
static void add_result(enum_query_t *q, int order, int preference, char *service, char *route, int supported)
{
enum_record_t *new_result, *rp, *prev = NULL;
@@ -256,7 +251,6 @@
}
}
-
static void free_results(enum_record_t **results)
{
enum_record_t *fp, *rp;
@@ -395,7 +389,7 @@
return;
xperr:
- //printf("<parse error>\n");
+
return;
}
@@ -453,7 +447,6 @@
free(result);
}
-
static switch_status_t enum_lookup(char *root, char *in, enum_record_t **results)
{
switch_status_t sstatus = SWITCH_STATUS_SUCCESS;
@@ -567,7 +560,6 @@
return sstatus;
}
-
SWITCH_STANDARD_DIALPLAN(enum_dialplan_hunt)
{
switch_caller_extension_t *extension = NULL;
@@ -603,7 +595,6 @@
}
return extension;
-
}
SWITCH_STANDARD_APP(enum_app_function)
@@ -666,10 +657,8 @@
free_results(&results);
}
}
-
}
-
SWITCH_STANDARD_API(enum_api)
{
int argc = 0;
@@ -729,7 +718,6 @@
return SWITCH_STATUS_SUCCESS;
}
-
static void do_load(void)
{
switch_mutex_lock(MUTEX);
@@ -745,8 +733,6 @@
}
-
-
SWITCH_STANDARD_API(enum_function)
{
int argc = 0;
@@ -854,7 +840,6 @@
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_enum_shutdown)
{
-
switch_event_unbind(&NODE);
if (globals.pool) {
Modified: freeswitch/trunk/src/mod/applications/mod_esf/mod_esf.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_esf/mod_esf.c (original)
+++ freeswitch/trunk/src/mod/applications/mod_esf/mod_esf.c Sat Oct 11 16:01:44 2008
@@ -40,6 +40,7 @@
uint32_t ip;
uint32_t port;
};
+
typedef struct ls_control_packet ls_control_packet_t;
typedef enum {
@@ -78,7 +79,6 @@
char *mcast_port_str = "34567";
const char *esf_broadcast_ip = NULL, *var;
-
if (!switch_strlen_zero((char *) data)) {
mydata = switch_core_session_strdup(session, data);
assert(mydata != NULL);
@@ -103,7 +103,6 @@
}
}
-
if (switch_true(switch_channel_get_variable(channel, SWITCH_BYPASS_MEDIA_VARIABLE))) {
switch_core_session_message_t msg = { 0 };
@@ -259,7 +258,6 @@
return;
}
-
SWITCH_MODULE_LOAD_FUNCTION(mod_esf_load)
{
switch_application_interface_t *app_interface;
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 Sat Oct 11 16:01:44 2008
@@ -52,9 +52,6 @@
typedef struct fifo_node fifo_node_t;
-
-
-
static switch_status_t on_dtmf(switch_core_session_t *session, void *input, switch_input_type_t itype, void *buf, unsigned int buflen)
{
switch_core_session_t *bleg = (switch_core_session_t *) buf;
@@ -102,10 +99,8 @@
return SWITCH_STATUS_SUCCESS;
}
-
static switch_status_t moh_on_dtmf(switch_core_session_t *session, void *input, switch_input_type_t itype, void *buf, unsigned int buflen)
{
-
switch (itype) {
case SWITCH_INPUT_TYPE_DTMF:
{
@@ -181,9 +176,8 @@
int do_orbit;
char *orbit_exten;
};
-typedef struct fifo_chime_data fifo_chime_data_t;
-
+typedef struct fifo_chime_data fifo_chime_data_t;
static switch_status_t caller_read_frame_callback(switch_core_session_t *session, switch_frame_t *frame, void *user_data)
{
@@ -222,7 +216,6 @@
return SWITCH_STATUS_SUCCESS;
}
-
static switch_status_t consumer_read_frame_callback(switch_core_session_t *session, switch_frame_t *frame, void *user_data)
{
fifo_node_t *node, **node_list = (fifo_node_t **) user_data;
@@ -252,7 +245,6 @@
switch_event_node_t *node;
} globals;
-
static fifo_node_t *create_node(const char *name, uint32_t importance)
{
fifo_node_t *node;
@@ -310,7 +302,6 @@
}
}
-
static void pres_event_handler(switch_event_t *event)
{
char *to = switch_event_get_header(event, "to");
@@ -443,7 +434,6 @@
if (argc > 4) {
moh = argv[4];
}
-
} else {
if (argc > 2) {
announce = argv[2];
@@ -493,7 +483,6 @@
}
}
-
if (chime_freq) {
ftmp = atoi(chime_freq);
if (ftmp > 0) {
@@ -501,8 +490,6 @@
}
}
-
-
switch_channel_answer(channel);
switch_mutex_lock(node->mutex);
@@ -510,7 +497,6 @@
switch_core_hash_insert(node->caller_hash, uuid, session);
-
if ((pri = switch_channel_get_variable(channel, "fifo_priority"))) {
p = atoi(pri);
}
@@ -688,7 +674,6 @@
}
}
-
if (argc > 2) {
if (!strcasecmp(argv[2], "nowait")) {
do_wait = 0;
@@ -698,12 +683,10 @@
}
}
-
if (!(my_id = switch_channel_get_variable(channel, "fifo_consumer_id"))) {
my_id = switch_core_session_get_uuid(session);
}
-
if (do_wait) {
for (i = 0; i < node_count; i++) {
if (!(node = node_list[i])) {
@@ -792,7 +775,6 @@
importance = node->importance;
}
}
-
}
if (winner > -1) {
@@ -823,7 +805,6 @@
}
}
-
if (!pop) {
if (!do_wait) {
break;
@@ -872,7 +853,6 @@
switch_ivr_sleep(session, 500, NULL);
}
-
switch_channel_set_variable(other_channel, "fifo_serviced_by", my_id);
switch_channel_set_variable(other_channel, "fifo_serviced_uuid", switch_core_session_get_uuid(session));
@@ -891,7 +871,6 @@
break;
}
-
switch_channel_answer(channel);
cloned_profile = switch_caller_profile_clone(other_session, switch_channel_get_caller_profile(channel));
switch_assert(cloned_profile);
@@ -945,7 +924,6 @@
send_presence(node);
switch_core_session_rwunlock(other_session);
-
if (!do_wait) {
done = 1;
}
@@ -1044,7 +1022,6 @@
switch_mutex_unlock(node->mutex);
}
}
-
}
}
@@ -1097,7 +1074,6 @@
switch_ivr_set_xml_chan_vars(variables, channel, c_off);
}
-
}
return cc_off;
@@ -1105,7 +1081,6 @@
static void list_node(fifo_node_t *node, switch_xml_t x_report, int *off, int verbose)
{
-
switch_xml_t x_fifo;
int cc_off = 0;
char buffer[35];
@@ -1126,7 +1101,6 @@
cc_off = xml_hash(x_fifo, node->caller_hash, "callers", "caller", cc_off, verbose);
cc_off = xml_hash(x_fifo, node->consumer_hash, "consumers", "consumer", cc_off, verbose);
-
}
#define FIFO_API_SYNTAX "list|list_verbose|count|importance [<fifo name>]"
@@ -1142,7 +1116,6 @@
const void *var;
int x = 0, verbose = 0;
-
if (!globals.running) {
return SWITCH_STATUS_FALSE;
}
@@ -1229,13 +1202,11 @@
return SWITCH_STATUS_SUCCESS;
}
-
SWITCH_MODULE_LOAD_FUNCTION(mod_fifo_load)
{
switch_application_interface_t *app_interface;
switch_api_interface_t *commands_api_interface;
-
/* create/register custom event message type */
if (switch_event_reserve_subclass(FIFO_EVENT) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!", FIFO_EVENT);
@@ -1305,7 +1276,6 @@
return SWITCH_STATUS_SUCCESS;
}
-
/* For Emacs:
* Local Variables:
* mode:c
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 Sat Oct 11 16:01:44 2008
@@ -55,17 +55,13 @@
"CREATE TABLE limit_data (\n"
" hostname VARCHAR(255),\n" " realm VARCHAR(255),\n" " id VARCHAR(255),\n" " uuid VARCHAR(255)\n" ");\n";
-
static char db_sql[] =
"CREATE TABLE db_data (\n"
" hostname VARCHAR(255),\n" " realm VARCHAR(255),\n" " data_key VARCHAR(255),\n" " data VARCHAR(255)\n" ");\n";
-
static char group_sql[] =
"CREATE TABLE group_data (\n" " hostname VARCHAR(255),\n" " groupname VARCHAR(255),\n" " url VARCHAR(255)\n" ");\n";
-
-
static switch_status_t limit_execute_sql(char *sql, switch_mutex_t *mutex)
{
switch_core_db_t *db;
@@ -102,7 +98,6 @@
}
#endif
-
end:
if (mutex) {
switch_mutex_unlock(mutex);
@@ -111,7 +106,6 @@
return status;
}
-
static switch_bool_t limit_execute_sql_callback(switch_mutex_t *mutex, char *sql, switch_core_db_callback_func_t callback, void *pdata)
{
switch_bool_t ret = SWITCH_FALSE;
@@ -152,10 +146,8 @@
}
return ret;
-
}
-
static switch_status_t do_config()
{
char *cf = "limit.conf";
@@ -191,7 +183,6 @@
#else
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ODBC IS NOT AVAILABLE!\n");
#endif
-
}
}
}
@@ -254,7 +245,6 @@
switch_xml_free(xml);
return status;
-
}
static switch_status_t hanguphook(switch_core_session_t *session)
@@ -282,7 +272,9 @@
size_t len;
int matches;
};
+
typedef struct callback callback_t;
+
static int sql2str_callback(void *pArg, int argc, char **argv, char **columnNames)
{
callback_t *cbt = (callback_t *) pArg;
@@ -292,7 +284,6 @@
return 0;
}
-
static int group_callback(void *pArg, int argc, char **argv, char **columnNames)
{
callback_t *cbt = (callback_t *) pArg;
@@ -301,7 +292,6 @@
return 0;
}
-
SWITCH_STANDARD_API(db_api_function)
{
int argc = 0;
@@ -360,7 +350,6 @@
goto done;
}
-
error:
stream->write_function(stream, "!err!");
@@ -369,10 +358,8 @@
switch_mutex_unlock(globals.mutex);
switch_safe_free(mydata);
return SWITCH_STATUS_SUCCESS;
-
}
-
#define DB_USAGE "[insert|delete]/<realm>/<key>/<val>"
#define DB_DESC "save data"
@@ -414,8 +401,6 @@
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "USAGE: db %s\n", DB_USAGE);
}
-
-
SWITCH_STANDARD_API(group_api_function)
{
int argc = 0;
@@ -493,7 +478,6 @@
switch_mutex_unlock(globals.mutex);
switch_safe_free(mydata);
return SWITCH_STATUS_SUCCESS;
-
}
#define GROUP_USAGE "[insert|delete]:<group name>:<val>"
@@ -527,7 +511,6 @@
limit_execute_sql(sql, globals.mutex);
switch_safe_free(sql);
}
-
}
#define LIMIT_USAGE "<realm> <id> <max> [transfer_destination_number]"
@@ -600,7 +583,6 @@
switch_mutex_unlock(globals.mutex);
}
-
SWITCH_MODULE_LOAD_FUNCTION(mod_limit_load)
{
switch_status_t status;
@@ -637,8 +619,6 @@
return SWITCH_STATUS_SUCCESS;
}
-
-
/* For Emacs:
* Local Variables:
* mode:c
More information about the Freeswitch-svn
mailing list