#ifdef __cplusplus
extern "C" {
#endif

// Requested events
#define MGCP_EVENT_DTMF_0		0
#define MGCP_EVENT_DTMF_1		1
#define MGCP_EVENT_DTMF_2		2
#define MGCP_EVENT_DTMF_3		3
#define MGCP_EVENT_DTMF_4		4
#define MGCP_EVENT_DTMF_5		5
#define MGCP_EVENT_DTMF_6		6
#define MGCP_EVENT_DTMF_7		7
#define MGCP_EVENT_DTMF_8		8
#define MGCP_EVENT_DTMF_9		9
#define MGCP_EVENT_DTMF_STAR	10
#define MGCP_EVENT_DTMF_POUND	11
#define MGCP_EVENT_DTMF_T		12
#define MGCP_EVENT_DTMF_A		13
#define MGCP_EVENT_DTMF_B		14
#define MGCP_EVENT_DTMF_C		15
#define MGCP_EVENT_DTMF_D		16
#define MGCP_EVENT_DTMF_L		17

#define MGCP_EVENT_LINE_HD		18	// Off hook transition
#define MGCP_EVENT_LINE_HU		19	// On hook transition
#define MGCP_EVENT_LINE_HF		20	// Flash hook
#define MGCP_EVENT_LINE_OC		21	// Report on completion

#define MGCP_EVENT_BASE_ENF		22	// Embedded RQNT failure
#define MGCP_EVENT_BASE_OEF		23	// Observed events full
#define MGCP_EVENT_BASE_QBO		24	// quarantine buffer overflow

// signal events
#define MGCP_EVENT_GENERIC_PAT	40	// Pattern 
#define MGCP_EVENT_GENERIC_RT	41	// Ringback tone
#define MGCP_EVENT_GENERIC_RBK	42	// Ring back on connection
#define MGCP_EVENT_GENERIC_CF	43	// Confirm tone
#define MGCP_EVENT_GENERIC_CG	44	// Network Congestion tone
#define MGCP_EVENT_GENERIC_IT	45	// Intercept tone
#define MGCP_EVENT_GENERIC_PT	46	// Preemption tone

#define MGCP_EVENT_LINE_ADSI	48	// adsi display adsi(string)
#define MGCP_EVENT_LINE_VMWI	49	// visual message waiting indicator
#define MGCP_EVENT_LINE_AW		50	// Answer tone
#define MGCP_EVENT_LINE_BZ		51	// Busy tone
#define MGCP_EVENT_LINE_CI		52	// Caller-id ci(ti, nu, na)
#define MGCP_EVENT_LINE_WT		53	// Call waiting tone
#define MGCP_EVENT_LINE_DL		54	// Dial tone
#define MGCP_EVENT_LINE_MWI		55	// Message waiting indicator
#define MGCP_EVENT_LINE_NBZ		56	// Network busy
#define MGCP_EVENT_LINE_RO		57	// Reorder tone
#define MGCP_EVENT_LINE_RG		58	// Ringing
#define MGCP_EVENT_LINE_RS		59	// Ringsplash
#define MGCP_EVENT_LINE_P		60	// Prompt tone
#define MGCP_EVENT_LINE_E		61	// Error tone
#define MGCP_EVENT_LINE_SL		62	// Stutter dialtone
#define MGCP_EVENT_LINE_V		63	// Alerting tone
#define MGCP_EVENT_LINE_Y		64	// Reorder warning tone
#define MGCP_EVENT_LINE_Z		65	// Calling card service tone
#define MGCP_EVENT_LINE_OT		66	// Offhook warning tone
#define MGCP_EVENT_LINE_S		67	// Distinctive tone pattern s(###)
#define MGCP_EVENT_LINE_Z_POS	68	
#define MGCP_EVENT_LINE_Z_NEG	69	
#define MGCP_EVENT_LINE_RT		70	// Ringback tone

#define MGCP_EVENT_UNKNOWN		128
#define MGCP_EVENT_CRCX			129
#define MGCP_CALL_CONNECTED		130
#define MGCP_EVENT_DLCX			131
#define MGCP_START_CALL			132
#define MGCP_EVENT_HANGUP		134
#define MGCP_STOP_SIGNAL		135
#define MGCP_SEND_DTMF0			140
#define MGCP_SEND_DTMF1			141
#define MGCP_SEND_DTMF2			142
#define MGCP_SEND_DTMF3			143
#define MGCP_SEND_DTMF4			144
#define MGCP_SEND_DTMF5			145
#define MGCP_SEND_DTMF6			146
#define MGCP_SEND_DTMF7			147
#define MGCP_SEND_DTMF8			148
#define MGCP_SEND_DTMF9			149
#define MGCP_SEND_DTMFSTAR		150
#define MGCP_SEND_DTMFPOUND		151

#define MGCP_MODE_SENDONLY	0
#define MGCP_MODE_RECVONLY	1
#define MGCP_MODE_SENDRECV	2
#define MGCP_MODE_CONFRNCE	3
#define MGCP_MODE_INACTIVE	4
#define MGCP_MODE_LOOPBACK	5
#define MGCP_MODE_CONTTEST	6
#define MGCP_MODE_NETWLOOP	7
#define MGCP_MODE_NETWTEST	8
#define MGCP_MODE_UNKNOWN	9

extern  DCHAR Mgcp_iConnMode;

	void	MgcpInitialize();							// mgcp.c
	void	MgcpStartup();
	void	MgcpLogon();
	void	MgcpLogoff();
	void	MgcpHandleTimer();
	BOOLEAN MgcpRunUdp();		
	void	MgcpNotify(UCHAR iEvent);

	void	MgcpNotifyKey(UCHAR iKeyID);

#ifdef __cplusplus
}
#endif
