// SimRTPDlg.h : header file
//

#if !defined(AFX_SIMRTPDLG_H__A34053B1_FEAF_4BC2_B093_6D4C52CCF32A__INCLUDED_)
#define AFX_SIMRTPDLG_H__A34053B1_FEAF_4BC2_B093_6D4C52CCF32A__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "windows.h"
#include "winsock.h"
#include "cclRtp.h"
#include "WavInOut.h"
#include "adtbuffer.h"

//typedef enum {
//	WAV_PCMU = 0x0,
//	WAV_PCMA = 0x8,
//	WAV_GSM = 0x3
//	} WAV_FORMATE;


/////////////////////////////////////////////////////////////////////////////
// CSimRTPDlg dialog

class CSimRTPDlg : public CDialog
{
// Construction
public:
	int				m_RtpChan;
	WavInOut*		m_WaveIOObj;
	adtBuffer		m_BufRTP2IO;
	adtBuffer		m_BufIO2RTP;
	BOOL			m_bUDP;
	BOOL			m_bTCP;
	BOOL			m_bCallAuto;
	BOOL			m_flag;
	int	         	m_nUDPPort;
	int				m_nTCPPort;
	CFile			m_log;

	CSimRTPDlg(CWnd* pParent = NULL);	// standard constructor

	static int RTPEventHandler(int,const char*,int);
	static int Wav2RTP(char* buff, int len);
	static int RTP2Wav(char* buff, int len);

	int	 MediaConnection();
	int	 MediaPlayTone();
	int  Media_RTP_Stop();
	int  RTPPeerConnect(CString , int );
	int  RTPOpenPort(void);
// Dialog Data
	//{{AFX_DATA(CSimRTPDlg)
	enum { IDD = IDD_SIMRTP_DIALOG };
	CButton	m_OK;
	CEdit	m_IP_CTL;
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CSimRTPDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CSimRTPDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	virtual void OnCancel();
	afx_msg void OnChangeEdit1();
	virtual void OnOK();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_SIMRTPDLG_H__A34053B1_FEAF_4BC2_B093_6D4C52CCF32A__INCLUDED_)
