view mgw/struct.h @ 96:f24bbfd23c9d

mgw p2g: outgoing seq numbers, forwarding control
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 25 Sep 2022 19:32:27 -0800
parents f280328e7e2e
children 9aed16c30622
line wrap: on
line source

/*
 * This header file defines internal data structures for themwi-mgw.
 */

struct bind_range_cfg {
	struct in_addr	bind_ip;
	unsigned	port_range_start;
	unsigned	port_range_end;
	unsigned	port_next;
	unsigned	port_tries;
};

struct rtp_one_end {
	int	rtp_fd;
	int	rtcp_fd;
	struct sockaddr_in bound_addr;
	struct sockaddr_in remote_addr;
};

struct endpoint {
	unsigned	ep_type;
	struct rtp_one_end rtp_gsm;
	struct rtp_one_end rtp_pstn;
	unsigned	gsm_payload_type;
	unsigned	gsm_payload_msg_type;
	unsigned	pstn_payload_type;
	unsigned	fwd_mode;
	/* gateway functionality */
	void		*gsm_encoder_state;
	void		*gsm_decoder_state;
	int		p2g_state;
	uint32_t	p2g_ssrc;
	uint32_t	p2g_last_ts;
	uint16_t	p2g_last_seq;
	uint16_t	p2g_out_seq;
	int		p2g_err_flags;
	/* linked list management */
	unsigned	ep_id;
	struct endpoint	*next;
};

struct ctrl_conn {
	struct endpoint	*endp_list;
	unsigned	next_ep_id;
};