mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-23 20:51:58 +00:00
add high and low priority event queues
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@674 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -85,6 +85,8 @@ struct switch_event_subclass {
|
||||
struct switch_event {
|
||||
/*! the event id (descriptor) */
|
||||
switch_event_t event_id;
|
||||
/*! the priority of the event */
|
||||
switch_priority_t priority;
|
||||
/*! the owner of the event */
|
||||
char *owner;
|
||||
/*! the subclass of the event */
|
||||
@@ -139,6 +141,14 @@ SWITCH_DECLARE(switch_status) switch_event_shutdown(void);
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status) switch_event_create_subclass(switch_event **event, switch_event_t event_id, char *subclass_name);
|
||||
|
||||
/*!
|
||||
\brief Set the priority of an event
|
||||
\param event the event to set the priority on
|
||||
\param priority the event priority
|
||||
\return SWITCH_STATUS_SUCCESS
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status) switch_event_set_priority(switch_event *event, switch_priority_t priority);
|
||||
|
||||
/*!
|
||||
\brief Retrieve a header value from an event
|
||||
\param event the event to read the header from
|
||||
@@ -253,6 +263,13 @@ SWITCH_DECLARE(switch_status) switch_event_add_body(switch_event *event, char *f
|
||||
*/
|
||||
#define switch_event_create(event, id) switch_event_create_subclass(event, id, SWITCH_EVENT_SUBCLASS_ANY)
|
||||
|
||||
/*!
|
||||
\brief Deliver an event to all of the registered event listeners
|
||||
\param event the event to send (will be nulled)
|
||||
\note normaly use switch_event_fire for delivering events (only use this when you wish to deliver the event blocking on your thread)
|
||||
*/
|
||||
SWITCH_DECLARE(void) switch_event_deliver(switch_event **event);
|
||||
|
||||
/*!
|
||||
\brief Fire an event filling in most of the arguements with obvious values
|
||||
\param event the event to send (will be nulled on success)
|
||||
|
||||
@@ -47,6 +47,22 @@ extern "C" {
|
||||
#define SWITCH_TRUE 1
|
||||
#define SWITCH_FALSE 0
|
||||
|
||||
|
||||
/*!
|
||||
\enum switch_priority_t
|
||||
\brief Priority Indication
|
||||
<pre>
|
||||
SWITCH_PRIORITY_NORMAL - Normal Priority
|
||||
SWITCH_PRIORITY_LOW - Low Priority
|
||||
SWITCH_PRIORITY_HIGH - High Priority
|
||||
</pre>
|
||||
*/
|
||||
typedef enum {
|
||||
SWITCH_PRIORITY_NORMAL,
|
||||
SWITCH_PRIORITY_LOW,
|
||||
SWITCH_PRIORITY_HIGH,
|
||||
} switch_priority_t;
|
||||
|
||||
/*!
|
||||
\enum switch_ivr_option_t
|
||||
\brief Possible options related to ivr functions
|
||||
|
||||
@@ -65,7 +65,12 @@ extern "C" {
|
||||
!strcasecmp(expr, "true") ||\
|
||||
atoi(expr))) ? SWITCH_TRUE : SWITCH_FALSE
|
||||
|
||||
|
||||
/*!
|
||||
\brief Return a printable name of a switch_priority_t
|
||||
\param priority the priority to get the name of
|
||||
\return the printable form of the priority
|
||||
*/
|
||||
SWITCH_DECLARE(char *) switch_priority_name(switch_priority_t priority);
|
||||
|
||||
/*!
|
||||
\brief Return the RFC2833 character based on an event id
|
||||
|
||||
Reference in New Issue
Block a user