mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-24 05:02:10 +00:00
add ability to read from a stream
do not use this unless you understand what you are doing and you want to take the risk, you are warnned
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#include <string>
|
||||
extern "C" {
|
||||
#endif
|
||||
#ifdef DOH
|
||||
@@ -149,7 +150,9 @@ SWITCH_DECLARE(bool) email(char *to, char *from, char *headers = NULL, char *bod
|
||||
SWITCH_DECLARE_CONSTRUCTOR Stream(void);
|
||||
SWITCH_DECLARE_CONSTRUCTOR Stream(switch_stream_handle_t *);
|
||||
virtual SWITCH_DECLARE_CONSTRUCTOR ~ Stream();
|
||||
SWITCH_DECLARE(std::string) read();
|
||||
SWITCH_DECLARE(void) write(const char *data);
|
||||
SWITCH_DECLARE(void) raw_write(std::string data);
|
||||
SWITCH_DECLARE(const char *) get_data(void);
|
||||
};
|
||||
|
||||
|
||||
@@ -91,6 +91,7 @@ struct switch_state_handler_table {
|
||||
};
|
||||
|
||||
struct switch_stream_handle {
|
||||
switch_stream_handle_read_function_t read_function;
|
||||
switch_stream_handle_write_function_t write_function;
|
||||
switch_stream_handle_raw_write_function_t raw_write_function;
|
||||
void *data;
|
||||
|
||||
@@ -2152,6 +2152,7 @@ typedef void (*switch_scheduler_func_t) (switch_scheduler_task_t *task);
|
||||
|
||||
typedef switch_status_t (*switch_state_handler_t) (switch_core_session_t *);
|
||||
typedef struct switch_stream_handle switch_stream_handle_t;
|
||||
typedef uint8_t * (*switch_stream_handle_read_function_t) (switch_stream_handle_t *handle, int *len);
|
||||
typedef switch_status_t (*switch_stream_handle_write_function_t) (switch_stream_handle_t *handle, const char *fmt, ...);
|
||||
typedef switch_status_t (*switch_stream_handle_raw_write_function_t) (switch_stream_handle_t *handle, uint8_t *data, switch_size_t datalen);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user