view mgw/dtmf_table.c @ 176:f5c4f9a764be

osmo-bts-rtp-bfi.patch: updated version This version of the osmo-bts patch sets the TAF bit correctly in generated RTP BFI packets, correctly generates RTP BFI in the case of FACCH stealing on sysmoBTS, and removes one EFR-specific bogon from sysmoBTS code.
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 17 Feb 2023 18:27:03 -0800
parents 815e4c59162e
children
line wrap: on
line source

/*
 * This module holds the table of all possible DTMF tones we can generate.
 */

#include <math.h>
#include <stdint.h>
#include "dtmf_defs.h"

#define	FREQ_697	(M_PI * 697.0 / 4000.0)
#define	FREQ_770	(M_PI * 770.0 / 4000.0)
#define	FREQ_852	(M_PI * 852.0 / 4000.0)
#define	FREQ_941	(M_PI * 941.0 / 4000.0)
#define	FREQ_1209	(M_PI * 1209.0 / 4000.0)
#define	FREQ_1336	(M_PI * 1336.0 / 4000.0)
#define	FREQ_1477	(M_PI * 1477.0 / 4000.0)
#define	FREQ_1633	(M_PI * 1633.0 / 4000.0)

struct dtmf_desc dtmf_table[] = {
	{'1', FREQ_697, FREQ_1209},
	{'2', FREQ_697, FREQ_1336},
	{'3', FREQ_697, FREQ_1477},
	{'A', FREQ_697, FREQ_1633},
	{'4', FREQ_770, FREQ_1209},
	{'5', FREQ_770, FREQ_1336},
	{'6', FREQ_770, FREQ_1477},
	{'B', FREQ_770, FREQ_1633},
	{'7', FREQ_852, FREQ_1209},
	{'8', FREQ_852, FREQ_1336},
	{'9', FREQ_852, FREQ_1477},
	{'C', FREQ_852, FREQ_1633},
	{'*', FREQ_941, FREQ_1209},
	{'0', FREQ_941, FREQ_1336},
	{'#', FREQ_941, FREQ_1477},
	{'D', FREQ_941, FREQ_1633},
	/* table search terminator */
	{0, 0, 0}
};