mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-12 12:37:05 +00:00
man am I OCD about this stuff or what
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9966 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
1 parent
0ecfc14d68
commit
f1bc3e6bb2
4 files changed
+5
-72
No files matched your search
@@ -52,9 +52,6 @@ struct fifo_node {
|
||||
|
||||
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 @@ static switch_status_t on_dtmf(switch_core_session_t *session, void *input, swit
|
||||
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,10 +176,9 @@ struct fifo_chime_data {
|
||||
int do_orbit;
|
||||
char *orbit_exten;
|
||||
};
|
||||
|
||||
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)
|
||||
{
|
||||
fifo_chime_data_t *cd = (fifo_chime_data_t *) user_data;
|
||||
@@ -222,7 +216,6 @@ static switch_status_t caller_read_frame_callback(switch_core_session_t *session
|
||||
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 @@ static struct {
|
||||
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 send_presence(fifo_node_t *node)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void pres_event_handler(switch_event_t *event)
|
||||
{
|
||||
char *to = switch_event_get_header(event, "to");
|
||||
@@ -443,7 +434,6 @@ SWITCH_STANDARD_APP(fifo_function)
|
||||
if (argc > 4) {
|
||||
moh = argv[4];
|
||||
}
|
||||
|
||||
} else {
|
||||
if (argc > 2) {
|
||||
announce = argv[2];
|
||||
@@ -493,7 +483,6 @@ SWITCH_STANDARD_APP(fifo_function)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (chime_freq) {
|
||||
ftmp = atoi(chime_freq);
|
||||
if (ftmp > 0) {
|
||||
@@ -501,8 +490,6 @@ SWITCH_STANDARD_APP(fifo_function)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
switch_channel_answer(channel);
|
||||
|
||||
switch_mutex_lock(node->mutex);
|
||||
@@ -510,7 +497,6 @@ SWITCH_STANDARD_APP(fifo_function)
|
||||
|
||||
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 @@ SWITCH_STANDARD_APP(fifo_function)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (argc > 2) {
|
||||
if (!strcasecmp(argv[2], "nowait")) {
|
||||
do_wait = 0;
|
||||
@@ -698,12 +683,10 @@ SWITCH_STANDARD_APP(fifo_function)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
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 @@ SWITCH_STANDARD_APP(fifo_function)
|
||||
importance = node->importance;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (winner > -1) {
|
||||
@@ -823,7 +805,6 @@ SWITCH_STANDARD_APP(fifo_function)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!pop) {
|
||||
if (!do_wait) {
|
||||
break;
|
||||
@@ -872,7 +853,6 @@ SWITCH_STANDARD_APP(fifo_function)
|
||||
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 @@ SWITCH_STANDARD_APP(fifo_function)
|
||||
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 @@ SWITCH_STANDARD_APP(fifo_function)
|
||||
send_presence(node);
|
||||
switch_core_session_rwunlock(other_session);
|
||||
|
||||
|
||||
if (!do_wait) {
|
||||
done = 1;
|
||||
}
|
||||
@@ -1044,7 +1022,6 @@ SWITCH_STANDARD_APP(fifo_function)
|
||||
switch_mutex_unlock(node->mutex);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1097,7 +1074,6 @@ static int xml_hash(switch_xml_t xml, switch_hash_t *hash, char *container, char
|
||||
|
||||
switch_ivr_set_xml_chan_vars(variables, channel, c_off);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return cc_off;
|
||||
@@ -1105,7 +1081,6 @@ static int xml_hash(switch_xml_t xml, switch_hash_t *hash, char *container, char
|
||||
|
||||
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 @@ static void list_node(fifo_node_t *node, switch_xml_t x_report, int *off, int ve
|
||||
|
||||
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 @@ SWITCH_STANDARD_API(fifo_api_function)
|
||||
const void *var;
|
||||
int x = 0, verbose = 0;
|
||||
|
||||
|
||||
if (!globals.running) {
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
@@ -1229,13 +1202,11 @@ SWITCH_STANDARD_API(fifo_api_function)
|
||||
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 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_fifo_shutdown)
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/* For Emacs:
|
||||
* Local Variables:
|
||||
* mode:c
|
||||
|
||||
Reference in new issue
Block a user