⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 voip_api.h

📁 telcobridges voip develop
💻 H
📖 第 1 页 / 共 2 页
字号:
/*--------------------------------------------------------------------------------------------------------------------------------
 |
 |	Project:    	VOIP sample
 |
 |	Filename:   	voip_api.h
 |
 |	Copyright:  	TelcoBridges 2002-2004, All Rights Reserved
 |
 |	Description:	This file contains definitions, enums and structs and messages
 |					that are exchanged between the main thread and the CLI.
 |
 |	Notes:      	Tabs = 4
 |
 *-------------------------------------------------------------------------------------------------------------------------------
 |
 |	Revision:   	$Revision: 1.22 $
 |
 *------------------------------------------------------------------------------------------------------------------------------*/


/*--------------------------------------------------------------------------------------------------------------------------------
 |  Define header file
 *------------------------------------------------------------------------------------------------------------------------------*/
#ifndef __VOIP_API_H__
#define __VOIP_API_H__


/*--------------------------------------------------------------------------------------------------------------------------------
 |  C++ support
 *------------------------------------------------------------------------------------------------------------------------------*/
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */


/*--------------------------------------------------------------------------------------------------------------------------------
 |  Global variables
 *------------------------------------------------------------------------------------------------------------------------------*/


/*--------------------------------------------------------------------------------------------------------------------------------
 |  Defines
 *------------------------------------------------------------------------------------------------------------------------------*/

/* Messages to control the application in general */
#define	VOIP_MSG_ID_OP_QUIT						TBX_MSG_ID_GEN (TBX_ID_CLASS_TBX_APPS_VOIP_PRIVATE,	0x100)
#define	VOIP_MSG_ID_OP_SET_TRACE_LEVEL			TBX_MSG_ID_GEN (TBX_ID_CLASS_TBX_APPS_VOIP_PRIVATE,	0x101)
#define	VOIP_MSG_ID_OP_RELOAD_CONFIG			TBX_MSG_ID_GEN (TBX_ID_CLASS_TBX_APPS_VOIP_PRIVATE,	0x102)
#define	VOIP_MSG_ID_OP_POLL_STREAM_RES_STATS	TBX_MSG_ID_GEN (TBX_ID_CLASS_TBX_APPS_VOIP_PRIVATE,	0x103)
#define VOIP_MSG_ID_OP_START_STRESS_TEST		TBX_MSG_ID_GEN (TBX_ID_CLASS_TBX_APPS_VOIP_PRIVATE,	0x104)
#define VOIP_MSG_ID_OP_STOP_STRESS_TEST			TBX_MSG_ID_GEN (TBX_ID_CLASS_TBX_APPS_VOIP_PRIVATE,	0x105)
#define VOIP_MSG_ID_OP_RESET_STRESS_TEST_STATS	TBX_MSG_ID_GEN (TBX_ID_CLASS_TBX_APPS_VOIP_PRIVATE, 0x106)
#define VOIP_MSG_ID_OP_START_DEMO				TBX_MSG_ID_GEN (TBX_ID_CLASS_TBX_APPS_VOIP_PRIVATE,	0x107)
#define VOIP_MSG_ID_OP_STOP_DEMO				TBX_MSG_ID_GEN (TBX_ID_CLASS_TBX_APPS_VOIP_PRIVATE,	0x108)
#define VOIP_MSG_ID_OP_NEXT_DEMO_STEP			TBX_MSG_ID_GEN (TBX_ID_CLASS_TBX_APPS_VOIP_PRIVATE,	0x109)
#define	VOIP_MSG_ID_OP_ALLOCATE_CONNECTION		TBX_MSG_ID_GEN (TBX_ID_CLASS_TBX_APPS_VOIP_PRIVATE,	0x10A)
#define VOIP_MSG_ID_OP_CLEAR_CONNECTION			TBX_MSG_ID_GEN (TBX_ID_CLASS_TBX_APPS_VOIP_PRIVATE,	0x10B)
#define VOIP_MSG_ID_OP_RESET_BERT_STATS			TBX_MSG_ID_GEN (TBX_ID_CLASS_TBX_APPS_VOIP_PRIVATE,	0x10C)

/* Message used for streaming */
#define VOIP_MSG_ID_OP_STREAM_GET_DATA_ADDR		TBX_MSG_ID_GEN (TBX_ID_CLASS_TBX_APPS_VOIP_PRIVATE,	0x1000)
#define VOIP_MSG_ID_OP_STREAM_STOP_CONFIRMED	TBX_MSG_ID_GEN (TBX_ID_CLASS_TBX_APPS_VOIP_PRIVATE,	0x1002)


/*--------------------------------------------------------------------------------------------------------------------------------
 |  Types
 *------------------------------------------------------------------------------------------------------------------------------*/


/*--------------------------------------------------------------------------------------------------------------------------------
 |  Messages
 *------------------------------------------------------------------------------------------------------------------------------*/

/*-------------------------------------------------------------------------------------------------------------------------------
 |
 |	Message:
 |		VOIP_MSG_ID_OP_QUIT
 |
 |	Description:
 |		This event is sent by the customer-defined application to the main state machine
 |		to quit the application.
 |
 |	Event parameters:
 |		un32MsgVersion			Should be 1
 |
 |	Notices:
 |		~
 |
 |	Compatibility:
 |		~
 |
 |	Side effects:
 |		~
 |
 *------------------------------------------------------------------------------------------------------------------------------*/
typedef struct _VOIP_EVT_OP_QUIT
{
	TBX_MSG_HEADER								Header;
	TBX_UINT32									un32MsgVersion;
	TBX_UINT32									un32Padding;

} VOIP_EVT_OP_QUIT, *PVOIP_EVT_OP_QUIT;

typedef union _VOIP_MSG_OP_QUIT
{
	TBX_MSG_HEADER								Header;
	VOIP_EVT_OP_QUIT							Event;

} VOIP_MSG_OP_QUIT, *PVOIP_MSG_OP_QUIT;

/*-------------------------------------------------------------------------------------------------------------------------------
 |
 |	Message:
 |		VOIP_MSG_ID_OP_SET_TRACE_LEVEL
 |
 |	Description:
 |		This event is sent by the customer-defined application to the main state machine
 |		to change the trace level .
 |
 |	Event parameters:
 |		un32MsgVersion			Should be 1
 |		un32DisplayTraceLevel	Trace level to set for display
 |		un32LogFileTraceLevel	Trace level to set for log file
 |
 |	Notices:
 |		~
 |
 |	Compatibility:
 |		~
 |
 |	Side effects:
 |		~
 |
 *------------------------------------------------------------------------------------------------------------------------------*/
typedef struct _VOIP_EVT_OP_SET_TRACE_LEVEL
{
	TBX_MSG_HEADER								Header;
	TBX_UINT32									un32MsgVersion;
	TBX_UINT32									un32DisplayTraceLevel;
	TBX_UINT32									un32LogFileTraceLevel;
	TBX_UINT32									un32Padding;

} VOIP_EVT_OP_SET_TRACE_LEVEL, *PVOIP_EVT_OP_SET_TRACE_LEVEL;

typedef union _VOIP_MSG_OP_SET_TRACE_LEVEL
{
	TBX_MSG_HEADER								Header;
	VOIP_EVT_OP_SET_TRACE_LEVEL					Event;

} VOIP_MSG_OP_SET_TRACE_LEVEL, *PVOIP_MSG_OP_SET_TRACE_LEVEL;

/*-------------------------------------------------------------------------------------------------------------------------------
 |
 |	Message:
 |		VOIP_MSG_ID_OP_RELOAD_CONFIG
 |
 |	Description:
 |		This event is sent by the customer-defined application to the main state machine
 |		to reload the application's configuration file.
 |
 |	Event parameters:
 |		un32MsgVersion			Should be 1
 |
 |	Notices:
 |		~
 |
 |	Compatibility:
 |		~
 |
 |	Side effects:
 |		~
 |
 *------------------------------------------------------------------------------------------------------------------------------*/
typedef struct _VOIP_EVT_OP_RELOAD_CONFIG
{
	TBX_MSG_HEADER								Header;
	TBX_UINT32									un32MsgVersion;
	TBX_UINT32									un32Padding;

} VOIP_EVT_OP_RELOAD_CONFIG, *PVOIP_EVT_OP_RELOAD_CONFIG;

typedef union _VOIP_MSG_OP_RELOAD_CONFIG
{
	TBX_MSG_HEADER								Header;
	VOIP_EVT_OP_RELOAD_CONFIG					Event;

} VOIP_MSG_OP_RELOAD_CONFIG, *PVOIP_MSG_OP_RELOAD_CONFIG;

/*-------------------------------------------------------------------------------------------------------------------------------
 |
 |	Message:
 |		VOIP_MSG_ID_OP_RESET_BERT_STATS
 |
 |	Description:
 |		This event is sent by the customer-defined application to the main state machine
 |		to reset bert statistics
 |
 |	Event parameters:
 |		un32MsgVersion			Should be 1
 |
 |	Notices:
 |		~
 |
 |	Compatibility:
 |		~
 |
 |	Side effects:
 |		~
 |
 *------------------------------------------------------------------------------------------------------------------------------*/
typedef struct _VOIP_EVT_OP_RESET_BERT_STATS
{
	TBX_MSG_HEADER								Header;
	TBX_UINT32									un32MsgVersion;

} VOIP_EVT_OP_RESET_BERT_STATS, *PVOIP_EVT_OP_RESET_BERT_STATS;

typedef union _VOIP_MSG_OP_RESET_BERT_STATS
{
	TBX_MSG_HEADER								Header;
	VOIP_EVT_OP_RESET_BERT_STATS				Event;

} VOIP_MSG_OP_RESET_BERT_STATS, *PVOIP_MSG_OP_RESET_BERT_STATS;

/*-------------------------------------------------------------------------------------------------------------------------------
 |
 |	Message:
 |		VOIP_MSG_ID_OP_POLL_STREAM_RES_STATS
 |
 |	Description:
 |		This event is sent by the customer-defined application to the main state machine
 |		to poll stream resource statistics.
 |
 |	Event parameters:
 |		un32MsgVersion			Should be 1
 |
 |	Notices:
 |		~
 |
 |	Compatibility:
 |		~
 |
 |	Side effects:
 |		~
 |
 *------------------------------------------------------------------------------------------------------------------------------*/
typedef struct _VOIP_EVT_OP_POLL_STREAM_RES_STATS
{
	TBX_MSG_HEADER								Header;
	TBX_UINT32									un32MsgVersion;
	TBX_BOOL									fGlobalStats;
	TB640_STREAM_INTERFACE_TYPE					Interface;
	TBX_UINT16									un16RxIPPort;
	TBX_UINT16									un16TxIPPort;
	TBX_BOOL									fResetStats;

} VOIP_EVT_OP_POLL_STREAM_RES_STATS, *PVOIP_EVT_OP_POLL_STREAM_RES_STATS;

typedef union _VOIP_MSG_OP_POLL_STREAM_RES_STATS
{
	TBX_MSG_HEADER								Header;
	VOIP_EVT_OP_POLL_STREAM_RES_STATS			Event;

} VOIP_MSG_OP_POLL_STREAM_RES_STATS, *PVOIP_MSG_OP_POLL_STREAM_RES_STATS;

/*-------------------------------------------------------------------------------------------------------------------------------
 |
 |	Message:
 |		VOIP_MSG_ID_OP_START_STRESS_TEST
 |
 |	Description:
 |		This event is sent by the customer-defined application to the main state machine
 |		to start stress test
 |
 |	Event parameters:
 |		FirstResClass						First resource class identifier
 |		pszStreamSocketIP					Stream socket IP address
 |		un32ConnectionsPerSecond			Connections per second
 |		un32MinConnectionDuration			Minimum connection duration
 |		un32MaxConnectionDuration			Maximum connection duration
 |		fAutoAbort							Automatically abort stress test on failure
 |		fClearOpenedConnectionUponStartup	Clear connection before starting stress-test
 |		fDoBertTests						Do BERT testing while doing stress-tests
 |		un32TestDurationInSec				Test duration in seconds
 |
 |	Notices:
 |		~
 |
 |	Compatibility:
 |		~
 |
 |	Side effects:
 |		~
 |
 *------------------------------------------------------------------------------------------------------------------------------*/
typedef struct _VOIP_EVT_OP_START_STRESS_TEST
{
	TBX_MSG_HEADER								Header;
	TBX_UINT32									un32MsgVersion;
	VOIP_RESOURCE_TYPE							FirstResType;
	TBX_CHAR									szStreamSocketIP[64];
	TBX_UINT32									un32ConnectionsPerSecond;
	TBX_UINT32									un32MinConnectionDuration;
	TBX_UINT32									un32MaxConnectionDuration;
	TBX_BOOL									fAutoAbort;
	TBX_BOOL									fClearOpenedConnectionUponStartup;
	TBX_BOOL									fDoBertTests;
	TBX_UINT32									un32TestDurationInSec;

} VOIP_EVT_OP_START_STRESS_TEST, *PVOIP_EVT_OP_START_STRESS_TEST;

typedef union _VOIP_MSG_OP_START_STRESS_TEST
{
	TBX_MSG_HEADER								Header;
	VOIP_EVT_OP_START_STRESS_TEST				Event;

} VOIP_MSG_OP_START_STRESS_TEST, *PVOIP_MSG_OP_START_STRESS_TEST;

/*-------------------------------------------------------------------------------------------------------------------------------
 |
 |	Message:
 |		VOIP_MSG_ID_OP_STOP_STRESS_TEST
 |
 |	Description:
 |		This event is sent by the customer-defined application to the main state machine
 |		to stop stress test
 |
 |	Event parameters:
 |		~
 |
 |	Notices:
 |		~
 |
 |	Compatibility:
 |		~
 |
 |	Side effects:
 |		~
 |
 *------------------------------------------------------------------------------------------------------------------------------*/
typedef struct _VOIP_EVT_OP_STOP_STRESS_TEST
{
	TBX_MSG_HEADER								Header;
	TBX_UINT32									un32MsgVersion;

} VOIP_EVT_OP_STOP_STRESS_TEST, *PVOIP_EVT_OP_STOP_STRESS_TEST;

typedef union _VOIP_MSG_OP_STOP_STRESS_TEST
{
	TBX_MSG_HEADER								Header;
	VOIP_EVT_OP_STOP_STRESS_TEST				Event;

} VOIP_MSG_OP_STOP_STRESS_TEST, *PVOIP_MSG_OP_STOP_STRESS_TEST;

/*-------------------------------------------------------------------------------------------------------------------------------
 |
 |	Message:
 |		VOIP_MSG_ID_OP_RESET_STRESS_TEST_STATS
 |
 |	Description:
 |		This event is sent by the customer-defined application to the main state machine
 |		to reset stress test stats
 |
 |	Event parameters:
 |		~
 |
 |	Notices:
 |		~

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -