This source file includes following definitions.
- sctp_no_nagle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39 #include <ctype.h>
40 #include <string.h>
41 #include <unistd.h>
42 #include <stdlib.h>
43 #include <errno.h>
44 #include <stdarg.h>
45 #include <stdio.h>
46 #include <sys/types.h>
47 #include <sys/socket.h>
48 #include <netinet/in.h>
49
50
51 #include <sctp.h>
52
53 #include <arpa/inet.h>
54 #include <stdarg.h>
55 #include <netdb.h>
56
57 #include <sys/time.h>
58
59 #define MAX_DIALED_DIGITS 31
60 #define MAX_CALLING_NAME 31
61
62
63
64
65 #define CORE_MAX_SPANS 200
66 #define CORE_MAX_CHAN_PER_SPAN 30
67 #define MAX_PENDING_CALLS CORE_MAX_SPANS * CORE_MAX_CHAN_PER_SPAN
68
69 #define SIZE_RDNIS 80
70
71
72 #define MSGWINDOW
73
74
75 typedef struct
76 {
77 uint32_t event_id;
78 uint32_t fseqno;
79 #ifdef MSGWINDOW
80 uint32_t bseqno;
81 #endif
82 uint16_t call_setup_id;
83 uint32_t trunk_group;
84 uint32_t span;
85 uint32_t chan;
86 uint8_t called_number_digits_count;
87 char called_number_digits [MAX_DIALED_DIGITS + 1];
88 uint8_t calling_number_digits_count;
89 char calling_number_digits [MAX_DIALED_DIGITS + 1];
90 uint8_t release_cause;
91 struct timeval tv;
92
93 uint8_t calling_number_screening_ind;
94 uint8_t calling_number_presentation;
95 char redirection_string [SIZE_RDNIS];
96
97 } t_m3ua;
98
99 typedef t_m3ua m3uac_event_t;
100 typedef uint32_t m3uac_event_id_t;
101
102
103 typedef struct m3uac_ip_cfg
104 {
105 char local_ip[25];
106 int local_port;
107 char remote_ip[25];
108 int remote_port;
109 }m3uac_ip_cfg_t;
110
111 struct m3uac_connection {
112 ftdm_socket_t socket;
113 struct sockaddr_in local_addr;
114 struct sockaddr_in remote_addr;
115 m3uac_event_t event;
116 struct hostent remote_hp;
117 struct hostent local_hp;
118 unsigned int flags;
119 ftdm_mutex_t *mutex;
120 FILE *log;
121 unsigned int txseq;
122 unsigned int rxseq;
123 unsigned int txwindow;
124 unsigned int rxseq_reset;
125 m3uac_ip_cfg_t cfg;
126 uint32_t hb_elapsed;
127 int up;
128 };
129
130 typedef enum {
131 MSU_FLAG_EVENT = (1 << 0)
132 } m3uac_flag_t;
133
134 typedef struct m3uac_connection m3uac_connection_t;
135
136 static inline void sctp_no_nagle(int socket)
137 {
138
139
140 }
141
142 int m3uac_connection_close(m3uac_connection_t *mcon);
143 int m3uac_connection_open(m3uac_connection_t *mcon, char *local_ip, int local_port, char *ip, int port);
144 m3uac_event_t *m3uac_connection_read(m3uac_connection_t *mcon, int iteration);
145 m3uac_event_t *m3uac_connection_readp(m3uac_connection_t *mcon, int iteration);
146 int m3uac_connection_write(m3uac_connection_t *mcon, m3uac_event_t *event);
147 void m3uac_event_init(m3uac_event_t *event, m3uac_event_id_t event_id, int chan, int span);
148 void m3uac_call_init(m3uac_event_t *event, const char *calling, const char *called, int setup_id);
149 const char *m3uac_event_id_name(uint32_t event_id);
150 int m3uac_exec_command(m3uac_connection_t *mcon, int span, int chan, int id, int cmd, int cause);
151
152
153
154
155
156
157
158
159
160
161
162
163
164