2G ems initial
This commit is contained in:
13
omc/plat/mgc/src/include/.copyarea.db
Normal file
13
omc/plat/mgc/src/include/.copyarea.db
Normal file
@@ -0,0 +1,13 @@
|
||||
ClearCase CopyAreaDB|4
|
||||
vobs\r9\plat\mgc\src\include
|
||||
2
|
||||
9
|
||||
9:mgc_def.h|1|11d70a41714|650|3b82df45|eae4844e6cf311dd91a5001c23e19543|0
|
||||
5:mgc.h|1|11d70a415dc|1fce|4708214d|e9b483ee6cf311dd91a5001c23e19543|0
|
||||
e:mgc_sess_ctl.h|1|11d70a41782|368|68f705aa|fc348ac66cf311dd91a5001c23e19543|0
|
||||
9:mgc_pub.h|1|11d70a4161b|93|519c2e5b|36d96aa5bfa511dc8589001c23e19543|0
|
||||
b:mgc_debug.h|1|11d70a41659|13d|7ae68cf|37796ac1bfa511dc8589001c23e19543|0
|
||||
9:mgc_fsm.h|1|11d70a41753|a0|21d73362|3a696b4dbfa511dc8589001c23e19543|0
|
||||
9:mgc_ext.h|1|11d70a416c6|3cd|d7c35c3|ea54841e6cf311dd91a5001c23e19543|0
|
||||
c:mgc_struct.h|1|11d70a416e6|d5e|477a2e7b|eae484366cf311dd91a5001c23e19543|0
|
||||
b:mgc_const.h|1|11d70a41688|80c|c6b62f59|ea5484066cf311dd91a5001c23e19543|0
|
||||
251
omc/plat/mgc/src/include/mgc.h
Normal file
251
omc/plat/mgc/src/include/mgc.h
Normal file
@@ -0,0 +1,251 @@
|
||||
#ifndef _MGC__H
|
||||
#define _MGC__H
|
||||
|
||||
#include "../../../public/src/include/pub_sdp.h"
|
||||
#include "../../../mgcp/src/include/mgcp.h"
|
||||
#include "../../../8ecp/src/include/8ecp.h"
|
||||
|
||||
#define MGC_MAX_NUM_OF_SAP 4
|
||||
#define MGC_MAX_USER_NAME_LEN 8
|
||||
#define MGC_MAX_DOMAIN_LEN 64
|
||||
#define MGC_MAX_PHY_PORT_PER_MG 32
|
||||
|
||||
#define MGC_USER_TYPE_MGC 0
|
||||
#define MGC_USER_TYPE_MG 1
|
||||
|
||||
#define MGC_MAX_NUM_OF_MG 1024
|
||||
#define MGC_MAX_NUM_OF_PHY_PORT 1024
|
||||
#define MGC_MAX_NUM_OF_CHNL 9424
|
||||
#define MGC_MAX_NUM_OF_PORT 8192
|
||||
|
||||
#define MGC_MAX_NUM_OF_AAS_MGC 4
|
||||
|
||||
#define MGC_MG_TYPE_INTERNAL 0
|
||||
#define MGC_MG_TYPE_AudioCoder 1
|
||||
#define MGC_MG_TYPE_LGC_MG 2
|
||||
#define MGC_MG_TYPE_SSW_CSS 3
|
||||
#define MGC_MG_TYPE_IPBSS 4
|
||||
#define MGC_MG_TYPE_ANALOG 11
|
||||
#define MGC_MG_TYPE_ANN 21
|
||||
|
||||
#define MGC_PHY_PORT_TYPE_E1 1
|
||||
#define MGC_PHY_PORT_TYPE_T1 2
|
||||
#define MGC_PHY_PORT_TYPE_ANALOG 3
|
||||
|
||||
#define MGC_MG_CTRL_TYPE_MGCP 0
|
||||
#define MGC_MG_CTRL_TYPE_8ECP 1
|
||||
|
||||
#define MGC_MEDIA_ATTR_EC_FLAG 0x01
|
||||
#define MGC_MEDIA_ATTR_SS_FLAG 0x02
|
||||
#define MGC_MEDIA_ATTR_VT_FLAG 0x04
|
||||
|
||||
#define MGC_OPER_ID_CONNECT_CHNL 1
|
||||
#define MGC_OPER_ID_CONNECT_DTMF 2
|
||||
#define MGC_OPER_ID_CONNECT_TONE 3
|
||||
#define MGC_OPER_ID_CRCX 4
|
||||
#define MGC_OPER_ID_MDCX 5
|
||||
#define MGC_OPER_ID_DLCX 6
|
||||
#define MGC_OPER_ID_RQNT 7
|
||||
#define MGC_OPER_ID_AUEP 8
|
||||
#define MGC_OPER_ID_CONNECT_AAS 9
|
||||
|
||||
#define MGC_OPER_FAILURE 0
|
||||
#define MGC_OPER_SUCCESS 1
|
||||
|
||||
#define MGC_VCTYPE_MAX 13
|
||||
#define MGC_VCTYPE_MAX_1 12
|
||||
|
||||
#define MGC_VCTYPE_PCMA 0
|
||||
#define MGC_VCTYPE_PCMU 1
|
||||
#define MGC_VCTYPE_GSM 2
|
||||
#define MGC_VCTYPE_GSM_EFR 3
|
||||
#define MGC_VCTYPE_AMR_12_2 4
|
||||
#define MGC_VCTYPE_G729B 5
|
||||
#define MGC_VCTYPE_AMR_10_2 6
|
||||
#define MGC_VCTYPE_AMR_7_95 7
|
||||
#define MGC_VCTYPE_AMR_7_4 8
|
||||
#define MGC_VCTYPE_AMR_6_7 9
|
||||
#define MGC_VCTYPE_AMR_5_15 10
|
||||
#define MGC_VCTYPE_AMR_5_9 11
|
||||
#define MGC_VCTYPE_AMR_4_75 12
|
||||
|
||||
|
||||
|
||||
#define MGC_MEDIA_PARA_FLAG_EC 0x0001
|
||||
#define MGC_MEDIA_PARA_FLAG_SS 0x0002
|
||||
#define MGC_MEDIA_PARA_FLAG_VT 0x0004
|
||||
#define MGC_MEDIA_PARA_FLAG_CM 0x0008
|
||||
#define MGC_MEDIA_PARA_FLAG_PT 0x0010
|
||||
|
||||
#define MGC_MAX_NUM_OF_CODEC 16
|
||||
|
||||
#define MGC_HOLD_MUSIC 7
|
||||
#define MGC_TONE_RING 8
|
||||
#define MGC_TONE_BUSY 9
|
||||
#define MGC_TONE_WARN 10
|
||||
|
||||
#define MGC_CONNECT_SILENT_TONE 0x01
|
||||
|
||||
#define MGC_MG_NETWORK_PORT 4967
|
||||
#define MGC_MGC_NETWORK_PORT 4966
|
||||
|
||||
|
||||
#define MGC_CONNECT_STATUS_IDLE 0
|
||||
#define MGC_CONNECT_STATUS_CREATING 1
|
||||
#define MGC_CONNECT_STATUS_CREATED 2
|
||||
#define MGC_CONNECT_STATUS_TONE 3
|
||||
|
||||
typedef enum{
|
||||
MGC_DTMF_1 = 1,
|
||||
MGC_DTMF_2 = 2,
|
||||
MGC_DTMF_3 = 3,
|
||||
MGC_DTMF_4 = 4,
|
||||
MGC_DTMF_5 = 5,
|
||||
MGC_DTMF_6 = 6,
|
||||
MGC_DTMF_7 = 7,
|
||||
MGC_DTMF_8 = 8,
|
||||
MGC_DTMF_9 = 9,
|
||||
MGC_DTMF_0 = 10,
|
||||
MGC_DTMF_START = 11,
|
||||
MGC_DTMF_POUND = 12
|
||||
}MGC_DTMF_DEF;
|
||||
|
||||
typedef enum{
|
||||
MGC_PKG_L = 0,
|
||||
MGC_PKG_D = 1,
|
||||
MGC_PKG_G = 2
|
||||
}MGC_PKG_TYPE;
|
||||
|
||||
typedef struct _OPER_REC
|
||||
{
|
||||
BYTE operaId;
|
||||
BYTE tone;
|
||||
WORD duration;
|
||||
WORD times;
|
||||
}OPER_REC;
|
||||
|
||||
typedef struct _CHNL
|
||||
{
|
||||
WORD mgNo; // mg No.
|
||||
BYTE portNo; // local physical port No. of that mg
|
||||
WORD chlNo; // local channel No. of that trunk
|
||||
WORD connectNo;
|
||||
}CHNL;
|
||||
|
||||
typedef struct _MGC_CODEC_LIST
|
||||
{
|
||||
BYTE num; // num of codecs
|
||||
WORD priority; // priority level, used when comparing different codec list
|
||||
BYTE codec[MGC_MAX_NUM_OF_CODEC]; // codec ID number, high priority codec first
|
||||
}MGC_CODEC_LIST;
|
||||
|
||||
typedef struct _MEDIA_PARA
|
||||
{
|
||||
WORD flag; // which media attribute is affected
|
||||
BYTE ecDisable; // echo canceller disable or enable
|
||||
BYTE ssDisable; // silence suppression disable or enable;
|
||||
BYTE conMode; // connect mode
|
||||
BYTE ptime; // packetization period
|
||||
MGC_CODEC_LIST vocoderType; // vocoder type
|
||||
}MEDIA_PARA;
|
||||
|
||||
typedef struct _MG_ATTR
|
||||
{
|
||||
BYTE ptime; // ptime, in ms
|
||||
BYTE mgType; // non-virtual/ann
|
||||
BYTE ctrlType; // 8ecp or mgcp
|
||||
BYTE epDes; // endpoint description method: structured or unstructured
|
||||
BYTE toneCap; // Tone generation capability
|
||||
BYTE maxPorts; // maximum physical ports of this MG
|
||||
WORD maxChnls; // maximum channels of this MG, only applicable to virtual MG.
|
||||
DWORD ip; // IP address of the MG
|
||||
char domain[MGC_MAX_DOMAIN_LEN]; // domain name of the mg
|
||||
BYTE e1cardNo;
|
||||
DWORD auditTimer;
|
||||
|
||||
MGC_CODEC_LIST codecList; // list of codecs that the MG supports
|
||||
}MG_ATTR;
|
||||
|
||||
typedef struct _MEDIA_ATTR
|
||||
{
|
||||
BYTE ecDisable; // echo canceller disable or enable
|
||||
BYTE ssDisable; // silence suppression disable or enable
|
||||
BYTE vocoderType; // vocoder type
|
||||
BYTE conMode; // connect mode
|
||||
char callId[33]; // call Id
|
||||
char conId[33]; // connection id
|
||||
BYTE ptime; // packetization period
|
||||
WORD pkgEvent; // package + event
|
||||
WORD pkgSignal; // package + signal
|
||||
WORD pkgReq; //package+req
|
||||
WORD restMode; // restart mode
|
||||
WORD restDelay; // restart delay
|
||||
|
||||
PUB_SDP_MSG sdp; // media info of this channel
|
||||
}MEDIA_ATTR;
|
||||
|
||||
typedef struct _EVENT
|
||||
{
|
||||
BYTE pkg; // package name
|
||||
BYTE event; // event name
|
||||
}EVENT;
|
||||
|
||||
typedef struct _SIGNAL
|
||||
{
|
||||
BYTE pkg; // package name
|
||||
BYTE signal; // signal name
|
||||
}SIGNAL;
|
||||
|
||||
typedef struct _MGC_SAP
|
||||
{
|
||||
char usrName[MGC_MAX_USER_NAME_LEN]; // user name
|
||||
BYTE usrType; // user acts as a mg or mgc
|
||||
|
||||
// callback function registration - indication
|
||||
int (*mgc_ind)(CHNL chnl, BYTE cmd, WORD *usrPort, WORD mgcPort, MEDIA_ATTR *mediaAttr);
|
||||
|
||||
// callback function registration - confirmation
|
||||
int (*mgc_cnf)(WORD usrPort, WORD mgcPort, BYTE operId, BYTE success, WORD cause);
|
||||
}MGC_SAP;
|
||||
|
||||
int mgc_bind(MGC_SAP *sap);
|
||||
int mgc_unbind(MGC_SAP *sap, BYTE sapIndex);
|
||||
|
||||
int mgc_crcx_chnl(WORD usrPort, CHNL chnl);
|
||||
int mgc_dlcx_chnl(WORD usrPort, CHNL chnl);
|
||||
int mgc_mdcx_chnl(WORD usrPort, CHNL chnl, MEDIA_PARA *mediaPara, BYTE sdFlag);
|
||||
int mgc_recvonly_chnl(WORD usrPort, CHNL orgChnl, CHNL destChnl);
|
||||
int mgc_rqnt_chnl(WORD usrPort, CHNL chnl, EVENT *event, SIGNAL *signal);
|
||||
int mgc_auep_chnl(WORD usrPort, CHNL chnl);
|
||||
|
||||
int mgc_connect_chnl(WORD usrPort, CHNL orgChnl, CHNL destChnl, BYTE flag);
|
||||
int mgc_connect_dtmf(WORD usrPort, CHNL orgChnl, CHNL dstChnl, BYTE dtmfNo);
|
||||
int mgc_connect_tone(WORD usrPort, CHNL orgChnl, CHNL dstChnl, BYTE toneNo, WORD duration);
|
||||
int mgc_connect_AAS(WORD usrPort, CHNL orgChnl, CHNL dstChnl, BYTE toneNo, WORD duration, WORD times);
|
||||
|
||||
int mgc_create_MG(BYTE sapIndex, MG_ATTR *mgAttr);
|
||||
int mgc_delete_MG(BYTE sapIndex, WORD mgNo);
|
||||
int mgc_modify_MG(BYTE sapIndex, WORD mgNo, MG_ATTR *mgAttr);
|
||||
|
||||
int mgc_add_port(BYTE sapIndex, WORD mgNo, BYTE portNo, BYTE portType);
|
||||
int mgc_delete_port(BYTE sapIndex, WORD mgNo, BYTE portNo);
|
||||
int mgc_modify_port(BYTE sapIndex, WORD mgNo, BYTE portNo, BYTE portType);
|
||||
|
||||
int mgc_query_mg_status(WORD mgNo);
|
||||
int mgc_query_port_status(WORD mgNo, BYTE portNo);
|
||||
int mgc_query_channel_status(CHNL chnl);
|
||||
|
||||
int mgc_create_virtual_chnl(WORD port, CHNL *chnl);
|
||||
int mgc_release_virtual_chnl(WORD port, CHNL chnl);
|
||||
|
||||
int mgc_query_chnl_media(WORD port, CHNL chnl, PUB_SDP_MSG **mediaInfo, BYTE *mgPayloads, BYTE *mgPlNum);
|
||||
int mgc_update_chnl_media(WORD port, CHNL chnl, PUB_SDP_MSG *mediaInfo);
|
||||
|
||||
int mgc_license_ctrl(WORD maxMgNum, WORD maxChnlNum);
|
||||
|
||||
int mgc_rsp(BYTE cmd, WORD usrPort, WORD port, WORD retCode, MEDIA_ATTR *mediaAttr);
|
||||
|
||||
int mgc_chnl_codec_update(CHNL chnl , MGC_CODEC_LIST codecList);
|
||||
int mgc_query_chnl_status(CHNL chnl);
|
||||
OPER_REC *mgc_query_chnl_oper_rec(CHNL chnl);
|
||||
#endif
|
||||
75
omc/plat/mgc/src/include/mgc_const.h
Normal file
75
omc/plat/mgc/src/include/mgc_const.h
Normal file
@@ -0,0 +1,75 @@
|
||||
#ifndef _MGC_CONST__H
|
||||
#define _MGC_CONST__H
|
||||
|
||||
#define MGC_MAX_OPER_STEPS_NUM 8
|
||||
|
||||
#define MGC_MGCF_STATE_REQUEST 1
|
||||
#define MGC_MGCF_STATE_INDICATION 2
|
||||
#define MGC_MGCF_STATE_INIT 3
|
||||
|
||||
#define MGC_MGCF_TIMER_50MS 5
|
||||
#define MGC_MGCF_TIMER_1S 100
|
||||
#define MGC_MGCF_TIMER_10S 10 * MGC_MGCF_TIMER_1S
|
||||
#define MGC_MGCF_TIMER_20S 20 * MGC_MGCF_TIMER_1S
|
||||
#define MGC_MGCF_TIMER_1H 3600 * MGC_MGCF_TIMER_1S
|
||||
|
||||
#define MGC_CHNL_START_DS 0
|
||||
#define MGC_CHNL_START_INTERNAL 8192
|
||||
#define MGC_CHNL_START_ANN 9216
|
||||
#define MGC_CHNL_START_MSS 9256
|
||||
#define MGC_CHNL_START_AALN 9416
|
||||
|
||||
#define MGC_CHNL_NUM_INTERNAL 1024
|
||||
#define MGC_CHNL_NUM_ANN 200
|
||||
//#define MGC_CHNL_NUM_MSS 4
|
||||
#define MGC_CHNL_NUM_AALN 8
|
||||
#define MGC_CHNL_NUM_DS_TOTAL 8192
|
||||
|
||||
#define MGC_CHNL_NUM_INTERNAL_PER_PORT 1
|
||||
#define MGC_CHNL_NUM_AALN_PER_PORT 1
|
||||
#define MGC_CHNL_NUM_ANN_PER_TYPE 40
|
||||
#define MGC_CHNL_NUM_DS_PER_PORT 32
|
||||
|
||||
#define MGC_MNG_CMD_IDLE 0
|
||||
#define MGC_MNG_CMD_REMOVE_CHNL 1
|
||||
#define MGC_MNG_CMD_OVERWRITE 2
|
||||
#define MGC_MNG_CMD_CLEAR_AFTER_OPER 3
|
||||
|
||||
#define MGC_CHNL_STATUS_IDLE 0
|
||||
#define MGC_CHNL_STATUS_CREATING 1
|
||||
#define MGC_CHNL_STATUS_CREATED 2
|
||||
|
||||
|
||||
#define MGC_INTERNAL_VIRTUAL_MG 0
|
||||
#define MGC_8ECP_MG_OFFSET 1
|
||||
#define MGC_8ECP_MAX_TRK_PER_MG 8
|
||||
|
||||
#define MGC_MAX_NUM_OF_CHNL_CON 512
|
||||
#define MGC_MAX_NUM_OF_CON 8192
|
||||
|
||||
#define MGC_MGCP_MGC_PORT 2727
|
||||
#define MGC_MGCP_MG_PORT 2427
|
||||
|
||||
#define MGC_MAX_ASCIIIN_LEN 4096
|
||||
#define MGC_MAX_ASCIIOUT_LEN 4096
|
||||
#define MGC_MAX_ASCITMP_LEN 4096
|
||||
|
||||
#define MGC_MONITOR_NONE 0x0000
|
||||
#define MGC_MONITOR_ERROR 0x0010
|
||||
#define MGC_MONITOR_ALL 0xffff
|
||||
|
||||
#define MGC_CHNL_CLEAR_PORT 0
|
||||
#define MGC_CHNL_SAVE_PORT 1
|
||||
|
||||
#define MGC_MAX_TONE_NO 16
|
||||
|
||||
//#define MGC_8K_TONE_CHNL_SILENT (0 * 8 + 7) * 32 + 31
|
||||
|
||||
#define MGC_PKG_SIG_G_RT ((MGCP_PKG_G << 8) | MGCP_G_SIG_RT)
|
||||
#define MGC_PKG_SIG_L_BZ ((MGCP_PKG_L << 8) | MGCP_L_SIG_BZ)
|
||||
#define MGC_PKG_SIG_L_WT ((MGCP_PKG_L << 8) | MGCP_L_SIG_WT)
|
||||
|
||||
#define MGC_CHNL_AUEP_IDLE 0
|
||||
#define MGC_CHNL_AUEP_IN_PROGRESS 1
|
||||
|
||||
#endif
|
||||
11
omc/plat/mgc/src/include/mgc_debug.h
Normal file
11
omc/plat/mgc/src/include/mgc_debug.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#ifndef _MGC_DEBUG__H
|
||||
#define _MGC_DEBUG__H
|
||||
|
||||
void mgc_mon(void);
|
||||
int mgc_debug_set(void);
|
||||
int mgc_asciout_proc(BYTE *out_str);
|
||||
int mgc_hex_to_ascii(BYTE *from_hex, BYTE from_len, BYTE *to_asc);
|
||||
int mgc_log_err(char *err_msg);
|
||||
int mgc_log_procedure(WORD mgNo, WORD portIndex, WORD chnlIndex, char *msg);
|
||||
|
||||
#endif
|
||||
74
omc/plat/mgc/src/include/mgc_def.h
Normal file
74
omc/plat/mgc/src/include/mgc_def.h
Normal file
@@ -0,0 +1,74 @@
|
||||
#ifndef _MGC_DEF__H
|
||||
#define _MGC_DEF__H
|
||||
|
||||
#include "mgc_pub.h"
|
||||
#include "mgc.h"
|
||||
#include "mgc_const.h"
|
||||
#include "mgc_struct.h"
|
||||
|
||||
DWORD sysID;
|
||||
DWORD localIP;
|
||||
DWORD peerIP;
|
||||
|
||||
_8ECP_SAP mgc8ecpSap;
|
||||
MGCP_SAP mgcMgcpSap;
|
||||
int mgc8ecpSapIndex;
|
||||
int mgcMgcpSapIndex;
|
||||
MGC_SAP mgcSap[MGC_MAX_NUM_OF_SAP];
|
||||
|
||||
WORD mgcSelectPort;
|
||||
WORD mgc_select_connection;
|
||||
WORD mgc_select_ass_mgc_mgNo;
|
||||
|
||||
WORD mgc_e1card0_mgNo;
|
||||
WORD mgc_e1card1_mgNo;
|
||||
|
||||
WORD mgc_aas_mgNo[MGC_MAX_NUM_OF_AAS_MGC];
|
||||
|
||||
WORD mgc_8k_tone_card_silent;
|
||||
|
||||
MG_INFO mgcMgInfo[MGC_MAX_NUM_OF_MG];
|
||||
PHY_PORT_INFO mgcPhyPort[MGC_MAX_NUM_OF_PHY_PORT];
|
||||
CHNL_INFO mgcChnl[MGC_MAX_NUM_OF_CHNL];
|
||||
PORT_INFO mgcPort[MGC_MAX_NUM_OF_PORT];
|
||||
|
||||
MGCP_PARA mgcMgcpPara;
|
||||
|
||||
CONNECT_INFO mgcConnectInfo[MGC_MAX_NUM_OF_CON];
|
||||
|
||||
WORD mgcMaxMgNo;
|
||||
WORD mgcMaxChlNo;
|
||||
|
||||
WORD mgcMgCreated;
|
||||
WORD mgcChlAssigned;
|
||||
|
||||
char vcName[MGC_VCTYPE_MAX][16];
|
||||
|
||||
const BYTE MGC_AC_LINE_STATUS_IDLEN = 12;
|
||||
|
||||
DWORD MGC_AC_LINE_STATUS_OID[20] =
|
||||
{
|
||||
1,3,6,1,2,1,10,18,6,1,10,0
|
||||
};
|
||||
|
||||
const BYTE MGC_LGC_MG_STATUS_IDLEN = 13;
|
||||
|
||||
DWORD MGC_LGC_MG_STATUS_OID[20] =
|
||||
{
|
||||
1,3,6,1,4,1,1373,2,2,30,2,1,0
|
||||
};
|
||||
|
||||
BYTE mgcAsciInBuf[MGC_MAX_ASCIIIN_LEN];
|
||||
BYTE mgcAsciOutBuf[MGC_MAX_ASCIIOUT_LEN];
|
||||
BYTE mgcAsciTempBuf[MGC_MAX_ASCITMP_LEN];
|
||||
WORD mgcMonitorFg;
|
||||
|
||||
const WORD MGC_TONE_NO_TO_PKG_SIG[16] =
|
||||
{
|
||||
MGC_PKG_SIG_L_BZ, MGC_PKG_SIG_L_BZ, MGC_PKG_SIG_L_BZ, MGC_PKG_SIG_L_BZ,
|
||||
MGC_PKG_SIG_L_BZ, MGC_PKG_SIG_L_BZ, MGC_PKG_SIG_L_BZ, MGC_PKG_SIG_L_BZ,
|
||||
MGC_PKG_SIG_G_RT, MGC_PKG_SIG_L_BZ, MGC_PKG_SIG_L_BZ, MGC_PKG_SIG_L_WT,
|
||||
MGC_PKG_SIG_L_BZ, MGC_PKG_SIG_L_BZ, MGC_PKG_SIG_L_BZ, MGC_PKG_SIG_L_BZ
|
||||
};
|
||||
|
||||
#endif
|
||||
39
omc/plat/mgc/src/include/mgc_ext.h
Normal file
39
omc/plat/mgc/src/include/mgc_ext.h
Normal file
@@ -0,0 +1,39 @@
|
||||
#ifndef _MGC_EXT__H
|
||||
#define _MGC_EXT__H
|
||||
|
||||
#include "mgc_pub.h"
|
||||
#include "mgc.h"
|
||||
#include "mgc_const.h"
|
||||
#include "mgc_struct.h"
|
||||
|
||||
extern _8ECP_SAP mgc8ecpSap;
|
||||
extern MGCP_SAP mgcMgcpSap;
|
||||
extern int mgc8ecpSapIndex;
|
||||
extern int mgcMgcpSapIndex;
|
||||
extern MGC_SAP mgcSap[MGC_MAX_NUM_OF_SAP];
|
||||
|
||||
extern MG_INFO mgcMgInfo[MGC_MAX_NUM_OF_MG];
|
||||
extern PHY_PORT_INFO mgcPhyPort[MGC_MAX_NUM_OF_PHY_PORT];
|
||||
extern CHNL_INFO mgcChnl[MGC_MAX_NUM_OF_CHNL];
|
||||
extern PORT_INFO mgcPort[MGC_MAX_NUM_OF_PORT];
|
||||
|
||||
extern MGCP_PARA mgcMgcpPara;
|
||||
|
||||
extern WORD mgcMaxMgNo;
|
||||
extern WORD mgcMaxChlNo;
|
||||
|
||||
extern WORD mgcMgCreated;
|
||||
extern WORD mgcChlAssigned;
|
||||
|
||||
extern CONNECT_INFO mgcConnectInfo[MGC_MAX_NUM_OF_CON];
|
||||
|
||||
extern char vcName[MGC_VCTYPE_MAX][16];
|
||||
|
||||
extern BYTE mgcAsciInBuf[MGC_MAX_ASCIIIN_LEN];
|
||||
extern BYTE mgcAsciOutBuf[MGC_MAX_ASCIIOUT_LEN];
|
||||
extern BYTE mgcAsciTempBuf[MGC_MAX_ASCITMP_LEN];
|
||||
extern WORD mgcMonitorFg;
|
||||
|
||||
extern const WORD MGC_TONE_NO_TO_PKG_SIG[16];
|
||||
|
||||
#endif
|
||||
11
omc/plat/mgc/src/include/mgc_fsm.h
Normal file
11
omc/plat/mgc/src/include/mgc_fsm.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#ifndef _MGC_FSM__H
|
||||
#define _MGC_FSM__H
|
||||
|
||||
#include "mgc_pub.h"
|
||||
#include "mgc.h"
|
||||
#include "mgc_const.h"
|
||||
#include "mgc_struct.h"
|
||||
|
||||
void mgc_fsm(WORD port);
|
||||
|
||||
#endif
|
||||
7
omc/plat/mgc/src/include/mgc_pub.h
Normal file
7
omc/plat/mgc/src/include/mgc_pub.h
Normal file
@@ -0,0 +1,7 @@
|
||||
#ifndef _MGC_PUB__H
|
||||
#define _MGC_PUB__H
|
||||
|
||||
#include "../../../public/src/include/includes.h"
|
||||
#include "../../../public/src/include/public.h"
|
||||
|
||||
#endif
|
||||
40
omc/plat/mgc/src/include/mgc_sess_ctl.h
Normal file
40
omc/plat/mgc/src/include/mgc_sess_ctl.h
Normal file
@@ -0,0 +1,40 @@
|
||||
#ifndef _MGC_SESS_CTL_H
|
||||
#define _MGC_SESS_CTL_H
|
||||
#include "mgc_pub.h"
|
||||
#include "mgc.h"
|
||||
#include "mgc_const.h"
|
||||
#include "mgc_ext.h"
|
||||
#include "mgc_struct.h"
|
||||
#include "mgc_debug.h"
|
||||
|
||||
#define MGC_SESS_RECORD 8192
|
||||
#define MGC_SDP_IPADDR_LEN 35
|
||||
typedef struct _MGC_SDP_TAG
|
||||
{
|
||||
PUB_SDP_MEDIA m;
|
||||
PUB_SDP_C c;
|
||||
BYTE mode;
|
||||
}MGC_SDP_TAG;
|
||||
|
||||
typedef enum{
|
||||
MGC_SESS_STATUS_UNDEF =-1,
|
||||
MGC_SESS_STATUS_IDLE,
|
||||
MGC_SESS_STATUS_USED
|
||||
}MGC_SESS_STATUS;
|
||||
|
||||
typedef struct _MGC_SESS_REC
|
||||
{
|
||||
int id;
|
||||
MGC_SESS_STATUS status;
|
||||
CHNL chnl;
|
||||
MGC_SDP_TAG sdpTag;
|
||||
}MGC_SESS_REC;
|
||||
|
||||
void mgc_sess_init(void);
|
||||
void mgc_sess_rec_init(MGC_SESS_REC *pSess , int id);
|
||||
MGC_SESS_REC *mgc_sess_is_already_rec(CHNL chnl);
|
||||
BOOL mgc_sess_rec_org_and_dst_chnl(CHNL orgChnl , CHNL destChnl);
|
||||
BOOL mgc_sess_is_chnl_need_update(CHNL chnl, MGCP_PARA *pPara);
|
||||
|
||||
#endif
|
||||
|
||||
114
omc/plat/mgc/src/include/mgc_struct.h
Normal file
114
omc/plat/mgc/src/include/mgc_struct.h
Normal file
@@ -0,0 +1,114 @@
|
||||
#ifndef _MGC_STRUCT__H
|
||||
#define _MGC_STRUCT__H
|
||||
|
||||
#include "mgc.h"
|
||||
#include "mgc_const.h"
|
||||
|
||||
typedef struct _MG_INFO
|
||||
{
|
||||
BYTE created; // created flag;
|
||||
BYTE status; // MG status: available/unavailable
|
||||
BYTE stLast; // MG status last: available/unavailable
|
||||
BYTE monFlag;
|
||||
BYTE usrType; // user acts as a mg or mgc
|
||||
DWORD auditTimer;
|
||||
|
||||
MG_ATTR mgAttr; // MG attributes
|
||||
|
||||
// number and index of the ports created on this MG, not applicable to virtual MG
|
||||
BYTE portNum;
|
||||
WORD portIndex[MGC_MAX_PHY_PORT_PER_MG];// max 32 physical ports per MG
|
||||
|
||||
// number and starting index of the channel created on this MG, only applicable to virtual MG
|
||||
WORD chnlNum;
|
||||
WORD chnlStartIndex;
|
||||
BYTE sapIndex[MGC_MAX_NUM_OF_SAP];
|
||||
|
||||
DWORD requestId; // SNMP request id
|
||||
}MG_INFO;
|
||||
|
||||
typedef struct _PHY_PORT_INFO
|
||||
{
|
||||
BYTE created; // created flag
|
||||
BYTE mgNo; // mg No. this port resides on
|
||||
BYTE portNo; // mg local physical port No.
|
||||
BYTE portType; // port type: E1/T1/analogue
|
||||
BYTE sapIndex; // sap index, indicating which user creates this port
|
||||
BYTE phyStatus; // physical port status: online/offline
|
||||
BYTE stLast; // physical port status: online/offline
|
||||
BYTE monFlag;
|
||||
|
||||
// number and starting index of the channel created on this port, not applicable to virtual MG
|
||||
BYTE chnlNum; // depend on mg type
|
||||
WORD chnlStartIndex;
|
||||
}PHY_PORT_INFO;
|
||||
|
||||
typedef struct _CHNL_INFO
|
||||
{
|
||||
BYTE assigned; // assigned flag
|
||||
BYTE mgNo; // mg No. this channel resides on
|
||||
BYTE portNo; // mg local physical port No., not applicable to virtual MG
|
||||
BYTE status; // connection status, created or not
|
||||
WORD port; // which port is in handling this channel
|
||||
BYTE sapIndex; // sap index, indicating which user creates this channel, applicable for ANN MG
|
||||
BYTE monFlag; // monitor flag
|
||||
BYTE auepSt; // AUEP status
|
||||
WORD connectNum;
|
||||
|
||||
WORD connectIndex[MGC_MAX_NUM_OF_CHNL_CON]; //Media Index
|
||||
MEDIA_ATTR comMediaAttr;
|
||||
|
||||
|
||||
// MGC_CODEC_LIST codecList; // list of codecs that this channel may negotiate with other channel
|
||||
// MEDIA_ATTR mediaAttr; // media info of this channel
|
||||
}CHNL_INFO;
|
||||
|
||||
typedef struct _CONNECT_INFO
|
||||
{
|
||||
BYTE assigned;
|
||||
WORD chlIndex;
|
||||
WORD port; // which port is in handling this connection
|
||||
BYTE status;
|
||||
CHNL aasChnl;
|
||||
DWORD flag;
|
||||
|
||||
MGC_CODEC_LIST codecList;
|
||||
MEDIA_ATTR mediaAttr;
|
||||
OPER_REC operRec;
|
||||
}CONNECT_INFO;
|
||||
|
||||
typedef struct _MGCF_OPER_STEP
|
||||
{
|
||||
CHNL localChnl; // local channel to be operated, mandatory
|
||||
CHNL remChnl; // remote channel to be operated, optional
|
||||
BYTE cmd; // operation command
|
||||
DWORD delay; // delay after the operation
|
||||
WORD pkgSignal; // package + signal
|
||||
MEDIA_PARA media; // media para
|
||||
|
||||
WORD chnlConnectIndex; //chnl connectIndex
|
||||
|
||||
WORD flag;
|
||||
}MGCF_OPER_STEP;
|
||||
|
||||
typedef struct _PORT_INFO
|
||||
{
|
||||
BYTE assigned;
|
||||
BYTE mgcfState; // mgcf state
|
||||
BYTE mgcfState2; // mgcf state2
|
||||
WORD mgcfTimer; // mgcf timer
|
||||
CHNL mgcfChnl; // current operation channel
|
||||
WORD usrPort; // user port
|
||||
WORD llPort; // lower layer port
|
||||
WORD usrCmd; // user command or response
|
||||
WORD llCmd; // lower layer command or response
|
||||
BYTE mngCmd; // management commmand
|
||||
DWORD ip;
|
||||
|
||||
BYTE mgcfOperId;
|
||||
BYTE mgcfOperStepsNum; // total number of operation steps
|
||||
BYTE mgcfOperStepIndex; // current operation step index
|
||||
MGCF_OPER_STEP mgcfOperSteps[MGC_MAX_OPER_STEPS_NUM]; // max 8 steps
|
||||
}PORT_INFO;
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user