q931ptl.hpp
来自「ABis无线接口全套资料」· HPP 代码 · 共 395 行 · 第 1/2 页
HPP
395 行
/* ======================================================================== *\ | | | JOYIT Communication Technology | Copyright (C) 2005, All Right Reserved. | | System: PSC | Sub-system: Q931 | Filename:Q931ptl.cpp | Environment: Red Hat Linux 7.2 & GNU C/C++ Compiler 2.96 | Function description: Q931 Protocol class |\* ======================================================================== */#ifndef _Q931PTL_HPP#define _Q931PTL_HPP#ifndef _PUBDEF_HPP#include "pubdef.hpp"#endif#ifndef _PTLBASE_HPP#include "ptlbase.hpp"#endifclass CQ931Pdu : public CPduBase{public: CQ931Pdu( ); CQ931Pdu(CQ931Pdu& s); // Copy construction function. Add 2005-11-04, by Wujianjin. CQ931Pdu(UINT8 pt, UINT8 pv, UINT8 pcf, UINT16 mt); ~CQ931Pdu( );public: static UINT8 Q931Ie2JoyitIe[MAX_IE]; // Index means Q931 IE value, array element value means Joyit Q931 IE value. static UINT8 JoyitIe2Q931Ie[MAX_IE]; // Index means Joyit Q931 IE value, array element value means Q931 IE value. static UINT16 Q931Msg2JoyitMsg[MAX_MSG]; // Index means Q931 message value, array element value means Joyit Q931 message value. static UINT8 JoyitMsg2Q931Msg[MAX_MSG]; // Index means Joyit Q931 message value, array element value means Q931 message value. static void InitStaticData( ); // Initialize static data member. static void InitQ931Ie( ); // Initialize Q931Ie2JoyitIe array. static void InitJoyitIe( ); // Initialize JoyitIe2Q931Ie array. static void InitQ931Msg( ); // Initialize Q931Msg2JoyitMsg array. static void InitJoyitMsg( ); // Initialize JoyitMsg2Q931Msg array. // static uchar SetJoyitIeType (UINT8 id); // Q931's IE to Q931 API's IE index. static uchar ToJoyitIe (UINT8 id); // Q931's IE to Q931 API's IE index. // static uchar ChangeToQ931IeType(UINT8 id); // Q931 API's IE index to Q931's IE. static uchar ToQ931Ie(UINT8 id); // Q931 API's IE index to Q931's IE. static UINT16 ToJoyitMsg(UINT8 id); // Q931 message type to Q931 API message index. static uchar ToQ931Msg(UINT16 id); // Q931 API message index to Q931 message type.public: virtual int Unpacked(char * ptr, UINT16 len); virtual char * Output(UINT16& len);public: virtual int DecomposeQ931Pdu(char * ptr, UINT16 len); virtual char * ComposeQ931Pdu(UINT16& len); char * ComposeJoyitApi(UINT16& len);public: // Add 2005-10-27, by Wujianjin. UINT16 WhatPrimitive(UINT16 mType, UINT8 ir=0); // Input Joyit API message type, return what Joyit API primitive type belong to.private: // Add 2005-10-27, by Wujianjin. UINT16 ownedPcmId; // This message owned to which PRI. UINT8 ownedTsId; // This message owned to which time slot. UINT16 linkId; // DSS1 link ID. Only useable in Q931 PDU. Add 2005-10-29, by Wujianjin.public: // Add 2005-10-27, by Wujianjin. void OwnedPri(UINT16 pcm) { ownedPcmId = pcm; } void OwnedTs(UINT8 ts) { ownedTsId = ts; } void OwnedDss1(UINT16 dlid) { linkId = dlid; } void WhoOwned(UINT16& pcm, UINT8& ts) { pcm = ownedPcmId; ts = ownedTsId; } UINT16 GetPri( ) { return ownedPcmId; } UINT8 GetTs( ) { return ownedTsId; } UINT8 GetDss1( ) { return linkId; } private: // Add 2005-10-28, by Wujianjin. UINT8 lengthOfCallReference; // Leng of call reference.public: // Add 2005-10-28, by Wujianjin. UINT8 GetProtocoldiscriminator( ) { // Only useable in Q931 PDU after unpacked the PDU. return Header[0]; } UINT8 GetLOCR( ) { // Only useable in Q931 PDU after unpacked the PDU. return lengthOfCallReference; } UINT8 GetCallFlag( ); // Only useable in Q931 PDU after unpacked the PDU. UINT16 GetCallReference( ); // Only useable in Q931 PDU after unpacked the PDU.//public:// void SortIeAscending( ); // Add 2005-11-03, by Wu jianjin. Because Q931 require all ie sort ascending.};//// Declare Q931 IE//#define Q931_IE_SGM 0x00 // Segmented message #define Q931_IE_BC 0x04 // Bearer capability#define Q931_IE_CAUSE 0x08 // Cause #define Q932_IE_EXTFAC 0x0d // Extended facility#define Q931_IE_CALLID 0x10 // Call identity#define Q932_IE_CALLSTATE 0x14 // Call state#define Q931_IE_CHNID 0x18 // Channel identification#define Q932_IE_FAC 0x1c // Facility#define Q931_IE_PI 0x1e // Progress Indicator#define Q931_IE_NWSF 0x20 // Network Specific Facilities#define Q931_IE_NTFIND 0x27 // Notification Indicator #define Q931_IE_DISPLAY 0x28 // Display#define Q931_IE_DATETIME 0x29 // Date/time#define Q931_IE_KB 0x2C // Keypad facility#define Q932_IE_INFOREQ 0x32 // Information request#define Q931_IE_SIGNAL 0x34 // Signal#define Q932_IE_FTACT 0x38 // Feature activation #define Q932_IE_FTIND 0x39 // Feature indication#define Q932_IE_SPIND 0x3a // Service profile identification#define Q932_IE_ENDID 0x3b // Endpoint identifier#define Q931_IE_INFRATE 0x40 // Information rate#define Q931_IE_E2ETD 0x42 // End-to-end transit delay #define Q931_IE_TDSAI 0x43 // Transit delay selection and indication#define Q931_IE_PLBP 0x44 // Packet layer binary parameters#define Q931_IE_PLWS 0x45 // Packet layer window size#define Q931_IE_PKTSIZE 0x46 // Packet size#define Q931_IE_CUG 0x47 // Closed User Group #define Q931_IE_RCI 0x4a // Reverse charge indication#define Q931_IE_CONUM 0x4c // Connected number#define Q931_IE_CONSUB 0x4d // Connected subaddress#define Q931_IE_CLNPRTNUM 0x6c // Calling Party Number#define Q931_IE_CLNPRTSUB 0x6d // Calling Party subaddress#define Q931_IE_CLDPRTNUM 0x70 // Called Party Number#define Q931_IE_CLDPRTSUB 0x71 // Called Party subaddress#define Q931_IE_RGN 0x74 // Redirecting Number#define Q931_IE_RNN 0x76 // Redirection Number#define Q931_IE_TNWS 0x78 // Transit Network Selection#define Q931_IE_RSTIND 0x79 // Restart indicator#define Q931_IE_LLC 0x7c // Low layer compatibility#define Q931_IE_HLC 0x7d // High layer compatibility #define Q931_IE_U2U 0x7e // User-to-user // Single octet IE. Specifical process.#define Q931_IE_RESERVED 0x80 // Reserved.#define Q931_IE_SHIFT 0x90 // 0x9f // Shift#define Q931_IE_MOREDATA 0xA0 // 0x20 // More data#define Q931_IE_SNDCMP 0xA1 // 0x21 // Sending complete#define Q931_IE_CNGL 0xB0 // 0x0b // Congestion level#define Q931_IE_RPTIND 0xD0 // 0x0d // Repeat indicator// // Declare Q931 signal message type.//// Call establishment message#define Q931_MSG_ALERTING 0x01#define Q931_MSG_CALL_PROC 0x02#define Q931_MSG_PROGRESS 0x03#define Q931_MSG_SETUP 0x05 #define Q931_MSG_SETUP_ACK 0x0d#define Q931_MSG_CONNECT 0x07#define Q931_MSG_CONNECT_ACK 0x0f// Call information phase messages#define Q931_MSG_USER_INF 0x20#define Q931_MSG_SUSPEND_REJ 0x21
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?