annotate mgw/struct.h @ 168:8c28426abef0

mgw: start using the new libgsmfrp dependency
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 19 Nov 2022 22:57:59 -0800
parents 529906fddcfa
children a6eb2de277f6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
32
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 * This header file defines internal data structures for themwi-mgw.
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 */
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 struct bind_range_cfg {
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 struct in_addr bind_ip;
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 unsigned port_range_start;
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 unsigned port_range_end;
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 unsigned port_next;
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 unsigned port_tries;
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 };
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 struct rtp_one_end {
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 int rtp_fd;
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 int rtcp_fd;
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 struct sockaddr_in bound_addr;
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 struct sockaddr_in remote_addr;
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 };
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 struct endpoint {
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21 unsigned ep_type;
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 struct rtp_one_end rtp_gsm;
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 struct rtp_one_end rtp_pstn;
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 unsigned gsm_payload_type;
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25 unsigned gsm_payload_msg_type;
100
1579ec0e9fb9 mgw internal code: set GSM side RTP packet size in one place
Mychaela Falconia <falcon@freecalypso.org>
parents: 97
diff changeset
26 unsigned gsm_rtp_pkt_size;
1579ec0e9fb9 mgw internal code: set GSM side RTP packet size in one place
Mychaela Falconia <falcon@freecalypso.org>
parents: 97
diff changeset
27 unsigned gsm_payload_magic;
32
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28 unsigned pstn_payload_type;
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 unsigned fwd_mode;
95
f280328e7e2e themwi-mgw: initial implementation of PSTN to GSM forwarding
Mychaela Falconia <falcon@freecalypso.org>
parents: 32
diff changeset
30 /* gateway functionality */
f280328e7e2e themwi-mgw: initial implementation of PSTN to GSM forwarding
Mychaela Falconia <falcon@freecalypso.org>
parents: 32
diff changeset
31 void *gsm_encoder_state;
f280328e7e2e themwi-mgw: initial implementation of PSTN to GSM forwarding
Mychaela Falconia <falcon@freecalypso.org>
parents: 32
diff changeset
32 void *gsm_decoder_state;
168
8c28426abef0 mgw: start using the new libgsmfrp dependency
Mychaela Falconia <falcon@freecalypso.org>
parents: 150
diff changeset
33 void *gsm_decoder_extra_state;
103
3b3f07b112f3 mgw: implement GSM to PSTN forwarding
Mychaela Falconia <falcon@freecalypso.org>
parents: 100
diff changeset
34 /* GSM to PSTN forwarding */
3b3f07b112f3 mgw: implement GSM to PSTN forwarding
Mychaela Falconia <falcon@freecalypso.org>
parents: 100
diff changeset
35 int g2p_state;
3b3f07b112f3 mgw: implement GSM to PSTN forwarding
Mychaela Falconia <falcon@freecalypso.org>
parents: 100
diff changeset
36 uint32_t g2p_ssrc;
3b3f07b112f3 mgw: implement GSM to PSTN forwarding
Mychaela Falconia <falcon@freecalypso.org>
parents: 100
diff changeset
37 uint32_t g2p_last_ts;
3b3f07b112f3 mgw: implement GSM to PSTN forwarding
Mychaela Falconia <falcon@freecalypso.org>
parents: 100
diff changeset
38 uint16_t g2p_last_seq;
3b3f07b112f3 mgw: implement GSM to PSTN forwarding
Mychaela Falconia <falcon@freecalypso.org>
parents: 100
diff changeset
39 uint16_t g2p_out_seq;
3b3f07b112f3 mgw: implement GSM to PSTN forwarding
Mychaela Falconia <falcon@freecalypso.org>
parents: 100
diff changeset
40 int g2p_drop_flag;
3b3f07b112f3 mgw: implement GSM to PSTN forwarding
Mychaela Falconia <falcon@freecalypso.org>
parents: 100
diff changeset
41 int g2p_err_flags;
127
f062c32a5116 mgw: implement DTMF
Mychaela Falconia <falcon@freecalypso.org>
parents: 103
diff changeset
42 struct timeval g2p_local_time;
f062c32a5116 mgw: implement DTMF
Mychaela Falconia <falcon@freecalypso.org>
parents: 103
diff changeset
43 /* DTMF generation toward PSTN */
f062c32a5116 mgw: implement DTMF
Mychaela Falconia <falcon@freecalypso.org>
parents: 103
diff changeset
44 unsigned dtmf_frames_sent;
f062c32a5116 mgw: implement DTMF
Mychaela Falconia <falcon@freecalypso.org>
parents: 103
diff changeset
45 uint32_t dtmf_last_ts;
150
529906fddcfa mgw DTMF timing fix in the corner case of no speech
Mychaela Falconia <falcon@freecalypso.org>
parents: 127
diff changeset
46 struct timeval dtmf_last_time;
127
f062c32a5116 mgw: implement DTMF
Mychaela Falconia <falcon@freecalypso.org>
parents: 103
diff changeset
47 int16_t *dtmf_sample_ptr;
f062c32a5116 mgw: implement DTMF
Mychaela Falconia <falcon@freecalypso.org>
parents: 103
diff changeset
48 int dtmf_m_bit;
f062c32a5116 mgw: implement DTMF
Mychaela Falconia <falcon@freecalypso.org>
parents: 103
diff changeset
49 int dtmf_stop_req;
f062c32a5116 mgw: implement DTMF
Mychaela Falconia <falcon@freecalypso.org>
parents: 103
diff changeset
50 int dtmf_aftermath;
103
3b3f07b112f3 mgw: implement GSM to PSTN forwarding
Mychaela Falconia <falcon@freecalypso.org>
parents: 100
diff changeset
51 /* PSTN to GSM forwarding */
95
f280328e7e2e themwi-mgw: initial implementation of PSTN to GSM forwarding
Mychaela Falconia <falcon@freecalypso.org>
parents: 32
diff changeset
52 int p2g_state;
f280328e7e2e themwi-mgw: initial implementation of PSTN to GSM forwarding
Mychaela Falconia <falcon@freecalypso.org>
parents: 32
diff changeset
53 uint32_t p2g_ssrc;
f280328e7e2e themwi-mgw: initial implementation of PSTN to GSM forwarding
Mychaela Falconia <falcon@freecalypso.org>
parents: 32
diff changeset
54 uint32_t p2g_last_ts;
f280328e7e2e themwi-mgw: initial implementation of PSTN to GSM forwarding
Mychaela Falconia <falcon@freecalypso.org>
parents: 32
diff changeset
55 uint16_t p2g_last_seq;
96
f24bbfd23c9d mgw p2g: outgoing seq numbers, forwarding control
Mychaela Falconia <falcon@freecalypso.org>
parents: 95
diff changeset
56 uint16_t p2g_out_seq;
97
9aed16c30622 mgw p2g: set M bit when restarting forwarding after no-forward
Mychaela Falconia <falcon@freecalypso.org>
parents: 96
diff changeset
57 int p2g_drop_flag;
95
f280328e7e2e themwi-mgw: initial implementation of PSTN to GSM forwarding
Mychaela Falconia <falcon@freecalypso.org>
parents: 32
diff changeset
58 int p2g_err_flags;
32
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
59 /* linked list management */
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
60 unsigned ep_id;
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
61 struct endpoint *next;
127
f062c32a5116 mgw: implement DTMF
Mychaela Falconia <falcon@freecalypso.org>
parents: 103
diff changeset
62 struct endpoint *dtmf_next;
f062c32a5116 mgw: implement DTMF
Mychaela Falconia <falcon@freecalypso.org>
parents: 103
diff changeset
63 struct endpoint **dtmf_pp;
32
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
64 };
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
65
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
66 struct ctrl_conn {
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
67 struct endpoint *endp_list;
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
68 unsigned next_ep_id;
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
69 };