mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-24 05:02:10 +00:00
Mega Changes
adding mod_park for putting channels in limbo state for remote control. adding stuff to mod_event_socket to let you do the bgapi <command> <args> this will let you execute a job in the bg and the result will be sent as an event with an indicated uuid to match the reply to the command adding switch_core_port_allocator (to be used soon) adding "make sure" to do a full rebild of the freeswitch object files There will be more to this committed as the week progresses make sure you do a rebuild after this update or you'll be sowwie ./configure && make sure git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2540 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -298,17 +298,19 @@ SWITCH_DECLARE(const switch_state_handler_table_t *) switch_channel_get_state_ha
|
||||
/*!
|
||||
\brief Set private data on channel
|
||||
\param channel channel on which to set data
|
||||
\param key unique keyname to associate your private data to
|
||||
\param private_info void pointer to private data
|
||||
\return SWITCH_STATUS_SUCCESS if data was set
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_channel_set_private(switch_channel_t *channel, void *private_info);
|
||||
SWITCH_DECLARE(switch_status_t) switch_channel_set_private(switch_channel_t *channel, char *key, void *private_info);
|
||||
|
||||
/*!
|
||||
\brief Retrieve private from a given channel
|
||||
\param channel channel to retrieve data from
|
||||
\param key unique keyname to retrieve your private data
|
||||
\return void pointer to channel's private data
|
||||
*/
|
||||
SWITCH_DECLARE(void *) switch_channel_get_private(switch_channel_t *channel);
|
||||
SWITCH_DECLARE(void *) switch_channel_get_private(switch_channel_t *channel, char *key);
|
||||
|
||||
/*!
|
||||
\brief Assign a name to a given channel
|
||||
|
||||
@@ -42,6 +42,17 @@
|
||||
#include <switch.h>
|
||||
|
||||
BEGIN_EXTERN_C
|
||||
#define SWITCH_CMD_CHUNK_LEN 1024
|
||||
#define SWITCH_STANDARD_STREAM(s) if ((s.data = (char *)malloc(SWITCH_CMD_CHUNK_LEN))) { \
|
||||
memset(s.data, 0, SWITCH_CMD_CHUNK_LEN); \
|
||||
s.end = s.data;\
|
||||
s.data_size = SWITCH_CMD_CHUNK_LEN;\
|
||||
s.write_function = switch_console_stream_write;\
|
||||
s.alloc_len = SWITCH_CMD_CHUNK_LEN;\
|
||||
s.alloc_chunk = SWITCH_CMD_CHUNK_LEN;\
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*!
|
||||
\brief A simple comand loop that reads input from the terminal
|
||||
|
||||
@@ -99,7 +99,7 @@ struct switch_core_thread_session {
|
||||
|
||||
struct switch_core_session;
|
||||
struct switch_core_runtime;
|
||||
|
||||
struct switch_core_port_allocator;
|
||||
|
||||
/*!
|
||||
\defgroup core1 Core Library
|
||||
@@ -107,6 +107,34 @@ struct switch_core_runtime;
|
||||
\{
|
||||
*/
|
||||
|
||||
///\defgroup pa1 Port Allocation
|
||||
///\ingroup core1
|
||||
///\{
|
||||
|
||||
/*!
|
||||
\brief Initilize the port allocator
|
||||
\param start the starting port
|
||||
\param end the ending port
|
||||
\param inc the amount to increment each port
|
||||
\param new pointer for the return value
|
||||
\return SWITCH_STATUS_SUCCESS if the operation was a success
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_port_allocator_new(switch_port_t start, switch_port_t end, uint32_t inc, switch_core_port_allocator_t **new);
|
||||
|
||||
/*!
|
||||
\brief Get a port from the port allocator
|
||||
\param alloc the allocator object
|
||||
\return the port
|
||||
*/
|
||||
SWITCH_DECLARE(switch_port_t) switch_core_port_allocator_request_port(switch_core_port_allocator_t *alloc);
|
||||
|
||||
/*!
|
||||
\brief destroythe port allocator
|
||||
\param alloc the allocator object
|
||||
*/
|
||||
SWITCH_DECLARE(void) switch_core_port_allocator_destroy(switch_core_port_allocator_t **alloc);
|
||||
///\}
|
||||
|
||||
///\defgroup ss Startup/Shutdown
|
||||
///\ingroup core1
|
||||
///\{
|
||||
@@ -469,6 +497,30 @@ SWITCH_DECLARE(int32_t) switch_core_session_event_count(switch_core_session_t *s
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_dequeue_event(switch_core_session_t *session, switch_event_t **event);
|
||||
|
||||
/*!
|
||||
\brief Queue a private event on a given session
|
||||
\param session the session to queue the message on
|
||||
\param event the event to queue
|
||||
\return the status returned by the message handler
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_queue_private_event(switch_core_session_t *session, switch_event_t **event);
|
||||
|
||||
|
||||
/*!
|
||||
\brief Indicate the number of waiting private events on a session
|
||||
\param session the session to check
|
||||
\return the number of events
|
||||
*/
|
||||
SWITCH_DECLARE(int32_t) switch_core_session_private_event_count(switch_core_session_t *session);
|
||||
|
||||
/*!
|
||||
\brief DE-Queue a private event on a given session
|
||||
\param session the session to de-queue the message on
|
||||
\param event the de-queued event
|
||||
\return the SWITCH_STATUS_SUCCESS if the event was de-queued
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_dequeue_private_event(switch_core_session_t *session, switch_event_t **event);
|
||||
|
||||
|
||||
/*!
|
||||
\brief Read a frame from a session
|
||||
|
||||
@@ -42,6 +42,8 @@
|
||||
|
||||
BEGIN_EXTERN_C
|
||||
|
||||
static const switch_state_handler_table_t noop_state_handler = {};
|
||||
|
||||
/**
|
||||
* @defgroup switch_ivr IVR Library
|
||||
* @ingroup core1
|
||||
@@ -59,6 +61,8 @@ BEGIN_EXTERN_C
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_sleep(switch_core_session_t *session, uint32_t ms);
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_park(switch_core_session_t *session);
|
||||
|
||||
/*!
|
||||
\brief Wait for DTMF digits calling a pluggable callback function when digits are collected.
|
||||
\param session the session to read.
|
||||
|
||||
@@ -68,6 +68,8 @@ struct switch_stream_handle {
|
||||
void *end;
|
||||
switch_size_t data_size;
|
||||
switch_size_t data_len;
|
||||
switch_size_t alloc_len;
|
||||
switch_size_t alloc_chunk;
|
||||
switch_event_t *event;
|
||||
};
|
||||
|
||||
|
||||
@@ -382,7 +382,8 @@ CF_BRIDGED = (1 << 7) - Channel in a bridge
|
||||
CF_HOLD = (1 << 8) - Channel is on hold
|
||||
CF_SERVICE = (1 << 9) - Channel has a service thread
|
||||
CF_TAGGED = (1 << 10) - Channel is tagged
|
||||
CF_WINNER = (1 << 10) - Channel is the winner
|
||||
CF_WINNER = (1 << 11) - Channel is the winner
|
||||
CF_CONTROLLED = (1 << 12) - Channel is under control
|
||||
</pre>
|
||||
*/
|
||||
|
||||
@@ -398,7 +399,8 @@ typedef enum {
|
||||
CF_HOLD = (1 << 8),
|
||||
CF_SERVICE = (1 << 9),
|
||||
CF_TAGGED = (1 << 10),
|
||||
CF_WINNER = (1 << 11)
|
||||
CF_WINNER = (1 << 11),
|
||||
CF_CONTROLLED = (1 << 12)
|
||||
} switch_channel_flag_t;
|
||||
|
||||
|
||||
@@ -571,6 +573,10 @@ typedef enum {
|
||||
SWITCH_EVENT_CHANNEL_EXECUTE - A channel has executed a module's application
|
||||
SWITCH_EVENT_CHANNEL_BRIDGE - A channel has bridged to another channel
|
||||
SWITCH_EVENT_CHANNEL_UNBRIDGE - A channel has unbridged from another channel
|
||||
SWITCH_EVENT_CHANNEL_PROGRESS - A channel has been parked
|
||||
SWITCH_EVENT_CHANNEL_OUTGOING - A channel has been unparked
|
||||
SWITCH_EVENT_CHANNEL_PARK - A channel has been parked
|
||||
SWITCH_EVENT_CHANNEL_UNPARK - A channel has been unparked
|
||||
SWITCH_EVENT_API - An API call has been executed
|
||||
SWITCH_EVENT_LOG - A LOG event has been triggered
|
||||
SWITCH_EVENT_INBOUND_CHAN - A new inbound channel has been created
|
||||
@@ -586,8 +592,7 @@ typedef enum {
|
||||
SWITCH_EVENT_DTMF - DTMF was sent
|
||||
SWITCH_EVENT_MESSAGE - A Basic Message
|
||||
SWITCH_EVENT_CODEC - Codec Change
|
||||
SWITCH_EVENT_PROGRESS - Early Media
|
||||
SWITCH_EVENT_OUTGOING - Outgoing Channel
|
||||
SWITCH_EVENT_BACKGROUND_JOB - Background Job
|
||||
SWITCH_EVENT_ALL - All events at once
|
||||
</pre>
|
||||
|
||||
@@ -604,6 +609,8 @@ typedef enum {
|
||||
SWITCH_EVENT_CHANNEL_UNBRIDGE,
|
||||
SWITCH_EVENT_CHANNEL_PROGRESS,
|
||||
SWITCH_EVENT_CHANNEL_OUTGOING,
|
||||
SWITCH_EVENT_CHANNEL_PARK,
|
||||
SWITCH_EVENT_CHANNEL_UNPARK,
|
||||
SWITCH_EVENT_API,
|
||||
SWITCH_EVENT_LOG,
|
||||
SWITCH_EVENT_INBOUND_CHAN,
|
||||
@@ -619,6 +626,7 @@ typedef enum {
|
||||
SWITCH_EVENT_DTMF,
|
||||
SWITCH_EVENT_MESSAGE,
|
||||
SWITCH_EVENT_CODEC,
|
||||
SWITCH_EVENT_BACKGROUND_JOB,
|
||||
SWITCH_EVENT_ALL
|
||||
} switch_event_types_t;
|
||||
|
||||
@@ -728,6 +736,7 @@ typedef struct switch_api_interface switch_api_interface_t;
|
||||
typedef struct switch_file_interface switch_file_interface_t;
|
||||
typedef struct switch_speech_interface switch_speech_interface_t;
|
||||
typedef struct switch_directory_interface switch_directory_interface_t;
|
||||
typedef struct switch_core_port_allocator switch_core_port_allocator_t;
|
||||
|
||||
typedef void (*switch_application_function_t)(switch_core_session_t *, char *);
|
||||
typedef void (*switch_event_callback_t)(switch_event_t *);
|
||||
|
||||
Reference in New Issue
Block a user