#ifndef _MGC_TANDEM_INFO_H
#define _MGC_TANDEM_INFO_H

#include "mgc_struct.h"

typedef enum
{
    MGC_TANDEM_CONN_POS_UNDEF = -1,
	MGC_TANDEM_CONN_POS_TAR,
	MGC_TANDEM_CONN_POS_TX,
	MGC_TANDEM_CONN_POS_RX,
	MGC_TANDEM_CONN_POS_AOR,
	MGC_TANDEM_CONN_POS_SUR
}MGC_TANDEM_CONN_POS;

BOOL mgc_tandem_info_unset_conn(MGC_TANDEM_INFO *pTandem , CONNECT_INFO *pConnect);
BOOL mgc_tandem_info_set_conn(MGC_TANDEM_INFO *pTandem , CONNECT_INFO *pConn, MGC_TANDEM_CONN_POS pos);
MGC_TANDEM_CONN_POS  mgc_tandem_info_get_conn_pos(MGC_TANDEM_INFO *pTandem , CONNECT_INFO *pConn);
MGC_TANDEM_INFO *mgc_tandem_info_get_tandem_by_id(DWORD id);
MGC_TANDEM_INFO *mgc_tandem_info_get_idle_tandem(void);
void mgc_tandem_info_setup(void);
BOOL mgc_tandem_info_add_tandem_res(BYTE sapIndex, WORD mgNo);
BOOL mgc_tandem_info_set_esccd_info(MGC_TANDEM_INFO *pTandem , MGCP_ESCCD rxEsccd , MGCP_ESCCD txEsccd);
BOOL mgc_tandem_info_create_tar_tandem(CONNECT_INFO *pConnect, PORT_INFO *pPortInfo);
BOOL mgc_tandem_info_create_tandem(MGC_TANDEM_INFO *pTandem , PORT_INFO *pPortInfo);
BOOL mgc_tandem_info_stop_tandem_send_to_tar(CONNECT_INFO *pConnect, PORT_INFO *pPortInfo);
BOOL mgc_tandem_info_stop_tandem_send_to_aor(CONNECT_INFO *pConnect, PORT_INFO *pPortInfo);
MGC_TANDEM_STATUS mgc_tandem_info_get_status(MGC_TANDEM_INFO *pTandem);
BOOL mgc_tandem_info_dettach_aor_related_tandem(CONNECT_INFO *pConnect, CONNECT_INFO *pPeerConnect, PORT_INFO *pPortInfo);
BOOL mgc_tandem_info_connect(CONNECT_INFO *pConnect, CONNECT_INFO *pPeerConnect, MGC_CON_MODE mode , PORT_INFO *pPortInfo);
BOOL mgc_tandem_info_remove_connection_from_tandem(CONNECT_INFO *pConnect, PORT_INFO *pPortInfo);
BOOL mgc_tandem_info_mdcx(CONNECT_INFO *pConnect , PORT_INFO *pPortInfo);
BOOL mgc_tandem_info_add_crcx_aas(CONNECT_INFO *pAasConnect, CONNECT_INFO *pPeerConnect, PORT_INFO *pPortInfo);
BOOL mgc_tandem_info_add_mdcx_aas(CONNECT_INFO *pConnect, CONNECT_INFO *pAasConnect,  PORT_INFO *pPortInfo);
BOOL mgc_tandem_info_clear(MGC_TANDEM_INFO *pTandem, PORT_INFO *pPortInfo);

#endif
