#include "stdafx.h"

#include "..\\inc\\debug.h"

static char _cConvertTable[][40] = {
"check point 0",	//	IDS_CHECK_POINT_0			0x1000
"check point 1",	//	IDS_CHECK_POINT_1			0x1001
"check point 2",	//	IDS_CHECK_POINT_2			0x1002
"check point 3",	//	IDS_CHECK_POINT_3			0x1003
"check point 4",	//	IDS_CHECK_POINT_4			0x1004
"check point 5",	//	IDS_CHECK_POINT_5			0x1005
"check point 6",	//	IDS_CHECK_POINT_6			0x1006
"check point 7",	//	IDS_CHECK_POINT_7			0x1007
"check point 8",	//	IDS_CHECK_POINT_8			0x1008
"check point 9",	//	IDS_CHECK_POINT_9			0x1009
"RSVP packet",		//	IDS_IPT_RSVP				0x100a
"asn1 decode too many extensions",			//	IDS_ASN1_TOO_MANY_EXTENSIONS	0x100b
"asn1 decode exception",						//	IDS_ASN1_DECODE_EXCEPTION		0x100c
"remote dtmf received",					//	IDS_REMOTE_DTMF				0x100d
"encode overflow",	//	IDS_ENCODE_OVERFLOW			0x100e
"decode overflow",	//	IDS_DECODE_OVERFLOW			0x100f

"mac address",		//	IDS_MAC_ADDRESS				0x1010
"local ip",			//	IDS_LOCAL_IP				0x1011
"subnet mask",		//	IDS_SUBNET_MASK				0x1012
"router ip",		//	IDS_ROUTER_IP				0x1013
"proxy ip",			//	IDS_PROXY_IP				0x1014
"gk ras port",		//	IDS_GK_RAS_PORT				0x1015
"H.323 faststart",		//	IDS_H323_FASTSTART			0x1016
"service ip",		//	IDS_SERVICE_IP				0x1017

"arp send",			//	IDS_ARP_SEND				0x1018
"arp failed",		//	IDS_ARP_FAILED				0x1019
"arp resolved",		//	IDS_ARP_RESOLVED			0x101a
"arp retry",		//	IDS_ARP_RETRY				0x101b
"",					//	IDS_ARP_RESERVED_0			0x101c
"",					//	IDS_ARP_RESERVED_1			0x101d
"pppoe large packet",	//	IDS_PPPOE_LARGE_PACKET	0x101e	
"",					//	IDS_ARP_RESERVED_3			0x101f

"tcp state",		//	IDS_TCP_STATE				0x1020
"tcp unknown",		//	IDS_TCP_UNKNOWN				0x1021
"tcp retry",		//	IDS_TCP_RETRY				0x1022
"tcp large packet",	//	IDS_TCP_LARGE_PACKET		0x1023
"",					//	IDS_TCP_RESERVED_1			0x1024
"",					//	IDS_TCP_RESERVED_2			0x1025
"",					//	IDS_TCP_RESERVED_3			0x1026
"",					//	IDS_TCP_RESERVED_4			0x1027

"icmp echorq",		//	IDS_ICMP_ECHORQ				0x1028
"icmp redirect",	//	IDS_ICMP_REDIRECT			0x1029
"icmp large packet",//	IDS_ICMP_LARGE_PACKET		0x102a
"icmp echo reply",	//	IDS_ICMP_ECHORP				0x102b
"icmp echo timer",	//	IDS_ICMP_TIMEEX				0x102c
"",					//	IDS_ICMP_RESERVED_2			0x102d
"",					//	IDS_ICMP_RESERVED_3			0x102e
"",					//	IDS_ICMP_RESERVED_4			0x102f

"dns ip",			//	IDS_DNS_IP					0x1030
"dns result",		//	IDS_DNS_RESULT				0x1031
"dns send",			//	IDS_DNS_SEND				0x1032
"dns failed",		//	IDS_DNS_FAILED				0x1033
"dns retry",		//	IDS_DNS_RETRY				0x1034
"",					//	IDS_DNS_RESERVED_0			0x1035
"",					//	IDS_DNS_RESERVED_1			0x1036
"",					//	IDS_DNS_RESERVED_2			0x1037

"udp unknown",		//	IDS_UDP_UNKNOWN				0x1038
"udp unknown large",//	IDS_UDP_UNKNOWN_LARGE		0x1039
"",					//	IDS_UDP_RESERVED_0			0x103a
"",					//	IDS_UDP_RESERVED_1			0x103b
"",					//	IDS_UDP_RESERVED_2			0x103c
"",					//	IDS_UDP_RESERVED_3			0x103d
"",					//	IDS_UDP_RESERVED_4			0x103e
"",					//	IDS_UDP_RESERVED_5			0x103f

"dhcp server",		//	IDS_DHCP_SERVER				0x1040
"dhcp discover",	//	IDS_DHCP_DISCOVER			0x1041
"dhcp retry",		//	IDS_DHCP_RETRY				0x1042
"dhcp failed",		//	IDS_DHCP_FAILED				0x1043
"dhcp invalid reply",	//	IDS_DHCP_INVALID_REPLY	0x1044
"dhcp message type",//	IDS_DHCP_MESSAGE_TYPE		0x1045
"dhcp lease time",	//	IDS_DHCP_LEASE_TIME			0x1046
"dhcp error",		//	IDS_DHCP_ERROR				0x1047
"dhcp T1",			//	IDS_DHCP_T1					0x1048
"dhcp T2",			//	IDS_DHCP_T2					0x1049
"",					//	IDS_DHCP_RESERVED_0			0x104a
"dhcp length",		//	IDS_DHCP_LENGTH				0x104b
"dhcp bound",		//	IDS_DHCP_BOUND				0x104c
"dhcp renewed",		//	IDS_DHCP_RENEWED			0x104d
"dhcp renewing",	//	IDS_DHCP_RENEWING			0x104e
"dhcp rebinding",	//	IDS_DHCP_REBINDING			0x104f

"dhcp ack",			//	IDS_DHCP_ACK				0x1050
"",					//	IDS_RESERVED				0x1051
"",					//	IDS_RESERVED				0x1052
"",					//	IDS_RESERVED				0x1053
"",					//	IDS_RESERVED				0x1054
"",					//	IDS_RESERVED				0x1055
"",					//	IDS_RESERVED				0x1056
"",					//	IDS_RESERVED				0x1057

"telnet timer failed",	//	IDS_TELNET_TIMER_FAILED	0x1058	
"telnet init",		//	IDS_TELNET_INIT				0x1059
"telnet timer",		//	IDS_TELNET_TIMER			0x105a
"",					//	IDS_TELNET_RESERVED_2		0x105b
"",					//	IDS_TELNET_RESERVED_3		0x105c
"",					//	IDS_TELNET_RESERVED_4		0x105d
"",					//	IDS_TELNET_RESERVED_5		0x105e
"",					//	IDS_TELNET_RESERVED_6		0x105f

"",					//	IDS_RESERVED				0x1060
"",					//	IDS_RESERVED				0x1061
"",					//	IDS_RESERVED				0x1062
"",					//	IDS_RESERVED				0x1063
"",					//	IDS_RESERVED				0x1064
"",					//	IDS_RESERVED				0x1065
"",					//	IDS_RESERVED				0x1066
"",					//	IDS_RESERVED				0x1067

"DDA logon Failed",	//	IDS_DDA_LOGON_FAILED		0x1068
"DDA send ARQ",		//	IDS_DDA_SEND_ARQ			0x1069
"DDA logon ok",		//	IDS_DDA_LOGON_OK			0x106a
"DDA receive ART",	//	IDS_DDA_RCV_ART				0x106b
"CDR send CODE_CONNECT",//	IDS_CDR_SEND_CONNECT	0x106c
"CDR receive CODE_POLL",//	IDS_CDR_RCV_POLL		0x106d
"CDR send CODE_CDR",	//	IDS_CDR_SEND_CDR		0x106e
"CDR receive CODE_ACK",	//	IDS_CDR_RCV_ACK			0x106f

"http password error",	//	IDS_HTTP_PASSWORD_ERROR	0x1070
"http update success",	//	IDS_HTTP_UPDATE_SUCCESS	0x1071
"http update fail",		//	IDS_HTTP_UPDATE_FAIL	0x1072
"http accept",			//	IDS_HTTP_ACCEPT			0x1073
"http connect",			//	IDS_HTTP_CONNECT		0x1074
"http timer fail",		//	IDS_HTTP_TIMER_FAIL		0x1075
"",						//	IDS_HTTP_RESERVED_6		0x1076
"",						//	IDS_HTTP_RESERVED_7		0x1077

"tftp start",		//	IDS_TFTP_SEND				0x1078
"tftp oack",		//	IDS_TFTP_OACK				0x1079
"tftp successful",	//	IDS_TFTP_FINISHED			0x107a
"block",			//	IDS_TFTP_BLOCK				0x107b
"tftp error",		//	IDS_TFTP_ERROR				0x107c
"tftp retry",		//	IDS_TFTP_RETRY				0x107d
"tftp failed",		//	IDS_TFTP_FAILED				0x107e
"",					//	IDS_TFTP_RESERVED_7			0x107f

"ras reg req",		//	IDS_RAS_REG_REQ				0x1080
"ras reg cfm",		//	IDS_RAS_REG_CFM				0x1081
"ras reg rej",		//	IDS_RAS_REG_REJ				0x1082
"ras adm req",		//	IDS_RAS_ADM_REQ				0x1083
"ras adm cfm",		//	IDS_RAS_ADM_CFM				0x1084
"ras adm rej",		//	IDS_RAS_ADM_REJ				0x1085
"ras unreg req",	//	IDS_RAS_UNREG_REQ			0x1086
"ras unreg cfm",	//	IDS_RAS_UNREG_CFM			0x1087
"ras unreg rej",	//	IDS_RAS_UNREG_REJ			0x1088
"ras disengage req",//	IDS_RAS_DISENGAGE_REQ		0x1089
"ras disengage cfm",//	IDS_RAS_DISENGAGE_CFM		0x108a
"ras disengage rej",//	IDS_RAS_DISENGAGE_REJ		0x108b
"ras info req",		//	IDS_RAS_INFO_REQ			0x108c
"ras timer failed",	//	IDS_RAS_TIMER_FAILED		0x108d
"ras reg alive",	//	IDS_RAS_REG_ALIVE			0x108e
"ras decode reg cfm failed",	//	IDS_RAS_REG_CFM_ERROR		0x108f	

"q931 port",				//	IDS_Q931_PORT				0x1090	
"q931 error",				//	IDS_Q931_ERROR				0x1091
"q931 msg type",			//	IDS_Q931_MSG_TYPE			0x1092
"q931 from destination",	//	IDS_Q931_FROM_DESTINATION	0x1093
"q931 bearer",				//	IDS_Q931_BEARER				0x1094
"q931 cause",				//	IDS_Q931_CAUSE				0x1095
"q931 facility",			//	IDS_Q931_FACILITY			0x1096
"q931 progress",			//	IDS_Q931_PROGRESS			0x1097
"q931 call state",			//	IDS_Q931_CALL_STATE			0x1098
"q931 display",				//	IDS_Q931_DISPLAY			0x1099
"q931 signal",				//	IDS_Q931_SIGNAL				0x109a
"q931 calling number",		//	IDS_Q931_CALLING_NUMBER		0x109b
"q931 called number",		//	IDS_Q931_CALLED_NUMBER		0x109c
"q931 keypad",				//	IDS_Q931_KEYPAD				0x109d
"",							//	IDS_Q931_RESERVED_1			0x109e
"",							//	IDS_Q931_RESERVED_2			0x109f

"h2250 unknown",			//	IDS_H2250_UNKNOWN			0x10a0
"h2250 setup",				//	IDS_H2250_SETUP				0x10a1
"h2250 connect",			//	IDS_H2250_CONNECT			0x10a2
"h2250 alerting",			//	IDS_H2250_ALERTING			0x10a3
"h2250 call proceeding",	//	IDS_H2250_CALL_PROCEEDING	0x10a4
"h2250 release complete",	//	IDS_H2250_RELEASE_COMPLETE	0x10a5
"h2250 facility",			//	IDS_H2250_FACILITY			0x10a6
"h2250 timer failed",		//	IDS_H2250_TIMER_FAILED		0x10a7
"h2250 closed",				//	IDS_H2250_CLOSED			0x10a8
"h2250 information",		//	IDS_H2250_INFO				0x10a9
"h2250 progress",			//	IDS_H2250_PROGRESS			0x10aa
"h2250 user input",			//	IDS_H2250_USER_INPUT		0x10ab
"h2250 status inquiry",	//	IDS_H2250_STATUS_INQUIRY	0x10ac
"h2250 tcp accept",		//	IDS_H2250_ACCEPT		0x10ad
"h2250 status",				//	IDS_H2250_STATUS			0x10ae
"h2250 user info",			//	IDS_H2250_USER_INFO			0x10af

"h245 port",		//	IDS_H245_PORT				0x10b0
"h245 unknown",		//	IDS_H245_UNKNOWN			0x10b1
"h245 cap",			//	IDS_H245_CAP				0x10b2
"h245 cap ack",		//	IDS_H245_CAP_ACK			0x10b3
"h245 cap rej",		//	IDS_H245_CAP_REJ			0x10b4
"h245 msd",			//	IDS_H245_MSD				0x10b5
"h245 msd ack",		//	IDS_H245_MSD_ACK			0x10b6
"h245 msd rej",		//	IDS_H245_MSD_REJ			0x10b7
"h245 olc",			//	IDS_H245_OLC				0x10b8
"h245 olc ack",		//	IDS_H245_OLC_ACK			0x10b9
"h245 olc rej",		//	IDS_H245_OLC_REJ			0x10ba
"h245 olc close",	//	IDS_H245_OLC_CLOSE			0x10bb
"h245 end session",	//	IDS_H245_END_SESSION		0x10bc
"h245 rt req",		//	IDS_H245_RT_REQ				0x10bd
"h245 closed",		//	IDS_H245_CLOSED				0x10be
"h245 user input",	//	IDS_H245_USER_INPUT			0x10bf
"h245 msd master",	//	IDS_H245_MSD_MASTER			0x10c0
"h245 msd slave",	//	IDS_H245_MSD_SLAVE			0x10c1
"h245 timer failed",//	IDS_H245_TIMER_FAILED		0x10c2
"h245 cap release",	//	IDS_H245_CAP_RELEASE		0x10c3
"h245 msd release",	//	IDS_H245_MSD_RELEASE		0x10c4
"h245 rt resp",		//	IDS_H245_RT_RESP			0x10c5
"h245 tcp accept",	//	IDS_H245_ACCEPT				0x10c6
"h245 olc close ack",	//	IDS_H245_OLC_CLOSE_ACK		0x10c7

"rtp port",			//	IDS_RTP_PORT				0x10c8
"rtp unknown",		//	IDS_RTP_UNKNOWN				0x10c9
"rtp packet lost",	//	IDS_RTP_PACKET_LOST			0x10ca
"rtp packet late",	//	IDS_RTP_PACKET_LATE			0x10cb
"rtp audio type",	//	IDS_RTP_AUDIO_TYPE			0x10cc
"",					//	IDS_RTP_RESERVED_3			0x10cd
"sender report",	//	IDS_RTCP_SENDER_REPORT		0x10ce	
"receiver report",	//	IDS_RTCP_RECEIVER_REPORT	0x10cf		

"task restart",		//	IDS_TASK_RESTART			0x10d0
"task call",		//	IDS_TASK_CALL				0x10d1
"task called",		//	IDS_TASK_CALLED				0x10d2
"task hangup",		//	IDS_TASK_HANGUP				0x10d3
"task answer",		//	IDS_TASK_ANSWER				0x10d4
"",					//	IDS_TASK_RESERVED_0			0x10d5
"",					//	IDS_TASK_RESERVED_1			0x10d6
"",					//	IDS_TASK_RESERVED_2			0x10d7

"local alias",			//	IDS_LOCAL_ALIAS			0x10d8
"local phone number",	//	IDS_LOCAL_PHONE_NUMBER	0x10d9
"peer alias",			//	IDS_PEER_ALIAS			0x10da
"peer phone number",	//	IDS_PEER_PHONE_NUMBER	0x10db
"peer ip",				//	IDS_PEER_IP				0x10dc
"peer info",			//	IDS_PEER_INFO			0x10dd
"current time",			//	IDS_CURRENT_TIME		0x10de
"bandwith",				//	IDS_BANDWITH			0x10df

"gk routed call",		//	IDS_GK_ROUTED_CALL		0x10e0
"gk routed h245",		//	IDS_GK_ROUTED_H245		0x10e1
"logon fail",			//	IDS_LOGON_FAIL			0x10e2
"logon success",		//	IDS_LOGON_SUCCESS		0x10e3
"gk h323 version",		//	IDS_GK_H323_VERSION		0x10e4	
"handset up",			//	IDS_HANDSET_UP			0x10e5		
"handset down",			//	IDS_HANDSET_DOWN		0x10e6		
"page1 running",		//	IDS_PAGE1_RUNNING		0x10e7	

"upgrade binary mismatch",	//	IDS_UPGRADE_BINARY_MISMATCH		0x10e8
"voice msg create",		//	IDS_VOICE_MSG_CREATE				0x10e9
"voice msg open",		//	IDS_VOICE_MSG_OPEN					0x10ea
"voice msg close",		//	IDS_VOICE_MSG_CLOSE					0x10eb
"voice msg read",		//	IDS_VOICE_MSG_READ					0x10ec
"voice msg write",		//	IDS_VOICE_MSG_WRITE					0x10ed
"voice msg delete",		//	IDS_VOICE_MSG_DELETE				0x10ee
"voice msg index",		//	IDS_VOICE_MSG_INDEX					0x10ef

"handset output",		//	IDS_HANDSET_OUTPUT		0x10f0
"handset input",		//	IDS_HANDSET_INPUT		0x10f1
"handfree output",		//	IDS_HANDFREE_OUTPUT		0x10f2
"handfree input",		//	IDS_HANDFREE_INPUT		0x10f3
"upgrade binary length mismacth",	//	IDS_UPGRADE_BINARY_LENERROR			0x10f4
"handset flash",		//	IDS_HANDSET_FLASH		0x10f5
"",						//	IDS_RESERVED_F6			0x10f6
"",						//	IDS_RESERVED_F7			0x10f7

"call start time",		//	IDS_CALL_START_TIME		0x10f8
"call duration",		//	IDS_CALL_DURATION		0x10f9
"call type",			//	IDS_CALL_TYPE			0x10fa
"call write stop",		//	IDS_CALL_WRITE_STOP		0x10fb
"call write start",		//	IDS_CALL_WRITE_START	0x10fc
"call rec index",		//	IDS_CALL_REC_INDEX		0x10fd
"call type wrong",		//	IDS_CALL_TYPE_WRONG		0x10fe
"call record empty",	//	IDS_CALL_REC_EMPTY		0x10ff

"lcp cfg req",			//IDS_LCP_CFG_REQ			0x1100
"lcp cfg ack",			//IDS_LCP_CFG_ACK			0x1101
"lcp cfg nak",			//IDS_LCP_CFG_NAK			0x1102
"lcp cfg rej",			//IDS_LCP_CFG_REJ			0x1103
"lcp echo req",			//IDS_LCP_ECHO_REQ			0x1104
"lcp echo reply",		//IDS_LCP_ECHO_REPLY		0x1105
"lcp term req",			//IDS_LCP_TERM_REQ			0x1106
"lcp term ack",			//IDS_LCP_TERM_ACK			0x1107
"pap auth req",			//IDS_PAP_AUTH_REQ			0x1108
"pap auth ack",			//IDS_PAP_AUTH_ACK			0x1109
"pap auth nak",			//IDS_PAP_AUTH_NAK			0x110a
"ipcp cfg req",			//IDS_IPCP_CFG_REQ			0x110b
"ipcp cfg ack",			//IDS_IPCP_CFG_ACK			0x110c
"ipcp cfg nak",			//IDS_IPCP_CFG_NAK			0x110d
"ipcp cfg rej", 		//IDS_IPCP_CFG_REJ			0x110e
"PPPoE connected",		//IDS_PPPOE_CONNECTED		0x110f

"Network unreachable",			//IDS_ICMP_ERROR_0		0x1110
"Host unreachable",				//IDS_ICMP_ERROR_1		0x1111
"Protocol unreachable",			//IDS_ICMP_ERROR_2		0x1112
"Port unreachable",				//IDS_ICMP_ERROR_3		0x1113
"Fragmentation needed and DF set",	//IDS_ICMP_ERROR_4	0x1114
"Source route failed",			//IDS_ICMP_ERROR_5		0x1115
"Destination network unknown",	//IDS_ICMP_ERROR_6		0x1116
"Destination host unknown",		//IDS_ICMP_ERROR_7		0x1117
"Source host isolate",			//IDS_ICMP_ERROR_8		0x1118
"",								//IDS_ICMP_ERROR_9		0x1119
"",								//IDS_ICMP_ERROR_10		0x111a
"Network unreachable for TOS",	//IDS_ICMP_ERROR_11		0x111b
"Host unreachable for TOS",		//IDS_ICMP_ERROR_12		0x111c
"",								//IDS_ERROR_RESERVED_1	0x111d
"",								//IDS_ERROR_RESERVED_2	0x111e
"",								//IDS_ERROR_RESERVED_3	0x111f

"h450 ctInitiate",			//IDS_H450_CTINITIATE		0x1120
"h450 Return Result",		//IDS_H450_RETURN_RESULT	0x1121
"h450 Return Error",		//IDS_H450_RETURN_ERROR		0x1122
"h450 invoke",				//IDS_H450_INVOKE			0x1123
"h450 ctSetup",				//IDS_H450_CTSETUP			0x1124
"peer hold",				//IDS_H450_PEER_HOLD		0x1125
"peer retrieve",			//IDS_H450_PEER_RETRIEVE	0x1126
"",							//IDS_H450_RESERVED_8		0x1127
"",							//IDS_H450_RESERVED_9		0x1128
"",							//IDS_H450_RESERVED_a		0x1129
"",							//IDS_H450_RESERVED_b		0x112a
"",							//IDS_H450_RESERVED_c		0x112b
"",							//IDS_H450_RESERVED_d		0x112c
"",							//IDS_H450_RESERVED_e		0x112d
"",							//IDS_H450_RESERVED_f		0x112e
"",							//IDS_H450_RESERVED_0		0x112f

"gatekeeper request",		//IDS_RAS_GK_REQ			0x1130
"gatekeeper confirm",		//IDS_RAS_GK_CFM			0x1131
"gatekeepr reject",			//IDS_RAS_GK_REJ			0x1132
"ras info response",		//IDS_RAS_INFO_RESP			0x1133
"gk id mismatch",			//IDS_RAS_GKID_MISMATCH		0x1134
"ignore ras from other gk",	//IDS_RAS_IGNORE			0x1135
"duplicated ras message",	//IDS_RAS_DUPLICATE			0x1136
"h235 md5",					//IDS_RAS_H235_MD5			0x1137
"h235 cat",					//IDS_RAS_H235_CAT			0x1138
"ras location req",	// IDS_RAS_LOCATION_REQ		0x1139
"ras location cfm",	// IDS_RAS_LOCATION_CFM		0x113a
"ras nonstandard",	// IDS_RAS_NONSTANDARD			0x113b
"h235 sha1",				//IDS_RAS_H235_SHA1			0x113c
"",							//IDS_RAS_RESERVED_e		0x113d
"",							//IDS_RAS_RESERVED_f		0x113e
"",							//IDS_RAS_RESERVED_0		0x113f

"chap challenge",			//IDS_CHAP_CHALLENGE		0x1140
"chap response",			//IDS_CHAP_RESPONSE			0x1141
"chap success",				//IDS_CHAP_SUCCESS			0x1142
"chap failure",				//IDS_CHAP_FAILURE			0x1143
"",							//IDS_PPP_RESERVED_0		0x1144
"ftp server ip unmatch",	//IDS_FTP_SERVER_UNMATCH	0x1145
"ftp error response",		//IDS_FTP_ERROR_RESPONSE	0x1146
"ftp get file",				//IDS_FTP_GET_FILE			0x1147

"ftp connected",			//IDS_FTP_CONNECT			0x1148
"ftp closed",				//IDS_FTP_CLOSE				0x1149
"ftp timer failed",			//IDS_FTP_TIME_FAILED		0x114a
"ftp data connected",		//IDS_FTP_DATA_CONNECT		0x114b
"ftp data closed",			//IDS_FTP_DATA_CLOSE		0x114c
"ftp data timer failed",	//IDS_FTP_DATA_TIME_FAILED	0x114d
"ftp start file transfer",	//IDS_FTP_START_DATA		0x114e
"ftp finish file transfer",	//IDS_FTP_FINISH_DATA		0x114f

"n2p error login",			// IDS_N2P_ERROR_LOGIN			0x1150
"n2p timer failed",			// IDS_N2P_TIMER_FAILED			0x1151
"n2p tcp reset",			// IDS_N2P_TCP_RESET			0x1152
"n2p tcp closed",			// IDS_N2P_TCP_CLOSED			0x1153
"n2p nat resolved",			// IDS_N2P_NAT_RESOLVED			0x1154
"n2p tcp data",				// IDS_N2P_TCP_DATA				0x1155
"",							// IDS_N2P_RESERVED_7			0x1156
"",							// IDS_N2P_RESERVED_8			0x1157
"",							// IDS_N2P_RESERVED_9			0x1158
"",							// IDS_N2P_RESERVED_a			0x1159
"",							// IDS_N2P_RESERVED_b			0x115a
"",							// IDS_N2P_RESERVED_c			0x115b
"",							// IDS_N2P_RESERVED_d			0x115c
"",							// IDS_N2P_RESERVED_e			0x115d
"",							// IDS_N2P_RESERVED_f			0x115e
"",							// IDS_N2P_RESERVED_0			0x115f

"Proxy-Auth",				// IDS_SIP_PROXY_AUTH			0x1160
"Proxy-Auth Failed",		// IDS_SIP_PROXY_AUTH_FAIL		0x1161
"Invite Request",			// IDS_SIP_INVITE_REQ			0x1162
"ReInvite Request",			// IDS_SIP_REINVITE_REQ			0x1163
"ACK Request",				// IDS_SIP_ACK_REQ				0x1164
"Peer Hangup",				// IDS_SIP_PEER_HANGUP			0x1165
"Peer Busy",				// IDS_SIP_PEER_BUSY			0x1166
"Invalid Response Code",	// IDS_SIP_INVALID_RESP			0x1167
"Unknown Request Method",	// IDS_SIP_UNKNOWN_REQ			0x1168
"No More Client Trans",		// IDS_SIP_NO_FREE_CLI_TRANS	0x1169
"No Match Client Trans",	// IDS_SIP_NO_MATCH_TRANS		0x116a
"Options Request",			// IDS_SIP_OPTION_REQ			0x116b
"Unknown Auth Method",		// IDS_SIP_UNKNOWN_AUTH			0x116c
"Response to Invite",		// IDS_SIP_RESP_INVITE			0x116d
"WWW-Auth",					// IDS_SIP_WWW_AUTH				0x116e
"WWW-Auth Failed",			// IDS_SIP_WWW_AUTH_FAIL		0x116f

"Reg add failed",			// IDS_SIP_REG_ADD_FAIL			0x1170
"Reg update failed",		// IDS_SIP_REG_UPDATE_FAIL		0x1171
"Reg remove failed",		// IDS_SIP_REG_REMOVE_FAIL		0x1172
"Reg add OK",				// IDS_SIP_REG_ADD_OK			0x1173
"Reg update OK",			// IDS_SIP_REG_UPDATE_OK		0x1174
"Reg remove OK",			// IDS_SIP_REG_REMOVE_OK		0x1175
"Transmission Error",		// IDS_SIP_RETRANS_FAILED		0x1176
"Sdp Version Mismatch",		// IDS_SIP_SDP_VER_MISMATCH		0x1177
"Sdp Audio Mismatch",		// IDS_SIP_SDP_AUDIO_MISMATCH	0x1178
"No More Server Trans",		// IDS_SIP_NO_FREE_SERV_TRANS	0x1179
"Refer Req",				// IDS_SIP_REFER_REQ			0x117a
"Notify Req",				// IDS_SIP_NOTIFY_REQ			0x117b
"Prack Req",				// IDS_SIP_PRACK_REQ			0x117c
"Update Req",				// IDS_SIP_UPDATE_REQ			0x117d
"Refer Accepted",			// IDS_SIP_REFER_ACCEPTED		0x117e
"Refer Denied",				// IDS_SIP_REFER_DENIED			0x117f

"From tag or call id mismatch",	// IDS_SIP_TAG_OR_CALL_ID	0x1180
"Stun Completed",			// IDS_STUN_COMPLETED			0x1181
"Stun retry",				// IDS_STUN_RETRY				0x1182
"Binding Error Response",	// IDS_STUN_BINDING_ERROR		0x1183
"First Mapped Addr",		// IDS_STUN_FIRST_MAPPED_ADDR	0x1184
"Second Mapped Addr",		// IDS_STUN_SECOND_MAPPED_ADDR	0x1185
"Stun No Reponse",			// IDS_STUN_NO_RESPONSE			0x1186
"NAT type unknown",			// IDS_NAT_TYPE_UNKNOWN			0x1187
"NAT type full cone",		// IDS_NAT_TYPE_FULL_CONE		0x1188
"NAT type symmetric",		// IDS_NAT_TYPE_SYMMETRIC		0x1189
"NAT type restricted",		// IDS_NAT_TYPE_RESTRICTED		0x118a
"NAT type port restricted",	// IDS_NAT_TYPE_PORT_RESTRICTED	0x118b
"",							// IDS_SIP_RESERVED_7			0x118c
"",							// IDS_SIP_RESERVED_8			0x118d
"",							// IDS_SIP_RESERVED_9			0x118e
"",							// IDS_SIP_RESERVED_a			0x118f

"Unauthorized CA",			// IDS_MGCP_UNAUTHORIZED_CA		0x1190
"",							// IDS_MGCP_RESERVED_0			0x1191
"",							// IDS_MGCP_RESERVED_1			0x1192
"",							// IDS_MGCP_RESERVED_3			0x1193
"",							// IDS_MGCP_RESERVED_4			0x1194
"",							// IDS_MGCP_RESERVED_5			0x1195
"",							// IDS_MGCP_RESERVED_6			0x1196
"",							// IDS_MGCP_RESERVED_7			0x1197
"",							// IDS_MGCP_RESERVED_8			0x1198
"",							// IDS_MGCP_RESERVED_9			0x1199
"",							// IDS_MGCP_RESERVED_a			0x119a
"",							// IDS_MGCP_RESERVED_b			0x119b
"",							// IDS_MGCP_RESERVED_c			0x119c
"",							// IDS_MGCP_RESERVED_d			0x119d
"",							// IDS_MGCP_RESERVED_e			0x119e
"",							// IDS_MGCP_RESERVED_f			0x119f

"Client TCP data",			// IDS_USER_CLIENT_TCP_DATA		0x11a0
"user tcp connected",		// IDS_USER_TCP_CONNECTED		0x11a1
"",							// IDS_USER_RESERVED_3			0x11a2
"",							// IDS_USER_RESERVED_4			0x11a3
"",							// IDS_USER_RESERVED_5			0x11a4
"",							// IDS_USER_RESERVED_6			0x11a5
"",							// IDS_USER_RESERVED_7			0x11a6
"",							// IDS_USER_RESERVED_8			0x11a7
"",							// IDS_USER_RESERVED_9			0x11a8
"",							// IDS_USER_RESERVED_a			0x11a9
"",							// IDS_USER_RESERVED_b			0x11aa
"",							// IDS_USER_RESERVED_c			0x11ab
"",							// IDS_USER_RESERVED_d			0x11ac
"",							// IDS_USER_RESERVED_e			0x11ad
"",							// IDS_USER_RESERVED_f			0x11ae
"",							// IDS_USER_RESERVED_0			0x11af

"wp error login",			// IDS_WP_ERROR_LOGIN			0x11b0
"wp timer failed",			// IDS_WP_TIMER_FAILED			0x11b1
"wp tcp reset",				// IDS_WP_TCP_RESET				0x11b2
"wp tcp closed",			// IDS_WP_TCP_CLOSED			0x11b3
"wp nat resolved",			// IDS_WP_NAT_RESOLVED			0x11b4
"wp tcp data",				// IDS_WP_TCP_DATA				0x11b5
"wp tcp connected",			// IDS_WP_TCP_CONNECTED			0x11b6
"wp logon confirm",			// IDS_WP_LOGON_CFM			0x11b7
"wp logon reject",			// IDS_WP_LOGON_REJ			0x11b8
"wp logon goto others",		// IDS_WP_LOGON_GOTO			0x11b9
"wp call process",			// IDS_WP_CALL_PROCESS			0x11ba
"wp call calling",			// IDS_WP_CALL_CALLING			0x11bb
"wp call altering",			// IDS_WP_CALL_ALTERING		0x11bc
"wp call answer",			// IDS_WP_CALL_ANSWER			0x11bd
"wp call hangup",			// IDS_WP_CALL_HANGUP			0x11be
"wp find user",				// IDS_WP_FIND_USER			0x11bf

"wp call error",			// IDS_WP_CALL_ERR				0x11c0
"wp audio proxy info",		// IDS_WP_AP_INFO			0x11c1
"wp call balance",			// IDS_WP_CALL_BALANCE			0x11c2
"wp make call",				// IDS_WP_MAKE_CALL			0x11c3
"wp audio proxy request",	// IDS_WP_AP_REQ			0x11c4
"wp call refuse",			// IDS_WP_CALL_REFUSE		0x11c5
"wp ",	// IDS_WP_RESERVED_7			0x11c6
"wp ",	// IDS_WP_RESERVED_8			0x11c7
"wp ",	// IDS_WP_RESERVED_9			0x11c8
"wp ",	// IDS_WP_RESERVED_a			0x11c9
"wp ",	// IDS_WP_RESERVED_b			0x11ca
"wp ",	// IDS_WP_RESERVED_c			0x11cb
"wp ",	// IDS_WP_RESERVED_d			0x11cc
"wp ",	// IDS_WP_RESERVED_e			0x11cd
"wp ",	// IDS_WP_RESERVED_f			0x11ce
"wp ",	// IDS_WP_RESERVED_0			0x11cf

"epn error login",			// IDS_EPN_ERROR_LOGIN			0x11d0
"epn timer failed",			// IDS_EPN_TIMER_FAILED			0x11d1
"epn tcp reset",			// IDS_EPN_TCP_RESET			0x11d2
"epn tcp closed",			// IDS_EPN_TCP_CLOSED			0x11d3
"epn call balance",			// IDS_EPN_CALL_BALANCE			0x11d4
"epn tcp data",				// IDS_EPN_TCP_DATA				0x11d5
"epn tcp connected",		// IDS_EPN_TCP_CONNECTED		0x11d6
"epn logon confirm",		// IDS_EPN_LOGON_CFM			0x11d7
"epn logon reject",			// IDS_EPN_LOGON_REJ			0x11d8
"epn adm confirm",			// IDS_EPN_ADM_CFM				0x11d9
"epn adm reject",			// IDS_EPN_ADM_REJ				0x11da
"epn conn request",			// IDS_EPN_CONN_REQ				0x11db
"epn call altering",		// IDS_EPN_CALL_ALERTING		0x11dc
"epn call answer",			// IDS_EPN_CALL_ANSWER			0x11dd
"epn call hangup",			// IDS_EPN_CALL_HANGUP			0x11de
"epn call error",			// IDS_EPN_CALL_ERR				0x11df

"epn data error ",			// IDS_EPN_DATA_ERROR			0x11e0
"epn est request",			// IDS_EPN_EST_REQ				0x11e1
"epn est confirm",			// IDS_EPN_EST_CFM				0x11e2
"epn cap confirm",			// IDS_EPN_CAP_CFM				0x11e3
"epn cap reject",			// IDS_EPN_CAP_REJ				0x11e4
"epn est reject",			// IDS_EPN_EST_REJ				0x11e5
"epn incoming dtmf",		// IDS_EPN_INCOMING_DTMF		0x11e6
"epn hangup reject",		// IDS_EPN_HANGUP_REJ			0x11e7
"epn ",	// IDS_EPN_RESERVED_9			0x11e8
"epn ",	// IDS_EPN_RESERVED_a			0x11e9
"epn ",	// IDS_EPN_RESERVED_b			0x11ea
"epn ",	// IDS_EPN_RESERVED_c			0x11eb
"epn ",	// IDS_EPN_RESERVED_d			0x11ec
"epn ",	// IDS_EPN_RESERVED_e			0x11ed
"epn ",	// IDS_EPN_RESERVED_f			0x11ee
"epn ",	// IDS_EPN_RESERVED_0			0x11ef
};


int IntFromString(CString str)
{
	int iVal = 0x80000000;

	str.MakeLower();
	if (str.Find("0x") != -1)
	{
		sscanf(str, "0x%x", &iVal);
	}
	else
	{
		sscanf(str, "%d", &iVal);
	}
	return iVal;
}

CString Palm1DebugConvertString(CString strOrig)
{
	CString str, strFind, strLeft, strMiddle, strRight;
	int iIndex, iPos, iVal, iLength;

	str.Empty();
	strFind = strOrig;
	while (1)
	{
		if (strFind.GetLength() < 6)
		{
			str += strFind;
			break;
		}
		iPos = strFind.Find("0x");
		if (iPos == -1)
		{
			str += strFind;
			break;
		}
		else if (iPos > 0)
		{
			strLeft = strFind.Left(iPos);
			str += strLeft;
		}

		strMiddle = strFind.Mid(iPos, 6);
		iIndex = IntFromString(strMiddle);
		if (iIndex >= 0x1000 && iIndex < 0x1200)
		{
			str += _cConvertTable[iIndex-0x1000];
		}
		else
		{
			strRight = strFind.Right(strFind.GetLength() - iPos);
			str += strRight;
			break;
		}

		iLength = strFind.GetLength() - iPos - 6;
		if (iLength)
		{
			strRight = strFind.Right(iLength);
			strFind = strRight;
//			OutputDebugString("\r\n");
//			OutputDebugString(strFind);
		}
		else
		{
			break;
		}

		iLength = strRight.GetLength() - 1;
		if (iLength)
		{
			iVal = atoi(strRight.Right(iLength));
		}
		else
		{
			break;
		}
		switch (iIndex)
		{
		case IDS_RAS_REG_REJ:
			str += "--";
			switch (iVal)
			{
			case 0:
				str += "discoveryRequired";
				break;
			case 1:
				str += "invalidRevision";
				break;
			case 2:
				str += "invalidCallSignalAddress";
				break;
			case 3: 
				str += "invalidRASAddress";
				break;
			case 4: 
				str += "duplicateAlias";
				break;
			case 5:
				str += "invalidTerminalType";
				break;
			case 6: 
				str += "undefinedReason";
				break;
			case 7:
				str += "transportNotSupported";
				break;
			case 8:
				str += "transportQOSNotSupported";
				break;
			case 9:
				str += "resourceUnavailable";
				break;
			case 10:
				str += "invalidAlias";
				break;
			case 11:
				str += "securityDenial";
				break;
			case 12:
				str += "fullRegistrationRequired";
				break;
			case 13:
				str += "additiveRegistrationNotSupported";
				break;
			case 14:
				str += "invalidTerminalAliases";
				break;
			case 15:
				str += "genericDataReason";
				break;
			case 16:
				str += "neededFeatureNotSupported";
				break;
			}
			break;

		case IDS_RAS_ADM_REJ:
			str += "--";
			switch (iVal)
			{
			case 0:
				str += "called party not registered -- can't translate address";
				break;
			case 1:
				str += "invalid permission -- permission has expired";
				break;
			case 2:
				str += "request denied -- no bandwith available";
				break;
			case 3:
				str += "undefined reason";
				break;
			case 4:
				str += "caller not registered";
				break;
			case 5:
				str += "route call to gatekeeper";
				break;
			case 6:
				str += "invalid endpoint identifier";
				break;
			case 7:
				str += "resource unavailable";
				break;
			case 8:
				str += "security denial";
				break;
			case 9:
				str += "qos control not supported";
				break;
			case 10:
				str += "incomplete address";
				break;
			case 11:
				str += "aliases inconsistant";
				break;
			case 12:
				str += "routeCallToSCN";
				break;
			case 13:
				str += "exceedsCallCapacity";
				break;
			case 14:
				str += "collectDestination";
				break;
			case 15:
				str += "collectPIN";
				break;
			case 16:
				str += "genericDataReason";
				break;
			case 17:
				str += "neededFeatureNotSupported";
				break;
			}
			break;

		case IDS_H245_OLC_REJ:
			str += "--";
			switch (iVal)
			{
			case 0:
				str += "unspecified";
				break;
			case 1:
				str += "unsuitableReverseParameters";
				break;
			case 2:
				str += "dataTypeNotSupported";
				break;
			case 3:
				str += "dataTypeNotAvailable";
				break;
			case 4:
				str += "unknownDataType";
				break;
			case 5:
				str += "dataTypeALCombinationNotSupported";
				break;
			// 	...,
			case 6:
				str += "multicastChannelNotAllowed";
				break;
			case 7:
				str += "insufficientBandwidth";
				break;
			case 8:
				str += "separateStackEstablishmentFailed";
				break;
			case 9:
				str += "invalidSessionID";
				break;
			case 10:
				str += "masterSlaveConflict";
				break;
			case 11:
				str += "waitForCommunicationMode";
				break;
			case 12:
				str += "invalidDependentChannel";
				break;
			case 13:
				str += "replacementForRejected";
				break;
			}
			break;

		case IDS_H2250_RELEASE_COMPLETE:
			str += "--";
			switch (iVal)
			{
			case 0:
				str += "noBandwidth -- bandwidth taken away or ARQ denied";
				break;
			case 1:
				str += "gatekeeperResources -- exhausted";
				break;
			case 2:
				str += "unreachableDestination -- no transport path to the destination";
				break;
			case 3:
				str += "destinationRejection -- rejected at destination";
				break;
			case 4:
				str += "invalidRevision";
				break;
			case 5:
				str += "noPermission -- called party's gatekeeper rejects";
				break;
			case 6:
				str += "unreachableGatekeeper -- terminal cannot reach gatekeeper for ARQ";
				break;
			case 7:
				str += "gatewayResources";
				break;
			case 8:
				str += "badFormatAddress";
				break;
			case 9:
				str += "adaptiveBusy -- call is dropping due to LAN crowding";
				break;
			case 10:
				str += "inConf -- no address in AlternativeAddress";
				break;
			case 11:
				str += "undefinedReason";
				break;
			case 12:
				str += "facilityCallDeflection -- call was deflected using a Facility message";
				break;
			case 13:
				str += "securityDenied -- incompatible security settings";
				break;
			case 14:
				str += "calledPartyNotRegistered -- used by gatekeeper when endpoint has preGrantedARQ to bypass ARQ/ACF";
				break;
			case 15:
				str += "callerNotRegistered -- used by gatekeeper when endpoint has preGrantedARQ to bypass ARQ/ACF";
				break;
			case 16:
				str += "newConnectionNeeded	-- indicates that the Setup was not accepted on this connection, but that the Setup may be accepted on a new connection";
				break;
			case 17:
				str += "nonStandardReason";
				break;
			case 18:
				str += "replaceWithConferenceInvite";
				break;
			case 19:
				str += "genericDataReason";
				break;
			case 20:
				str += "neededFeatureNotSupported";
				break;
			case 21:
				str += "tunnelledSignallingRejected";
				break;
			}
			break;
		}
	}

	return str;
}
