?? configuration.h
字號:
#ifndef __CONFIGURATION_H__
#define __CONFIGURATION_H__
#ifdef __cplusplus
extern "C" {
#endif
#define MASK_FORWARD_ALL 1
#define MASK_FORWARD_BUSY 2
#define MASK_FORWARD_NOANSWER 4
/* IP 地址或 E.164號碼最大長度 */
#ifndef MAX_PHONE_NUMBER_LEN
#define MAX_PHONE_NUMBER_LEN 32
#endif
#define MAX_SPEED_DIAL_KEY 10
#define MODE_FTP 0
#define MODE_TFTP 1
/*話機ip分配方式*/
#define STATICIP 0
#define DHCPIP 1
#define PPPOEIP 2
#ifndef AUDIO_CODEC_NUM
#define AUDIO_CODEC_NUM 4
#endif
/* 話機的基本配置 */
struct s_cfgbasic
{
char linename[15]; /*在線名稱*/
char password[7]; /* 話機密碼 */
char linenumber[MAX_PHONE_NUMBER_LEN+1]; /* 本機號碼 */
char linenumber2[MAX_PHONE_NUMBER_LEN+1]; /* 在線號碼2 */
char linenumber3[MAX_PHONE_NUMBER_LEN+1]; /* 在線號碼3*/
unsigned char ringtype; /* 振鈴類型 */
unsigned char ringvolume; /* 振鈴音量 */
unsigned char handsetvolume;/*聽筒音量*/
unsigned char speakerphonevolume;/*免提喇叭音量*/
long time; /* 話機時間 */
unsigned char ifdebug; /* 是否重定向輸出 */
unsigned short dstport; /* 接收輸出信息的UDP端口 */
unsigned int dstaddr; /*接收輸出信息的UDP地址 */
};
/* 網絡配置 */
struct s_cfgnetwork
{
/**unsigned char ifpppoe;**/
/* 是否使用pppoe */
unsigned char ipType;
#ifdef INCLUDE_PPPOE_APP
char pppoeid[20]; /* pppoe帳號 */
char pppoepin[20]; /* pppoe密碼 */
unsigned char ifautodialatstartup; /* 話機啟動時是否自動pppoe撥號 */
unsigned char retryCount;
#endif
/**unsigned char ifdhcp; **/
/* 是否使用dhcp */
unsigned int ipaddr; /* 話機IP */
unsigned int subnetmask; /* 子網掩碼 */
unsigned int gateway; /* 網關 */
unsigned char ifproxy; /* 是否使用代理服務器 */
unsigned int proxyip; /* 代理服務器IP */
unsigned short proxyport; /* 代理服務器端口 */
unsigned char netspeed; /* 網口設置,0 - auto 1 - 10M 2 - 100M */
#ifdef INCLUDE_NAT_APP
unsigned char ifnat; /* 是否啟用NAT */
unsigned int natlocalip; /* NAT本地IP地址 */
unsigned int natlocalmask; /* NAT本地子網掩碼 */
#endif
};
/* sntp設置 */
struct s_cfgsntp
{
unsigned char ifsntp; /* 是否使用sntp */
unsigned int serverip; /* sntp服務器IP */
int timezone; /* 時區 */
};
/* 升級ftp設置 */
struct s_cfgftp
{
unsigned char mode; /* ftp/tftp*/
unsigned int server; /* 服務器IP*/
char usrid[20]; /* 用戶名 */
char pin[10]; /* 密碼 */
char filename[20]; /* 升級文件名*/
};
/* 呼叫轉移設置 */
struct s_cfgforward
{
unsigned char mode; /* 呼叫轉移的類型 1-all 2-busy 4-noanswer*/
char numberAll[MAX_PHONE_NUMBER_LEN+1];
char numberBusy[MAX_PHONE_NUMBER_LEN+1];
char numberNoAnswer[MAX_PHONE_NUMBER_LEN+1];
int interval;
};
typedef struct CodecElem
{
int isUsed;
char codecName[32];
int codecType;
} CodecElem;
/* 語音設置 */
struct s_cfgaudio
{
CodecElem codecPrefOrder[AUDIO_CODEC_NUM];
};
typedef enum dtmftype
{
DTMF_H245STRING,
DTMF_RFC2833EVENT,
DTMF_Q931
} DtmfType;
/* 服務設置 */
struct s_cfgservice
{
unsigned char ifservice; /* 是否使用登錄服務器 對于H323是否使用GateKeeper 對于SIP是否使用Proxy Server */
unsigned int serverip; /* 登錄服務器的IP */
unsigned short serviceport; /* 服務監聽端口 */
unsigned short registerport; /* 注冊端口 */
char serviceid[20]; /* 向服務器驗證使用的ID */
unsigned short rtpport; /* RTP端口 */
unsigned char ifbilling; /* 2004.03.04, 是否使用計費服務器 */
unsigned short localbillingport; /* 2004.03.04, 發送通話時間的本地UDP端口 */
unsigned short billingserverport; /* 2004.03.04, 計費服務器UDP監聽端口 */
unsigned int billingserverip; /* 2004.03.04, 計費服務器的IP */
DtmfType dtmftype; /* 發送DTMF號碼的方式 */
};
/* H323設置 */
#ifdef HC
struct s_cfgh323
{
unsigned short q931port; /* Q931端口 */
unsigned short h245port; /* H245端口 */
unsigned char ifencryption; /* 是否使用加密 */
char encryptionusr[20]; /* 加密的用戶名 */
char encryptionpin[10]; /* 加密的密碼 */
unsigned char registermode; /* 向網守注冊的方式 */
char registerid[20]; /* 注冊ID */
char registerpin[10]; /* 注冊密碼 */
char e164id[MAX_PHONE_NUMBER_LEN+1];/* E.164號碼 */
unsigned int audiogateway; /* 語音網關 */
unsigned char iffirewall; /* 是否使用防火墻 */
unsigned char isFastStart; /*是否使用fastStart*/
unsigned char isH245Tunneling; /* 是否使用H245Tunneling */
};
#endif
/* SIP 設置*/
#ifdef SIP
struct s_cfgsip
{
char registername[64];
unsigned short registerport;
char registerpass[20];
char phonenum[20];
};
#endif
/* MGCP 設置 */
#ifdef MGCP
struct s_cfgmgcp
{
char callagentaddr[64];
char endpointid[33];
char domainname[33];
int callagentport;
int localport;
int reqtimeout;
int delmsgtimeout;
int epidsetmode;/*1--默認(aaln/0@[192.168.123.113]),2--域名(aaln/0@broadeasy.com),4--任意aaln/0@xxx*/
};
#endif
/* 話機配置 */
struct s_config
{
struct s_cfgbasic conf_basic;
struct s_cfgaudio conf_audio;
struct s_cfgforward conf_forward;
struct s_cfgnetwork conf_network;
struct s_cfgftp conf_ftp;
struct s_cfgsntp conf_sntp;
struct s_cfgservice conf_service;
#ifdef HC
struct s_cfgh323 conf_h323;
#endif
#ifdef SIP
struct s_cfgsip conf_sip;
#endif
#ifdef MGCP
struct s_cfgmgcp conf_mgcp;
#endif
unsigned char conf_speedDial[MAX_SPEED_DIAL_KEY]; /* 速撥號碼,此處保存
對應phonebook記錄的數組下標 */
unsigned char bootFileHead[4];
unsigned char appFileHead[4];
#ifdef HC
unsigned char ifEchoInput; /* 輸入是否回顯 */
#endif
char noInUse; /* 速撥號碼的第一個字段保存在
phoneconfig的最后一個字節,而在
初始化時這個字節被用來作為
字符串結束標志0。*/
};
extern struct s_config phoneconfig;
#ifdef __cplusplus
}
#endif
#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -