RTS API Documentation  1.10.11
switch_msrp.h
Go to the documentation of this file.
1 /*
2  * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
3  * Copyright (C) 2011-2017, Seven Du <dujinfang@gmail.com>
4  *
5  * Version: MPL 1.1
6  *
7  * The contents of this file are subject to the Mozilla Public License Version
8  * 1.1 (the "License"); you may not use this file except in compliance with
9  * the License. You may obtain a copy of the License at
10  * http://www.mozilla.org/MPL/
11  *
12  * Software distributed under the License is distributed on an "AS IS" basis,
13  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
14  * for the specific language governing rights and limitations under the
15  * License.
16  *
17  * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
18  *
19  * The Initial Developer of the Original Code is
20  * Seven Du <dujinfang@gmail.com>
21  * Portions created by the Initial Developer are Copyright (C)
22  * the Initial Developer. All Rights Reserved.
23  *
24  * Contributor(s):
25  *
26  *
27  *
28  * msrp.h -- MSRP lib
29  *
30  */
31 
32 #ifndef _MSRP_H
33 #define _MSRP_H
34 
35 #include <switch.h>
36 
37 enum {
43 
48 };
49 
50 typedef enum {
59 
60  /* Fake headers */
64 
67 
71 
72 typedef struct msrp_msg_s {
73  int state;
74  int method;
76  const char *transaction_id;
77  const char *delimiter;
79  const char *code_description;
85  int range_star; /* range-end is '*' */
86  char *last_p;
87  char *payload;
88  struct msrp_msg_s *next;
90 
93  int secure;
94  int active;
95  char *remote_path;
98  char *remote_setup;
100  char *local_path;
103  char *local_setup;
106  char *call_id;
115  uint8_t frame_data[SWITCH_RTP_MAX_BUF_LEN];
116  int running;
117  void *user_data;
119 };
120 
125 // switch_status_t switch_msrp_session_push_msg(switch_msrp_session_t *ms, switch_msrp_msg_t *msg);
127 SWITCH_DECLARE(switch_status_t) switch_msrp_perform_send(switch_msrp_session_t *ms, switch_msrp_msg_t *msg, const char *file, const char *func, int line);
129 SWITCH_DECLARE(const char *) switch_msrp_listen_ip(void);
130 
133 
140 
141 #define switch_msrp_send(ms, msg) switch_msrp_perform_send(ms, msg, __FILE__, __SWITCH_FUNC__, __LINE__)
142 
143 #endif
144 
145 /* For Emacs:
146  * Local Variables:
147  * mode:c
148  * indent-tabs-mode:t
149  * tab-width:4
150  * c-basic-offset:4
151  * End:
152  * For VIM:
153  * vim:set softtabstop=4 shiftwidth=4 tabstop=4 noet:
154  */
switch_msrp_msg_t * msrp_msg
Definition: switch_msrp.h:107
switch_status_t switch_msrp_destroy(void)
Definition: switch_msrp.c:349
switch_status_t switch_msrp_session_destroy(switch_msrp_session_t **ms)
Definition: switch_msrp.c:392
void switch_msrp_load_apis_and_applications(switch_loadable_module_interface_t **moudle_interface)
Definition: switch_msrp.c:1870
const char * switch_msrp_listen_ip(void)
Definition: switch_msrp.c:289
switch_msrp_msg_t * last_msg
Definition: switch_msrp.h:108
switch_size_t byte_start
Definition: switch_msrp.h:80
void switch_msrp_msg_set_payload(switch_msrp_msg_t *msrp_msg, const char *buf, switch_size_t payload_bytes)
Definition: switch_msrp.c:82
const char * code_description
Definition: switch_msrp.h:79
void switch_msrp_msg_destroy(switch_msrp_msg_t **msg)
Definition: switch_msrp.c:1663
switch_size_t msrp_msg_buffer_size
Definition: switch_msrp.h:110
switch_bool_t
Definition: switch_types.h:437
switch_size_t byte_end
Definition: switch_msrp.h:81
char * switch_msrp_header_name(switch_msrp_header_type_t htype)
switch_memory_pool_t * pool
Representation of an event.
Definition: switch_event.h:80
const char * switch_msrp_msg_get_header(switch_msrp_msg_t *msrp_msg, switch_msrp_header_type_t htype)
Definition: switch_msrp.c:685
char * last_p
Definition: switch_msrp.h:86
switch_status_t switch_msrp_perform_send(switch_msrp_session_t *ms, switch_msrp_msg_t *msg, const char *file, const char *func, int line)
Definition: switch_msrp.c:1583
#define SWITCH_RTP_MAX_BUF_LEN
Definition: switch_rtp.h:45
struct msrp_msg_s * next
Definition: switch_msrp.h:88
switch_size_t bytes
Definition: switch_msrp.h:82
const char * delimiter
Definition: switch_msrp.h:77
switch_status_t switch_msrp_msg_add_header(switch_msrp_msg_t *msrp_msg, switch_msrp_header_type_t htype, char *fmt,...)
Definition: switch_msrp.c:651
switch_size_t payload_bytes
Definition: switch_msrp.h:83
int cJSON_bool fmt
Definition: switch_cJSON.h:150
switch_msrp_header_type_t
Definition: switch_msrp.h:50
switch_status_t switch_msrp_init(void)
Definition: switch_msrp.c:294
int range_star
Definition: switch_msrp.h:85
switch_msrp_msg_t * switch_msrp_msg_dup(switch_msrp_msg_t *msg)
Definition: switch_msrp.c:1637
switch_byte_t switch_byte_t * buf
switch_msrp_socket_t * msock
Definition: switch_msrp.h:112
switch_event_t * headers
Definition: switch_msrp.h:75
const char * transaction_id
Definition: switch_msrp.h:76
char * remote_accept_wrapped_types
Definition: switch_msrp.h:97
struct msrp_msg_s switch_msrp_msg_t
An abstraction of a data frame.
Definition: switch_frame.h:54
uintptr_t switch_size_t
struct fspr_thread_mutex_t switch_mutex_t
Definition: switch_apr.h:314
switch_msrp_msg_t * switch_msrp_msg_create(void)
Definition: switch_msrp.c:1625
switch_memory_pool_t * pool
Definition: switch_msrp.h:92
char * local_accept_wrapped_types
Definition: switch_msrp.h:102
switch_status_t
Common return values.
int code_number
Definition: switch_msrp.h:78
switch_mutex_t * mutex
Definition: switch_msrp.h:109
switch_size_t msrp_msg_count
Definition: switch_msrp.h:111
Main Library Header.
#define SWITCH_DECLARE(type)
switch_msrp_msg_t * switch_msrp_session_pop_msg(switch_msrp_session_t *ms)
Definition: switch_msrp.c:445
switch_frame_t frame
Definition: switch_msrp.h:114
switch_queue_t * send_queue
Definition: switch_msrp.h:118
switch_msrp_session_t * switch_msrp_session_new(switch_memory_pool_t *pool, const char *call_id, switch_bool_t secure)
Definition: switch_msrp.c:378
struct fspr_pool_t switch_memory_pool_t
char * payload
Definition: switch_msrp.h:87
switch_msrp_client_socket_t * csock
Definition: switch_msrp.h:113
switch_size_t accumulated_bytes
Definition: switch_msrp.h:84
The abstraction of a loadable module.
switch_status_t switch_msrp_start_client(switch_msrp_session_t *msrp_session)
Definition: switch_msrp.c:1488