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

📄 tupptl.hpp

📁 ABis无线接口全套资料
💻 HPP
字号:
/* ======================================================================== *\
 |
 |
 |  JOYIT Communication Technology
 |  Copyright (C)  2003~2006,  All Right Reserved.
 |
 |  System: Programmable Signaling Gateway
 |  Sub-system: ISUP
 |  Filename: isupptl.cpp
 |  Environment: Red Hat Linux 7.2 & GNU C/C++ Compiler 2.96
 |  Function description: ISUP Protocol class
 |
\* ======================================================================== */

#ifndef _TUPPTL_HPP
#define _TUPPTL_HPP

#ifndef _PUBDEF_HPP
#include "pubdef.hpp"
#endif

#ifndef _PTLBASE_HPP
#include "ptlbase.hpp"
#endif

class CTupPdu : public CPduBase
{
public:
	CTupPdu( );
	CTupPdu(CTupPdu& s);
	CTupPdu(UINT8 pt, UINT8 pv, UINT8 pcf, UINT16 mt);
	~CTupPdu( );

public:
	static UINT16	TupMsg2JoyitMsg[MAX_MSG];	// Index means ISUP message value, array element value means Joyit ISUP message value.
	static UINT8	JoyitMsg2TupMsg[MAX_MSG];	// Index means Joyit ISUP message value, array element value means ISUP message value.

	static void		InitStaticData( );			// Initialize static data member.
	static void		InitTupMsg( );			// Initialize IsupMsg2JoyitMsg array.
	static void		InitJoyitMsg( );			// Initialize JoyitMsg2IsupMsg array.
	
	static UINT16	ToJoyitMsg(UINT8 id);	// ISUP message type to ISUP API message index.
	static uchar	ToTupMsg(UINT16 id);	// ISUP API message index to ISUP message type.

//public:
	virtual int Unpacked(char  * ptr, UINT16 len, UINT8 mod=MOD_JOYIT);
	virtual char 	* OutPut(UINT16& len, UINT8 mod=MOD_JOYIT);

public:
	virtual int DecomposeTupPdu(char  * ptr, UINT16 len);
	virtual char * ComposeTupPdu(UINT16& len);
	char  * ComposeJoyitApi(UINT16 & len); // Add 2005-11-20, by Wu jianjin.

public:
	unsigned char UnwrapCalledPartyNumber(unsigned char *src, unsigned char len, unsigned char *dst);
	void UnwrapOriginalCalledPartyNumber(unsigned char *src, unsigned char *para,unsigned char *dst);
	void UnwrapCallingPartyNumber(unsigned char *src, unsigned char *para,unsigned char *dst);

//public:
	unsigned short WrapCalledPartyNumber(unsigned char *src, unsigned short len, unsigned char *dst);
	unsigned short WrapOriginalCalledPartyNumber(unsigned char *src, unsigned short len, unsigned char *dst);
	unsigned short WrapCallingPartyNumber(unsigned char *src, unsigned short len, unsigned char *dst);

private: // Add 2005-11-19, by Wujianjin.
	UINT16	ownedPcmId; // This message owned to which Global PCM ID.
	UINT8	ownedTsId;  // This message owned to which time slot.
	UINT8	rlgType; // RLG response for ? 0: CLF; 1: RSC.

	
public: // Add 2005-11-19, by Wujianjin.
	UINT16 WhatPrimitive(UINT16 mType, UINT8 ri=0); // Input Joyit API message type, return what Joyit API primitive type belong to.

	void OwnedPcm(UINT16 pcm)
	{
		ownedPcmId = pcm;
	}

	void OwnedTs(UINT8 ts)
	{
		ownedTsId = ts;
	}

	void WhoOwned(UINT16& pcm, UINT8& ts)
	{
		pcm = ownedPcmId;
		ts = ownedTsId;
	}

	UINT16 GetPcm( )
	{
		return ownedPcmId;
	}

	UINT8 GetTs( )
	{
		return ownedTsId;
	}
	void SetRLG4RSC( )
	{		rlgType = 1;
	}};

// Declare TUP signal message type.
//
#define TUP_IAM		0x11
#define TUP_IAI		0x21
#define TUP_SAM		0x31
#define TUP_SAO		0x41
#define TUP_GSM		0x12
#define TUP_COT		0x32
#define TUP_CCF		0x42
#define TUP_GRQ		0x13
#define TUP_ACM		0x14
#define TUP_CHG     0x24
#define TUP_SEC		0x15
#define TUP_CGC		0x25
#define TUP_NNC		0x35
#define TUP_ADI		0x45
#define TUP_CFL		0x55
#define TUP_SSB		0x65
#define TUP_UNN		0x75
#define TUP_LOS		0x85
#define TUP_SST		0x95
#define TUP_ACB		0xA5
#define TUP_DPN		0xB5
#define TUP_EUM		0xF5
#define TUP_ANU		0x06
#define TUP_ANC		0x16
#define TUP_ANN		0x26
#define TUP_CBK		0x36
#define TUP_CLF		0x46
#define TUP_RAN		0x56
#define TUP_FOT		0x66
#define TUP_CCL		0x76
#define TUP_RLG		0x17
#define TUP_BLO		0x27
#define TUP_BLA		0x37
#define TUP_UBL		0x47
#define TUP_UBA		0x57
#define TUP_CCR		0x67
#define TUP_RSC		0x77
#define TUP_MGB		0x18
#define TUP_MBA		0x28
#define TUP_MGU		0x38
#define TUP_MUA		0x48
#define TUP_HGB		0x58
#define TUP_HBA		0x68
#define TUP_HGU		0x78
#define TUP_HUA		0x88
#define TUP_GRS		0x98
#define TUP_GRA		0xA8
#define TUP_SGB		0xB8
#define TUP_SBA		0xC8
#define TUP_SGU		0xD8
#define TUP_SUA		0xE8
#define TUP_ACC		0x1A
#define TUP_MPM		0x2C
#define TUP_OPR		0x1D
#define TUP_SLB	    0x1E
#define TUP_STB		0x2E
#define TUP_MAL	    0x1F

#endif


// ------------------------------------------------------------------------
//
//  Revision list.
//  ==============
//
//  1.0,	2005-12-12,	Wang jinquan
//      Initial version.
//
//	2.0,	2005-12-25,	Wu jianjin
//		Fix logical error.
// -------------------------------------------------------------------

⌨️ 快捷键说明

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