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

📄 ss7tranpar1.cpp

📁 VC6.0环境下的ss7isup部分的信令解释程序
💻 CPP
📖 第 1 页 / 共 3 页
字号:


#include "stdafx.h"
#include "ss7tran.h"
#include "ss7tranDlg.h"
#include "isup_def.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

extern char strchangehex(CString str1);


void CSs7tranDlg::tranpar_Access_delivery_info(CString str)
{
	long lpar;
	long ltemp,tt;
	long i;
	CString stroutput;
	CListBox *pCtrl = (CListBox *)GetDlgItem( IDC_LIST1 ) ; 	

	lpar=strchangehex(str);

	stroutput=str;
	stroutput+=":Access delivery information";
	pCtrl->AddString(stroutput);


	stroutput=strbithead;
	stroutput+="bit A:Access delivery indicator";
	pCtrl->AddString(stroutput);
	ltemp=(lpar&1);
	stroutput=strtranhead;
	switch (ltemp)
	{
		case 0:
			stroutput+="0__No set-up message generated";
		break;
		case 1:
			stroutput="1__Set-up message generated";
		break;
		default:
		break;
	}
	pCtrl->AddString(stroutput);

	lpar>>=1;
	stroutput=strbithead;
	stroutput="bit H-B:not used";
	tt=0x40;
	stroutput=strtranhead;
	for(i=0;i<7;i++)
	{
		ltemp=(lpar&tt)>>(6-i);
		switch (ltemp)
		{
			case 0:
				stroutput="0";
			break;
			case 1:
				stroutput="1";
			break;
			default:
			break;
		}
		tt>>=1;
	}
	pCtrl->AddString(stroutput);
}

void CSs7tranDlg::tranpar_Access_transport(CString str)
{
}

void CSs7tranDlg::tranpar_Automatic_congestion_level(CString str)
{
	long lpar;
	long ltemp,tt;
	long i;
	CString stroutput;
	CListBox *pCtrl = (CListBox *)GetDlgItem( IDC_LIST1 ) ; 	

	lpar=strchangehex(str);

	stroutput=str;
	stroutput+=":Automatic congestion level";
	pCtrl->AddString(stroutput);

	stroutput=strbithead;
	stroutput+="bit HGFEDCBA:Automatic congestion level";
	pCtrl->AddString(stroutput);
	tt=0x80;
	stroutput=strtranhead;
	for(i=0;i<8;i++)
	{
		ltemp=(lpar&tt)>>(7-i);
		switch (ltemp)
		{
			case 0:
				stroutput+="0";
			break;
			case 1:
				stroutput+="1";
			break;
			default:
			break;
		}
		tt>>=1;
	}
	if (lpar==1)
		stroutput+="__Congestion level 1 exceeded";
	else if (lpar==2)
		stroutput+="__Congestion level 2 exceeded";
	else
		stroutput+="__spare";
	pCtrl->AddString(stroutput);
}

void CSs7tranDlg::tranpar_Backward_call_indicators(CString str)
{
	long lpar;
	long ltemp;
	CString str1;
	CString stroutput;
	CListBox *pCtrl = (CListBox *)GetDlgItem( IDC_LIST1 ) ; 	

	stroutput=str;
	stroutput+=":Backward call indicators";
	pCtrl->AddString(stroutput);

	str1=str.Left(2);
	str.Delete(0,3);
	lpar=strchangehex(str1);


	stroutput=strbithead;
	stroutput+="bit BA:Charge indicator";
	pCtrl->AddString(stroutput);

	stroutput=strtranhead;
	ltemp=(lpar&3);
	lpar>>=2;	
	switch (ltemp)
	{
		case 0:
			stroutput+="00__no indication";
		break;
		case 1:
			stroutput+="01__no charge";
		break;
		case 2:
			stroutput+="10__charge";
		break;
		case 3:
			stroutput+="11__spare";
		break;
		default:
		break;
	}
	pCtrl->AddString(stroutput);

	stroutput=strbithead;
	stroutput+="bit DC:Called party's status indicator";
	pCtrl->AddString(stroutput);
	stroutput=strtranhead;
	ltemp=(lpar&3);
	lpar>>=2;	
	switch (ltemp)
	{
		case 0:
			stroutput+="00__no indication";
		break;
		case 1:
			stroutput+="01__subscriber free";
		break;
		case 2:
			stroutput+="10__connect when free";
		break;
		case 3:
			stroutput+="11__spare";
		break;
		default:
		break;
	}
	pCtrl->AddString(stroutput);

	stroutput=strbithead;
	stroutput+="bit FE:Called party's category indicator";
	pCtrl->AddString(stroutput);
	stroutput=strtranhead;
	ltemp=(lpar&3);
	lpar>>=2;	
	switch (ltemp)
	{
		case 0:
			stroutput+="00__no indication";
		break;
		case 1:
			stroutput+="01__ordinary subscriber";
		break;
		case 2:
			stroutput+="10__payphone";
		break;
		case 3:
			stroutput+="11__spare";
		break;
		default:
		break;
	}
	pCtrl->AddString(stroutput);

	stroutput=strbithead;
	stroutput+="bit HG:End-to-end method indicator";
	pCtrl->AddString(stroutput);
	stroutput=strtranhead;
	ltemp=(lpar&3);
	lpar>>=2;	
	switch (ltemp)
	{
		case 0:
			stroutput+="00__no end-to-end method available (only link-by-link method available)";
		break;
		case 1:
			stroutput+="01__pass along method available";
		break;
		case 2:
			stroutput+="10__SCCP method available";
		break;
		case 3:
			stroutput+="11__pass along and SCCP methods available ";
		break;
		default:
		break;
	}
	pCtrl->AddString(stroutput);

	str1=str.Left(2);
	str.Delete(0,2);
	lpar=strchangehex(str1);
	
	stroutput=strbithead;
	stroutput+="bit I:Interworking indicator ";
	pCtrl->AddString(stroutput);
	stroutput=strtranhead;
	ltemp=(lpar&1);
	lpar>>=1;	
	switch (ltemp)
	{
		case 0:
			stroutput+="0__no interworking encountered";
		break;
		case 1:
			stroutput+="1__interworking encountered";
		break;
		default:
		break;
	}
	pCtrl->AddString(stroutput);

	stroutput=strbithead;
	stroutput+="bit J:End-to-end information indicator ";
	pCtrl->AddString(stroutput);
	stroutput=strtranhead;
	ltemp=(lpar&1);
	lpar>>=1;	
	switch (ltemp)
	{
		case 0:
			stroutput+="0__no end-to-end information available";
		break;
		case 1:
			stroutput+="1__end-to-end information available";
		break;
		default:
		break;
	}
	pCtrl->AddString(stroutput);

	stroutput=strbithead;
	stroutput+="bit K:ISDN User Part indicator ";
	pCtrl->AddString(stroutput);
	stroutput=strtranhead;
	ltemp=(lpar&1);
	lpar>>=1;	
	switch (ltemp)
	{
		case 0:
			stroutput+="0__ISDN User Part not used all the way";
		break;
		case 1:
			stroutput+="1__ISDN User Part used all the way";
		break;
		default:
		break;
	}
	pCtrl->AddString(stroutput);

	stroutput=strbithead;
	stroutput+="bit L:Holding indicator (national use) ";
	pCtrl->AddString(stroutput);
	stroutput=strtranhead;
	ltemp=(lpar&1);
	lpar>>=1;	
	switch (ltemp)
	{
		case 0:
			stroutput+="0__holding not requested";
		break;
		case 1:
			stroutput+="1__holding requested";
		break;
		default:
		break;
	}
	pCtrl->AddString(stroutput);

	stroutput=strbithead;
	stroutput+="bit M:ISDN access indicator ";
	pCtrl->AddString(stroutput);
	stroutput=strtranhead;
	ltemp=(lpar&1);
	lpar>>=1;	
	switch (ltemp)
	{
		case 0:
			stroutput+="0__terminating access non-ISDN";
		break;
		case 1:
			stroutput+="1__terminating access ISDN";
		break;
		default:
		break;
	}
	pCtrl->AddString(stroutput);

	stroutput=strbithead;
	stroutput+="bit N:Echo control device indicator";
	pCtrl->AddString(stroutput);
	stroutput=strtranhead;
	ltemp=(lpar&1);
	lpar>>=1;	
	switch (ltemp)
	{
		case 0:
			stroutput+="0__incoming half echo control device not included";
		break;
		case 1:
			stroutput+="1__incoming half echo control device included";
		break;
		default:
		break;
	}
	pCtrl->AddString(stroutput);

	stroutput=strbithead;
	stroutput+="bit PO:SCCP method indicator (Note 2)";
	pCtrl->AddString(stroutput);
	stroutput=strtranhead;
	ltemp=(lpar&1);
	lpar>>=1;	
	switch (ltemp)
	{
		case 00:
			stroutput+="00__no indication";
		break;
		case 01:
			stroutput+="01__connectionless method available";
		break;
		case 10:
			stroutput+="10__connection oriented method available";
		break;
		case 11:
			stroutput+="11__connectionless and connection oriented methods available";
		break;
		default:
		break;
	}
	pCtrl->AddString(stroutput);
}

void CSs7tranDlg::tranpar_Call_diversion_information(CString str)
{
	long lpar;
	long ltemp,tt;
	long i;
	CString str1;
	CString stroutput;
	CListBox *pCtrl = (CListBox *)GetDlgItem( IDC_LIST1 ) ; 	

	stroutput=str;
	stroutput+=":Call diversion information";
	pCtrl->AddString(stroutput);

	
	str1=str.Left(2);
	str.Delete(0,2);
	lpar=strchangehex(str1);

	stroutput=strbithead;
	stroutput+="bit CBA:Notification subscription options";
	pCtrl->AddString(stroutput);
	stroutput=strtranhead;
	tt=0x4;
	for(i=0;i<3;i++)
	{
		ltemp=(lpar&tt)>>(2-i);
		switch (ltemp&1)
		{
			case 0:
				stroutput+="0";
			break;
			case 1:
				stroutput+="1";
			break;
			default:
			break;
		}
		tt>>=1;
	}
	if ((lpar&0x7)==0)
		stroutput+="__Unknown";
	else if ((lpar&0x7)==1)
		stroutput+="__presentation not allowed";
	else if ((lpar&0x7)==2)
		stroutput+="__presentation allowed with redirection number";
	else if ((lpar&0x7)==3)
		stroutput+="__presentation allowed without redirection number";
	else
		stroutput+="__spare";
	pCtrl->AddString(stroutput);
	lpar>>=3;


	stroutput=strbithead;
	stroutput+="bit GFED:Redirection reason";
	pCtrl->AddString(stroutput);
	stroutput=strtranhead;
	tt=0x8;
	for(i=0;i<4;i++)
	{
		ltemp=(lpar&tt)>>(3-i);
		switch (ltemp&1)
		{
			case 0:
				stroutput+="0";
			break;
			case 1:
				stroutput+="1";
			break;
			default:
			break;
		}
		tt>>=1;
	}
	if ((lpar&0x0F)==0)
		stroutput+="__Unknown";
	else if ((lpar&0x0F)==1)
		stroutput+="__User busy";
	else if ((lpar&0x0F)==2)
		stroutput+="__no reply";
	else if ((lpar&0x0F)==3)
		stroutput+="__unconditional";
	else if ((lpar&0x0F)==4)
		stroutput+="__deflection during alerting";
	else if ((lpar&0x0F)==5)
		stroutput+="__deflection immediate response";
	else if ((lpar&0x0F)==6)
		stroutput+="__mobile subscriber not reachable";
	else
		stroutput+="__spare";
	pCtrl->AddString(stroutput);
	lpar>>=4;

	stroutput=strbithead;
	stroutput+="bit H:Spare";
	pCtrl->AddString(stroutput);

	stroutput=strtranhead;
	switch (lpar&1)
	{
		case 0:
			stroutput+="0";
		break;
		case 1:
			stroutput+="1";
		break;
		default:
		break;
	}
	pCtrl->AddString(stroutput);
	
}

void CSs7tranDlg::tranpar_Call_history_information(CString str)
{

}

void CSs7tranDlg::tranpar_Call_reference(CString str)
{
	long lpar;
	long ltemp,tt;
	long i;
	CString str1;
	CString strtemp;
	CString stroutput;
	CListBox *pCtrl = (CListBox *)GetDlgItem( IDC_LIST1 ) ; 	

	stroutput=str;
	stroutput+=":Call reference";
	pCtrl->AddString(stroutput);


	lpar=0;

	for(i=0;i<4;i++)
	{
		str1=str.Left(2);
		str.Delete(0,3);
		lpar=strchangehex(str1);
		lpar*=256;
	}

	stroutput=strbithead;
	stroutput+="byte3-0 :Call identity";
	pCtrl->AddString(stroutput);

	stroutput=strtranhead;
	tt=0x80000000;
	for(i=0;i<32;i++)
	{
		ltemp=(lpar&tt)>>(31-i);
		switch (ltemp&1)
		{
			case 0:
				stroutput+="0";
			break;
			case 1:
				stroutput+="1";
			break;
			default:
			break;
		}
		tt>>=1;
	}
	strtemp.Format("%d",lpar);
	stroutput+="__";
	stroutput+=strtemp;
	pCtrl->AddString(stroutput);

	str1=str.Left(2);
	lpar=strchangehex(str1);

	stroutput=strbithead;
	stroutput+="bitFEDCBA :Point code";
	pCtrl->AddString(stroutput);

	stroutput=strtranhead;
	tt=0x20;
	for(i=0;i<6;i++)
	{
		ltemp=(lpar&tt)>>(5-i);
		switch (ltemp&1)
		{
			case 0:
				stroutput+="0";
			break;
			case 1:
				stroutput+="1";
			break;
			default:
			break;
		}
		tt>>=1;
	}
	strtemp.Format("%d",(lpar&0x3F));
	stroutput+="__";
	stroutput+=strtemp;
	pCtrl->AddString(stroutput);
	lpar>>=6;

	stroutput=strbithead;
	stroutput+="bitHG :Spare";
	pCtrl->AddString(stroutput);

	stroutput=strtranhead;
	tt=0x2;
	for(i=0;i<2;i++)
	{
		ltemp=(lpar&tt)>>(1-i);
		switch (ltemp&1)
		{
			case 0:
				stroutput+="0";
			break;
			case 1:
				stroutput+="1";
			break;
			default:
			break;
		}
		tt>>=1;
	}
	pCtrl->AddString(stroutput);
}

void CSs7tranDlg::tranpar_Called_party_number(CString str)
{
	long lpar;
	long ltemp,tt;
	long i;
	long ladroande;
	CString str1;
	CString stroutput;
	CString strtemp;
	CListBox *pCtrl = (CListBox *)GetDlgItem( IDC_LIST1 ) ; 	

	stroutput=str;
	stroutput+=":Called party number";
	pCtrl->AddString(stroutput);

	str1=str.Left(2);
	str.Delete(0,3);
	lpar=strchangehex(str1);

	stroutput=strbithead;
	stroutput+="byte 1:";
	stroutput+=str1;
	pCtrl->AddString(stroutput);

	stroutput=strbithead;
	stroutput+="bit GFEDCBA :Nature of address indicator";
	pCtrl->AddString(stroutput);
	tt=0x40;
	stroutput=strtranhead;
	for(i=0;i<7;i++)
	{
		ltemp=(lpar&tt)>>(6-i);
		switch (ltemp&1)
		{
			case 0:
				stroutput+="0";
			break;
			case 1:
				stroutput+="1";
			break;
			default:
			break;
		}
		tt>>=1;
	}
	if ((lpar&0x7F)==0)
		stroutput+="__spare";
	else if ((lpar&0x7F)==1)
		stroutput+="__subscriber number";
	else if ((lpar&0x7F)==2)
		stroutput+="__unknown";
	else if ((lpar&0x7F)==3)
		stroutput+="__national (significant) number";
	else if ((lpar&0x7F)==4)
		stroutput+="__international number";
	else if (((lpar&0x7F)>=5) && ((lpar&0x7F)<=0x6F))
		stroutput+="__spare";
	else if (((lpar&0x7F)>=0x70) && ((lpar&0x7F)<=0x7E))
		stroutput+="__reserved for national use";
	else if ((lpar&0x7F)==0x7F)
		stroutput+="__spare";
	else
		stroutput+="__spare";
	pCtrl->AddString(stroutput);
	
	stroutput=strbithead;
	stroutput+="bit F :Odd/even indicator";
	pCtrl->AddString(stroutput);
	stroutput=strtranhead;
	if ((lpar&0x80)==0x80)
	{
		stroutput+="1__odd number of address signals";
		ladroande=1;
	}
	else
	{
		stroutput+="0__even number of address signals";
		ladroande=0;
	}
	pCtrl->AddString(stroutput);


	str1=str.Left(2);
	str.Delete(0,3);
	lpar=strchangehex(str1);
	stroutput=strbithead;
	stroutput+="byte 2:";
	stroutput+=str1;
	pCtrl->AddString(stroutput);

	stroutput=strbithead;
	stroutput+="bit DCBA :spare";
	pCtrl->AddString(stroutput);
	tt=0x8;
	stroutput=strtranhead;
	for(i=0;i<4;i++)
	{
		ltemp=(lpar&tt)>>(3-i);
		switch (ltemp&1)
		{
			case 0:
				stroutput+="0";
			break;
			case 1:
				stroutput+="1";
			break;
			default:
			break;
		}
		tt>>=1;
	}
	pCtrl->AddString(stroutput);
	
	lpar>>=4;
	stroutput=strbithead;
	stroutput+="bit GHE :Numbering plan indicator";
	pCtrl->AddString(stroutput);
	tt=0x4;
	stroutput=strtranhead;
	for(i=0;i<3;i++)
	{
		ltemp=(lpar&tt)>>(2-i);
		switch (ltemp&1)
		{
			case 0:
				stroutput+="0";
			break;
			case 1:
				stroutput+="1";
			break;
			default:
			break;
		}
		tt>>=1;
	}
	switch (lpar&0x7)
	{
		case 0:
		case 2:
		case 7:
			stroutput+="__spare";
		break;
		case 1:
			stroutput+="__ISDN (Telephony) numbering plan (Recommendation E.164)";
		break;
			stroutput+="__spare";
		break;
		case 3:
			stroutput+="__Data numbering plan (Recommendation X.121)";
		break;
		case 4:
			stroutput+="__Telex numbering plan (Recommendation F.69)";
		break;
		case 5:
			stroutput+="__reserved for national use";
		break;
	}
	pCtrl->AddString(stroutput);

	stroutput=strbithead;
	stroutput+="bit F :Internal network number indicator (INN ind.)";
	pCtrl->AddString(stroutput);
	stroutput=strtranhead;
	if ((lpar&0x8)==0x0)
	{
		stroutput+="0__routing to internal network number allowed";
	}
	else
		stroutput+="1__routing to internal network number not allowed";
	pCtrl->AddString(stroutput);

	long j;

	stroutput=strbithead;
	stroutput+="byte 3-byte end:";
	stroutput+=str;
	stroutput+="__address signal";
	pCtrl->AddString(stroutput);

	long addressnum;
	addressnum=0;
	for(j=0;j<100;j++)
	{
		str1=str.Left(2);
		str.Delete(0,2);
		if (str.Find(",")!=-1)
			str.Delete(0,1);
		else
		{
				j=110;
		}
		lpar=strchangehex(str1);
		stroutput=strtranhead;

⌨️ 快捷键说明

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