37 #define MSRP_BUFF_SIZE (SWITCH_RTP_MAX_BUF_LEN - 32) 91 memcpy(msrp_msg->
payload, buf, payload_bytes);
92 *(msrp_msg->
payload + payload_bytes) =
'\0';
99 return (msrp_h_success_report && !strcmp(msrp_h_success_report,
"yes"));
110 SSL_CTX_free(
globals.ssl_client_ctx);
117 const char *err =
"";
119 globals.ssl_client_method = SSLv23_client_method();
121 assert(
globals.ssl_client_ctx);
122 SSL_CTX_set_options(
globals.ssl_client_ctx, SSL_OP_NO_SSLv2);
124 globals.ssl_method = SSLv23_server_method();
130 SSL_CTX_set_options(
globals.ssl_ctx, SSL_OP_NO_SSLv2);
132 SSL_CTX_set_options(
globals.ssl_ctx, SSL_OP_NO_SSLv3);
134 SSL_CTX_set_options(
globals.ssl_ctx, SSL_OP_NO_TLSv1);
136 SSL_CTX_set_options(
globals.ssl_ctx, SSL_OP_NO_COMPRESSION);
152 err =
"SUPPLIED CERT FILE NOT FOUND\n";
156 if (!SSL_CTX_use_certificate_file(
globals.ssl_ctx,
globals.cert, SSL_FILETYPE_PEM)) {
157 err =
"CERT FILE ERROR";
164 err =
"SUPPLIED KEY FILE NOT FOUND\n";
168 if (!SSL_CTX_use_PrivateKey_file(
globals.ssl_ctx,
globals.key, SSL_FILETYPE_PEM)) {
169 err =
"PRIVATE KEY FILE ERROR";
174 if ( !SSL_CTX_check_private_key(
globals.ssl_ctx) ) {
175 err =
"PRIVATE KEY FILE ERROR";
179 SSL_CTX_set_cipher_list(
globals.ssl_ctx,
"HIGH:!DSS:!aNULL@STRENGTH");
192 char *cf =
"msrp.conf";
213 if (!strcasecmp(var,
"listen-ip")) {
215 }
else if (!strcasecmp(var,
"listen-port")) {
216 globals.msock.port = atoi(val);
217 }
else if (!strcasecmp(var,
"listen-ssl-port")) {
218 globals.msock_ssl.port = atoi(val);
219 }
else if (!strcasecmp(var,
"debug")) {
221 }
else if (!strcasecmp(var,
"secure-cert")) {
223 }
else if (!strcasecmp(var,
"secure-key")) {
225 }
else if (!strcasecmp(var,
"message-buffer-size") && val) {
226 globals.message_buffer_size = atoi(val);
227 if (
globals.message_buffer_size == 0)
globals.message_buffer_size = 50;
262 if (rv)
goto sock_fail;
265 if (rv)
goto sock_fail;
271 if (rv)
goto sock_fail;
276 if (rv)
goto sock_fail;
279 if (rv)
goto sock_fail;
307 set_global_ip(
"0.0.0.0");
312 globals.message_buffer_size = 50;
369 globals.msock_ssl.thread = NULL;
400 if ((*ms)->csock && (*ms)->csock->sock) {
408 while(sanity-- > 0 && (*ms)->running) {
413 if ((*ms)->send_queue) {
483 switch(msrp_msg->
method) {
488 default: sprintf(method,
"??%d", msrp_msg->
method);
break;
492 "MSRP %s %s%s\r\nFrom: %s\r\nTo: %s\r\nMessage-ID: %s\r\n" 496 "=================================\n",
506 content_type ?
"Content-Type: " :
"",
507 content_type ? content_type :
"",
508 content_type ?
"\r\n" :
"",
509 msrp_msg->
payload ?
"\r\n" :
"",
511 msrp_msg->
payload ?
"\r\n" :
"",
525 r = SSL_read(csock->
ssl, buf, *len);
527 int error = SSL_get_error(csock->
ssl, r);
528 if (!(SSL_ERROR_SYSCALL == error && errno == 9)) {
541 char err[1024] = { 0 };
554 *len = SSL_write(csock->
ssl, buf, *len);
566 for(i=0,j=0; i<len; i++) {
567 if (buf[i] ==
'\0') {
570 }
else if(buf[i] ==
'\r') {
573 }
else if(buf[i] ==
'\n') {
582 if ((++k) %80 == 0) buff[j++] =
'\n';
588 "%d: %s [%" SWITCH_SIZE_T_FMT "] bytes [\n%s]\n", line, is_send?
"SEND" :
"RECV", len, buff);
593 char *p, *q, *s = NULL;
599 if (p == NULL)
return NULL;
600 if (q == NULL)
return NULL;
602 end = buf + len - strlen(delim);
604 while(p < end && *q) {
606 if (s == NULL) s = p;
614 if (*q ==
'\0')
return s;
632 "MSRP_H_CONTENT_TYPE",
633 "MSRP_H_SUCCESS_REPORT",
634 "MSRP_H_FAILURE_REPORT",
638 "MSRP_H_TRASACTION_ID",
640 "MSRP_H_CODE_DESCRIPTION",
692 char *p = start + skip;
694 if (*p && *p ==
' ') p++;
696 while(*q !=
'\n' && q < end) q++;
698 if (*(q-1) ==
'\r') *(q-1) =
'\0';
710 const char *end = start + len;
713 if (!strncasecmp(p,
"MSRP ", 5)) {
717 while(*q && q < end && *q !=
' ') q++;
728 if (++p >= end)
goto done;
730 if (!strncasecmp(p,
"SEND", 4)) {
733 }
else if (!strncasecmp(p,
"REPORT", 6)) {
736 }
else if (!strncasecmp(p,
"AUTH", 4)) {
742 while(*q && q < end && *q !=
' ') q++;
747 while(*q && q < end && *q !=
'\n') q++;
749 if (*(q-1) ==
'\r') *(q-1) =
'\0';
756 }
else if (!strncasecmp(p,
"From-Path:", 10)) {
760 }
else if (!strncasecmp(p,
"To-Path:", 8)) {
764 }
else if (!strncasecmp(p,
"Status:", 7)) {
768 }
else if (!strncasecmp(p,
"Keep-Alive:", 11)) {
772 }
else if (!strncasecmp(p,
"Message-ID:", 11)) {
776 }
else if (!strncasecmp(p,
"Content-Type:", 13)) {
780 }
else if (!strncasecmp(p,
"Success-Report:", 15)) {
784 }
else if (!strncasecmp(p,
"Failure-Report:", 15)) {
788 }
else if (!strncasecmp(p,
"Byte-Range:", 11)) {
790 if (*p && *p ==
' ') p++;
792 while(*q && q < end && *q !=
'-') q++;
798 if (*p && *p ==
'*') {
801 while(*q && q < end && *q !=
'/') q++;
806 while(*q && q < end && *q !=
'\n') q++;
808 if (*(q-1) ==
'\r') *(q-1) =
'\0';
810 msrp_msg->
bytes = atoi(p);
829 }
else if (*p ==
'\r' && *(p+1) ==
'\n') {
835 char *x = p + strlen(msrp_msg->
delimiter);
843 }
else if(*x ==
'+') {
857 while(*q && q < end && *q !=
':') q++;
915 char *delim_pos = NULL;
921 if (!strncmp(buf + len - dlen - 3, msrp_msg->
delimiter, dlen)) {
922 payload_bytes = len - dlen - 5;
926 msrp_msg->
last_p = buf + len;
936 payload_bytes = delim_pos - buf - 2;
940 msrp_msg->
last_p = delim_pos + dlen + 3;
952 if (strncasecmp(buf, msrp_msg->
delimiter, dlen)) {
960 msrp_msg->
last_p = buf + dlen + 3;
1001 sprintf(buf,
"MSRP %s 200 OK\r\nTo-Path: %s\r\nFrom-Path: %s\r\n" 1016 sprintf(buf,
"MSRP %s REPORT\r\nTo-Path: %s\r\nFrom-Path: %s\r\nMessage-ID: %s\r\n" 1036 int len = strlen(to_path);
1038 int slash_count = 0;
1040 for(i=0; i<len; i++){
1041 if (*(to_path + i) ==
'/') {
1042 if (++slash_count == 3)
break;
1062 char uuid[128] = { 0 };
1071 const char *remote_ip = NULL;
1102 remote_port = atoi(p);
1106 if (!remote_ip || remote_port <= 0) {
1131 char errbuf[512] = {0};
1138 if (msrp_session->
secure) {
1148 ssl = SSL_new(
globals.ssl_client_ctx);
1151 SSL_set_fd(ssl, sockdes);
1153 if ((ret = SSL_connect(ssl)) != 1 ) {
1160 cert = SSL_get_peer_certificate(ssl);
1167 certname = X509_NAME_new();
1168 certname = X509_get_subject_name(cert);
1170 X509_NAME_print_ex(outbio, certname, 0, 0);
1171 BIO_printf(outbio,
"\n");
1192 int secure_established = 0;
1206 ssl = SSL_new(
globals.ssl_ctx);
1210 SSL_set_fd(ssl, sockdes);
1213 code = SSL_accept(ssl);
1216 secure_established = 1;
1218 }
else if (code == 0) {
1220 }
else if (code < 0) {
1221 if (code == -1 && SSL_get_error(ssl, code) != SSL_ERROR_WANT_READ) {
1238 if (helper->
debug) {
1249 if (helper->
debug) {
1289 msrp_session->
csock = csock;
1321 if (helper->
debug) {
1332 last_p = msrp_msg->
last_p;
1336 last_p = msrp_msg->
last_p;
1339 last_p = msrp_msg->
last_p;
1347 if (p + len > last_p) {
1352 int rest_len = p - last_p;
1354 memmove(buf, last_p, rest_len);
1359 if (rest_len > 10) {
1403 if (!msrp_session->
running)
break;
1416 if (ssl) SSL_free(ssl);
1418 if (msrp_session) msrp_session->
running = 0;
1448 char remote_ip[128];
1469 helper->
pool = worker_pool;
1518 #define MSRP_TRANS_ID_LEN 16 1527 const char *to_path = msrp_h_to_path ? msrp_h_to_path : ms->
remote_path;
1528 const char *from_path = msrp_h_from_path ? msrp_h_from_path: ms->
local_path;
1541 if (
zstr(content_type)) {
1542 content_type =
"text/plain";
1548 sprintf(buf,
"MSRP %s SEND\r\nTo-Path: %s\r\nFrom-Path: %s\r\n" 1549 "Message-ID: %s\r\n" 1558 msrp_msg->
payload ?
"Content-Type: " :
"",
1559 msrp_msg->
payload ? content_type :
"",
1560 msrp_msg->
payload ?
"\r\n\r\n" :
"");
1571 sprintf(buf + len,
"\r\n");
1575 sprintf(buf + len,
"-------%s$\r\n", transaction_id);
1576 len += (10 + strlen(transaction_id));
1691 if (
zstr(filename)) {
1769 while(sanity-- && !msrp_session->
running) {
1807 char *mycmd = NULL, *argv[3] = { 0 };
1813 if (
zstr(cmd) || !(mycmd = strdup(cmd))) {
1819 if (argc < 2 || !argv[0]) {
1824 stream->write_function(stream,
"-ERR Usage: cannot locate session.\n");
1829 stream->write_function(stream,
"-ERR No msrp_session.\n");
1839 stream->write_function(stream,
"+OK message sent\n");
1844 stream->write_function(stream,
"-ERR Usage: uuid_msrp_send <uuid> msg\n");
1848 #define MSRP_SYNTAX "debug <on|off>|restart" 1852 stream->write_function(stream,
"-ERR usage: " MSRP_SYNTAX "\n");
1856 if (!strcmp(cmd,
"debug on")) {
1858 stream->write_function(stream,
"+OK debug on\n");
1859 }
else if(!strcmp(cmd,
"debug off")) {
1861 stream->write_function(stream,
"+OK debug off\n");
1862 }
else if(!strcmp(cmd,
"restart")) {
1877 SWITCH_ADD_API(api_interface,
"uuid_msrp_send",
"send msrp text", uuid_msrp_send_function,
"<msg>");
switch_status_t switch_socket_connect(switch_socket_t *sock, switch_sockaddr_t *sa)
switch_status_t switch_console_set_complete(const char *string)
void switch_xml_free(_In_opt_ switch_xml_t xml)
frees the memory allocated for an switch_xml structure
#define switch_channel_answer(channel)
Answer a channel (initiate/acknowledge a successful connection)
switch_msrp_msg_t * msrp_msg
#define switch_core_new_memory_pool(p)
Create a new sub memory pool from the core's master pool.
A module interface to implement an application.
const char * switch_xml_attr_soft(_In_ switch_xml_t xml, _In_z_ const char *attr)
returns the value of the requested tag attribute, or "" if not found
char * switch_core_session_sprintf(_In_ switch_core_session_t *session, _In_z_ _Printf_format_string_ const char *fmt,...)
printf-style style printing routine. The data is output to a string allocated from the session ...
static switch_bool_t switch_true(const char *expr)
Evaluate the truthfullness of a string expression.
#define SWITCH_CHANNEL_SESSION_LOG(x)
uint16_t switch_sockaddr_get_port(switch_sockaddr_t *sa)
SWITCH_STANDARD_APP(msrp_recv_file_function)
#define SWITCH_FOPEN_TRUNCATE
switch_status_t switch_file_write(switch_file_t *thefile, const void *buf, switch_size_t *nbytes)
switch_status_t switch_mutex_destroy(switch_mutex_t *lock)
#define SWITCH_CHANNEL_LOG
#define switch_malloc(ptr, len)
#define SWITCH_SO_IPV6_V6ONLY
static switch_status_t msrp_socket_send(switch_msrp_client_socket_t *csock, char *buf, switch_size_t *len)
switch_status_t msrp_report(switch_msrp_client_socket_t *csock, switch_msrp_msg_t *msrp_msg, char *status_code)
switch_msrp_msg_t * last_msg
switch_status_t switch_socket_bind(switch_socket_t *sock, switch_sockaddr_t *sa)
static switch_status_t load_config(void)
const char * code_description
#define SWITCH_FOPEN_READ
switch_msrp_socket_t msock_ssl
switch_size_t msrp_msg_buffer_size
static char * msrp_parse_header(char *start, int skip, const char *end, switch_msrp_msg_t *msrp_msg, switch_msrp_header_type_t htype, switch_memory_pool_t *pool)
#define switch_core_strdup(_pool, _todup)
Copy a string using memory allocation from a given pool.
#define SWITCH_ADD_APP(app_int, int_name, short_descript, long_descript, funcptr, syntax_string, app_flags)
switch_status_t switch_threadattr_stacksize_set(switch_threadattr_t *attr, switch_size_t stacksize)
switch_status_t switch_socket_timeout_set(switch_socket_t *sock, switch_interval_time_t t)
#define switch_core_destroy_memory_pool(p)
Returns a subpool back to the main pool.
static void *SWITCH_THREAD_FUNC msrp_listener(switch_thread_t *thread, void *obj)
static switch_bool_t msrp_check_success_report(switch_msrp_msg_t *msrp_msg)
char * find_delim(char *buf, int len, const char *delim)
void switch_msrp_msg_destroy(switch_msrp_msg_t **msg)
#define switch_channel_ready(_channel)
switch_status_t switch_msrp_start_client(switch_msrp_session_t *msrp_session)
#define SWITCH_SO_TCP_KEEPIDLE
switch_status_t switch_queue_trypop(switch_queue_t *queue, void **data)
int32_t switch_sockaddr_get_family(switch_sockaddr_t *sa)
static void close_socket(switch_socket_t **sock)
#define SWITCH_FPROT_OS_DEFAULT
const char * switch_msrp_msg_get_header(switch_msrp_msg_t *msrp_msg, switch_msrp_header_type_t htype)
char * switch_msrp_msg_header_name(switch_msrp_header_type_t htype)
A representation of an XML tree.
switch_status_t switch_socket_recv(switch_socket_t *sock, char *buf, switch_size_t *len)
static void *SWITCH_THREAD_FUNC msrp_worker(switch_thread_t *thread, void *obj)
#define SWITCH_SO_KEEPALIVE
switch_status_t switch_event_dup(switch_event_t **event, switch_event_t *todup)
Duplicate an event.
switch_msrp_session_t * msrp_session
int switch_snprintf(_Out_z_cap_(len) char *buf, _In_ switch_size_t len, _In_z_ _Printf_format_string_ const char *format,...)
#define SWITCH_SOCK_INVALID
switch_msrp_socket_t msock
static switch_bool_t msrp_find_uuid(char *uuid, const char *to_path)
switch_size_t payload_bytes
switch_status_t switch_socket_addr_get(switch_sockaddr_t **sa, switch_bool_t remote, switch_socket_t *sock)
switch_status_t switch_socket_send(switch_socket_t *sock, const char *buf, switch_size_t *len)
switch_status_t switch_mutex_unlock(switch_mutex_t *lock)
switch_msrp_header_type_t
_Ret_ switch_channel_t * switch_core_session_get_channel(_In_ switch_core_session_t *session)
Retrieve a pointer to the channel object associated with a given session.
#define SWITCH_MUTEX_NESTED
#define SWITCH_PATH_SEPARATOR
switch_status_t switch_socket_accept(switch_socket_t **new_sock, switch_socket_t *sock, switch_memory_pool_t *pool)
switch_status_t switch_threadattr_detach_set(switch_threadattr_t *attr, int32_t on)
#define MSRP_TRANS_ID_LEN
switch_byte_t switch_byte_t * buf
#define switch_yield(ms)
Wait a desired number of microseconds and yield the CPU.
static switch_msrp_msg_t * msrp_parse_headers(char *start, int len, switch_msrp_msg_t *msrp_msg, switch_memory_pool_t *pool)
unsigned int switch_separate_string(_In_ char *buf, char delim, _Post_count_(return) char **array, unsigned int arraylen)
Separate a string into an array based on a character delimiter.
A module interface to implement an api function.
void switch_stun_random_string(char *buf, uint16_t len, char *set)
Writes random characters into a buffer.
switch_msrp_session_t * switch_msrp_session_new(switch_memory_pool_t *pool, const char *call_id, switch_bool_t secure)
switch_status_t switch_mutex_lock(switch_mutex_t *lock)
#define switch_core_alloc(_pool, _mem)
Allocate memory directly from a memory pool.
static switch_status_t switch_msrp_do_send(switch_msrp_session_t *ms, switch_msrp_msg_t *msrp_msg, const char *file, const char *func, int line)
#define switch_channel_get_variable(_c, _v)
#define SWITCH_THREAD_STACKSIZE
switch_status_t switch_event_add_header_string(switch_event_t *event, switch_stack_t stack, const char *header_name, const char *data)
Add a string header to an event.
const char * transaction_id
const char * switch_msrp_listen_ip(void)
void dump_buffer(const char *buf, switch_size_t len, int line, int is_send)
#define switch_safe_free(it)
Free a pointer and set it to NULL unless it already is NULL.
switch_status_t switch_socket_listen(switch_socket_t *sock, int32_t backlog)
struct switch_msrp_session_s * msrp_session
switch_status_t switch_mutex_init(switch_mutex_t **lock, unsigned int flags, switch_memory_pool_t *pool)
switch_status_t switch_socket_opt_set(switch_socket_t *sock, int32_t opt, int32_t on)
switch_status_t switch_thread_join(switch_status_t *retval, switch_thread_t *thd)
switch_status_t switch_msrp_msg_add_header(switch_msrp_msg_t *msrp_msg, switch_msrp_header_type_t htype, char *fmt,...)
static switch_status_t msock_init(char *ip, switch_port_t port, switch_socket_t **sock, switch_memory_pool_t *pool)
switch_memory_pool_t * pool
static void msrp_deinit_ssl(void)
int switch_vasprintf(_Out_opt_ char **buf, _In_z_ _Printf_format_string_ const char *format, _In_ va_list ap)
struct worker_helper worker_helper_t
switch_status_t switch_file_read(switch_file_t *thefile, void *buf, switch_size_t *nbytes)
switch_status_t switch_msrp_perform_send(switch_msrp_session_t *ms, switch_msrp_msg_t *msrp_msg, const char *file, const char *func, int line)
void switch_core_session_rwunlock(_In_ switch_core_session_t *session)
Unlock a read or write lock on as given session.
switch_directories SWITCH_GLOBAL_dirs
switch_status_t switch_msrp_session_destroy(switch_msrp_session_t **ms)
char * switch_strerror(switch_status_t statcode, char *buf, switch_size_t bufsize)
struct fspr_sockaddr_t switch_sockaddr_t
#define switch_str_nil(s)
Make a null string a blank string instead.
switch_status_t switch_os_sock_get(switch_os_socket_t *thesock, switch_socket_t *sock)
switch_status_t switch_file_exists(const char *filename, switch_memory_pool_t *pool)
switch_status_t switch_socket_create(switch_socket_t **new_sock, int family, int type, int protocol, switch_memory_pool_t *pool)
switch_memory_pool_t * pool
switch_memory_pool_t * pool
switch_status_t
Common return values.
static switch_msrp_msg_t * msrp_parse_buffer(char *buf, int len, switch_msrp_msg_t *msrp_msg, switch_memory_pool_t *pool)
char * switch_uuid_str(char *buf, switch_size_t len)
#define SWITCH_SO_TCP_KEEPINTVL
void switch_msrp_msg_set_payload(switch_msrp_msg_t *msrp_msg, const char *buf, switch_size_t payload_bytes)
switch_xml_t switch_xml_open_cfg(_In_z_ const char *file_path, _Out_ switch_xml_t *node, _In_opt_ switch_event_t *params)
open a config in the core registry
switch_msrp_msg_t * switch_msrp_session_pop_msg(switch_msrp_session_t *ms)
switch_status_t switch_socket_close(switch_socket_t *sock)
switch_size_t msrp_msg_count
switch_status_t switch_socket_shutdown(switch_socket_t *sock, switch_shutdown_how_e how)
#define switch_core_session_locate(uuid_str)
Locate a session based on it's uuid.
switch_msrp_client_socket_t csock
#define switch_event_create(event, id)
Create a new event assuming it will not be custom event and therefore hiding the unused parameters...
#define switch_event_get_header(_e, _h)
struct fspr_file_t switch_file_t
switch_status_t msrp_reply(switch_msrp_client_socket_t *csock, switch_msrp_msg_t *msrp_msg)
#define switch_channel_set_flag(_c, _f)
switch_xml_t switch_xml_child(_In_ switch_xml_t xml, _In_z_ const char *name)
returns the first child tag (one level deeper) with the given name or NULL \ if not found ...
const SSL_METHOD * ssl_method
switch_status_t switch_msrp_init(void)
SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_ip, globals.ip)
#define SWITCH_ADD_API(api_int, int_name, descript, funcptr, syntax_string)
switch_status_t switch_queue_trypush(switch_queue_t *queue, void *data)
#define SWITCH_SO_REUSEADDR
void switch_msrp_load_apis_and_applications(switch_loadable_module_interface_t **module_interface)
void random_string(char *buf, uint16_t size)
switch_msrp_msg_t * switch_msrp_msg_create(void)
switch_status_t switch_queue_term(switch_queue_t *queue)
void switch_log_printf(_In_ switch_text_channel_t channel, _In_z_ const char *file, _In_z_ const char *func, _In_ int line, _In_opt_z_ const char *userdata, _In_ switch_log_level_t level, _In_z_ _Printf_format_string_ const char *fmt,...) PRINTF_FUNCTION(7
Write log data to the logging engine.
const char * switch_stristr(const char *instr, const char *str)
#define SWITCH_SO_TCP_NODELAY
char * msrp_msg_serialize(switch_msrp_msg_t *msrp_msg)
switch_status_t switch_threadattr_create(switch_threadattr_t **new_attr, switch_memory_pool_t *pool)
switch_status_t switch_thread_create(switch_thread_t **new_thread, switch_threadattr_t *attr, switch_thread_start_t func, void *data, switch_memory_pool_t *cont)
switch_queue_t * send_queue
struct fspr_pool_t switch_memory_pool_t
switch_status_t switch_file_open(switch_file_t **newf, const char *fname, int32_t flag, switch_fileperms_t perm, switch_memory_pool_t *pool)
const char * switch_get_addr(char *buf, switch_size_t len, switch_sockaddr_t *in)
switch_status_t switch_queue_create(switch_queue_t **queue, unsigned int queue_capacity, switch_memory_pool_t *pool)
void switch_event_destroy(switch_event_t **event)
Destroy an event.
SWITCH_STANDARD_API(uuid_msrp_send_function)
static void msrp_init_ssl(void)
struct fspr_socket_t switch_socket_t
#define SWITCH_FOPEN_CREATE
int switch_core_gen_certs(const char *prefix)
void switch_channel_clear_flag(switch_channel_t *channel, switch_channel_flag_t flag)
Clear given flag(s) from a channel.
switch_status_t switch_file_close(switch_file_t *thefile)
char * switch_core_sprintf(_In_ switch_memory_pool_t *pool, _In_z_ _Printf_format_string_ const char *fmt,...)
printf-style style printing routine. The data is output to a string allocated from the pool ...
struct fspr_thread_t switch_thread_t
#define switch_msrp_send(ms, msg)
switch_status_t switch_sockaddr_info_get(switch_sockaddr_t **sa, const char *hostname, int32_t family, switch_port_t port, int32_t flags, switch_memory_pool_t *pool)
static switch_status_t msrp_socket_recv(switch_msrp_client_socket_t *csock, char *buf, switch_size_t *len)
#define SWITCH_FOPEN_WRITE
SWITCH_BEGIN_EXTERN_C char * switch_mprintf(const char *zFormat,...)
switch_msrp_client_socket_t * csock
switch_size_t accumulated_bytes
switch_memory_pool_t * switch_core_session_get_pool(_In_ switch_core_session_t *session)
Retrieve the memory pool from a session.
const SSL_METHOD * ssl_client_method
#define SWITCH_UUID_FORMATTED_LENGTH
The abstraction of a loadable module.
switch_msrp_msg_t * switch_msrp_msg_dup(switch_msrp_msg_t *msg)
switch_status_t switch_msrp_destroy(void)
switch_size_t switch_file_get_size(switch_file_t *thefile)
switch_status_t switch_msrp_session_push_msg(switch_msrp_session_t *ms, switch_msrp_msg_t *msg)