changeset 198:cf1ba5d65188

mgw: start using project-global rtp_defs.h
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 29 Mar 2023 20:06:40 -0800
parents 73bbe7da45cd
children e6c7ced3c031
files include/rtp_defs.h mgw/gsm2pstn.c mgw/int_defs.h mgw/pstn2gsm.c
diffstat 4 files changed, 3 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/include/rtp_defs.h	Sun Mar 26 15:29:48 2023 -0800
+++ b/include/rtp_defs.h	Wed Mar 29 20:06:40 2023 -0800
@@ -3,10 +3,8 @@
  * functions in our GSM and PSTN environment.
  */
 
+#define	RTP_PACKET_HDR_SIZE	12
 #define	RTP_PACKET_SIZE_PSTN	172
-#define	RTP_PACKET_SIZE_GSM_FR	45
-#define	RTP_PACKET_SIZE_GSM_EFR	43
-#define	RTP_PACKET_SIZE_BFI	14
 #define	RTP_MAX_PAYLOAD		160
 
 struct rtp_packet {
--- a/mgw/gsm2pstn.c	Sun Mar 26 15:29:48 2023 -0800
+++ b/mgw/gsm2pstn.c	Wed Mar 29 20:06:40 2023 -0800
@@ -17,6 +17,7 @@
 #include <gsm.h>	/* libgsm dependency */
 #include <gsm_fr_preproc.h>
 #include <gsm_efr.h>
+#include "../include/rtp_defs.h"
 #include "../include/tmgw_ctrl.h"
 #include "../include/tmgw_const.h"
 #include "struct.h"
--- a/mgw/int_defs.h	Sun Mar 26 15:29:48 2023 -0800
+++ b/mgw/int_defs.h	Wed Mar 29 20:06:40 2023 -0800
@@ -2,19 +2,8 @@
  * This header file holds miscellaneous internal definitions for themwi-mgw.
  */
 
-#define	RTP_PACKET_SIZE_PSTN	172
 #define	RTP_PACKET_SIZE_GSM_FR	45
 #define	RTP_PACKET_SIZE_GSM_EFR	43
 #define	RTP_PACKET_SIZE_BFI	14
-#define	RTP_MAX_PAYLOAD		160
-
-struct rtp_packet {
-	uint8_t		v_p_x_cc;
-	uint8_t		m_pt;
-	uint16_t	seq;
-	uint32_t	tstamp;
-	uint32_t	ssrc;
-	uint8_t		payload[RTP_MAX_PAYLOAD];
-};
 
 #define	SAMPLES_PER_FRAME	160
--- a/mgw/pstn2gsm.c	Sun Mar 26 15:29:48 2023 -0800
+++ b/mgw/pstn2gsm.c	Wed Mar 29 20:06:40 2023 -0800
@@ -16,6 +16,7 @@
 #include <unistd.h>
 #include <gsm.h>	/* libgsm dependency */
 #include <gsm_efr.h>
+#include "../include/rtp_defs.h"
 #include "../include/tmgw_ctrl.h"
 #include "../include/tmgw_const.h"
 #include "struct.h"