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

📄 megacomgc.h

📁 h.248协议源码
💻 H
字号:
/******************************************************************************/
/* filename   megacomgc.h                                                   */
/*                                                                            */
/* Header file for a sample application level protocol where 2 MGs are        */
/* controlled by a single MGC using underlying megaco protocol                */
/******************************************************************************/
#include "rvcore.h"
#include "rvlog.h"
#include "rvstdiologlistener.h"
#include "rvfileloglistener.h"
#include "rvmegacostack.h"
#include "rvmegacoentity.h"
#include "rvmegacosystem.h"
#include "rvmegacoobjects.h"
#include "rvmegacoerrors.h"
#include "rvmd5.h"
#include "rvtimer.h"
#include "rvqueue.h"
#include <stdio.h>

#define  MGC_TEXT_ENCODED_PORT    2944
#define  MGC_BINARY_ENCODED_PORT  2945 
#define  NO_EVENT                 0 
#define  ANALOG_PHONE_TYPE        4
#define  MAX_IP_ADDRESS_LEN       16
    
#ifdef RV_PERFORMANCETEST_ON
#define  MAX_TERMINATIONS         500
#else
#define  MAX_TERMINATIONS         10
#endif

/* Note: typically we"ll have many terminations per MG, 
   and a list of MGs indexes to quickly locate the beggining
   of the terminations of every MG */
#define  MAX_MGS                  10

#define  CREATE_COMMAND_REPLY     1         /* Appl. asks to create           */
                                            /* default reply                  */
#define  SEND_COMMAND_REPLY       2         /* Appl. sends formatted command  */
                                            /* reply                          */
#define  SEND_COMMAND             1         /* Application sends 1 command    */
#define  SEND_ACTION              2         /* Aplication sends an action that*/
                                            /* may contain multiple commands  */

enum appl_states
    {
    S_IDLE_DISCONNECTED      =    1,        /* Protocol is idle, waiting for  */
                                            /* OFF_HOOK event                 */
    S_WAITING_FOR_LOCAL_SETUP,              /* Protocol is completing local   */
                                            /* telephone connection setup     */
    S_WAITING_FOR_REMOTE_SETUP,             /* Protocol is completing remote  */
                                            /* telephone connection setup     */
    S_CONNECTED                             /* Telephones are connected       */
    } applStates;

#define MAX_APPL_STATES           4

enum appl_events
    {
    E_SERVICE_CHANGE_IND    =     1,        /* Service change of any kind     */
    E_ON_HOOK_LISTEN_REQ,                   /* Prepare the phone to listen for*/ 
                                            /* on_hook event                  */
    E_OFF_HOOK_LISTEN_REQ,                  /* Prepare the phone to listen for*/ 
                                            /* off_hook event                 */
    E_DIAL_NUMBER_IND,                      /* The caller dials the number    */
    E_RING_SIGNAL_REQ,                      /* Send ring signal to called tel.*/
    E_RING_SIGNAL_RESP,                     /* Get reply from remote tel.     */
    E_BUSY_SIGNAL_RESP,                     /* Send busy signal to local if   */
                                            /* remote is busy                 */
    E_ERROR_MSG_RESP,                       /* Send "reorder" msg to local if */
                                            /* call cannot be completed       */
    E_STOP_RING_SIGNAL_REQ,                 /* Stop ring signal on called tel.*/
    E_STOP_RING_TONE_REQ,                   /* Stop tone signal on calling tel*/
    E_ON_HOOK_DISC_IND,                     /* One of the tels. hangs up      */
    E_TIMEOUT, 
    E_ILLEGAL,
    E_IMPOSSIBLE,
    E_RECEIVE_REQUEST,
    E_RECEIVE_REPLY,
    E_GO_IN_SERVICE,
    E_GO_OUT_OF_SERVICE,
    E_LOCAL_CONNECT,
    E_REMOTE_CONNECT,
    E_APPL_SPECIAL,
    E_SWITCH_TERMINATION,
    E_SEND_REPLY,
    E_WRONG_NUMBER_REQ,
    E_DO_CLEANUP
    } applEvents;

#define MAX_APPL_EVENTS          25

enum appl_actions
    {
    A_SERVICE_CHANGE_IND,
    A_APPL_SPECIAL,
    A_ON_HOOK_LISTEN_REQ,                                 
    A_OFF_HOOK_LISTEN_REQ,                                  
    A_DIAL_NUMBER_IND,                               
    A_RING_SIGNAL_REQ,                               
    A_RING_SIGNAL_RESP,                                
    A_BUSY_SIGNAL_RESP2,                                
    A_BUSY_SIGNAL_RESP3,                                
    A_ERROR_MSG_RESP,                                 
    A_STOP_RING_SIGNAL_REQ,                    
    A_STOP_RING_SIGNAL_REQ2,                    
    A_STOP_RING_TONE_REQ,                         
    A_ON_HOOK_DISC_IND2,                                                        
    A_ON_HOOK_DISC_IND4,                            
    A_TIMEOUT,              
    A_ILLEGAL,              
    A_ILLEGAL1,              
    A_IMPOSSIBLE,              
    A_RECEIVE_REQUEST1,     
    A_RECEIVE_REQUEST2,
    A_RECEIVE_REQUEST3,
    A_RECEIVE_REQUEST4, 
    A_RECEIVE_REPLY,
    A_RECEIVE_REPLY3,
    A_GO_IN_SERVICE,
    A_GO_OUT_OF_SERVICE,
    A_LOCAL_CONNECT,
    A_REMOTE_CONNECT,
    A_SEND_REPLY,
    A_SET_RTP_TERMINATION,
    A_SWITCH_TERMINATION2,
    A_SWITCH_TERMINATION3,
    A_SWITCH_TERMINATION4,
    A_WRONG_NUMBER_REQ,
    A_DO_NOTHING,
    A_DO_CLEANUP
    } applActions;









⌨️ 快捷键说明

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