mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-08 20:43:51 +00:00
inter session communication goodies
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@309 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
1 parent
73b4b25b15
commit
061c1ecb1b
6 files changed
+140
-10
No files matched your search
@@ -47,6 +47,37 @@ extern "C" {
|
||||
#define SWITCH_MAX_CORE_THREAD_SESSION_OBJS 128
|
||||
#define SWITCH_MAX_STREAMS 128
|
||||
|
||||
/*! \brief A message object designed to allow unlike technologies to exchange data */
|
||||
struct switch_core_session_message {
|
||||
/*! uuid of the sender (for replies)*/
|
||||
char *from;
|
||||
/*! enumeration of the type of message */
|
||||
switch_core_session_message_t message_id;
|
||||
|
||||
/*! optional numeric arg*/
|
||||
int numeric_arg;
|
||||
/*! optional string arg*/
|
||||
char *string_arg;
|
||||
/*! optional string arg*/
|
||||
size_t string_arg_size;
|
||||
/*! optional arbitrary pointer arg */
|
||||
void *pointer_arg;
|
||||
/*! optional arbitrary pointer arg's size */
|
||||
size_t pointer_arg_size;
|
||||
|
||||
/*! optional numeric reply*/
|
||||
int numeric_reply;
|
||||
/*! optional string reply*/
|
||||
char *string_reply;
|
||||
/*! optional string reply*/
|
||||
size_t string_reply_size;
|
||||
/*! optional arbitrary pointer reply */
|
||||
void *pointer_reply;
|
||||
/*! optional arbitrary pointer reply's size */
|
||||
size_t pointer_reply_size;
|
||||
|
||||
};
|
||||
|
||||
/*! \brief A generic object to pass as a thread's session object to allow mutiple arguements and a pool */
|
||||
struct switch_core_thread_session {
|
||||
/*! status of the thread */
|
||||
@@ -213,6 +244,14 @@ SWITCH_DECLARE(void) switch_core_session_signal_state_change(switch_core_session
|
||||
*/
|
||||
SWITCH_DECLARE(char *) switch_core_session_get_uuid(switch_core_session *session);
|
||||
|
||||
/*!
|
||||
\brief Send a message to another session using it's uuid
|
||||
\param uuid_str the unique id of the session you want to send a message to
|
||||
\param message the switch_core_session_message object to send
|
||||
\return the status returned by the message handler
|
||||
*/
|
||||
SWITCH_DECLARE (switch_status) switch_core_session_message_send(char *uuid_str, switch_core_session_message *message);
|
||||
|
||||
/*!
|
||||
\brief Retrieve private user data from a session
|
||||
\param session the session to retrieve from
|
||||
@@ -293,6 +332,13 @@ SWITCH_DECLARE(switch_status) switch_core_session_outgoing_channel(switch_core_s
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status) switch_core_session_answer_channel(switch_core_session *session);
|
||||
|
||||
/*!
|
||||
\brief Receive a message on a given session
|
||||
\param session the session to receive the message from
|
||||
\return the status returned by the message handler
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status) switch_core_session_receive_message(switch_core_session *session, switch_core_session_message *message);
|
||||
|
||||
/*!
|
||||
\brief Read a frame from a session
|
||||
\param session the session to read from
|
||||
|
||||
Reference in new issue
Block a user