/*************************************************
File name:	command.c
Author: 	
Version:	9:00:00 
Date:  		2007-8-4
Description:该文件定义了命令的参数在数据库里的值与输入输出的值的相互转换模式
			
			
			
			
												
History:               
No. 		
Author:		  
Date:		 
Version:	   
Description:
*************************************************/
#include "smcli.h"

/* by simon at 23/9/26 */
extern CmdBuf *cmdBuf;
extern int OptNo_index;

//hlr exchange mode define
#define exM_hlrImsi			1
#define exM_hlrMsisdn		2
#define exM_hlrCcNdcSn		3
#define exM_hlrState		4
#define exM_hlrNam			5
#define exM_hlrClirpm		6
#define exM_hlrCfuopt		7
#define exM_hlrCfbopt		8
#define exM_hlrCfnryopt		9
#define exM_hlrCfnryTimer	10
#define exM_hlrCfnrcopt		11
#define exM_hlrSms			12
#define exM_hlrCategory		13
#define exM_hlrRszi			14
#define exM_hlrCsrr			15
#define exM_hlrCbsp			16
#define exM_hlrCbwpa		17
#define exM_hlrOCsi1		21
#define exM_hlrOCsi2		22
#define exM_hlrOCsi3		23
#define exM_hlrOCsi4		24
#define exM_hlrOCsi5		25
#define exM_hlrOCsi6		26
#define exM_hlrOCsi7		27
#define exM_hlrOCsi8		28
#define exM_hlrOCsi9		29
#define exM_hlrOCsi10		30
#define exM_hlrOCsi11		31
#define exM_hlrOCsi12		32
#define exM_hlrOCsi13		33
#define exM_hlrOCsi14		34
#define exM_hlrOCsi15		35
#define exM_hlrOCsi16		36
#define exM_hlrOCsi17		37
#define exM_hlrOCsi18		38
#define exM_hlrSsCsi		41
#define exM_hlrSsCsi1		42
#define exM_hlrPdp1			43
#define exM_hlrPdp2			44
#define exM_hlrPdp3			45
#define exM_hlrPdp4			46
#define exM_hlrPdp5			47
#define exM_hlrPdp6			48
#define exM_hlrPdp7			49
#define exM_hlrPdp8			50
#define exM_hlrPdp9			51
#define exM_hlrPdp10		52
#define exM_hlrPdp11		53
#define exM_hlrPdp12		54
#define exM_hlrPdp13		55
#define exM_hlrPdp14		56
#define exM_hlrPdp15		57
#define exM_hlrPdp16		58
#define exM_hlrPdp17		59
#define exM_hlrPdp18		60
#define exM_hlrPdp19		61
#define exM_hlrPdp20		62
#define exM_hlrPdp21		63
#define exM_hlrPdp22		64
#define exM_hlrPdp23		65
#define exM_hlrPdp24		66
#define exM_hlrPdp25		67
#define exM_hlrPdp26		68
#define exM_hlrPdp27		69
#define exM_hlrPdp28		70
#define exM_hlrPdp29		71
#define exM_hlrPdp30		72
#define exM_hlrPdp31		73
#define exM_hlrPdp32		74
#define exM_hlrPdp33		75
#define exM_hlrPdp34		76
#define exM_hlrPdp35		77
#define exM_hlrUserNo		78

#define optNo_Rszi			31
#define optNo_Sscsi			156

//pps  exchange mode define
#define exM_ppsDate			1
#define exM_ppsRentType		2
#define exM_ppsCallType		3
#define exM_ppsSM			4
#define exM_ppsBalance		5
#define exM_ppsCardStatus	6
#define exM_ppsPoolAccountType 30
#define exM_ppsFFPlanState 31

//vms  exchange mode define
#define exM_vmsHexDec		1	//20041101
#define exM_vmsGreetingType	2	//20041101
#define exM_vmsMailboxId	3	//20041101

//mnp  exchange mode define
#define exM_mnpStatus		1
#define exM_mnpDate			2

//imdm exchange mode define
#define exM_imdmMsisdn 1
#define exM_imdmImei 2
#define exM_imdmImsi 3
#define exM_imdmOprFlag 4
#define exM_imdmClass 5
#define exM_imdmUserType 6
//#define exM_imdmType 5
//#define exM_imdmStatus 6

//ipalim exchange mode define
#define exM_ipalimImsi 1
#define exM_ipalimMsisdn 2
#define exM_ipalimMsisdnExtern 3
#define exM_ipalimTmsi 4
#define exM_ipalimLai 5
#define exM_ipalimType 6

//auc exchange mode define
#define exM_aucImsi 1

/*
CmdBuf defCmdBuf[CmdBufSize] = {
	
	{1, "omc", "account", "172.18.128.1",
	 0, 0, 0, 0, "OMC_PUB.sysUser", "", "", "",
	 {2, 2, 2, 2, 9, 2, 9, 9, 9}
	 , 12,
	 {
	  //{{0,1,2,3,4,5,6,7,9}, 0=mandatory,1~8=privilege1.........privilege8,9=nouse
	  //{{0,re,mo,cr,de,co,ex,im,di}
	  //,"optName","exMode","fieldName","initFieldValue","optValue","fieldValue"
	  {{0, 9, 9, 9, 9, 9, 9, 9, 9}
	   , "", 0, "", "", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 9, 9, 9, 9}
	   , "", 0, "", "", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 9, 1, 9, 9}
	   , "expfile", 0, "", "", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 9, 1, 9, 9}
	   , "query", 0, "", "", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 9, 1, 9, 9}
	   , "fields", 0, "", "", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 9, 1, 9, 9}
	   , "max", 0, "", "", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 9, 9, 9, 9}
	   , "", 0, "", "", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 9, 9, 9, 9}
	   , "", 0, "", "", "", ""}
	  ,
	  {{0, 0, 0, 0, 0, 9, 9, 9, 9}
	   , "account_name", 9 * 10000000 + 1 * 100000 + 16 * 1000 + 0,
	   "userName", "", "", ""}
	  ,
	  {{0, 9, 2, 0, 9, 9, 9, 9, 9}
	   , "password", 9 * 10000000 + 6 * 100000 + 16 * 1000 + 0, "password",
	   "", "", ""}
	  ,
	  {{0, 1, 2, 0, 9, 9, 9, 9, 9}
	   , "real_name", 9 * 10000000 + 1 * 100000 + 16 * 1000 + 0,
	   "realName", "", "", ""}
	  ,
	  {{0, 1, 2, 0, 9, 9, 9, 9, 9}
	   , "privilege", 0 * 10000000 + 1 * 100000 + 1 * 1000 + 0,
	   "privilege", "", "", ""}
	  }
	 }
	,

	{0, "hlr", "subscriber", "172.18.98.1",
	 330, 0, 0, 0, "HLR_DB.subscriberData", "OBJ_330.tmpSubsData_0", "",
	 "",
	 {1, 2, 2, 2, 1, 1, 2, 1, 9}
	 , 216,
	 {
	  //{{0,1,2,3,4,5,6,7,9}, 0=mandatory,1~8=privilege1.........privilege8,9=nouse
	  //{{0,re,mo,cr,de,co,ex,im,di}
	  //,"optName","exMode","fieldName","initFieldValue","optValue","fieldValue"
	  {{0, 9, 9, 9, 9, 9, 9, 9, 9}
	   , "ipaddress", 0, "", "", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 0, 9, 9, 9}
	   , "passwd", 0, "", "123456", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 9, 1, 9, 9}
	   , "expfile", 0, "", "", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 9, 1, 9, 9}
	   , "query", 0, "", "", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 9, 1, 9, 9}
	   , "fields", 0, "", "", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 9, 1, 9, 9}
	   , "max", 0, "", "", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 9, 9, 0, 9}
	   , "impfile", 0, "", "", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 1, 9, 9, 9}
	   , "srvip", 0, "", "", "", ""}
	  ,
	  {{0, 0, 0, 0, 0, 9, 9, 9, 9}
	   , "imsi", 0 * 10000000 + 15 * 100000 + 16 * 1000 + exM_hlrImsi,
	   "imsi", "0000000000000000", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "imsi_flag", exM_hlrState, "used_flag", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "nam", exM_hlrNam, "nam", "00", "", ""}
	  ,
	  {{0, 1, 2, 0, 2, 9, 9, 9, 9}
	   , "msisdn", 0 * 10000000 + 6 * 100000 + 16 * 1000 + exM_hlrCcNdcSn,
	   "inter_msisdn",
	   "EEEEEEEEEEEEEEEEEE", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "category", exM_hlrCategory, "category", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "odb", exM_hlrState, "sub_status", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "baoc", exM_byte0_bit0, "odb_general", "00000000", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "boic", exM_byte0_bit1, "odb_general", "00000000", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "boic_hplmn", exM_byte0_bit2, "odb_general", "00000000", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "bpric", exM_byte0_bit3, "odb_general", "00000000", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "bprec", exM_byte0_bit4, "odb_general", "00000000", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "bass", exM_byte0_bit5, "odb_general", "00000000", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "osb1", exM_byte0_bit0, "odb_specific", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "osb2", exM_byte0_bit1, "odb_specific", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "baic", exM_byte2_bit0, "odb_general", "00000000", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "baic_hplmn", exM_byte2_bit1, "odb_general", "00000000", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "roaming", exM_byte2_bit3, "odb_general", "00000000", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "roaming_ct", exM_byte2_bit4, "odb_general", "00000000", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "mct", exM_byte0_bit2, "odb_specific", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "bearer_service", 1 * 10000000 + 8 * 100000 + 8 * 1000 + 0,
	   "bearer_data", "07FFFFFF", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "telephony", exM_byte0_bit0, "tele_data", "0F00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "emergency_call", exM_byte0_bit1, "tele_data", "0F00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "sms", exM_hlrSms, "tele_data", "0F00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "rszi0", 4 * 10000000 + 1 * 100000 + 2 * 1000 + exM_hlrRszi,
	   "rszi", "FFFFFFFFFFFFFFFFFFFF",
	   "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "rszi1", 4 * 10000000 + 1 * 100000 + 2 * 1000 + exM_hlrRszi,
	   "rszi", "FFFFFFFFFFFFFFFFFFFF",
	   "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "rszi2", 4 * 10000000 + 1 * 100000 + 2 * 1000 + exM_hlrRszi,
	   "rszi", "FFFFFFFFFFFFFFFFFFFF",
	   "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "rszi3", 4 * 10000000 + 1 * 100000 + 2 * 1000 + exM_hlrRszi,
	   "rszi", "FFFFFFFFFFFFFFFFFFFF",
	   "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "rszi4", 4 * 10000000 + 1 * 100000 + 2 * 1000 + exM_hlrRszi,
	   "rszi", "FFFFFFFFFFFFFFFFFFFF",
	   "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "rszi5", 4 * 10000000 + 1 * 100000 + 2 * 1000 + exM_hlrRszi,
	   "rszi", "FFFFFFFFFFFFFFFFFFFF",
	   "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "rszi6", 4 * 10000000 + 1 * 100000 + 2 * 1000 + exM_hlrRszi,
	   "rszi", "FFFFFFFFFFFFFFFFFFFF",
	   "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "rszi7", 4 * 10000000 + 1 * 100000 + 2 * 1000 + exM_hlrRszi,
	   "rszi", "FFFFFFFFFFFFFFFFFFFF",
	   "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "rszi8", 4 * 10000000 + 1 * 100000 + 2 * 1000 + exM_hlrRszi,
	   "rszi", "FFFFFFFFFFFFFFFFFFFF",
	   "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "rszi9", 4 * 10000000 + 1 * 100000 + 2 * 1000 + exM_hlrRszi,
	   "rszi", "FFFFFFFFFFFFFFFFFFFF",
	   "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "csrr", exM_hlrCsrr, "csr_type", "00", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "clip_a", exM_byte0_bit0, "clip_state", "00", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "clip_r", exM_byte0_bit1, "clip_state", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "clip_p", exM_byte0_bit2, "clip_state", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "clip_q", exM_byte0_bit3, "clip_state", "00", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "clip_o", exM_byte0_bit7, "clip_state", "00", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "clir_a", exM_byte0_bit0, "clir_state", "00", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "clir_r", exM_byte0_bit1, "clir_state", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "clir_p", exM_byte0_bit2, "clir_state", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "clir_q", exM_byte0_bit3, "clir_state", "00", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "clir_pm", exM_hlrClirpm, "clir_state", "00", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "colp_a", exM_byte0_bit0, "colp_state", "00", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "colp_r", exM_byte0_bit1, "colp_state", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "colp_p", exM_byte0_bit2, "colp_state", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "colp_q", exM_byte0_bit3, "colp_state", "00", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "colp_o", exM_byte0_bit7, "colp_state", "00", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "colr_a", exM_byte0_bit0, "colr_state", "00", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "colr_r", exM_byte0_bit1, "colr_state", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "colr_p", exM_byte0_bit2, "colr_state", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "colr_q", exM_byte0_bit3, "colr_state", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "cbsp", exM_hlrCbsp, "subs_option", "01", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "cbp", 0 * 10000000 + 4 * 100000 + 4 * 1000 + 0, "passwd", "12",
	   "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "cbwpa", 4 * 10000000 + 1 * 100000 + 2 * 1000 + exM_hlrCbwpa,
	   "attempt_count", "03", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "baoc_a", exM_byte0_bit0, "baoc_state", "00", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "baoc_r", exM_byte0_bit1, "baoc_state", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "baoc_p", exM_byte0_bit2, "baoc_state", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "baoc_q", exM_byte0_bit3, "baoc_state", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "boic_a", exM_byte0_bit0, "boic_state", "00", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "boic_r", exM_byte0_bit1, "boic_state", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "boic_p", exM_byte0_bit2, "boic_state", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "boic_q", exM_byte0_bit3, "boic_state", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "boic_ex_a", exM_byte0_bit0, "boichc_state", "00", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "boic_ex_r", exM_byte0_bit1, "boichc_state", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "boic_ex_p", exM_byte0_bit2, "boichc_state", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "boic_ex_q", exM_byte0_bit3, "boichc_state", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "baic_a", exM_byte0_bit0, "baic_state", "00", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "baic_r", exM_byte0_bit1, "baic_state", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "baic_p", exM_byte0_bit2, "baic_state", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "baic_q", exM_byte0_bit3, "baic_state", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "bicr_a", exM_byte0_bit0, "bicroam_state", "00", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "bicr_r", exM_byte0_bit1, "bicroam_state", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "bicr_p", exM_byte0_bit2, "bicroam_state", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "bicr_q", exM_byte0_bit3, "bicroam_state", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "cfu_a", exM_byte0_bit0, "cfu_state", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "cfu_r", exM_byte0_bit1, "cfu_state", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "cfu_p", exM_byte0_bit2, "cfu_state", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "cfu_q", exM_byte0_bit3, "cfu_state", "00", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "cfu_c", exM_byte0_bit5, "cfu_state", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "cfu_no", 0 * 10000000 + 0 * 100000 + 16 * 1000 + exM_hlrMsisdn,
	   "cfu_num", "EEEEEEEEEEEEEEEEEE", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "cfb_a", exM_byte0_bit0, "cfb_state", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "cfb_r", exM_byte0_bit1, "cfb_state", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "cfb_p", exM_byte0_bit2, "cfb_state", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "cfb_q", exM_byte0_bit3, "cfb_state", "00", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "cfb_c", exM_byte0_bit5, "cfb_state", "00", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "cfb_f", exM_byte0_bit7, "cfb_state", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "cfb_no", 0 * 10000000 + 1 * 100000 + 16 * 1000 + exM_hlrMsisdn,
	   "cfb_num", "EEEEEEEEEEEEEEEEEE", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "cfnry_a", exM_byte0_bit0, "cfnry_state", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "cfnry_r", exM_byte0_bit1, "cfnry_state", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "cfnry_p", exM_byte0_bit2, "cfnry_state", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "cfnry_q", exM_byte0_bit3, "cfnry_state", "00", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "cfnry_c", exM_byte0_bit5, "cfnry_state", "00", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "cfnry_f", exM_byte0_bit7, "cfnry_state", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "cfnry_t",
	   0 * 10000000 + 1 * 100000 + 2 * 1000 + exM_hlrCfnryTimer,
	   "cfnry_time", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "cfnry_no", 0 * 10000000 + 1 * 100000 + 16 * 1000 + exM_hlrMsisdn,
	   "cfnry_num", "EEEEEEEEEEEEEEEEEE", "",
	   ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "cfnrc_a", exM_byte0_bit0, "cfnrc_state", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "cfnrc_r", exM_byte0_bit1, "cfnrc_state", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "cfnrc_p", exM_byte0_bit2, "cfnrc_state", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "cfnrc_q", exM_byte0_bit3, "cfnrc_state", "00", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "cfnrc_c", exM_byte0_bit5, "cfnrc_state", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "cfnrc_no", 0 * 10000000 + 1 * 100000 + 16 * 1000 + exM_hlrMsisdn,
	   "cfnrc_num", "EEEEEEEEEEEEEEEEEE", "",
	   ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "cw_a", exM_byte0_bit0, "callwait_state", "00", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "cw_r", exM_byte0_bit1, "callwait_state", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "cw_p", exM_byte0_bit2, "callwait_state", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "cw_q", exM_byte0_bit3, "callwait_state", "00", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "ch_a", exM_byte0_bit0, "callhold_state", "00", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "ch_r", exM_byte0_bit1, "callhold_state", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "ch_p", exM_byte0_bit2, "callhold_state", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "ch_q", exM_byte0_bit3, "callhold_state", "00", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "ect_a", exM_byte0_bit0, "ect_state", "00", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "ect_r", exM_byte0_bit1, "ect_state", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "ect_p", exM_byte0_bit2, "ect_state", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "ect_q", exM_byte0_bit3, "ect_state", "00", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "mpc_a", exM_byte0_bit0, "mtpy_state", "00", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "mpc_r", exM_byte0_bit1, "mtpy_state", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "mpc_p", exM_byte0_bit2, "mtpy_state", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "mpc_q", exM_byte0_bit3, "mtpy_state", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "camel", exM_byte0_bit7, "camel_flag", "801F", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "o_csi", exM_byte1_bit0, "camel_flag", "801F", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "t_csi", exM_byte1_bit1, "camel_flag", "801F", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "ss_csi", exM_byte1_bit2, "camel_flag", "801F", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "sms_csi", exM_byte1_bit3, "camel_flag", "801F", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "gprs_csi", exM_byte1_bit4, "camel_flag", "801F", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "o_csi_dpv", 4 * 10000000 + 1 * 100000 + 2 * 1000 + exM_hlrOCsi1,
	   "o_csi",
	   "020002918675557122010EEE00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
	   "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "o_csi_sk", 4 * 10000000 + 1 * 100000 + 8 * 1000 + exM_hlrOCsi2,
	   "o_csi",
	   "020002918675557122010EEE00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
	   "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "o_csi_scf_no",
	   0 * 10000000 + 11 * 100000 + 18 * 1000 + exM_hlrOCsi3, "o_csi",
	   "020002918675557122010EEE00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
	   "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "o_csi_dch", exM_hlrOCsi4, "o_csi",
	   "020002918675557122010EEE00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
	   "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "o_csi_mtf", exM_hlrOCsi5, "o_csi",
	   "020002918675557122010EEE00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
	   "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "o_csi_mt", exM_hlrOCsi6, "o_csi",
	   "020002918675557122010EEE00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
	   "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "o_csi_dnlf", exM_hlrOCsi7, "o_csi",
	   "020002918675557122010EEE00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
	   "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "o_csi_d_no0",
	   0 * 10000000 + 11 * 100000 + 18 * 1000 + exM_hlrOCsi8, "o_csi",
	   "020002918675557122010EEE00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
	   "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "o_csi_d_no1",
	   0 * 10000000 + 11 * 100000 + 18 * 1000 + exM_hlrOCsi9, "o_csi",
	   "020002918675557122010EEE00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
	   "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "o_csi_d_no2",
	   0 * 10000000 + 11 * 100000 + 18 * 1000 + exM_hlrOCsi10, "o_csi",
	   "020002918675557122010EEE00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
	   "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "o_csi_d_no3",
	   0 * 10000000 + 11 * 100000 + 18 * 1000 + exM_hlrOCsi11, "o_csi",
	   "020002918675557122010EEE00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
	   "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "o_csi_dnllf", exM_hlrOCsi12, "o_csi",
	   "020002918675557122010EEE00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
	   "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "o_csi_dnl0",
	   4 * 10000000 + 1 * 100000 + 2 * 1000 + exM_hlrOCsi13, "o_csi",
	   "020002918675557122010EEE00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
	   "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "o_csi_dnl1",
	   4 * 10000000 + 1 * 100000 + 2 * 1000 + exM_hlrOCsi14, "o_csi",
	   "020002918675557122010EEE00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
	   "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "o_csi_dnl2",
	   4 * 10000000 + 1 * 100000 + 2 * 1000 + exM_hlrOCsi15, "o_csi",
	   "020002918675557122010EEE00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
	   "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "o_csi_ctf", exM_hlrOCsi16, "o_csi",
	   "020002918675557122010EEE00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
	   "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "o_csi_ct", exM_hlrOCsi17, "o_csi",
	   "020002918675557122010EEE00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
	   "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "o_csi_dc", 4 * 10000000 + 1 * 100000 + 2 * 1000 + exM_hlrOCsi18,
	   "o_csi",
	   "020002918675557122010EEE00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
	   "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "t_csi_dpv", 4 * 10000000 + 1 * 100000 + 2 * 1000 + exM_hlrOCsi1,
	   "t_csi",
	   "0C0000918675557122010EEE00000000", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "t_csi_sk", 4 * 10000000 + 1 * 100000 + 8 * 1000 + exM_hlrOCsi2,
	   "t_csi",
	   "0C0000918675557122010EEE00000000", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "t_csi_scf_no",
	   0 * 10000000 + 11 * 100000 + 18 * 1000 + exM_hlrOCsi3, "t_csi",
	   "0C0000918675557122010EEE00000000", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "t_csi_dch", exM_hlrOCsi4, "t_csi",
	   "0C0000918675557122010EEE00000000", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "t_csi_dc", 4 * 10000000 + 1 * 100000 + 2 * 1000 + exM_hlrOCsi18,
	   "t_csi",
	   "0C0000918675557122010EEE00000000", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "ss_csi_e0", exM_hlrSsCsi, "ss_csi", "00000000918675557122010EEE",
	   "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "ss_csi_e1", exM_hlrSsCsi, "ss_csi", "00000000918675557122010EEE",
	   "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "ss_csi_e2", exM_hlrSsCsi, "ss_csi", "00000000918675557122010EEE",
	   "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "ss_csi_e3", exM_hlrSsCsi, "ss_csi", "00000000918675557122010EEE",
	   "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "ss_csi_scf_no",
	   4 * 10000000 + 11 * 100000 + 18 * 1000 + exM_hlrSsCsi1, "ss_csi",
	   "00000000918675557122010EEE", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "sms_csi_dpv",
	   4 * 10000000 + 1 * 100000 + 2 * 1000 + exM_hlrOCsi1, "sms_csi",
	   "010003918675557122010EEE00000000", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "sms_csi_sk", 4 * 10000000 + 1 * 100000 + 8 * 1000 + exM_hlrOCsi2,
	   "sms_csi",
	   "010003918675557122010EEE00000000", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "sms_csi_scf_no",
	   0 * 10000000 + 11 * 100000 + 18 * 1000 + exM_hlrOCsi3, "sms_csi",
	   "010003918675557122010EEE00000000", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "sms_csi_dch", exM_hlrOCsi4, "sms_csi",
	   "010003918675557122010EEE00000000", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "sms_csi_dc",
	   4 * 10000000 + 1 * 100000 + 2 * 1000 + exM_hlrOCsi18, "sms_csi",
	   "010003918675557122010EEE00000000", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "gprs_csi_dpv",
	   4 * 10000000 + 1 * 100000 + 2 * 1000 + exM_hlrOCsi1, "gprs_csi",
	   "000003EEEEEEEEEEEEEEEEEE00000000", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "gprs_csi_sk",
	   4 * 10000000 + 1 * 100000 + 8 * 1000 + exM_hlrOCsi2, "gprs_csi",
	   "000003EEEEEEEEEEEEEEEEEE00000000", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "gprs_csi_scf_no",
	   0 * 10000000 + 11 * 100000 + 18 * 1000 + exM_hlrOCsi3, "gprs_csi",
	   "000003EEEEEEEEEEEEEEEEEE00000000", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "gprs_csi_dch", exM_hlrOCsi4, "gprs_csi",
	   "000003EEEEEEEEEEEEEEEEEE00000000", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "gprs_csi_dc",
	   4 * 10000000 + 1 * 100000 + 2 * 1000 + exM_hlrOCsi18, "gprs_csi",
	   "000003EEEEEEEEEEEEEEEEEE00000000", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "gprs_flag", exM_hlrState, "gprs_flag", "00", "", ""}
	  ,

	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "pdp1_flag", exM_hlrPdp1, "pdp1",
	   "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
	   "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "pdp1_type", exM_hlrPdp2, "pdp1",
	   "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
	   "", ""}
	  ,
	  //the pdpAddress must followed the pdpType
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "pdp1_address",
	   9 * 10000000 + 1 * 100000 + 39 * 1000 + exM_hlrPdp3, "pdp1",
	   "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
	   "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "pdp1_rc", exM_hlrPdp4, "pdp1",
	   "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
	   "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "pdp1_dc", exM_hlrPdp5, "pdp1",
	   "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
	   "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "pdp1_pc", exM_hlrPdp6, "pdp1",
	   "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
	   "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "pdp1_pt", exM_hlrPdp7, "pdp1",
	   "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
	   "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "pdp1_mt", exM_hlrPdp8, "pdp1",
	   "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
	   "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "pdp1_vaaf", exM_hlrPdp9, "pdp1",
	   "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
	   "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "pdp1_apn", 9 * 10000000 + 1 * 100000 + 32 * 1000 + exM_hlrPdp10,
	   "pdp1",
	   "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
	   "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "pdp2_flag", exM_hlrPdp1, "pdp2",
	   "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
	   "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "pdp2_type", exM_hlrPdp2, "pdp2",
	   "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
	   "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "pdp2_address",
	   9 * 10000000 + 1 * 100000 + 39 * 1000 + exM_hlrPdp3, "pdp2",
	   "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
	   "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "pdp2_rc", exM_hlrPdp4, "pdp2",
	   "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
	   "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "pdp2_dc", exM_hlrPdp5, "pdp2",
	   "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
	   "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "pdp2_pc", exM_hlrPdp6, "pdp2",
	   "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
	   "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "pdp2_pt", exM_hlrPdp7, "pdp2",
	   "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
	   "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "pdp2_mt", exM_hlrPdp8, "pdp2",
	   "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
	   "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "pdp2_vaaf", exM_hlrPdp9, "pdp2",
	   "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
	   "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "pdp2_apn", 9 * 10000000 + 1 * 100000 + 32 * 1000 + exM_hlrPdp10,
	   "pdp2",
	   "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
	   "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "pdp3_flag", exM_hlrPdp1, "pdp3",
	   "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
	   "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "pdp3_type", exM_hlrPdp2, "pdp3",
	   "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
	   "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "pdp3_address",
	   9 * 10000000 + 1 * 100000 + 39 * 1000 + exM_hlrPdp3, "pdp3",
	   "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
	   "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "pdp3_rc", exM_hlrPdp4, "pdp3",
	   "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
	   "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "pdp3_dc", exM_hlrPdp5, "pdp3",
	   "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
	   "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "pdp3_pc", exM_hlrPdp6, "pdp3",
	   "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
	   "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "pdp3_pt", exM_hlrPdp7, "pdp3",
	   "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
	   "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "pdp3_mt", exM_hlrPdp8, "pdp3",
	   "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
	   "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "pdp3_vaaf", exM_hlrPdp9, "pdp3",
	   "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
	   "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "pdp3_apn", 9 * 10000000 + 1 * 100000 + 32 * 1000 + exM_hlrPdp10,
	   "pdp3",
	   "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
	   "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "user_name", 9 * 10000000 + 1 * 100000 + 24 * 1000 + 0,
	   "user_name", "", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "user_desc", 9 * 10000000 + 1 * 100000 + 16 * 1000 + 0,
	   "user_remark", "", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "user_id", 9 * 10000000 + 1 * 100000 + 16 * 1000 + 0,
	   "user_certifiacate", "", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "user_no", 0 * 10000000 + 1 * 100000 + 16 * 1000 + exM_hlrUserNo,
	   "user_number", "0000000000000000", "",
	   ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "lmsi", 0, "lmsi", "00000000", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "vlr_no", 0, "vlr_num", "000000000000000000", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "msc_no", 0, "msc_num", "000000000000000000", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "pmf_gsm", exM_byte0_bit0, "purgems_flag", "03", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "pmf_gprs", exM_byte0_bit0, "purgems_flag", "03", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "sgsn_no", 0, "sgsn_num", "000000000000000000", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "ggsn_no", 0, "ggsn_num", "000000000000000000", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "ggsn_ad", 0, "ggsn_addr", "000000000000000000", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "msc_ar", 0, "mar_flag", "00", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "rrm", 0, "rruf_flag", "00", "", ""}
	  }
	 }
	,
	{0, "pps", "ppsuser", "172.18.98.1",
	 360, 0, 0, 0, "PPS_DB.user_info", "OBJ_360.tmpSubsData_0", "ppsParam",
	 "smcliPpsParam",
	 {1, 2, 2, 2, 1, 1, 2, 1, 2}	//20041010
	 , 47,						//20041010
	 {
	  {{0, 9, 9, 9, 9, 9, 9, 9, 9, 9}
	   , "ipaddress", 0, "", "", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 0, 9, 9, 9, 9}
	   , "passwd", 0, "", "123456", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 9, 1, 9, 9, 9}
	   , "expfile", 0, "", "", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 9, 1, 9, 9, 9}
	   , "query", 0, "", "", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 9, 1, 9, 9, 9}
	   , "fields", 0, "", "" "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 9, 1, 9, 9, 9}
	   , "max", 0, "", "", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 9, 9, 0, 9, 9}
	   , "impfile", 0, "", "", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 1, 9, 9, 9, 9}
	   , "srvip", 0, "", "", "", ""}
	  ,
	  {{0, 0, 0, 0, 0, 9, 9, 9, 9, 0}
	   , "msisdn", 0 * 10000000 + 6 * 100000 + 16 * 1000 + 0, "msisdn",
	   "FFFFFFFFFFFFFFFFFF", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9, 9}
	   , "pin", 0 * 10000000 + 6 * 100000 + 6 * 1000 + 0, "PIN", "123456",
	   "",
	   ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9, 9}
	   , "rent_type", exM_ppsRentType, "rent_type", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9, 9}
	   , "status", 0 * 10000000 + 1 * 100000 + 2 * 1000 + 0, "status",
	   "00", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9, 9}
	   , "balance", 2 * 10000000 + 7 * 100000 + 8 * 1000 + exM_ppsBalance,
	   "balance", "20000", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9, 9}
	   , "promotion_balance",
	   0 * 10000000 + 1 * 100000 + 6 * 1000 + exM_ppsBalance,
	   "promo_balance", "0", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9, 9}
	   , "cos_id", 4 * 10000000 + 1 * 100000 + 1 * 1000 + exM_ppsSM,
	   "cos_id", "0", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9, 9}
	   , "home_location0",
	   0 * 10000000 + 1 * 100000 + 2 * 1000 + exM_ppsSM, "home_location0",
	   "0", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9, 9}
	   , "home_location1",
	   0 * 10000000 + 1 * 100000 + 2 * 1000 + exM_ppsSM, "home_location1",
	   "1", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9, 9}
	   , "home_location2",
	   0 * 10000000 + 1 * 100000 + 2 * 1000 + exM_ppsSM, "home_location2",
	   "2", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9, 9}
	   , "home_location3",
	   0 * 10000000 + 1 * 100000 + 2 * 1000 + exM_ppsSM, "home_location3",
	   "3", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9, 9}
	   , "recharge_failed_times",
	   4 * 10000000 + 1 * 100000 + 2 * 1000 + exM_ppsSM,
	   "recharge_fail_counter", "0",
	   "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9, 9}
	   , "overdraft",
	   2 * 10000000 + 7 * 100000 + 6 * 1000 + exM_ppsBalance, "overdraft",
	   "0", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9, 9}
	   , "access_day", 0 * 10000000 + 8 * 100000 + 8 * 1000 + exM_ppsDate,
	   "access_date", "20040201000000",
	   "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9, 9}
	   , "mo_expiry_date",
	   0 * 10000000 + 8 * 100000 + 8 * 1000 + exM_ppsDate,
	   "mo_expiration_date",
	   "20060701000000 ", "",
	   ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9, 9}
	   , "mt_expiry_date",
	   0 * 10000000 + 8 * 100000 + 8 * 1000 + exM_ppsDate,
	   "mt_expiration_date",
	   "20060701000000 ", "",
	   ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9, 9}
	   , "promotion_date",
	   0 * 10000000 + 8 * 100000 + 8 * 1000 + exM_ppsDate,
	   "promo_exp_date",
	   "20060701000000 ", "",
	   ""}
	  ,
//	  {{0, 1, 2, 2, 9, 9, 9, 9, 9,9}
//	   , "mo_tariff_id", 0, "mo_tariff_id", "00", "", ""}
//	  ,
//	  {{0, 1, 2, 2, 9, 9, 9, 9, 9,9}
//	   , "mt_tariff_id", 0, "mt_tariff_id", "00", "", ""}
//	  ,
	 {{0, 1, 2, 2, 9, 9, 9, 9, 9, 9}
		 , "close_user_group_id", 4 * 10000000 + 1 * 100000 + 4 * 1000 + 0,
		 "cug_id", "0", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9, 9}
	   , "sm_inquiry_counter",
	   4 * 10000000 + 1 * 100000 + 2 * 1000 + exM_ppsSM,
	   "sm_inquiry_counter", "0", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9, 9}
	   , "prompt_language", 0 * 10000000 + 1 * 100000 + 1 * 1000 + 0,
	   "language_type", "0", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9, 9}
	   , "favorite_no_flag", 0 * 10000000 + 1 * 100000 + 2 * 1000 + 0,
	   "fav_numbers", "0", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9, 9}
	   , "favorite_no0", 0 * 10000000 + 0 * 100000 + 16 * 1000 + 0,
	   "favorite_number0", "", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9, 9}
	   , "favorite_no1", 0 * 10000000 + 0 * 100000 + 16 * 1000 + 0,
	   "favorite_number1", "", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9, 9}
	   , "favorite_no2", 0 * 10000000 + 0 * 100000 + 16 * 1000 + 0,
	   "favorite_number2", "", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9, 9}
	   , "favorite_no3", 0 * 10000000 + 0 * 100000 + 16 * 1000 + 0,
	   "favorite_number3", "", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9, 9}
	   , "favorite_no4", 0 * 10000000 + 0 * 100000 + 16 * 1000 + 0,
	   "favorite_number4", "", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9, 9}
	   , "favorite_change_counter",
	   4 * 10000000 + 1 * 100000 + 2 * 1000 + exM_ppsSM,
	   "fav_change_counter", "0",
	   "", ""}
	  ,
	  {{0, 1, 9, 9, 9, 9, 9, 9, 9, 9}
	   , "last_call_type", exM_ppsCallType, "last_call_type", "", "", ""}
	  ,
	  {{0, 1, 9, 9, 9, 9, 9, 9, 9, 9}
	   , "last_call_time", 0 * 10000000 + 8 * 100000 + 8 * 1000 + 0,
	   "last_call_time", "", "", ""}
	  ,
	  {{0, 1, 9, 9, 9, 9, 9, 9, 9, 9}
	   , "last_call_no", 0, "last_call_number", "", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9, 9}
	   , "cap_sm_balance0", 0 * 10000000 + 0 * 100000 + 8 * 1000 + 0,
	   "cap_sm_balance0", "", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9, 9}
	   , "cap_sm_counter0", 0 * 10000000 + 0 * 100000 + 8 * 1000 + 0,
	   "cap_sm_counter0", "", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9, 9}
	   , "cap_sm_balance1", 0 * 10000000 + 0 * 100000 + 8 * 1000 + 0,
	   "cap_sm_balance1", "", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9, 9}
	   , "cap_sm_counter1", 0 * 10000000 + 0 * 100000 + 8 * 1000 + 0,
	   "cap_sm_counter1", "", "", ""}
	  ,
	  //20041010 start
	  {{0, 9, 9, 9, 9, 9, 9, 9, 9, 2}
	   , "credit", 2 * 10000000 + 7 * 100000 + 8 * 1000 + 0, "", "", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 9, 9, 9, 9, 2}
	   , "promotion_credit", 2 * 10000000 + 7 * 100000 + 8 * 1000 + 0, "",
	   "", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 9, 9, 9, 9, 2}
	   , "mo_vday", 2 * 10000000 + 9 * 100000 + 8 * 1000 + 0, "", "", "",
	   ""}
	  ,
	  {{0, 9, 9, 9, 9, 9, 9, 9, 9, 2}
	   , "mt_vday", 2 * 10000000 + 9 * 100000 + 8 * 1000 + 0, "", "", "",
	   ""}
	  ,
	  {{0, 9, 9, 9, 9, 9, 9, 9, 9, 2}
	   , "promotion_vday", 2 * 10000000 + 9 * 100000 + 8 * 1000 + 0, "",
	   "", "", ""}
	  //20041010 end
	  }
	 }
	,
	{0, "pps", "ppscard", "172.18.98.1",
	 360, 0, 0, 1, "PPS_DB.card_info", "OBJ_360.tmpSubsData_1", "", "",
	 {1, 2, 9, 9, 9, 9, 9, 9, 9}
	 , 15,
	 {
	  //{{0,re,mo,cr,de,co,ex,im,di}
	  //,"optName","exMode","fieldName","initFieldValue","optValue","fieldValue"
	  {{0, 9, 9, 9, 9, 9, 9, 9, 9}
	   , "ipaddress", 0, "", "", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 0, 9, 9, 9}
	   , "passwd", 0, "", "123456", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 9, 9, 9, 9}
	   , "expfile", 0, "", "", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 9, 9, 9, 9}
	   , "query", 0, "", "", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 9, 9, 9, 9}
	   , "fields", 0, "", "", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 9, 9, 9, 9}
	   , "max", 0, "", "", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 9, 9, 9, 9}
	   , "impfile", 0, "", "", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 2, 9, 9, 9}
	   , "srvip", 0, "", "", "", ""}
	  ,
	  {{0, 0, 0, 9, 9, 9, 9, 9, 9}
	   , "cardno", 0 * 10000000 + 12 * 100000 + 18 * 1000 + 0, "card_no",
	   "0000000000000000", "", ""}
	  ,
	  {{0, 1, 9, 9, 9, 9, 9, 9, 9}
	   , "facevalue", 0, "face_value", "00", "", ""}
	  ,
	  {{0, 1, 3, 9, 9, 9, 9, 9, 9}
	   //, "status", exM_ppsCardStatus, "card_status", "00", "", ""}
	   , "status", 0, "card_status", "00", "", ""}
	  ,
	  {{0, 1, 9, 9, 9, 9, 9, 9, 9}
	   , "expiry_date", exM_ppsDate, "expiry_date", "00000000", "", ""}
	  ,
	  {{0, 1, 9, 9, 9, 9, 9, 9, 9}
	   , "valid_days", exM_ppsDate, "valid_time", "00", "", ""}
	  ,
	  {{0, 1, 9, 9, 9, 9, 9, 9, 9}
	   , "recharge_date", exM_ppsDate, "updated_date", "00000000", "", ""}
	  ,
	  {{0, 1, 9, 9, 9, 9, 9, 9, 9}
	   , "charged_to", 0 * 10000000 + 0 * 100000 + 16 * 1000 + 0,
	   "msisdn_used", "00", "", ""}
	  }
	 }
	,
	//20041101 start
	{0, "vms", "vmsSubscriber", "172.18.98.1",
	 390, 0, 0, 0, "VMS_DB.subscriberData_0", "OBJ_390.tmpSubsData_0", "",
	 "",
	 {1, 2, 2, 2, 1, 1, 2, 1, 9}
	 , 22,
	 {
	  //{{0,re,mo,cr,de,co,ex,im,di}
	  //,"optName","exMode","fieldName","initFieldValue","optValue","fieldValue"
	  {{0, 9, 9, 9, 9, 9, 9, 9, 9}
	   , "ipaddress", 0, "", "", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 0, 9, 9, 9}
	   , "passwd", 0, "", "123456", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 9, 1, 9, 9}
	   , "expfile", 0, "", "", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 9, 1, 9, 9}
	   , "query", 0, "", "", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 9, 1, 9, 9}
	   , "fields", 0, "", "", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 9, 1, 9, 9}
	   , "max", 0, "", "", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 9, 9, 0, 9}
	   , "impfile", 0, "", "", "", ""}
	  ,
	  {{0, 0, 0, 0, 0, 0, 0, 0, 0}
	   , "srvip", 0, "", "", "", ""}
	  ,
	  {{0, 0, 0, 0, 0, 9, 9, 9, 9}
	   , "msisdn", 0 * 10000000 + 6 * 100000 + 16 * 1000 + 0, "msisdn",
	   "FFFFFFFFFFFFFFFFFF", "", ""}
	  ,
	  {{0, 1, 9, 2, 9, 9, 9, 9, 9}
	   , "system_id",
	   0 * 10000000 + 1 * 100000 + 10 * 1000 + exM_vmsHexDec, "systemID",
	   "00", "", ""}
	  ,
	  {{0, 1, 9, 2, 9, 9, 9, 9, 9}
	   , "mailbox_id",
	   0 * 10000000 + 1 * 100000 + 4 * 1000 + exM_vmsMailboxId,
	   "mailboxID", "0", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "register_flag", exM_byte0_bit2, "status", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "active_flag", exM_byte0_bit1, "status", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "locked_flag", exM_byte0_bit0, "status", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "language", 0 * 10000000 + 1 * 100000 + 1 * 1000 + exM_vmsHexDec,
	   "promo_language", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "temporary_greeting", exM_byte0_bit7, "greeting", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "greeting_type", exM_vmsGreetingType, "greeting", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "password_flag", exM_byte0_bit0, "optionFlag", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "callback_flag", exM_byte0_bit1, "optionFlag", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "cli_flag", exM_byte0_bit2, "optionFlag", "00", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9}
	   , "password", 0 * 10000000 + 4 * 100000 + 4 * 1000 + 0, "pwdValue",
	   "0000", "", ""}
	  ,
	  {{0, 1, 3, 2, 9, 9, 9, 9, 9}
	   , "callback_timeout",
	   0 * 10000000 + 2 * 100000 + 2 * 1000 + exM_vmsHexDec, "acbTimeOut",
	   "10", "", ""}
	  }
	 }
	,
	//20041125 start
	{0, "pps", "ppsesme", "172.18.98.1",
	 360, 0, 0, 2, "PPS_DB.third_party", "OBJ_360.tmpSubsData_2", "", "",
	 {9, 9, 3, 9, 9, 9, 9, 9, 9}
	 , 14,
	 {
	  //{{0,re,mo,cr,de,co,ex,im,di}
	  //,"optName","exMode","fieldName","initFieldValue","optValue","fieldValue"
	  {{0, 9, 9, 9, 9, 9, 9, 9, 9, 9}
	   , "ipaddress", 0, "", "", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 0, 9, 9, 9, 9}
	   , "passwd", 0, "", "123456", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 9, 9, 9, 9, 9}
	   , "expfile", 0, "", "", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 9, 9, 9, 9, 9}
	   , "query", 0, "", "", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 9, 9, 9, 9, 9}
	   , "fields", 0, "", "", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 9, 9, 9, 9, 9}
	   , "max", 0, "", "", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 9, 9, 9, 9, 9}
	   , "impfile", 0, "", "", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 9, 1, 9, 9, 9}
	   , "srvip", 0, "", "", "", ""}
	  ,
	  {{0, 9, 9, 0, 9, 9, 9, 9, 9, 9}
	   , "no", 0, "service_number", "FFFFFFFFFFFFFFFFFF", "", ""}
	  ,
	  {{0, 9, 9, 3, 9, 9, 9, 9, 9, 9}
	   , "id", 0, "service_id", "00000000", "", ""}
	  ,
	  {{0, 9, 9, 3, 9, 9, 9, 9, 9, 9}
	   , "pwd", 0, "service_pwd", "00000000", "", ""}
	  ,
	  {{0, 9, 9, 3, 9, 9, 9, 9, 9, 9}
	   , "type", 0, "service_type", "0", "", ""}
	  ,
	  {{0, 9, 9, 3, 9, 9, 9, 9, 9, 9}
	   , "card_pwd", 0, "card_pwd", "00000000000000000000", "", ""}
	  ,
	  {{0, 9, 9, 3, 9, 9, 9, 9, 9, 9}
	   , "amount", exM_ppsBalance, "charge_amount", "0", "", ""}
	  }
	 }
	,
	//20041125 end
	{0, "hlr", "hlresme", "172.18.98.1",
	 330, 0, 0, 1, "HLR_DB.subscriberData", "OBJ_330.tmpSubsData_0", "",
	 "",
	 {1, 9, 9, 9, 9, 9, 9, 9, 9}
	 , 10,
	 {
	  //{{0,1,2,3,4,5,6,7,9}, 0=mandatory,1~8=privilege1.........privilege8,9=nouse
	  //{{0,re,mo,cr,de,co,ex,im,di}
	  //,"optName","exMode","fieldName","initFieldValue","optValue","fieldValue"
	  {{0, 9, 9, 9, 9, 9, 9, 9, 9}
	   , "ipaddress", 0, "", "", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 0, 9, 9, 9}
	   , "passwd", 0, "", "123456", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 9, 9, 9, 9}
	   , "expfile", 0, "", "", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 9, 9, 9, 9}
	   , "query", 0, "", "", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 9, 9, 9, 9}
	   , "fields", 0, "", "", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 9, 9, 9, 9}
	   , "max", 0, "", "", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 9, 9, 9, 9}
	   , "impfile", 0, "", "", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 1, 9, 9, 9}
	   , "srvip", 0, "", "", "", ""}
	  ,
	  {{0, 0, 9, 9, 9, 9, 9, 9, 9}
	   , "msisdn", 0 * 10000000 + 6 * 100000 + 16 * 1000 + exM_hlrCcNdcSn,
	   "inter_msisdn", "0000000000000000",
	   "", ""}
	  ,
	  {{0, 1, 9, 9, 9, 9, 9, 9, 9}
	   , "camel", exM_byte0_bit7, "camel_flag", "801F", "", ""}
	  }
	 }
	,
	{0, "mnp", "mnpSubscriber", "172.18.98.1",
	 370, 0, 0, 0, "MNP_DB.subscriberData", "OBJ_370.tmpSubsData_0", "",
	 "",
	 {1, 2, 2, 2, 1, 1, 2, 1, 2}	//20041010
	 , 14,						//20041010
	 {
	  {{0, 9, 9, 9, 9, 9, 9, 9, 9, 9}
	   , "ipaddress", 0, "", "", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 0, 9, 9, 9, 9}
	   , "passwd", 0, "", "123456", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 9, 1, 9, 9, 9}
	   , "expfile", 0, "", "", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 9, 1, 9, 9, 9}
	   , "query", 0, "", "", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 9, 1, 9, 9, 9}
	   , "fields", 0, "", "" "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 9, 1, 9, 9, 9}
	   , "max", 0, "", "", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 9, 9, 0, 9, 9}
	   , "impfile", 0, "", "", "", ""}
	  ,
	  {{0, 9, 9, 9, 9, 1, 9, 9, 9, 9}
	   , "srvip", 0, "", "", "", ""}
	  ,
	  {{0, 0, 0, 0, 0, 9, 9, 9, 9, 9}
	   , "msisdn", 0 * 10000000 + 6 * 100000 + 16 * 1000 + 0, "msisdn",
	   "FFFFFFFFFFFFFFFFFF", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9, 9}
	   , "status", exM_mnpStatus, "status", "02", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9, 9}
	   , "routing_number", 0 * 10000000 + 1 * 100000 + 8 * 1000 + 0,
	   "routing_number", "0000000000000000", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9, 9}
	   , "donor", 9 * 10000000 + 1 * 100000 + 16 * 1000 + 0, "donor",
	   "00000000000000000000000000000000", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9, 9}
	   , "recipient", 9 * 10000000 + 1 * 100000 + 16 * 1000 + 0,
	   "recipient", "00000000000000000000000000000000", "", ""}
	  ,
	  {{0, 1, 2, 2, 9, 9, 9, 9, 9, 9}
	   , "date",
	   0 * 10000000 + 8 * 100000 + 8 * 1000 + exM_mnpDate,
	   "date",
	   "20060701000000 ", "",
	   ""}
	  }
	 }
};
*/

////////////////////////follow two function are modifiable/////////////////////
/*************************************************
Function:        // exValueFieldToOpt
Description:     // 参数的值从数据库的格式转换成输入输出的格式
Calls:           // getBitValue
Called By:       // doCmdExportAccount; doCmdRead; ......
Table Accessed:  // 
Table Updated:   // 
Input:           // optNo:the index of the parameter;
Output:          // 
Return:          // 
Others:          // 
*************************************************/
int exValueFieldToOpt(int optNo)
{
	int i = 0;
	int j = 0;
	int tmpValue;
	unsigned char tmpBitValue;
	unsigned char tmpBitValue1;
	unsigned char tmpBitValue2;
	unsigned char tmpBitValue3;
	unsigned char tmpBitValue4;
	unsigned char tmpBitValue5;
	unsigned char tmpBitValue6;
	unsigned char tmpBitValue7;
	char tmpStr[15];
	int tmpExMode;

	tmpExMode = cmdBuf->optDef[optNo].exMode % 1000;
	//writeDebug("tmpExMode=%d,optNo=%d,cmdBuf->optDef[optNo].exMode=%d",tmpExMode,optNo,cmdBuf->optDef[optNo].exMode);
	//account
	if (cmdBuf->sysTypeNo == 0) {
		i = strlen(cmdBuf->optDef[optNo].fieldValue);
		if ((cmdBuf->optDef[optNo].fieldValue[i - 1] == '\n')
			|| (cmdBuf->optDef[optNo].fieldValue[i - 1] == '\r')) {
			cmdBuf->optDef[optNo].fieldValue[i - 1] = '\0';
			i = i - 1;
		}
		if ((cmdBuf->optDef[optNo].fieldValue[i - 1] == '\n')
			|| (cmdBuf->optDef[optNo].fieldValue[i - 1] == '\r')) {
			cmdBuf->optDef[optNo].fieldValue[i - 1] = '\0';
		}
		sprintf(cmdBuf->optDef[optNo].optValue, "%s",
				cmdBuf->optDef[optNo].fieldValue);
		return (0);
	}
	//hlr
	if (cmdBuf->sysTypeNo == 330) {
		switch (tmpExMode) {
		case exM_hlrImsi:
			//imsi
			j = strlen(cmdBuf->optDef[optNo].fieldValue);
			for (i = 0; i < j; i++) {
				if (cmdBuf->optDef[optNo].fieldValue[i] != '0') {
					break;
				}
			}
			sprintf(cmdBuf->optDef[optNo].optValue, "%.*s", j - i,
					cmdBuf->optDef[optNo].fieldValue + i);
			break;
		case exM_hlrCcNdcSn:
			//msisdn
			for (i = 2; i < strlen(cmdBuf->optDef[optNo].fieldValue); i++) {
				if (cmdBuf->optDef[optNo].fieldValue[i] != 'E') {
					cmdBuf->optDef[optNo].optValue[i - 2] =
						cmdBuf->optDef[optNo].fieldValue[i];
				} else {
					cmdBuf->optDef[optNo].optValue[i - 2] = '\0';
					return (0);
				}
			}
			break;
		case exM_hlrMsisdn:
			//cfu_num,cfb_num,cfnry_num,cfnrc_num
			for (i = 0; i < strlen(cmdBuf->optDef[optNo].fieldValue); i++) {
				if (cmdBuf->optDef[optNo].fieldValue[i] != 'E') {
					cmdBuf->optDef[optNo].optValue[i] =
						cmdBuf->optDef[optNo].fieldValue[i];
				} else {
					cmdBuf->optDef[optNo].optValue[i] = '\0';
					return (0);
				}
			}
			if (strlen(cmdBuf->optDef[optNo].optValue) == 0) {
				sprintf(cmdBuf->optDef[optNo].optValue, "\"\"");
			}
			break;
		case exM_hlrNam:
			//nam
			if (strcmp(cmdBuf->optDef[optNo].fieldValue, "01") == 0) {
				sprintf(cmdBuf->optDef[optNo].optValue, "gsm");
			} else if (strcmp(cmdBuf->optDef[optNo].fieldValue, "02") == 0) {
				sprintf(cmdBuf->optDef[optNo].optValue, "gprs");
			} else {
				sprintf(cmdBuf->optDef[optNo].optValue, "dual");
			}
			break;
		case exM_hlrState:
			//imsi_flag,baoc,boic,boic_hplmn,baic,cfu,cfb
			//cfnry,cfnrc,clip,clir,colp,colr,ch,cw
			if (strcmp(cmdBuf->optDef[optNo].fieldValue, "01") == 0) {
				sprintf(cmdBuf->optDef[optNo].optValue, "enable");
			} else {
				sprintf(cmdBuf->optDef[optNo].optValue, "disable");
			}
			break;
		case exM_hlrClirpm:
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 0, 4,
						&tmpBitValue);
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 0, 5,
						&tmpBitValue1);
			tmpBitValue2 = tmpBitValue1 * 2 + tmpBitValue;
			switch (tmpBitValue2) {
			case 0:
				sprintf(cmdBuf->optDef[optNo].optValue, "Permanent");
				break;
			case 1:
				sprintf(cmdBuf->optDef[optNo].optValue,
						"Temporary(Default:Restricted)");
				break;
			case 2:
				sprintf(cmdBuf->optDef[optNo].optValue,
						"Temporary(Default:Allowed)");
				break;
			default:
				break;
			}
			break;
		case exM_hlrSms:
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 0, 2,
						&tmpBitValue);
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 0, 3,
						&tmpBitValue1);
			tmpBitValue2 = tmpBitValue1 * 2 + tmpBitValue;
			switch (tmpBitValue2) {
			case 0:
				sprintf(cmdBuf->optDef[optNo].optValue, "None");
				break;
			case 1:
				sprintf(cmdBuf->optDef[optNo].optValue, "Mobile_Term");
				break;
			case 2:
				sprintf(cmdBuf->optDef[optNo].optValue, "Mobile_Org");
				break;
			case 3:
				sprintf(cmdBuf->optDef[optNo].optValue, "Both");
				break;
			default:
				break;
			}
			break;
		case exM_hlrCfuopt:
		case exM_hlrCfnrcopt:
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 0, 5,
						&tmpBitValue);
			if (tmpBitValue) {
				sprintf(cmdBuf->optDef[optNo].optValue,
						"Calling_Party:ON");
			} else {
				sprintf(cmdBuf->optDef[optNo].optValue,
						"Calling_Party:OFF");
			}
			break;
		case exM_hlrCfbopt:
		case exM_hlrCfnryopt:
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 0, 5,
						&tmpBitValue);
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 0, 7,
						&tmpBitValue1);
			tmpBitValue2 = tmpBitValue * 2 + tmpBitValue1;
			switch (tmpBitValue2) {
			case 0:
				sprintf(cmdBuf->optDef[optNo].optValue,
						"Calling_Party:OFF/Fwd_Party:OFF");
				break;
			case 1:
				sprintf(cmdBuf->optDef[optNo].optValue,
						"Calling_Party:OFF/Fwd_Party:ON");
				break;
			case 2:
				sprintf(cmdBuf->optDef[optNo].optValue,
						"Calling_Party:ON/Fwd_Party:OFF");
				break;
			case 3:
				sprintf(cmdBuf->optDef[optNo].optValue,
						"Calling_Party:ON/Fwd_Party:ON");
				break;
			default:
				break;
			}
			break;
		case exM_hlrCfnryTimer:
			//cfnry_timer
			hex2dec(cmdBuf->optDef[optNo].fieldValue,
					cmdBuf->optDef[optNo].optValue);
			//sprintf(cmdBuf->optDef[optNo].optValue, "%s",
			//      cmdBuf->optDef[optNo].fieldValue);
			break;
		case exM_hlrCategory:
			hex2dec(cmdBuf->optDef[optNo].fieldValue, tmpStr);
			i = atoi(tmpStr);
			switch (i) {
			case 00:
				sprintf(cmdBuf->optDef[optNo].optValue, "Unknown");
				break;
			case 01:
				sprintf(cmdBuf->optDef[optNo].optValue, "French");
				break;
			case 02:
				sprintf(cmdBuf->optDef[optNo].optValue, "English");
				break;
			case 03:
				sprintf(cmdBuf->optDef[optNo].optValue, "German");
				break;
			case 04:
				sprintf(cmdBuf->optDef[optNo].optValue, "Russian");
				break;
			case 05:
				sprintf(cmdBuf->optDef[optNo].optValue, "Spanish");
				break;
			case 10:
				sprintf(cmdBuf->optDef[optNo].optValue,
						"Ordinary_calling_subscriber");
				break;
			case 11:
				sprintf(cmdBuf->optDef[optNo].optValue,
						"Priory_calling_suscriber");
				break;
			default:
				sprintf(cmdBuf->optDef[optNo].optValue, "Unknown");
				break;
			}
			break;
		case exM_hlrRszi:
			i = (optNo - optNo_Rszi);
			tmpStr[0] = cmdBuf->optDef[optNo].fieldValue[i * 2];
			tmpStr[1] = cmdBuf->optDef[optNo].fieldValue[i * 2 + 1];
			tmpStr[2] = '\0';
			hex2dec(tmpStr, cmdBuf->optDef[optNo].optValue);
			break;
		case exM_hlrCsrr:
			hex2dec(cmdBuf->optDef[optNo].fieldValue,
					cmdBuf->optDef[optNo].optValue);
			i = atoi(cmdBuf->optDef[optNo].optValue);
			if (i > 7)
				sprintf(cmdBuf->optDef[optNo].optValue, "No_restriction");
			break;
		case exM_hlrCbsp:
			i = atoi(cmdBuf->optDef[optNo].fieldValue);
			switch (i) {
			case 0:
				sprintf(cmdBuf->optDef[optNo].optValue,
						"Control_provider");
				break;
			case 1:
				sprintf(cmdBuf->optDef[optNo].optValue, "Control_sub_pwd");
				break;
			case 2:
				sprintf(cmdBuf->optDef[optNo].optValue,
						"Control_sub_not_pwd");
				break;
			}
			break;
		case exM_hlrCbwpa:
			sprintf(cmdBuf->optDef[optNo].optValue, "%s",
					cmdBuf->optDef[optNo].fieldValue);
			break;
		case exM_hlrOCsi1:
			tmpStr[0] = cmdBuf->optDef[optNo].fieldValue[0];
			tmpStr[1] = cmdBuf->optDef[optNo].fieldValue[1];
			tmpStr[2] = '\0';
			hex2dec(tmpStr, cmdBuf->optDef[optNo].optValue);
			break;
		case exM_hlrOCsi2:
			tmpStr[0] = cmdBuf->optDef[optNo].fieldValue[24];
			tmpStr[1] = cmdBuf->optDef[optNo].fieldValue[25];
			tmpStr[2] = cmdBuf->optDef[optNo].fieldValue[26];
			tmpStr[3] = cmdBuf->optDef[optNo].fieldValue[27];
			tmpStr[4] = cmdBuf->optDef[optNo].fieldValue[28];
			tmpStr[5] = cmdBuf->optDef[optNo].fieldValue[29];
			tmpStr[6] = cmdBuf->optDef[optNo].fieldValue[30];
			tmpStr[7] = cmdBuf->optDef[optNo].fieldValue[31];
			tmpStr[8] = '\0';
			hex2dec(tmpStr, cmdBuf->optDef[optNo].optValue);
			break;
		case exM_hlrOCsi3:
			for (i = 0; i < 18; i++) {
				if (cmdBuf->optDef[optNo].fieldValue[i + 6] == 'E')
					break;
				cmdBuf->optDef[optNo].optValue[i] =
					cmdBuf->optDef[optNo].fieldValue[i + 6];
			}
			cmdBuf->optDef[optNo].optValue[i + 1] = '\0';
			break;
		case exM_hlrOCsi4:
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 1, 0,
						&tmpBitValue);
			if (tmpBitValue == 0)
				sprintf(cmdBuf->optDef[optNo].optValue, "Continue_call");
			else
				sprintf(cmdBuf->optDef[optNo].optValue, "Release_call");
			break;
		case exM_hlrOCsi5:
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 16, 0,
						&tmpBitValue);
			if (tmpBitValue == 0)
				sprintf(cmdBuf->optDef[optNo].optValue, "Not_use");
			else
				sprintf(cmdBuf->optDef[optNo].optValue, "In_use");
			break;
		case exM_hlrOCsi6:
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 17, 0,
						&tmpBitValue);
			if (tmpBitValue == 0)
				sprintf(cmdBuf->optDef[optNo].optValue, "Inhabiting");
			else
				sprintf(cmdBuf->optDef[optNo].optValue, "Enabling");
			break;
		case exM_hlrOCsi7:
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 16, 2,
						&tmpBitValue);
			if (tmpBitValue == 0)
				sprintf(cmdBuf->optDef[optNo].optValue, "Not_use");
			else
				sprintf(cmdBuf->optDef[optNo].optValue, "In_use");
			break;
		case exM_hlrOCsi8:
			for (i = 0; i < 18; i++) {
				if (cmdBuf->optDef[optNo].fieldValue[i + 38] == 'E')
					break;
				cmdBuf->optDef[optNo].optValue[i] =
					cmdBuf->optDef[optNo].fieldValue[i + 38];
			}
			cmdBuf->optDef[optNo].optValue[i + 1] = '\0';
			break;
		case exM_hlrOCsi9:
			for (i = 0; i < 18; i++) {
				if (cmdBuf->optDef[optNo].fieldValue[i + 56] == 'E')
					break;
				cmdBuf->optDef[optNo].optValue[i] =
					cmdBuf->optDef[optNo].fieldValue[i + 56];
			}
			cmdBuf->optDef[optNo].optValue[i + 1] = '\0';
			break;
		case exM_hlrOCsi10:
			for (i = 0; i < 18; i++) {
				if (cmdBuf->optDef[optNo].fieldValue[i + 74] == 'E')
					break;
				cmdBuf->optDef[optNo].optValue[i] =
					cmdBuf->optDef[optNo].fieldValue[i + 74];
			}
			cmdBuf->optDef[optNo].optValue[i + 1] = '\0';
			break;
		case exM_hlrOCsi11:
			for (i = 0; i < 18; i++) {
				if (cmdBuf->optDef[optNo].fieldValue[i + 92] == 'E')
					break;
				cmdBuf->optDef[optNo].optValue[i] =
					cmdBuf->optDef[optNo].fieldValue[i + 92];
			}
			cmdBuf->optDef[optNo].optValue[i + 1] = '\0';
			break;
		case exM_hlrOCsi12:
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 16, 3,
						&tmpBitValue);
			if (tmpBitValue == 0)
				sprintf(cmdBuf->optDef[optNo].optValue, "Not_use");
			else
				sprintf(cmdBuf->optDef[optNo].optValue, "In_use");
			break;
		case exM_hlrOCsi13:
			tmpStr[0] = cmdBuf->optDef[optNo].fieldValue[110];
			tmpStr[1] = cmdBuf->optDef[optNo].fieldValue[111];
			tmpStr[2] = '\0';
			hex2dec(tmpStr, cmdBuf->optDef[optNo].optValue);
			break;
		case exM_hlrOCsi14:
			tmpStr[0] = cmdBuf->optDef[optNo].fieldValue[112];
			tmpStr[1] = cmdBuf->optDef[optNo].fieldValue[113];
			tmpStr[2] = '\0';
			hex2dec(tmpStr, cmdBuf->optDef[optNo].optValue);
			break;
		case exM_hlrOCsi15:
			tmpStr[0] = cmdBuf->optDef[optNo].fieldValue[114];
			tmpStr[1] = cmdBuf->optDef[optNo].fieldValue[115];
			tmpStr[2] = '\0';
			hex2dec(tmpStr, cmdBuf->optDef[optNo].optValue);
			break;
		case exM_hlrOCsi16:
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 16, 1,
						&tmpBitValue);
			if (tmpBitValue == 0)
				sprintf(cmdBuf->optDef[optNo].optValue, "Not_use");
			else
				sprintf(cmdBuf->optDef[optNo].optValue, "In_use");
			break;
		case exM_hlrOCsi17:
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 18, 0,
						&tmpBitValue);
			if (tmpBitValue == 0)
				sprintf(cmdBuf->optDef[optNo].optValue, "Forward");
			else
				sprintf(cmdBuf->optDef[optNo].optValue, "Not_forword");
			break;
		case exM_hlrOCsi18:
			tmpStr[0] = cmdBuf->optDef[optNo].fieldValue[4];
			tmpStr[1] = cmdBuf->optDef[optNo].fieldValue[5];
			tmpStr[2] = '\0';
			hex2dec(tmpStr, cmdBuf->optDef[optNo].optValue);
			break;
		case exM_hlrSsCsi:
			i = optNo - optNo_Sscsi;
			tmpStr[0] = cmdBuf->optDef[optNo].fieldValue[i * 2];
			tmpStr[1] = cmdBuf->optDef[optNo].fieldValue[i * 2 + 1];
			tmpStr[2] = '\0';
			if (strcmp(tmpStr, "24") == 0)
				sprintf(cmdBuf->optDef[optNo].optValue, "cd");
			else if (strcmp(tmpStr, "31") == 0)
				sprintf(cmdBuf->optDef[optNo].optValue, "ect");
			else if (strcmp(tmpStr, "51") == 0)
				sprintf(cmdBuf->optDef[optNo].optValue, "multiPTY");
			else
				sprintf(cmdBuf->optDef[optNo].optValue, "None");
			break;
		case exM_hlrSsCsi1:
			for (i = 0; i < 18; i++) {
				if (cmdBuf->optDef[optNo].fieldValue[i + 8] == 'E')
					break;
				cmdBuf->optDef[optNo].optValue[i] =
					cmdBuf->optDef[optNo].fieldValue[i + 8];
			}
			cmdBuf->optDef[optNo].optValue[i + 1] = '\0';
			break;
		case exM_hlrPdp1:
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 0, 0,
						&tmpBitValue);
			if (tmpBitValue == 0)
				sprintf(cmdBuf->optDef[optNo].optValue, "disable");
			else
				sprintf(cmdBuf->optDef[optNo].optValue, "enable");
			break;
		case exM_hlrPdp2:
			omc_AsciiToRbcd(&tmpBitValue1,
							cmdBuf->optDef[optNo].fieldValue + 2, 2);
			omc_AsciiToRbcd(&tmpBitValue2,
							cmdBuf->optDef[optNo].fieldValue + 2 + 2, 2);
			tmpValue = tmpBitValue1 * 256 + tmpBitValue2;
			//printf("tmpValue=%d\n",tmpValue);
			if (tmpValue == 289)
				sprintf(cmdBuf->optDef[optNo].optValue, "IPv4");
			else if (tmpValue == 343)
				sprintf(cmdBuf->optDef[optNo].optValue, "IPv6");
			else
				sprintf(cmdBuf->optDef[optNo].optValue, "X.25");
			break;
		case exM_hlrPdp3:
			omc_AsciiToRbcd(&tmpBitValue1,
							cmdBuf->optDef[optNo].fieldValue + 2, 2);
			omc_AsciiToRbcd(&tmpBitValue2,
							cmdBuf->optDef[optNo].fieldValue + 2 + 2, 2);
			tmpValue = tmpBitValue1 * 256 + tmpBitValue2;
			cmdBuf->optDef[optNo].optValue[0] = 0;
			if (tmpValue == 289) {
				omc_AsciiToRbcd(&tmpBitValue1,
								cmdBuf->optDef[optNo].fieldValue + 6, 2);
				if(tmpBitValue1 == 0x04)
				{
					omc_AsciiToRbcd(&tmpBitValue1,
								cmdBuf->optDef[optNo].fieldValue + 6 + 2 +
								0 * 2, 2);
					omc_AsciiToRbcd(&tmpBitValue2,
								cmdBuf->optDef[optNo].fieldValue + 6 + 2 +
								1 * 2, 2);
					omc_AsciiToRbcd(&tmpBitValue3,
								cmdBuf->optDef[optNo].fieldValue + 6 + 2 +
								2 * 2, 2);
					omc_AsciiToRbcd(&tmpBitValue4,
								cmdBuf->optDef[optNo].fieldValue + 6 + 2 +
								3 * 2, 2);
					sprintf(cmdBuf->optDef[optNo].optValue, "%d.%d.%d.%d",
						tmpBitValue1, tmpBitValue2, tmpBitValue3,tmpBitValue4);
				}
				else
				{
					sprintf(cmdBuf->optDef[optNo].optValue, "null");
				}
			} else if (tmpValue == 343) {
				for (i = 0; i < 8; i++) {
					memcpy(tmpStr,
						   cmdBuf->optDef[optNo].fieldValue + 6 + 2 +
						   i * 4, 4);
					tmpStr[4] = 0;
					strcat(cmdBuf->optDef[optNo].optValue, tmpStr);
					strcat(cmdBuf->optDef[optNo].optValue, ":");
				}
				cmdBuf->optDef[optNo].optValue[39] = 0;
			} else {
				for (i = 0; i < 14; i++) {
					if (isdigit
						(cmdBuf->optDef[optNo].fieldValue[6 + 2 + i]))
						cmdBuf->optDef[optNo].optValue[i] =
							cmdBuf->optDef[optNo].fieldValue[6 + 2 + i];
					else
						break;
				}
				cmdBuf->optDef[optNo].optValue[i] = 0;
			}
			break;
		case exM_hlrPdp4:
			/*  sprintf(cmdBuf->optDef[optNo].optValue, "%c",
			   cmdBuf->optDef[optNo].fieldValue[41]);
			   break;
			 */
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 20, 0,
						&tmpBitValue);
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 20, 1,
						&tmpBitValue1);
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 20, 2,
						&tmpBitValue2);
			tmpBitValue3 =
				tmpBitValue2 * 4 + tmpBitValue1 * 2 + tmpBitValue;
			sprintf(cmdBuf->optDef[optNo].optValue, "%d", tmpBitValue3);
			break;
		case exM_hlrPdp5:
			/*sprintf(cmdBuf->optDef[optNo].optValue, "%c",
			   cmdBuf->optDef[optNo].fieldValue[40]);

			   break; */
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 20, 3,
						&tmpBitValue);
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 20, 4,
						&tmpBitValue1);
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 20, 5,
						&tmpBitValue2);
			tmpBitValue3 =
				tmpBitValue2 * 4 + tmpBitValue1 * 2 + tmpBitValue;
			sprintf(cmdBuf->optDef[optNo].optValue, "%d", tmpBitValue3);
			break;
		case exM_hlrPdp6:
			omc_AsciiToRbcd(&tmpBitValue,
							cmdBuf->optDef[optNo].fieldValue + 43, 1);
			if (tmpBitValue == 1)
				sprintf(cmdBuf->optDef[optNo].optValue, "High");
			else if (tmpBitValue == 2)
				sprintf(cmdBuf->optDef[optNo].optValue, "Normal");
			else
				sprintf(cmdBuf->optDef[optNo].optValue, "Low");
			break;
		case exM_hlrPdp7:
			omc_AsciiToRbcd(&tmpBitValue,
							cmdBuf->optDef[optNo].fieldValue + 42, 1);
			switch (tmpBitValue) {
			case 1:
				sprintf(cmdBuf->optDef[optNo].optValue, "8Kbps");
				break;
			case 2:
				sprintf(cmdBuf->optDef[optNo].optValue, "16Kbps");
				break;
			case 3:
				sprintf(cmdBuf->optDef[optNo].optValue, "32Kbps");
				break;
			case 4:
				sprintf(cmdBuf->optDef[optNo].optValue, "64Kbps");
				break;
			case 5:
				sprintf(cmdBuf->optDef[optNo].optValue, "128Kbps");
				break;
			case 6:
				sprintf(cmdBuf->optDef[optNo].optValue, "256Kbps");
				break;
			case 7:
				sprintf(cmdBuf->optDef[optNo].optValue, "512Kbps");
				break;
			case 8:
				sprintf(cmdBuf->optDef[optNo].optValue, "1024Kbps");
				break;
			case 9:
				sprintf(cmdBuf->optDef[optNo].optValue, "2048Kbps");
				break;
			}
			break;
		case exM_hlrPdp8:
			omc_AsciiToRbcd(&tmpBitValue,
							cmdBuf->optDef[optNo].fieldValue + 44, 2);
			switch (tmpBitValue) {
			case 1:
				sprintf(cmdBuf->optDef[optNo].optValue, "100Bph");
				break;
			case 2:
				sprintf(cmdBuf->optDef[optNo].optValue, "200Bph");
				break;
			case 3:
				sprintf(cmdBuf->optDef[optNo].optValue, "500Bph");
				break;
			case 4:
				sprintf(cmdBuf->optDef[optNo].optValue, "1KBph");
				break;
			case 5:
				sprintf(cmdBuf->optDef[optNo].optValue, "2KBph");
				break;
			case 6:
				sprintf(cmdBuf->optDef[optNo].optValue, "5KBph");
				break;
			case 7:
				sprintf(cmdBuf->optDef[optNo].optValue, "10KBph");
				break;
			case 8:
				sprintf(cmdBuf->optDef[optNo].optValue, "20KBph");
				break;
			case 9:
				sprintf(cmdBuf->optDef[optNo].optValue, "50KBph");
				break;
			case 10:
				sprintf(cmdBuf->optDef[optNo].optValue, "100KBph");
				break;
			case 11:
				sprintf(cmdBuf->optDef[optNo].optValue, "200KBph");
				break;
			case 12:
				sprintf(cmdBuf->optDef[optNo].optValue, "500KBph");
				break;
			case 13:
				sprintf(cmdBuf->optDef[optNo].optValue, "1MBph");
				break;
			case 14:
				sprintf(cmdBuf->optDef[optNo].optValue, "2MBph");
				break;
			case 15:
				sprintf(cmdBuf->optDef[optNo].optValue, "5MBph");
				break;
			case 16:
				sprintf(cmdBuf->optDef[optNo].optValue, "10MBph");
				break;
			case 17:
				sprintf(cmdBuf->optDef[optNo].optValue, "20MBph");
				break;
			case 18:
				sprintf(cmdBuf->optDef[optNo].optValue, "50MBph");
				break;
			case 31:
				sprintf(cmdBuf->optDef[optNo].optValue, "Best_effort");
				break;
			}
			break;
		case exM_hlrPdp9:
			omc_AsciiToRbcd(&tmpBitValue,
							cmdBuf->optDef[optNo].fieldValue + 46, 2);
			if (tmpBitValue == 0)
				sprintf(cmdBuf->optDef[optNo].optValue, "Not_allowed");
			else
				sprintf(cmdBuf->optDef[optNo].optValue, "Allowed");
			break;
		case exM_hlrPdp10:
			for (i = 0; i < 32; i++) {
				if (cmdBuf->optDef[optNo].fieldValue[48 + i * 2] == '0'
					&& cmdBuf->optDef[optNo].fieldValue[48 + i * 2 + 1] ==
					'0')
				{
					if(i==0)
						sprintf(cmdBuf->optDef[optNo].optValue, "null");
					break;

				}
				else {
					omc_AsciiToRbcd(&tmpBitValue,
									cmdBuf->optDef[optNo].fieldValue + 48 +
									i * 2, 2);
					cmdBuf->optDef[optNo].optValue[i] = tmpBitValue;
				}
			}
			if(i>0)
				cmdBuf->optDef[optNo].optValue[i] = 0;
			//writeDebug("optValue:%s,fieldValue:%s",cmdBuf->optDef[optNo].optValue,cmdBuf->optDef[optNo].fieldValue);
			break;
		case exM_hlrPdp11:
			omc_AsciiToRbcd(&tmpBitValue,
							cmdBuf->optDef[optNo].fieldValue + 112, 2);
			//writeDebug("fied value:%s",cmdBuf->optDef[optNo].fieldValue);
			switch(tmpBitValue)
			{
			case 0:				
				sprintf(cmdBuf->optDef[optNo].optValue, "Non_included_Ext");
				break;
			case 1:
				sprintf(cmdBuf->optDef[optNo].optValue, "Included_Ext");
				break;
			case 3:
				sprintf(cmdBuf->optDef[optNo].optValue, "Included_Ext_and_Ext2_only_1_octet");
				break;
			case 7:
				sprintf(cmdBuf->optDef[optNo].optValue, "Included_Ext_Ext2");
				break;
			case 15:
				sprintf(cmdBuf->optDef[optNo].optValue, "Included_Ext_Ext2_Ext3");
				break;
			}	
			break;		
		case exM_hlrPdp12:
			omc_AsciiToRbcd(&tmpBitValue,
							cmdBuf->optDef[optNo].fieldValue + 114, 2);
			sprintf(cmdBuf->optDef[optNo].optValue, "%d", tmpBitValue);
			break;
		case exM_hlrPdp13:
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 58, 0,
						&tmpBitValue);
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 58, 1,
						&tmpBitValue1);
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 58, 2,
						&tmpBitValue2);
			tmpBitValue3 = tmpBitValue2 * 4 + tmpBitValue1 * 2 + tmpBitValue;
			//writeDebug("tmpBitValue3 =%d",tmpBitValue3);
			switch(tmpBitValue3)
			{
			case 1:				
				sprintf(cmdBuf->optDef[optNo].optValue, "No_detect");
				break;
			case 2:
				sprintf(cmdBuf->optDef[optNo].optValue, "Err_SDUs_delilvered");
				break;
			case 3:
				sprintf(cmdBuf->optDef[optNo].optValue, "Err_SDUs_not_delivered");
				break;
			case 7:
				sprintf(cmdBuf->optDef[optNo].optValue, "Reserved");
				break;
			}
			break;
		case exM_hlrPdp14:
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 58, 3,
						&tmpBitValue);
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 58, 4,
						&tmpBitValue1);
			tmpBitValue2 = tmpBitValue1 * 2 + tmpBitValue;
			switch(tmpBitValue2)
			{
			case 1:				
				sprintf(cmdBuf->optDef[optNo].optValue, "delivery_order");
				break;
			case 2:
				sprintf(cmdBuf->optDef[optNo].optValue, "no_delivery_order");
				break;
			case 3:
				sprintf(cmdBuf->optDef[optNo].optValue, "Reserved");
				break;
			}
			break;
		case exM_hlrPdp15:
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 58, 5,
						&tmpBitValue);
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 58, 6,
						&tmpBitValue1);
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 58, 7,
						&tmpBitValue2);
			tmpBitValue3 = tmpBitValue2 * 4 + tmpBitValue1 * 2 + tmpBitValue;
			switch(tmpBitValue3)
			{
			case 1:				
				sprintf(cmdBuf->optDef[optNo].optValue, "Conversation_class");
				break;
			case 2:
				sprintf(cmdBuf->optDef[optNo].optValue, "Streaming_class");
				break;
			case 3:
				sprintf(cmdBuf->optDef[optNo].optValue, "Interactive_class");
				break;
			case 4:
				sprintf(cmdBuf->optDef[optNo].optValue, "Background_classs");
				break;
			case 7:
				sprintf(cmdBuf->optDef[optNo].optValue, "Reserved");
				break;				
			}
			break;	
		case exM_hlrPdp16:
			omc_AsciiToRbcd(&tmpBitValue,
							cmdBuf->optDef[optNo].fieldValue + 118, 2);
			switch (tmpBitValue) {
			case 1:
				sprintf(cmdBuf->optDef[optNo].optValue, "10_octets");
				break;
			case 20:
				sprintf(cmdBuf->optDef[optNo].optValue, "200_octets");
				break;
			case 80:
				sprintf(cmdBuf->optDef[optNo].optValue, "800_octets");
				break;
			case 100:
				sprintf(cmdBuf->optDef[optNo].optValue, "1000_octets");
				break;
			case 148:
				sprintf(cmdBuf->optDef[optNo].optValue, "1480_octets");
				break;
			case 150:
				sprintf(cmdBuf->optDef[optNo].optValue, "1500_octets");
				break;
			case 151:
				sprintf(cmdBuf->optDef[optNo].optValue, "1502_octets");
				break;
			case 152:
				sprintf(cmdBuf->optDef[optNo].optValue, "1510_octets");
				break;
			case 153:
				sprintf(cmdBuf->optDef[optNo].optValue, "1520_octets");
				break;
			case 255:
				sprintf(cmdBuf->optDef[optNo].optValue, "Reserved");
				break;
			}	
			break;	
		case exM_hlrPdp17:
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 60, 0,
						&tmpBitValue1);
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 60, 1,
						&tmpBitValue2);
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 60, 2,
						&tmpBitValue3);
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 60, 3,
						&tmpBitValue4);
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 60, 4,
						&tmpBitValue5);
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 60, 5,
						&tmpBitValue6);
			tmpBitValue =tmpBitValue6 * 32 + tmpBitValue5 * 16 + tmpBitValue4 * 8
			+	tmpBitValue3 * 4 + tmpBitValue2 * 2 + tmpBitValue1;
			sprintf(cmdBuf->optDef[optNo].optValue, "%d", tmpBitValue);
			break;
		case exM_hlrPdp18:
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 60, 6,
						&tmpBitValue1);
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 60, 7,
						&tmpBitValue2);
			tmpBitValue = tmpBitValue2 * 2 + tmpBitValue1;
			switch (tmpBitValue) {
			case 0:
				sprintf(cmdBuf->optDef[optNo].optValue, "X*1Kbps");
				break;
			case 1:
				sprintf(cmdBuf->optDef[optNo].optValue, "64Kbps+(X*8Kbps)");
				break;
			case 2:
				sprintf(cmdBuf->optDef[optNo].optValue, "576Kbps+(X*64Kbps)");
				break;
			case 3:
				sprintf(cmdBuf->optDef[optNo].optValue, "4672Kbps+(X*64Kbps)");
				break;
			}
			break;
		case exM_hlrPdp19:
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 61, 0,
						&tmpBitValue1);
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 61, 1,
						&tmpBitValue2);
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 61, 2,
						&tmpBitValue3);
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 61, 3,
						&tmpBitValue4);
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 61, 4,
						&tmpBitValue5);
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 61, 5,
						&tmpBitValue6);
			tmpBitValue =tmpBitValue6 * 32 + tmpBitValue5 * 16 + tmpBitValue4 * 8
			+	tmpBitValue3 * 4 + tmpBitValue2 * 2 + tmpBitValue1;
			sprintf(cmdBuf->optDef[optNo].optValue, "%d", tmpBitValue);
			break;
		case exM_hlrPdp20:
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 61, 6,
						&tmpBitValue1);
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 61, 7,
						&tmpBitValue2);
			tmpBitValue = tmpBitValue2 * 2 + tmpBitValue1;
			switch (tmpBitValue) {
			case 0:
				sprintf(cmdBuf->optDef[optNo].optValue, "X*1Kbps");
				break;
			case 1:
				sprintf(cmdBuf->optDef[optNo].optValue, "64Kbps+(X*8Kbps)");
				break;
			case 2:
				sprintf(cmdBuf->optDef[optNo].optValue, "576Kbps+(X*64Kbps)");
				break;
			case 3:
				sprintf(cmdBuf->optDef[optNo].optValue, "4672Kbps+(X*64Kbps)");
				break;
			}
			break;
		case exM_hlrPdp21:
			omc_AsciiToRbcd(&tmpBitValue,
							cmdBuf->optDef[optNo].fieldValue + 125, 1);
			switch (tmpBitValue) {
			case 1:
				sprintf(cmdBuf->optDef[optNo].optValue, "1E_2");
				break;
			case 2:
				sprintf(cmdBuf->optDef[optNo].optValue, "7E_3");
				break;
			case 3:
				sprintf(cmdBuf->optDef[optNo].optValue, "1E_3");
				break;
			case 4:
				sprintf(cmdBuf->optDef[optNo].optValue, "1E_4");
				break;
			case 5:
				sprintf(cmdBuf->optDef[optNo].optValue, "1E_5");
				break;
			case 6:
				sprintf(cmdBuf->optDef[optNo].optValue, "1E_6");
				break;
			case 7:
				sprintf(cmdBuf->optDef[optNo].optValue, "1E_1");
				break;
			case 15:
				sprintf(cmdBuf->optDef[optNo].optValue, "Reserved");
				break;
			}
			break;
		case exM_hlrPdp22:
			omc_AsciiToRbcd(&tmpBitValue,
							cmdBuf->optDef[optNo].fieldValue + 124, 1);
			switch (tmpBitValue) {
			case 1:
				sprintf(cmdBuf->optDef[optNo].optValue, "5E_2");
				break;
			case 2:
				sprintf(cmdBuf->optDef[optNo].optValue, "1E_2");
				break;
			case 3:
				sprintf(cmdBuf->optDef[optNo].optValue, "5E_3");
				break;
			case 4:
				sprintf(cmdBuf->optDef[optNo].optValue, "4E_3");
				break;
			case 5:
				sprintf(cmdBuf->optDef[optNo].optValue, "1E_3");
				break;
			case 6:
				sprintf(cmdBuf->optDef[optNo].optValue, "1E_4");
				break;
			case 7:
				sprintf(cmdBuf->optDef[optNo].optValue, "1E_5");
				break;
			case 8:
				sprintf(cmdBuf->optDef[optNo].optValue, "1E_6");
				break;	
			case 9:
				sprintf(cmdBuf->optDef[optNo].optValue, "6E_8");
				break;
			case 15:
				sprintf(cmdBuf->optDef[optNo].optValue, "Reserved");
				break;
			}
			break;
		case exM_hlrPdp23:
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 63, 0,
						&tmpBitValue);
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 63, 1,
						&tmpBitValue1);
			tmpBitValue2 = tmpBitValue1 * 2 + tmpBitValue;
			switch(tmpBitValue2)
			{
			case 0:
				sprintf(cmdBuf->optDef[optNo].optValue, "Reserved");
				break;
			case 1:				
				sprintf(cmdBuf->optDef[optNo].optValue, "Level_1");
				break;
			case 2:
				sprintf(cmdBuf->optDef[optNo].optValue, "Level_2");
				break;
			case 3:
				sprintf(cmdBuf->optDef[optNo].optValue, "Level_3");
				break;	
			}
			break;
		case exM_hlrPdp24:
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 63, 2,
						&tmpBitValue1);
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 63, 3,
						&tmpBitValue2);
			tmpBitValue = tmpBitValue2 * 2 + tmpBitValue1;
			switch(tmpBitValue)
			{
			case 0:
				sprintf(cmdBuf->optDef[optNo].optValue, "X*10ms");
				break;
			case 1:				
				sprintf(cmdBuf->optDef[optNo].optValue, "200ms+X*50ms");
				break;
			case 2:
				sprintf(cmdBuf->optDef[optNo].optValue, "1000ms+X*100ms");
				break;
			case 3:
				sprintf(cmdBuf->optDef[optNo].optValue, "2600ms+X*100ms");
				break;	
			}
			break;
		case exM_hlrPdp25:
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 64, 0,
						&tmpBitValue1);
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 64, 1,
						&tmpBitValue2);
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 64, 2,
						&tmpBitValue3);
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 64, 3,
						&tmpBitValue4);                          
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 64, 4,
						&tmpBitValue5);                          
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 64, 5,
						&tmpBitValue6);
			tmpBitValue =tmpBitValue6 * 32 + tmpBitValue5 * 16 + tmpBitValue4 * 8
			+	tmpBitValue3 * 4 + tmpBitValue2 * 2 + tmpBitValue1;
			sprintf(cmdBuf->optDef[optNo].optValue, "%d", tmpBitValue);
			break;
		case exM_hlrPdp26:
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 64, 6,
						&tmpBitValue1);
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 64, 7,
						&tmpBitValue2);
			tmpBitValue = tmpBitValue2 * 2 + tmpBitValue1;
			switch (tmpBitValue) {
			case 0:
				sprintf(cmdBuf->optDef[optNo].optValue, "X*1Kbps");
				break;
			case 1:
				sprintf(cmdBuf->optDef[optNo].optValue, "64Kbps+(X*8Kbps)");
				break;
			case 2:
				sprintf(cmdBuf->optDef[optNo].optValue, "576Kbps+(X*64Kbps)");
				break;
			case 3:
				sprintf(cmdBuf->optDef[optNo].optValue, "4672Kbps+(X*64Kbps)");
				break;
			}
			break;
		case exM_hlrPdp27:
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 65, 0,
						&tmpBitValue1);
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 65, 1,
						&tmpBitValue2);
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 65, 2,
						&tmpBitValue3);
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 65, 3,
						&tmpBitValue4);
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 65, 4,
						&tmpBitValue5);
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 65, 5,
						&tmpBitValue6);
			tmpBitValue =tmpBitValue6 * 32 + tmpBitValue5 * 16 + tmpBitValue4 * 8
			+	tmpBitValue3 * 4 + tmpBitValue2 * 2 + tmpBitValue1;
			sprintf(cmdBuf->optDef[optNo].optValue, "%d", tmpBitValue);
			break;
		case exM_hlrPdp28:
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 65, 6,
						&tmpBitValue1);
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 65, 7,
						&tmpBitValue2);
			tmpBitValue = tmpBitValue2 * 2 + tmpBitValue1;
			switch (tmpBitValue) {
			case 0:
				sprintf(cmdBuf->optDef[optNo].optValue, "X*1Kbps");
				break;
			case 1:
				sprintf(cmdBuf->optDef[optNo].optValue, "64Kbps+(X*8Kbps)");
				break;
			case 2:
				sprintf(cmdBuf->optDef[optNo].optValue, "576Kbps+(X*64Kbps)");
				break;
			case 3:
				sprintf(cmdBuf->optDef[optNo].optValue, "4672Kbps+(X*64Kbps)");
				break;
			}
			break;
		case exM_hlrPdp29:
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 66, 0,
						&tmpBitValue1);
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 66, 1,
						&tmpBitValue2);
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 66, 2,
						&tmpBitValue3);
			tmpBitValue = tmpBitValue3 * 4 + tmpBitValue2 * 2 + tmpBitValue1;
			switch (tmpBitValue) {
			case 0:
				sprintf(cmdBuf->optDef[optNo].optValue, "Spare");
				break;
			case 1:
				sprintf(cmdBuf->optDef[optNo].optValue, "Speech");
				break;
			}
			break;
		case exM_hlrPdp30:
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 66, 4,
						&tmpBitValue);
			switch (tmpBitValue) {
			case 0:
				sprintf(cmdBuf->optDef[optNo].optValue, "Not_optimised");
				break;
			case 1:
				sprintf(cmdBuf->optDef[optNo].optValue, "Optimised");
				break;
			}
			break;	
		case exM_hlrPdp32:
			omc_AsciiToRbcd(&tmpBitValue,
							cmdBuf->optDef[optNo].fieldValue + 134, 2);
			switch (tmpBitValue) {
			case 0:
				sprintf(cmdBuf->optDef[optNo].optValue, "<=8600kbps");
				break;
			case 1:
				sprintf(cmdBuf->optDef[optNo].optValue, "8700kbps");
				break;
			case 74:
				sprintf(cmdBuf->optDef[optNo].optValue, "16000kbps");
				break;
			case 75:
				sprintf(cmdBuf->optDef[optNo].optValue, "17Mbps");
				break;
			case 186:
				sprintf(cmdBuf->optDef[optNo].optValue, "128Mbps");
				break;
			case 187:
				sprintf(cmdBuf->optDef[optNo].optValue, "130Mbps");
				break;
			case 250:
				sprintf(cmdBuf->optDef[optNo].optValue, "256Mbps");
				break;
			}	
			break;	
		case exM_hlrPdp33:
			omc_AsciiToRbcd(&tmpBitValue,
							cmdBuf->optDef[optNo].fieldValue + 136, 2);
			switch (tmpBitValue) {
			case 0:
				sprintf(cmdBuf->optDef[optNo].optValue, "<=8600kbps");
				break;
			case 1:
				sprintf(cmdBuf->optDef[optNo].optValue, "8700kbps");
				break;
			case 74:
				sprintf(cmdBuf->optDef[optNo].optValue, "16000kbps");
				break;
			case 75:
				sprintf(cmdBuf->optDef[optNo].optValue, "17Mbps");
				break;
			case 186:
				sprintf(cmdBuf->optDef[optNo].optValue, "128Mbps");
				break;
			case 187:
				sprintf(cmdBuf->optDef[optNo].optValue, "130Mbps");
				break;
			case 250:
				sprintf(cmdBuf->optDef[optNo].optValue, "256Mbps");
				break;
			}	
			break;
		case exM_hlrPdp34:
			omc_AsciiToRbcd(&tmpBitValue,
							cmdBuf->optDef[optNo].fieldValue + 138, 2);
			switch (tmpBitValue) {
			case 0:
				sprintf(cmdBuf->optDef[optNo].optValue, "<=8600kbps");
				break;
			case 1:
				sprintf(cmdBuf->optDef[optNo].optValue, "8700kbps");
				break;
			case 74:
				sprintf(cmdBuf->optDef[optNo].optValue, "16000kbps");
				break;
			case 75:
				sprintf(cmdBuf->optDef[optNo].optValue, "17Mbps");
				break;
			case 186:
				sprintf(cmdBuf->optDef[optNo].optValue, "128Mbps");
				break;
			case 187:
				sprintf(cmdBuf->optDef[optNo].optValue, "130Mbps");
				break;
			case 250:
				sprintf(cmdBuf->optDef[optNo].optValue, "256Mbps");
				break;
			}	
			break;
		case exM_hlrPdp35:
			omc_AsciiToRbcd(&tmpBitValue,
							cmdBuf->optDef[optNo].fieldValue + 140, 2);
			switch (tmpBitValue) {
			case 0:
				sprintf(cmdBuf->optDef[optNo].optValue, "<=8600kbps");
				break;
			case 1:
				sprintf(cmdBuf->optDef[optNo].optValue, "8700kbps");
				break;
			case 74:
				sprintf(cmdBuf->optDef[optNo].optValue, "16000kbps");
				break;
			case 75:
				sprintf(cmdBuf->optDef[optNo].optValue, "17Mbps");
				break;
			case 186:
				sprintf(cmdBuf->optDef[optNo].optValue, "128Mbps");
				break;
			case 187:
				sprintf(cmdBuf->optDef[optNo].optValue, "130Mbps");
				break;
			case 250:
				sprintf(cmdBuf->optDef[optNo].optValue, "256Mbps");
				break;
			}	
			break;
		case exM_hlrUserNo:
			//user_no
			for (i = 0; i < strlen(cmdBuf->optDef[optNo].fieldValue); i++) {
				if (cmdBuf->optDef[optNo].fieldValue[i] != 'E') {
					cmdBuf->optDef[optNo].optValue[i] =
						cmdBuf->optDef[optNo].fieldValue[i];
				} else {
					cmdBuf->optDef[optNo].optValue[i] = '\0';
					return (0);
				}
			}
			if (strlen(cmdBuf->optDef[optNo].optValue) == 0) {
				sprintf(cmdBuf->optDef[optNo].optValue, "\"\"");
			}
			break;
		
		default:
			//printf("\n tmpSql=%s \n", cmdBuf->optDef[optNo].fieldValue);
			if (tmpExMode >= 100 && tmpExMode < 200) {
				int byteOffset = (int) ((tmpExMode - 100) / 10);
				int bitOffset = tmpExMode % 10;
				getBitValue(cmdBuf->optDef[optNo].fieldValue, byteOffset,
							bitOffset, &tmpBitValue);
				if (tmpBitValue > 0) {
					sprintf(cmdBuf->optDef[optNo].optValue, "enable");
				} else {
					sprintf(cmdBuf->optDef[optNo].optValue, "disable");
				}
			} else {
				sprintf(cmdBuf->optDef[optNo].optValue, "%s",
						cmdBuf->optDef[optNo].fieldValue);
			}
			break;
		}
	}							//end of if(cmdBuf->sysTypeNo == 330)
	if (cmdBuf->sysTypeNo == 360||cmdBuf->sysTypeNo == 395) {	//pps  
		if (tmpExMode == exM_ppsRentType) {
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 0, 0,
						&tmpBitValue);
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 0, 1,
						&tmpBitValue1);
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 0, 2,
						&tmpBitValue2);
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 0, 3,
						&tmpBitValue3);
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 0, 4,
						&tmpBitValue4);
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 0, 5,
						&tmpBitValue5);
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 0, 6,
						&tmpBitValue6);
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 0, 7,
						&tmpBitValue7);
			sprintf(cmdBuf->optDef[optNo].optValue, "%d%d%d%d%d%d%d%d",
					tmpBitValue7, tmpBitValue6, tmpBitValue5, tmpBitValue4,
					tmpBitValue3, tmpBitValue2, tmpBitValue1, tmpBitValue);
		} else if (tmpExMode == exM_ppsDate) {
			sprintf(cmdBuf->optDef[optNo].optValue, "%.*s", 14,
					cmdBuf->optDef[optNo].fieldValue);
		} else if (tmpExMode == exM_ppsCallType) {
			i = atoi(cmdBuf->optDef[optNo].fieldValue);
			if (i == 0)
				strcpy(cmdBuf->optDef[optNo].optValue, "mo_call");
			else if (i == 1)
				strcpy(cmdBuf->optDef[optNo].optValue, "mt_call");
			else if (i == 2)
				strcpy(cmdBuf->optDef[optNo].optValue, "mf_call");
			else
				strcpy(cmdBuf->optDef[optNo].optValue, "mo_sms");
		} else if (tmpExMode == exM_ppsSM) {
			hex2dec(cmdBuf->optDef[optNo].fieldValue,
					cmdBuf->optDef[optNo].optValue);
		} else if (tmpExMode == exM_ppsBalance) {
			if (cmdBuf->optDef[optNo].fieldValue[0] == '-')
				cmdBuf->optDef[optNo].fieldValue[0] = '~';
			sprintf(cmdBuf->optDef[optNo].optValue, "%s",
					cmdBuf->optDef[optNo].fieldValue);
		} else if (tmpExMode == exM_ppsCardStatus) {
			i = atoi(cmdBuf->optDef[optNo].fieldValue);
			if (i == 0)
				strcpy(cmdBuf->optDef[optNo].optValue, "Fresh");
			else
				strcpy(cmdBuf->optDef[optNo].optValue, "Charged");
		} else if (tmpExMode == exM_ppsPoolAccountType) {
			i = atoi(cmdBuf->optDef[optNo].fieldValue);
			if (i == 0)
				strcpy(cmdBuf->optDef[optNo].optValue, "normal");
			else if (i == 1)
				strcpy(cmdBuf->optDef[optNo].optValue, "parent");
			else if (i == 2)
				strcpy(cmdBuf->optDef[optNo].optValue, "child");
		} else if (tmpExMode == exM_ppsFFPlanState) {
			i = atoi(cmdBuf->optDef[optNo].fieldValue);
			if (i == 0)
				strcpy(cmdBuf->optDef[optNo].optValue, "normal");
			else if (i == 1)
				strcpy(cmdBuf->optDef[optNo].optValue, "suspend");
		} else {
			sprintf(cmdBuf->optDef[optNo].optValue, "%s",
					cmdBuf->optDef[optNo].fieldValue);
		}
	}
	//20041101 start
	if (cmdBuf->sysTypeNo == 390) {	//vms 
		switch (tmpExMode) {
		case exM_vmsHexDec:
			hex2dec(cmdBuf->optDef[optNo].fieldValue,
					cmdBuf->optDef[optNo].optValue);
			break;
		case exM_vmsMailboxId:
			hex2dec(cmdBuf->optDef[optNo].fieldValue,
					cmdBuf->optDef[optNo].optValue);
			break;
		case exM_vmsGreetingType:
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 0, 0,
						&tmpBitValue);
			getBitValue(cmdBuf->optDef[optNo].fieldValue, 0, 1,
						&tmpBitValue1);
			tmpBitValue2 = tmpBitValue1 * 2 + tmpBitValue;
			switch (tmpBitValue2) {
			case 0:
				sprintf(cmdBuf->optDef[optNo].optValue, "system");
				break;
			case 1:
				sprintf(cmdBuf->optDef[optNo].optValue, "hostname");
				break;
			case 2:
				sprintf(cmdBuf->optDef[optNo].optValue, "personal");
				break;
			default:
				break;
			}
			break;
		default:
			//printf("\n tmpSql=%s \n", cmdBuf->optDef[optNo].fieldValue);
			if (tmpExMode >= 100 && tmpExMode < 200) {
				int byteOffset = (int) ((tmpExMode - 100) / 10);
				int bitOffset = tmpExMode % 10;
				getBitValue(cmdBuf->optDef[optNo].fieldValue, byteOffset,
							bitOffset, &tmpBitValue);
				if (tmpBitValue > 0) {
					sprintf(cmdBuf->optDef[optNo].optValue, "enable");
				} else {
					sprintf(cmdBuf->optDef[optNo].optValue, "disable");
				}
			} else {
				//printf("%s=%s", cmdBuf->optDef[optNo].fieldName,
				//     cmdBuf->optDef[optNo].fieldValue);
				sprintf(cmdBuf->optDef[optNo].optValue, "%s",
						cmdBuf->optDef[optNo].fieldValue);
				//printf("%s=%s\n", cmdBuf->optDef[optNo].optName,
				//     cmdBuf->optDef[optNo].optValue);
			}
			break;
		}
	}
	//20041101 end

	if (cmdBuf->sysTypeNo == 370) {	//mnp 
		switch (tmpExMode) {
		case exM_mnpStatus:
			tmpValue = atoi(cmdBuf->optDef[optNo].fieldValue);
			if (tmpValue == 2) {
				sprintf(cmdBuf->optDef[optNo].optValue, "own_ported_out");
			} else if (tmpValue == 3) {
				sprintf(cmdBuf->optDef[optNo].optValue,
						"foreign_ported_in");
			} else {
				sprintf(cmdBuf->optDef[optNo].optValue,
						"foreign_ported_to_third_party");
			}
			break;
		case exM_mnpDate:
			sprintf(cmdBuf->optDef[optNo].optValue, "%.*s", 8,
					cmdBuf->optDef[optNo].fieldValue);
			break;
		default:
			if (tmpExMode >= 100 && tmpExMode < 200) {
				int byteOffset = (int) ((tmpExMode - 100) / 10);
				int bitOffset = tmpExMode % 10;
				getBitValue(cmdBuf->optDef[optNo].fieldValue, byteOffset,
							bitOffset, &tmpBitValue);
				if (tmpBitValue > 0) {
					sprintf(cmdBuf->optDef[optNo].optValue, "enable");
				} else {
					sprintf(cmdBuf->optDef[optNo].optValue, "disable");
				}
			} else {
				sprintf(cmdBuf->optDef[optNo].optValue, "%s",
						cmdBuf->optDef[optNo].fieldValue);
			}
			break;
		}
	}
	
	//opps
	if (cmdBuf->sysTypeNo == 375) {
		switch (tmpExMode) {
		case exM_imdmMsisdn:
			for (i = 0; i < strlen(cmdBuf->optDef[optNo].fieldValue); i++) {
				if (cmdBuf->optDef[optNo].fieldValue[i] != 'E') {
					cmdBuf->optDef[optNo].optValue[i] =
						cmdBuf->optDef[optNo].fieldValue[i];
				} else {
					cmdBuf->optDef[optNo].optValue[i] = '\0';
					return (0);
				}
			}
			break;
		case exM_imdmImsi:
			//imsi
			j = strlen(cmdBuf->optDef[optNo].fieldValue);
			//printf("exValueFieldToOpt,cmdBuf->optDef[optNo].fieldValue=+%s+,len=%d\n",cmdBuf->optDef[optNo].fieldValue[i],j);
			for (i = 0; i < j; i++) {
				if (cmdBuf->optDef[optNo].fieldValue[i] != '0') {
					break;
				}
			}
			sprintf(cmdBuf->optDef[optNo].optValue, "%.*s", j - i,
					cmdBuf->optDef[optNo].fieldValue + i);		
			if(j == 0)
				sprintf(cmdBuf->optDef[optNo].optValue,"000000000000000");
			break;
		case exM_imdmImei:	
			//imei
			j = strlen(cmdBuf->optDef[optNo].fieldValue);
			for (i = 0; i < j; i++) {
				if (cmdBuf->optDef[optNo].fieldValue[i] != '0') {
					break;
				}
			}
			sprintf(cmdBuf->optDef[optNo].optValue, "%.*s", j - i,
					cmdBuf->optDef[optNo].fieldValue + i);
			if(j == 0)
				sprintf(cmdBuf->optDef[optNo].optValue,"000000000000000");
			break;
		case exM_imdmOprFlag:
			if(strcmp(cmdBuf->optDef[optNo].fieldValue,"0") == 0)
				sprintf(cmdBuf->optDef[optNo].optValue,"OPR_0");
			else if(strcasecmp(cmdBuf->optDef[optNo].fieldValue,"1") == 0)
				sprintf(cmdBuf->optDef[optNo].optValue,"OPR_1");
			else if(strcasecmp(cmdBuf->optDef[optNo].fieldValue,"2") == 0)
				sprintf(cmdBuf->optDef[optNo].optValue,"OPR_2a");
			else if(strcasecmp(cmdBuf->optDef[optNo].fieldValue,"3") == 0)
				sprintf(cmdBuf->optDef[optNo].optValue,"OPR_2b");
			else if(strcasecmp(cmdBuf->optDef[optNo].fieldValue,"4") == 0)
				sprintf(cmdBuf->optDef[optNo].optValue,"IMDX_P1");
			else if(strcasecmp(cmdBuf->optDef[optNo].fieldValue,"5") == 0)
				sprintf(cmdBuf->optDef[optNo].optValue,"IMDX_P2");
			else if(strcasecmp(cmdBuf->optDef[optNo].fieldValue,"6") == 0)
				sprintf(cmdBuf->optDef[optNo].optValue,"IMDX_H");
			else
				sprintf(cmdBuf->optDef[optNo].optValue,"Unknown");
			//printf("cmdBuf->optDef[optNo].fieldValue=%s\n",cmdBuf->optDef[optNo].fieldValue);
			//sprintf(cmdBuf->optDef[optNo].optValue,"%s",cmdBuf->optDef[optNo].fieldValue);
			break;
		case exM_imdmClass:
			if(strcmp(cmdBuf->optDef[optNo].fieldValue,"0") == 0)
                                sprintf(cmdBuf->optDef[optNo].optValue,"Ordinary");
			else if(strcasecmp(cmdBuf->optDef[optNo].fieldValue,"1") == 0)
                                sprintf(cmdBuf->optDef[optNo].optValue,"Premium");
                        else if(strcasecmp(cmdBuf->optDef[optNo].fieldValue,"2") == 0)
                                sprintf(cmdBuf->optDef[optNo].optValue,"VIP");
			else
                                sprintf(cmdBuf->optDef[optNo].optValue,"Unknown");
			break;
		case exM_imdmUserType:
			if(strcmp(cmdBuf->optDef[optNo].fieldValue,"0") == 0)
				sprintf(cmdBuf->optDef[optNo].optValue,"OPPS");
			else if(strcasecmp(cmdBuf->optDef[optNo].fieldValue,"1") == 0)
				sprintf(cmdBuf->optDef[optNo].optValue,"Reserved");
			else if(strcasecmp(cmdBuf->optDef[optNo].fieldValue,"2") == 0)
				sprintf(cmdBuf->optDef[optNo].optValue,"iPALIM");
			else
                                sprintf(cmdBuf->optDef[optNo].optValue,"Unknown");
			break;
		//case exM_imdmType:
		//	sprintf(cmdBuf->optDef[optNo].optValue,"%s",cmdBuf->optDef[optNo].fieldValue);
		//	break;
		//case exM_imdmStatus:
		//	sprintf(cmdBuf->optDef[optNo].optValue,"%s",cmdBuf->optDef[optNo].fieldValue);	
		//	break;		
		}
	}

	//ipalim
	if(cmdBuf->sysTypeNo == 378) {
		switch(tmpExMode) {
		case exM_ipalimImsi:
			j = strlen(cmdBuf->optDef[optNo].fieldValue);
			for(i = 0; i < j; i++) {
				if(cmdBuf->optDef[optNo].fieldValue[i] != '0')
					break;
			}
			sprintf(cmdBuf->optDef[optNo].optValue, "%.*s", j - i, cmdBuf->optDef[optNo].fieldValue + i);
			if(j == 0)
				sprintf(cmdBuf->optDef[optNo].optValue,"000000000000000");
			break;
		case exM_ipalimMsisdn:
			for (i = 0; i < strlen(cmdBuf->optDef[optNo].fieldValue); i++) {
				if (cmdBuf->optDef[optNo].fieldValue[i] != 'E') {
					cmdBuf->optDef[optNo].optValue[i] =
						cmdBuf->optDef[optNo].fieldValue[i];
				} else {
					cmdBuf->optDef[optNo].optValue[i] = '\0';
					return (0);
				}
			}
			if (strlen(cmdBuf->optDef[optNo].optValue) == 0) {
				sprintf(cmdBuf->optDef[optNo].optValue, " ");
			}
			break;
		case exM_ipalimMsisdnExtern:
                        for (i = 0; i < strlen(cmdBuf->optDef[optNo].fieldValue); i++) {
                                if (cmdBuf->optDef[optNo].fieldValue[i] != 'E') {
                                        cmdBuf->optDef[optNo].optValue[i] =
                                                cmdBuf->optDef[optNo].fieldValue[i];
                                } else {
                                        cmdBuf->optDef[optNo].optValue[i] = '\0';
                                        return (0);
                                }
                        }
                        if (strlen(cmdBuf->optDef[optNo].optValue) == 0) {
                                sprintf(cmdBuf->optDef[optNo].optValue, " ");
                        }
                        break;
		case exM_ipalimTmsi:
                        for (i = 0; i < strlen(cmdBuf->optDef[optNo].fieldValue); i++) {
                                if (cmdBuf->optDef[optNo].fieldValue[i] != 'E') {
                                        cmdBuf->optDef[optNo].optValue[i] =
                                                cmdBuf->optDef[optNo].fieldValue[i];
                                } else {
                                        cmdBuf->optDef[optNo].optValue[i] = '\0';
                                        return (0);
                                }
                        }
                        if (strlen(cmdBuf->optDef[optNo].optValue) == 0) {
                                sprintf(cmdBuf->optDef[optNo].optValue, " ");
                        }
                        break;
		case exM_ipalimLai:
                        for (i = 0; i < strlen(cmdBuf->optDef[optNo].fieldValue); i++) {
                                if (cmdBuf->optDef[optNo].fieldValue[i] != 'E') {
                                        cmdBuf->optDef[optNo].optValue[i] =
                                                cmdBuf->optDef[optNo].fieldValue[i];
                                } else {
                                        cmdBuf->optDef[optNo].optValue[i] = '\0';
                                        return (0);
                                }
                        }
                        if (strlen(cmdBuf->optDef[optNo].optValue) == 0) {
                                sprintf(cmdBuf->optDef[optNo].optValue, " ");
                        }
                        break;
		case exM_ipalimType:
			i=atoi(cmdBuf->optDef[optNo].fieldValue);
			if(i == 0)
				sprintf(cmdBuf->optDef[optNo].optValue,"Private");
			else if(i == 1)
				sprintf(cmdBuf->optDef[optNo].optValue,"Public");
			else if(i == 2)
				sprintf(cmdBuf->optDef[optNo].optValue,"Hybrid");
			else
				sprintf(cmdBuf->optDef[optNo].optValue,"not_defined");
			break;
		}
		
	}
	
	//auc
	if (cmdBuf->sysTypeNo == 340) {
		switch (tmpExMode) {
		case exM_aucImsi:
			//imsi
			j = strlen(cmdBuf->optDef[optNo].fieldValue);
			//printf("exValueFieldToOpt,cmdBuf->optDef[optNo].fieldValue=+%s+,len=%d\n",cmdBuf->optDef[optNo].fieldValue[i],j);
			for (i = 0; i < j; i++) {
				if (cmdBuf->optDef[optNo].fieldValue[i] != '0') {
					break;
				}
			}
			sprintf(cmdBuf->optDef[optNo].optValue, "%.*s", j - i,
					cmdBuf->optDef[optNo].fieldValue + i);		
			if(j == 0)
				sprintf(cmdBuf->optDef[optNo].optValue,"000000000000000");
			break;
		}
	}
	
	return (0);
}

/*************************************************
Function:        // exValueOptToField
Description:     // 参数的值从输入输出的格式转换成数据库的格式
Calls:           // isxdigit; isdigit;
Called By:       // changeDefaultValueProcInput; doCmdReadAccount; doCmdModifyAccount; .....
Table Accessed:  // 
Table Updated:   // 
Input:           // optNo:the index of the parameter;
Output:          // 
Return:          // 0:successful; 1:failed;
Others:          // 
*************************************************/
int exValueOptToField(int optNo)
{
	int i = 0;
	int j = 0;
	int optValueType;
	float tmpField = 0;
	char tmpStr[15];
	char tmpStr_1[15];
	char tmpValue[64];
	int tmp = 0;

	int tmpExMode;
	
	//general check the optValue
	if (cmdBuf->optDef[optNo].exMode > 999) {
		//printf("%ld\n",cmdBuf->optDef[optNo].exMode);
		optValueType = cmdBuf->optDef[optNo].exMode / 10000000;
		//writeDebug("%ld\n,optValueType:%d,:%s,%d",cmdBuf->optDef[optNo].exMode,optValueType,cmdBuf->optDef[optNo].optValue,strlen(cmdBuf->optDef[optNo].optValue));
		switch (optValueType) {
		case 0:
			if (strlen(cmdBuf->optDef[optNo].optValue) <
				cmdBuf->optDef[optNo].exMode % 10000000 / 100000
				|| strlen(cmdBuf->optDef[optNo].optValue) >
				cmdBuf->optDef[optNo].exMode % 10000000 % 100000 / 1000)
				return (1);
			for (i = 0; i < strlen(cmdBuf->optDef[optNo].optValue); i++) {
				if (isdigit(cmdBuf->optDef[optNo].optValue[i]) <= 0) {
					return (1);
				}
			}
			break;
		case 1:
			if (strlen(cmdBuf->optDef[optNo].optValue) <
				cmdBuf->optDef[optNo].exMode % 10000000 / 100000
				|| strlen(cmdBuf->optDef[optNo].optValue) >
				cmdBuf->optDef[optNo].exMode % 10000000 % 100000 / 1000)
				return (1);
			for (i = 0; i < strlen(cmdBuf->optDef[optNo].optValue); i++) {
				if (isxdigit(cmdBuf->optDef[optNo].optValue[i]) <= 0)
					return (1);
			}
			break;
		case 2:
			if (cmdBuf->optDef[optNo].optValue[0] == '~') {
				if (strlen(cmdBuf->optDef[optNo].optValue) < 2
					|| strlen(cmdBuf->optDef[optNo].optValue) >
					cmdBuf->optDef[optNo].exMode % 10000000 / 100000)
					return (1);
				for (i = 1; i < strlen(cmdBuf->optDef[optNo].optValue);
					 i++) {
					if (isdigit(cmdBuf->optDef[optNo].optValue[i]) <= 0)
						return (1);
				}
			} else {
				if (strlen(cmdBuf->optDef[optNo].optValue) < 1
					|| strlen(cmdBuf->optDef[optNo].optValue) >
					cmdBuf->optDef[optNo].exMode % 10000000 % 100000 /
					1000)
					return (1);
				for (i = 0; i < strlen(cmdBuf->optDef[optNo].optValue);
					 i++) {
					if (isdigit(cmdBuf->optDef[optNo].optValue[i]) <= 0)
						return (1);
				}
			}

			break;
		case 3:
			if (cmdBuf->optDef[optNo].optValue[0] == '~') {
				if (strlen(cmdBuf->optDef[optNo].optValue) < 2
					|| strlen(cmdBuf->optDef[optNo].optValue) >
					cmdBuf->optDef[optNo].exMode % 10000000 / 100000)
					return (1);
				for (i = 1; i < strlen(cmdBuf->optDef[optNo].optValue);
					 i++) {
					if (isxdigit(cmdBuf->optDef[optNo].optValue[i]) <= 0)
						return (1);
				}
			} else {
				if (strlen(cmdBuf->optDef[optNo].optValue) < 1
					|| strlen(cmdBuf->optDef[optNo].optValue) >
					cmdBuf->optDef[optNo].exMode % 10000000 % 100000 /
					1000)
					return (1);
				for (i = 0; i < strlen(cmdBuf->optDef[optNo].optValue);
					 i++) {
					if (isxdigit(cmdBuf->optDef[optNo].optValue[i]) <= 0)
						return (1);
				}
			}

			break;
		case 4:
			for (i = 0; i < strlen(cmdBuf->optDef[optNo].optValue); i++) {
				if (isdigit(cmdBuf->optDef[optNo].optValue[i]) <= 0)
					return (1);
			}
			if (strlen(cmdBuf->optDef[optNo].optValue) <= 0)
				return (1);
			sprintf(tmpValue, "%lx", atol(cmdBuf->optDef[optNo].optValue));
			if (strlen(tmpValue) <
				cmdBuf->optDef[optNo].exMode % 10000000 / 100000
				|| strlen(tmpValue) >
				cmdBuf->optDef[optNo].exMode % 10000000 % 100000 / 1000)
				return (1);
			break;
		case 5:
			if (cmdBuf->optDef[optNo].optValue[0] == '~') {
				for (i = 1; i < strlen(cmdBuf->optDef[optNo].optValue);
					 i++) {
					if (isdigit(cmdBuf->optDef[optNo].optValue[i]) <= 0)
						return (1);
				}
				if (strlen(cmdBuf->optDef[optNo].optValue) <= 1)
					return (1);
				sprintf(tmpValue, "%lx",
						atol(cmdBuf->optDef[optNo].optValue));
				if (strlen(tmpValue) < 2
					|| strlen(tmpValue) >
					cmdBuf->optDef[optNo].exMode % 10000000 / 100000)
					return (1);
			} else {
				for (i = 0; i < strlen(cmdBuf->optDef[optNo].optValue);
					 i++) {
					if (isxdigit(cmdBuf->optDef[optNo].optValue[i]) <= 0)
						return (1);
				}
				if (strlen(cmdBuf->optDef[optNo].optValue) <= 0)
					return (1);
				sprintf(tmpValue, "%lx",
						atol(cmdBuf->optDef[optNo].optValue));
				if (strlen(tmpValue) < 1
					|| strlen(tmpValue) >
					cmdBuf->optDef[optNo].exMode % 10000000 % 100000 /
					1000)
					return (1);
			}
			break;
		default:
			if (strlen(cmdBuf->optDef[optNo].optValue) <
				cmdBuf->optDef[optNo].exMode % 10000000 / 100000
				|| strlen(cmdBuf->optDef[optNo].optValue) >
				cmdBuf->optDef[optNo].exMode % 10000000 % 100000 / 1000)
				return (1);
		}
	}

	if ((cmdBuf->sysTypeNo == 330)
		&& (!strcmp(cmdBuf->optDef[OptNo_index].fieldName, "inter_msisdn"))
		&& optNo == OptNo_index)
		tmpExMode = 0;
	else
		tmpExMode = cmdBuf->optDef[optNo].exMode % 1000;
	//writeDebug("optNo:%d,tmpExMode:%d,fieldName:%s",optNo,tmpExMode,cmdBuf->optDef[OptNo_index].fieldName);
	if (cmdBuf->sysTypeNo == 0) {
		i = strlen(cmdBuf->optDef[optNo].optValue);
		if ((cmdBuf->optDef[optNo].optValue[i - 1] == '\n')
			|| (cmdBuf->optDef[optNo].optValue[i - 1] == '\r')) {
			cmdBuf->optDef[optNo].optValue[i - 1] = '\0';
			i = i - 1;
		}
		if ((cmdBuf->optDef[optNo].optValue[i - 1] == '\n')
			|| (cmdBuf->optDef[optNo].optValue[i - 1] == '\r')) {
			cmdBuf->optDef[optNo].optValue[i - 1] = '\0';
		}
		sprintf(cmdBuf->optDef[optNo].fieldValue, "%s",
				cmdBuf->optDef[optNo].optValue);
		return (0);
	}

	if (cmdBuf->sysTypeNo == 330) {
		switch (tmpExMode) {
		case exM_hlrImsi:
			//imsi

			if (strlen(cmdBuf->optDef[optNo].optValue) <= 15) {
				sprintf(cmdBuf->optDef[optNo].fieldValue, "0%s",
						cmdBuf->optDef[optNo].optValue);

			} else {
				sprintf(cmdBuf->optDef[optNo].fieldValue, "%s",
						cmdBuf->optDef[optNo].optValue);

			}

			break;
		case exM_hlrCcNdcSn:
			//cc_ndc_sn
			sprintf(cmdBuf->optDef[optNo].fieldValue, "91%s",
					cmdBuf->optDef[optNo].optValue);
			for (i = strlen(cmdBuf->optDef[optNo].fieldValue); i < 18; i++) {
				cmdBuf->optDef[optNo].fieldValue[i] = 'E';
			}
			//cmdBuf->optDef[optNo].fieldValue[18] = '\0';
			break;
		case exM_hlrMsisdn:
			//basic_msisdn,cfu_num,cfb_num,cfnry_num,cfnrc_num
			if (strcmp(cmdBuf->optDef[optNo].optValue, "\"\"") == 0) {
				memset(cmdBuf->optDef[optNo].fieldValue, 0,
					   sizeof(cmdBuf->optDef[optNo].fieldValue));
			} else {
				sprintf(cmdBuf->optDef[optNo].fieldValue, "%s",
						cmdBuf->optDef[optNo].optValue);
			}
			for (i = strlen(cmdBuf->optDef[optNo].fieldValue); i < 18; i++) {
				cmdBuf->optDef[optNo].fieldValue[i] = 'E';
			}
			break;
		case exM_hlrNam:
			//nam
			if (strcmp(cmdBuf->optDef[optNo].optValue, "gsm") == 0) {
				sprintf(cmdBuf->optDef[optNo].fieldValue, "01");
			} else if (strcmp(cmdBuf->optDef[optNo].optValue, "gprs") == 0) {
				sprintf(cmdBuf->optDef[optNo].fieldValue, "02");
			} else if (strcmp(cmdBuf->optDef[optNo].optValue, "dual") == 0) {
				sprintf(cmdBuf->optDef[optNo].fieldValue, "00");
			} else {
				return (1);
			}
			break;
		case exM_hlrState:
			//imsi_flag,baoc,boic,boic_hplmn,baic,cfu,cfb
			//cfnry,cfnrc,clip,clir,colp,colr,ch,cw
			//printf("optValue=%s\n",cmdBuf->optDef[optNo].optValue);
			if (strcmp(cmdBuf->optDef[optNo].optValue, "enable") == 0) {
				sprintf(cmdBuf->optDef[optNo].fieldValue, "01");
			} else if (strcmp(cmdBuf->optDef[optNo].optValue, "disable") ==
					   0) {
				sprintf(cmdBuf->optDef[optNo].fieldValue, "00");
			} else
				return (1);
			//printf("fieldValue=%s\n",cmdBuf->optDef[optNo].fieldValue);
			break;
		case exM_hlrClirpm:
			if (strcmp
				(cmdBuf->optDef[optNo].optValue,
				 "Temporary(Default:Allowed)") == 0) {
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 0, 5, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 0, 4, 0);
			} else
				if (strcmp
					(cmdBuf->optDef[optNo].optValue,
					 "Temporary(Default:Restricted)") == 0) {
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 0, 5, 0);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 0, 4, 1);
			} else if (strcmp(cmdBuf->optDef[optNo].optValue, "Permanent") == 0) {	//Permanent
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 0, 4, 0);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 0, 5, 0);
			} else
				return (1);
			break;
		case exM_hlrSms:
			if (strcmp(cmdBuf->optDef[optNo].optValue, "None") == 0) {
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 0, 2, 0);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 0, 3, 0);
			} else
				if (strcmp
					(cmdBuf->optDef[optNo].optValue, "Mobile_Term") == 0) {
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 0, 2, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 0, 3, 0);
			} else if (strcmp
					   (cmdBuf->optDef[optNo].optValue,
						"Mobile_Org") == 0) {
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 0, 2, 0);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 0, 3, 1);
			} else if (strcmp(cmdBuf->optDef[optNo].optValue, "Both") == 0) {
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 0, 2, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 0, 3, 1);
			} else
				return (1);
			break;
/*		case exM_hlrCfuopt:
		case exM_hlrCfnrcopt:
			if (strcmp(cmdBuf->optDef[optNo].optValue, "Calling_Party:ON")
				== 0) {
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 0, 5, 1);
			} else {
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 0, 5, 0);
			}
			break;
		case exM_hlrCfbopt:
		case exM_hlrCfnryopt:
			if (strcmp
				(cmdBuf->optDef[optNo].optValue,
				 "Calling_Party:ON/Fwd_Party:ON") == 0) {
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 0, 5, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 0, 7, 1);
			} else
				if (strcmp
					(cmdBuf->optDef[optNo].optValue,
					 "Calling_Party:ON/Fwd_Party:OFF") == 0) {
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 0, 5, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 0, 7, 0);
			} else
				if (strcmp
					(cmdBuf->optDef[optNo].optValue,
					 "Calling_Party:OFF/Fwd_Party:ON") == 0) {
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 0, 5, 0);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 0, 7, 1);
			} else {
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 0, 5, 0);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 0, 7, 0);
			}
																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																					break;
*/ case exM_hlrCfnryTimer:
			//cfnry_timer
			//tmpInt = atoi(cmdBuf->optDef[optNo].optValue);
			i = strlen(cmdBuf->optDef[optNo].optValue);
			if ((cmdBuf->optDef[optNo].optValue[i - 1] == '\n')
				|| (cmdBuf->optDef[optNo].optValue[i - 1] == '\r')) {
				cmdBuf->optDef[optNo].optValue[i - 1] = '\0';
				i = i - 1;
			}
			if ((cmdBuf->optDef[optNo].optValue[i - 1] == '\n')
				|| (cmdBuf->optDef[optNo].optValue[i - 1] == '\r'))
				cmdBuf->optDef[optNo].optValue[i - 1] = '\0';
			sprintf(cmdBuf->optDef[optNo].fieldValue, "%X",
					atoi(cmdBuf->optDef[optNo].optValue));
			break;
		case exM_hlrCategory:
			if (strcmp(cmdBuf->optDef[optNo].optValue, "Unknown") == 0)
				sprintf(cmdBuf->optDef[optNo].fieldValue, "00");
			else if (strcmp(cmdBuf->optDef[optNo].optValue, "French") == 0)
				sprintf(cmdBuf->optDef[optNo].fieldValue, "01");
			else if (strcmp(cmdBuf->optDef[optNo].optValue, "English") ==
					 0)
				sprintf(cmdBuf->optDef[optNo].fieldValue, "02");
			else if (strcmp(cmdBuf->optDef[optNo].optValue, "German") == 0)
				sprintf(cmdBuf->optDef[optNo].fieldValue, "03");
			else if (strcmp(cmdBuf->optDef[optNo].optValue, "Russian") ==
					 0)
				sprintf(cmdBuf->optDef[optNo].fieldValue, "04");
			else if (strcmp(cmdBuf->optDef[optNo].optValue, "Spanish") ==
					 0)
				sprintf(cmdBuf->optDef[optNo].fieldValue, "05");
			else if (strcmp
					 (cmdBuf->optDef[optNo].optValue,
					  "Ordinary_calling_subscriber") == 0)
				sprintf(cmdBuf->optDef[optNo].fieldValue, "0A");
			else if (strcmp
					 (cmdBuf->optDef[optNo].optValue,
					  "Priory_calling_subscriber") == 0)
				sprintf(cmdBuf->optDef[optNo].fieldValue, "0B");
			else
				return (1);
			break;
		case exM_hlrRszi:
			i = (optNo - optNo_Rszi);
			sprintf(tmpStr, "%2X", atoi(cmdBuf->optDef[optNo].optValue));
			cmdBuf->optDef[optNo].fieldValue[i * 2] = tmpStr[0];
			cmdBuf->optDef[optNo].fieldValue[i * 2 + 1] = tmpStr[1];
			break;
		case exM_hlrCsrr:
			if (strcmp(cmdBuf->optDef[optNo].optValue, "No_restriction") ==
				0) {
				sprintf(cmdBuf->optDef[optNo].fieldValue, "FF");
				break;
			}
			if (strlen(cmdBuf->optDef[optNo].optValue) > 2)
				return (1);
			for (i = 0; i < strlen(cmdBuf->optDef[optNo].optValue); i++) {
				if (isdigit(cmdBuf->optDef[optNo].optValue[i]) <= 0)
					return (1);
			}
			i = atoi(cmdBuf->optDef[optNo].optValue);
			switch (i) {
			case 0:
				sprintf(cmdBuf->optDef[optNo].fieldValue, "%2d", i);
				break;
			case 1:
				sprintf(cmdBuf->optDef[optNo].fieldValue, "%2d", i);
				break;
			case 2:
				sprintf(cmdBuf->optDef[optNo].fieldValue, "%2d", i);
				break;
			case 3:
				sprintf(cmdBuf->optDef[optNo].fieldValue, "%2d", i);
				break;
			case 4:
				sprintf(cmdBuf->optDef[optNo].fieldValue, "%2d", i);
				break;
			case 5:
				sprintf(cmdBuf->optDef[optNo].fieldValue, "%2d", i);
				break;
			case 6:
				sprintf(cmdBuf->optDef[optNo].fieldValue, "%2d", i);
				break;
			case 7:
				sprintf(cmdBuf->optDef[optNo].fieldValue, "%2d", i);
				break;
			default:
				return (1);
			}
			break;
		case exM_hlrCbsp:
			if (strcmp(cmdBuf->optDef[optNo].optValue, "Control_provider")
				== 0)
				sprintf(cmdBuf->optDef[optNo].fieldValue, "00");
			else if (strcmp
					 (cmdBuf->optDef[optNo].optValue,
					  "Control_sub_pwd") == 0)
				sprintf(cmdBuf->optDef[optNo].fieldValue, "01");
			else if (strcmp
					 (cmdBuf->optDef[optNo].optValue,
					  "Control_sub_not_pwd") == 0)
				sprintf(cmdBuf->optDef[optNo].fieldValue, "02");
			else
				return (1);
			break;
		case exM_hlrCbwpa:
			sprintf(cmdBuf->optDef[optNo].fieldValue, "%s",
					cmdBuf->optDef[optNo].optValue);
			break;
		case exM_hlrOCsi1:
			sprintf(tmpStr, "%2x", atoi(cmdBuf->optDef[optNo].optValue));
			for (i = 0; i < 2; i++)
				cmdBuf->optDef[optNo].fieldValue[i + 0] = tmpStr[i];
			break;
		case exM_hlrOCsi2:
			sprintf(tmpStr, "%8lx", atol(cmdBuf->optDef[optNo].optValue));
			for (i = 0; i < 8; i++)
				cmdBuf->optDef[optNo].fieldValue[i + 24] = tmpStr[i];
			break;
		case exM_hlrOCsi3:
			i = strlen(cmdBuf->optDef[optNo].optValue);
			for (j = 0; j < i; j++)
				cmdBuf->optDef[optNo].fieldValue[j + 6] =
					cmdBuf->optDef[optNo].optValue[j];
			for (; j < 18; j++)
				cmdBuf->optDef[optNo].fieldValue[j + 6] = 'E';
			break;
		case exM_hlrOCsi4:
			if (strcmp(cmdBuf->optDef[optNo].optValue, "Release_call") ==
				0)
				cmdBuf->optDef[optNo].fieldValue[3] = '1';
			else if (strcmp
					 (cmdBuf->optDef[optNo].optValue,
					  "Continue_call") == 0)
				cmdBuf->optDef[optNo].fieldValue[3] = '0';
			else
				return (1);
			break;
		case exM_hlrOCsi5:
			if (strcmp(cmdBuf->optDef[optNo].optValue, "In_use") == 0)
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 16, 0, 1);
			else if (strcmp(cmdBuf->optDef[optNo].optValue, "Not_use") ==
					 0)
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 16, 0, 0);
			else
				return (1);
			break;
		case exM_hlrOCsi6:
			if (strcmp(cmdBuf->optDef[optNo].optValue, "Enabling") == 0)
				cmdBuf->optDef[optNo].fieldValue[35] = '1';
			else if (strcmp(cmdBuf->optDef[optNo].optValue, "Inhabiting")
					 == 0)
				cmdBuf->optDef[optNo].fieldValue[35] = '0';
			else
				return (1);
			break;
		case exM_hlrOCsi7:
			if (strcmp(cmdBuf->optDef[optNo].optValue, "In_use") == 0)
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 16, 2, 1);
			else if (strcmp(cmdBuf->optDef[optNo].optValue, "Not_use") ==
					 0)
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 16, 2, 0);
			else
				return (1);
			break;
		case exM_hlrOCsi8:
			i = strlen(cmdBuf->optDef[optNo].optValue);
			for (j = 0; j < i; j++)
				cmdBuf->optDef[optNo].fieldValue[j + 38] =
					cmdBuf->optDef[optNo].optValue[j];
			for (; j < 18; j++)
				cmdBuf->optDef[optNo].fieldValue[j + 38] = 'E';
			break;
		case exM_hlrOCsi9:
			i = strlen(cmdBuf->optDef[optNo].optValue);
			for (j = 0; j < i; j++)
				cmdBuf->optDef[optNo].fieldValue[j + 56] =
					cmdBuf->optDef[optNo].optValue[j];
			for (; j < 18; j++)
				cmdBuf->optDef[optNo].fieldValue[j + 56] = 'E';
			break;
		case exM_hlrOCsi10:
			i = strlen(cmdBuf->optDef[optNo].optValue);
			for (j = 0; j < i; j++)
				cmdBuf->optDef[optNo].fieldValue[j + 74] =
					cmdBuf->optDef[optNo].optValue[j];
			for (; j < 18; j++)
				cmdBuf->optDef[optNo].fieldValue[j + 74] = 'E';
			break;
		case exM_hlrOCsi11:
			i = strlen(cmdBuf->optDef[optNo].optValue);
			for (j = 0; j < i; j++)
				cmdBuf->optDef[optNo].fieldValue[j + 92] =
					cmdBuf->optDef[optNo].optValue[j];
			for (; j < 18; j++)
				cmdBuf->optDef[optNo].fieldValue[j + 92] = 'E';
			break;
		case exM_hlrOCsi12:
			if (strcmp(cmdBuf->optDef[optNo].optValue, "In_use") == 0)
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 16, 3, 1);
			else if (strcmp(cmdBuf->optDef[optNo].optValue, "Not_use") ==
					 0)
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 16, 3, 0);
			else
				return (1);
			break;
		case exM_hlrOCsi13:
			sprintf(tmpStr, "%2x", atoi(cmdBuf->optDef[optNo].optValue));
			for (i = 0; i < 2; i++)
				cmdBuf->optDef[optNo].fieldValue[i + 110] = tmpStr[i];
			break;
		case exM_hlrOCsi14:
			sprintf(tmpStr, "%2x", atoi(cmdBuf->optDef[optNo].optValue));
			for (i = 0; i < 2; i++)
				cmdBuf->optDef[optNo].fieldValue[i + 112] = tmpStr[i];
			break;
		case exM_hlrOCsi15:
			sprintf(tmpStr, "%2x", atoi(cmdBuf->optDef[optNo].optValue));
			for (i = 0; i < 2; i++)
				cmdBuf->optDef[optNo].fieldValue[i + 114] = tmpStr[i];
			break;
		case exM_hlrOCsi16:
			if (strcmp(cmdBuf->optDef[optNo].optValue, "In_use") == 0)
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 16, 1, 1);
			else if (strcmp(cmdBuf->optDef[optNo].optValue, "Not_use") ==
					 0)
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 16, 1, 0);
			else
				return (1);
			break;
		case exM_hlrOCsi17:
			if (strcmp(cmdBuf->optDef[optNo].optValue, "Not_forward") == 0)
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 18, 0, 1);
			else if (strcmp(cmdBuf->optDef[optNo].optValue, "Forward") ==
					 0)
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 18, 0, 0);
			else
				return (1);
			break;
		case exM_hlrOCsi18:
			sprintf(tmpStr, "%2x", atoi(cmdBuf->optDef[optNo].optValue));
			for (i = 0; i < 2; i++)
				cmdBuf->optDef[optNo].fieldValue[i + 4] = tmpStr[i];
			break;
		case exM_hlrSsCsi:
			j = optNo - optNo_Sscsi;
			if (strcmp(cmdBuf->optDef[optNo].optValue, "cd") == 0) {
				cmdBuf->optDef[optNo].fieldValue[0 + j * 2] = '2';
				cmdBuf->optDef[optNo].fieldValue[0 + j * 2 + 1] = '4';
			} else if (strcmp(cmdBuf->optDef[optNo].optValue, "ect") == 0) {
				cmdBuf->optDef[optNo].fieldValue[0 + j * 2] = '3';
				cmdBuf->optDef[optNo].fieldValue[0 + j * 2 + 1] = '1';
			} else if (strcmp(cmdBuf->optDef[optNo].optValue, "multiPTY")
					   == 0) {
				cmdBuf->optDef[optNo].fieldValue[0 + j * 2] = '5';
				cmdBuf->optDef[optNo].fieldValue[0 + j * 2 + 1] = '1';
			} else if (strcmp(cmdBuf->optDef[optNo].optValue, "None")
					   == 0) {
				cmdBuf->optDef[optNo].fieldValue[0 + j * 2] = '0';
				cmdBuf->optDef[optNo].fieldValue[0 + j * 2 + 1] = '0';
			} else
				return (1);
			break;
		case exM_hlrSsCsi1:
			i = strlen(cmdBuf->optDef[optNo].optValue);
			if(i < 11 || i > 18)
				return 1;
			for (j = 0; j < i; j++)
				cmdBuf->optDef[optNo].fieldValue[j + 8] =
					cmdBuf->optDef[optNo].optValue[j];
			for (; j < 18; j++)
				cmdBuf->optDef[optNo].fieldValue[j + 8] = 'E';
			break;
		case exM_hlrPdp1:
			if (!strcmp(cmdBuf->optDef[optNo].optValue, "enable")) {
				cmdBuf->optDef[optNo].fieldValue[0] = '0';
				cmdBuf->optDef[optNo].fieldValue[1] = '1';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "disable")) {
				cmdBuf->optDef[optNo].fieldValue[0] = '0';
				cmdBuf->optDef[optNo].fieldValue[1] = '0';
			} else
				return (1);
			break;
		case exM_hlrPdp2:
			if (!strcmp(cmdBuf->optDef[optNo].optValue, "IPv4")) {
				sprintf(tmpStr, "%4X", 289);
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "IPv6")) {
				sprintf(tmpStr, "%4X", 343);
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "X.25")) {
				sprintf(tmpStr, "%4X", 0);
			} else
				return (1);
			for (i = 0; i < 4; i++)
				cmdBuf->optDef[optNo].fieldValue[2 + i] = tmpStr[i];
			break;
		case exM_hlrPdp3:
			if (cmdBuf->optDef[optNo - 1].optFlag[0] == 1) {
				if (!strcmp(cmdBuf->optDef[optNo - 1].optValue, "IPv4")) {
					if(strcasecmp(cmdBuf->optDef[optNo].optValue,"null") == 0)
					{
						sprintf(tmpValue, "0000000000");
						strcat(tmpValue, "EEEEEEEEEEEEEEEEEEEEEEEE");
						for (i = 0; i < 34; i++)
							cmdBuf->optDef[optNo].fieldValue[6 + i] =
								tmpValue[i];
					}
					else
					{
						
						sprintf(tmpValue, "04");
						j = 0;
						tmpStr[0] = 0;
						for (i = 0;
							 i < strlen(cmdBuf->optDef[optNo].optValue) + 1;
							 i++) {
							if (isdigit(cmdBuf->optDef[optNo].optValue[i])) {
								tmpStr[j] = cmdBuf->optDef[optNo].optValue[i];
								j++;
							} else if (cmdBuf->optDef[optNo].optValue[i] == '.'
									   || cmdBuf->optDef[optNo].optValue[i] ==
									   0) {
								if (j > 3 || j < 1)
									return (1);
								tmpStr[j] = 0;
								if (atoi(tmpStr) > 255)
									return (1);
								sprintf(tmpStr_1, "%02X", atoi(tmpStr));
								strcat(tmpValue, tmpStr_1);
								j = 0;
								tmpStr[0] = 0;
							} else
								return (1);
						}
						if (strlen(tmpValue) != 10)
							return (1);
						strcat(tmpValue, "EEEEEEEEEEEEEEEEEEEEEEEE");
						for (i = 0; i < 34; i++)
							cmdBuf->optDef[optNo].fieldValue[6 + i] =
								tmpValue[i];
					}
				} else
					if (!strcmp
						(cmdBuf->optDef[optNo - 1].optValue, "IPv6")) {
					sprintf(tmpValue, "10");
					j = 0;
					tmpStr[0] = 0;
					for (i = 0;
						 i < strlen(cmdBuf->optDef[optNo].optValue) + 1;
						 i++) {
						if (isxdigit(cmdBuf->optDef[optNo].optValue[i])) {
							tmpStr[j] = cmdBuf->optDef[optNo].optValue[i];
							j++;
						} else if (cmdBuf->optDef[optNo].optValue[i] == ':'
								   || cmdBuf->optDef[optNo].optValue[i] ==
								   0) {
							if (j != 4) {
								return (1);
							}
							tmpStr[j] = 0;
							strcat(tmpValue, tmpStr);
							j = 0;
							tmpStr[0] = 0;
						} else {
							return (1);
						}
					}

					if (strlen(tmpValue) != 34) {
						return (1);
					}
					for (i = 0; i < 34; i++)
						cmdBuf->optDef[optNo].fieldValue[6 + i] =
							tmpValue[i];
				} else
					if (!strcmp
						(cmdBuf->optDef[optNo - 1].optValue, "X.25")) {
					if (strlen(cmdBuf->optDef[optNo].optValue) != 14
						&& strlen(cmdBuf->optDef[optNo].optValue) != 12)
						return (1);
					sprintf(tmpValue, "%02X",
							strlen(cmdBuf->optDef[optNo].optValue) / 2);
					for (i = 0; i < strlen(cmdBuf->optDef[optNo].optValue);
						 i++) {
						if (!isdigit(cmdBuf->optDef[optNo].optValue[i]))
							return (1);
					}
					strcat(tmpValue, cmdBuf->optDef[optNo].optValue);
					for (i = strlen(tmpValue); i < 34; i++)
						tmpValue[i] = 'E';
					for (i = 0; i < 34; i++)
						cmdBuf->optDef[optNo].fieldValue[6 + i] =
							tmpValue[i];
				} else
					return (1);
			} else {
				if (strchr(cmdBuf->optDef[optNo].optValue, '.')) {
					sprintf(tmpValue, "04");
					j = 0;
					tmpStr[0] = 0;
					for (i = 0;
						 i < strlen(cmdBuf->optDef[optNo].optValue) + 1;
						 i++) {
						if (isdigit(cmdBuf->optDef[optNo].optValue[i])) {
							tmpStr[j] = cmdBuf->optDef[optNo].optValue[i];
							j++;
						} else if (cmdBuf->optDef[optNo].optValue[i] == '.'
								   || cmdBuf->optDef[optNo].optValue[i] ==
								   0) {
							if (j > 3 || j < 1)
								return (1);
							tmpStr[j] = 0;
							if (atoi(tmpStr) > 255)
								return (1);
							sprintf(tmpStr_1, "%02X", atoi(tmpStr));
							strcat(tmpValue, tmpStr_1);
							j = 0;
							tmpStr[0] = 0;
						} else
							return (1);
					}
					if (strlen(tmpValue) != 10)
						return (1);
					strcat(tmpValue, "EEEEEEEEEEEEEEEEEEEEEEEE");
					for (i = 0; i < 34; i++)
						cmdBuf->optDef[optNo].fieldValue[6 + i] =
							tmpValue[i];
				} else if (strchr(cmdBuf->optDef[optNo].optValue, ':')) {
					sprintf(tmpValue, "10");
					j = 0;
					tmpStr[0] = 0;
					for (i = 0;
						 i < strlen(cmdBuf->optDef[optNo].optValue) + 1;
						 i++) {
						if (isxdigit(cmdBuf->optDef[optNo].optValue[i])) {
							tmpStr[j] = cmdBuf->optDef[optNo].optValue[i];
							j++;
						} else if (cmdBuf->optDef[optNo].optValue[i] == ':'
								   || cmdBuf->optDef[optNo].optValue[i] ==
								   0) {
							if (j != 4) {
								return (1);
							}
							tmpStr[j] = 0;
							strcat(tmpValue, tmpStr);
							j = 0;
							tmpStr[0] = 0;
						} else {
							return (1);
						}
					}

					if (strlen(tmpValue) != 34) {
						return (1);
					}
					for (i = 0; i < 34; i++)
						cmdBuf->optDef[optNo].fieldValue[6 + i] =
							tmpValue[i];
				} else {
					if (strlen(cmdBuf->optDef[optNo].optValue) != 14
						&& strlen(cmdBuf->optDef[optNo].optValue) != 12)
						return (1);
					sprintf(tmpValue, "%02X",
							strlen(cmdBuf->optDef[optNo].optValue) / 2);
					for (i = 0; i < strlen(cmdBuf->optDef[optNo].optValue);
						 i++) {
						if (!isdigit(cmdBuf->optDef[optNo].optValue[i]))
							return (1);
					}
					strcat(tmpValue, cmdBuf->optDef[optNo].optValue);
					for (i = strlen(tmpValue); i < 34; i++)
						tmpValue[i] = 'E';
					for (i = 0; i < 34; i++)
						cmdBuf->optDef[optNo].fieldValue[6 + i] =
							tmpValue[i];
				}
			}
			break;
		case exM_hlrPdp4:
			if (strlen(cmdBuf->optDef[optNo].optValue) > 1)
				return (1);
			if (cmdBuf->optDef[optNo].optValue[0] < '1'
				|| cmdBuf->optDef[optNo].optValue[0] > '5')
				return (1);
			/*cmdBuf->optDef[optNo].fieldValue[41] =
			   cmdBuf->optDef[optNo].optValue[0];
			 */
			tmp = atoi(cmdBuf->optDef[optNo].optValue);
			setBitValue(cmdBuf->optDef[optNo].fieldValue, 20, 0, tmp % 2);
			setBitValue(cmdBuf->optDef[optNo].fieldValue, 20, 1,
						tmp % 4 / 2);
			setBitValue(cmdBuf->optDef[optNo].fieldValue, 20, 2, tmp / 4);
			break;
		case exM_hlrPdp5:
			if (strlen(cmdBuf->optDef[optNo].optValue) > 1)
				return (1);
			if (cmdBuf->optDef[optNo].optValue[0] < '1'
				|| cmdBuf->optDef[optNo].optValue[0] > '4')
				return (1);
			/*      cmdBuf->optDef[optNo].fieldValue[40] =
			   cmdBuf->optDef[optNo].optValue[0];
			 */
			tmp = atoi(cmdBuf->optDef[optNo].optValue);
			setBitValue(cmdBuf->optDef[optNo].fieldValue, 20, 3, tmp % 2);
			setBitValue(cmdBuf->optDef[optNo].fieldValue, 20, 4,
						tmp % 4 / 2);
			setBitValue(cmdBuf->optDef[optNo].fieldValue, 20, 5, tmp / 4);                
			break;          
		case exM_hlrPdp6: 
			if (!strcmp(cmdBuf->optDef[optNo].optValue, "High"))
				cmdBuf->optDef[optNo].fieldValue[43] = '1';
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "Normal"))
				cmdBuf->optDef[optNo].fieldValue[43] = '2';
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "Low"))
				cmdBuf->optDef[optNo].fieldValue[43] = '3';
			else
				return (1);
			break;
		case exM_hlrPdp7:
			if (!strcmp(cmdBuf->optDef[optNo].optValue, "8Kbps"))
				cmdBuf->optDef[optNo].fieldValue[42] = '1';
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "16Kbps"))
				cmdBuf->optDef[optNo].fieldValue[42] = '2';
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "32Kbps"))
				cmdBuf->optDef[optNo].fieldValue[42] = '3';
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "64Kbps"))
				cmdBuf->optDef[optNo].fieldValue[42] = '4';
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "128Kbps"))
				cmdBuf->optDef[optNo].fieldValue[42] = '5';
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "256Kbps"))
				cmdBuf->optDef[optNo].fieldValue[42] = '6';
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "512Kbps"))
				cmdBuf->optDef[optNo].fieldValue[42] = '7';
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "1024Kbps"))
				cmdBuf->optDef[optNo].fieldValue[42] = '8';
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "2048Kbps"))
				cmdBuf->optDef[optNo].fieldValue[42] = '9';
			else
				return (1);
			break;
		case exM_hlrPdp8:
			if (!strcmp(cmdBuf->optDef[optNo].optValue, "100Bph")) {
				cmdBuf->optDef[optNo].fieldValue[44] = '0';
				cmdBuf->optDef[optNo].fieldValue[45] = '1';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "200Bph")) {
				cmdBuf->optDef[optNo].fieldValue[44] = '0';
				cmdBuf->optDef[optNo].fieldValue[45] = '2';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "500Bph")) {
				cmdBuf->optDef[optNo].fieldValue[44] = '0';
				cmdBuf->optDef[optNo].fieldValue[45] = '3';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "1KBph")) {
				cmdBuf->optDef[optNo].fieldValue[44] = '0';
				cmdBuf->optDef[optNo].fieldValue[45] = '4';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "2KBph")) {
				cmdBuf->optDef[optNo].fieldValue[44] = '0';
				cmdBuf->optDef[optNo].fieldValue[45] = '5';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "5KBph")) {
				cmdBuf->optDef[optNo].fieldValue[44] = '0';
				cmdBuf->optDef[optNo].fieldValue[45] = '6';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "10KBph")) {
				cmdBuf->optDef[optNo].fieldValue[44] = '0';
				cmdBuf->optDef[optNo].fieldValue[45] = '7';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "20KBph")) {
				cmdBuf->optDef[optNo].fieldValue[44] = '0';
				cmdBuf->optDef[optNo].fieldValue[45] = '8';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "50KBph")) {
				cmdBuf->optDef[optNo].fieldValue[44] = '0';
				cmdBuf->optDef[optNo].fieldValue[45] = '9';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "100KBph")) {
				cmdBuf->optDef[optNo].fieldValue[44] = '0';
				cmdBuf->optDef[optNo].fieldValue[45] = 'A';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "200KBph")) {
				cmdBuf->optDef[optNo].fieldValue[44] = '0';
				cmdBuf->optDef[optNo].fieldValue[45] = 'B';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "500KBph")) {
				cmdBuf->optDef[optNo].fieldValue[44] = '0';
				cmdBuf->optDef[optNo].fieldValue[45] = 'C';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "1MBph")) {
				cmdBuf->optDef[optNo].fieldValue[44] = '0';
				cmdBuf->optDef[optNo].fieldValue[45] = 'D';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "2MBph")) {
				cmdBuf->optDef[optNo].fieldValue[44] = '0';
				cmdBuf->optDef[optNo].fieldValue[45] = 'E';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "5MBph")) {
				cmdBuf->optDef[optNo].fieldValue[44] = '0';
				cmdBuf->optDef[optNo].fieldValue[45] = 'F';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "10MBph")) {
				cmdBuf->optDef[optNo].fieldValue[44] = '1';
				cmdBuf->optDef[optNo].fieldValue[45] = '0';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "20MBph")) {
				cmdBuf->optDef[optNo].fieldValue[44] = '1';
				cmdBuf->optDef[optNo].fieldValue[45] = '1';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "50MBph")) {
				cmdBuf->optDef[optNo].fieldValue[44] = '1';
				cmdBuf->optDef[optNo].fieldValue[45] = '2';
			} else
				if (!strcmp(cmdBuf->optDef[optNo].optValue, "Best_effort"))
			{
				cmdBuf->optDef[optNo].fieldValue[44] = '1';
				cmdBuf->optDef[optNo].fieldValue[45] = 'F';
			} else
				return (1);
			break;
		case exM_hlrPdp9:
			if (!strcmp(cmdBuf->optDef[optNo].optValue, "Not_allowed")) {
				cmdBuf->optDef[optNo].fieldValue[46] = '0';
				cmdBuf->optDef[optNo].fieldValue[47] = '0';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "Allowed")) {
				cmdBuf->optDef[optNo].fieldValue[46] = '0';
				cmdBuf->optDef[optNo].fieldValue[47] = '1';
			} else
				return (1);
			break;
		case exM_hlrPdp10:
			for (i = 0; i < strlen(cmdBuf->optDef[optNo].optValue); i++) {
				sprintf(tmpStr, "%02X", cmdBuf->optDef[optNo].optValue[i]);
				cmdBuf->optDef[optNo].fieldValue[48 + i * 2 + 0] =
					tmpStr[0];
				cmdBuf->optDef[optNo].fieldValue[48 + i * 2 + 1] =
					tmpStr[1];
			}
			for (j = 0;
				 j < 64 - strlen(cmdBuf->optDef[optNo].optValue) * 2;
				 j++) {
				cmdBuf->optDef[optNo].fieldValue[48 + i * 2 + j] = '0';
			}
			break;
		case exM_hlrPdp11:
			if (!strcmp(cmdBuf->optDef[optNo].optValue, "Non_included_Ext")) {
				cmdBuf->optDef[optNo].fieldValue[112] = '0';
				cmdBuf->optDef[optNo].fieldValue[113] = '0';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "Included_Ext")) {
				cmdBuf->optDef[optNo].fieldValue[112] = '0';
				cmdBuf->optDef[optNo].fieldValue[113] = '1';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "Included_Ext_and_Ext2_only_1_octet")) {
				cmdBuf->optDef[optNo].fieldValue[112] = '0';
				cmdBuf->optDef[optNo].fieldValue[113] = '3';
			}else if (!strcmp(cmdBuf->optDef[optNo].optValue, "Included_Ext_Ext2")) {
				cmdBuf->optDef[optNo].fieldValue[112] = '0';
				cmdBuf->optDef[optNo].fieldValue[113] = '7';
			}else if (!strcmp(cmdBuf->optDef[optNo].optValue, "Included_Ext_Ext2_EXt3")) {
				cmdBuf->optDef[optNo].fieldValue[112] = '0';
				cmdBuf->optDef[optNo].fieldValue[113] = 'F';
			}else
				return (1);
			break;
		case exM_hlrPdp12:
			if (strlen(cmdBuf->optDef[optNo].optValue) > 1)
				return (1);
			if (cmdBuf->optDef[optNo].optValue[0] < '0'
				|| cmdBuf->optDef[optNo].optValue[0] > '4')
				return (1);
			tmp = atoi(cmdBuf->optDef[optNo].optValue);
			setBitValue(cmdBuf->optDef[optNo].fieldValue, 57, 0, tmp % 2);
			setBitValue(cmdBuf->optDef[optNo].fieldValue, 57, 1,
						tmp % 4 / 2);
			setBitValue(cmdBuf->optDef[optNo].fieldValue, 57, 2, tmp / 4);
			break;
		case exM_hlrPdp13:
			if (!strcmp(cmdBuf->optDef[optNo].optValue, "No_detect"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 58, 0, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 58, 1, 0);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 58, 2, 0);	
			}
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "Err_SDUs_delilvered"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 58, 0, 0);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 58, 1, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 58, 2, 0);	
			}
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "Err_SDUs_not_delivered"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 58, 0, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 58, 1, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 58, 2, 0);	
			}
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "Reserved"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 58, 0, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 58, 1, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 58, 2, 1);	
			}
			else
				return (1);
			break;
		case exM_hlrPdp14:
			if (!strcmp(cmdBuf->optDef[optNo].optValue, "delivery_order"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 58, 3, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 58, 4, 0);	
			}
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "no_delivery_order"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 58, 3, 0);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 58, 4, 1);	
			}
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "Reserved"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 58, 3, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 58, 4, 1);	
			}
			else
				return (1);
			break;
		case exM_hlrPdp15:
			if (!strcmp(cmdBuf->optDef[optNo].optValue, "Conversation_class"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 58, 5, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 58, 6, 0);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 58, 7, 0);	
			}
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "Streaming_class"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 58, 5, 0);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 58, 6, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 58, 7, 0);	
			}
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "Interactive_class"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 58, 5, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 58, 6, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 58, 7, 0);	
			}
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "Background_class"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 58, 5, 0);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 58, 6, 0);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 58, 7, 1);	
			}
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "Reserved"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 58, 5, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 58, 6, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 58, 7, 1);	
			}
			else
				return (1);
			break;
		case exM_hlrPdp16:
			if (!strcmp(cmdBuf->optDef[optNo].optValue, "10_octets")) {
				cmdBuf->optDef[optNo].fieldValue[118] = '0';
				cmdBuf->optDef[optNo].fieldValue[119] = '1';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "200_octets")) {
				cmdBuf->optDef[optNo].fieldValue[118] = '1';
				cmdBuf->optDef[optNo].fieldValue[119] = '4';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "800_octets")) {
				cmdBuf->optDef[optNo].fieldValue[118] = '5';
				cmdBuf->optDef[optNo].fieldValue[119] = '0';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "1000_octets")) {
				cmdBuf->optDef[optNo].fieldValue[118] = '6';
				cmdBuf->optDef[optNo].fieldValue[119] = '4';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "1480_octets")) {
				cmdBuf->optDef[optNo].fieldValue[118] = '9';
				cmdBuf->optDef[optNo].fieldValue[119] = '4';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "1500_octets")) {
				cmdBuf->optDef[optNo].fieldValue[118] = '9';
				cmdBuf->optDef[optNo].fieldValue[119] = '6';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "1502_octets")) {
				cmdBuf->optDef[optNo].fieldValue[118] = '9';
				cmdBuf->optDef[optNo].fieldValue[119] = '7';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "1510_octets")) {
				cmdBuf->optDef[optNo].fieldValue[118] = '9';
				cmdBuf->optDef[optNo].fieldValue[119] = '8';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "1520_octets")) {
				cmdBuf->optDef[optNo].fieldValue[118] = '9';
				cmdBuf->optDef[optNo].fieldValue[119] = '9';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "Reserved"))
			{
				cmdBuf->optDef[optNo].fieldValue[118] = 'F';
				cmdBuf->optDef[optNo].fieldValue[119] = 'F';
			} else
				return (1);
			break;
		case exM_hlrPdp17:
			tmp = atoi(cmdBuf->optDef[optNo].optValue);
			setBitValue(cmdBuf->optDef[optNo].fieldValue, 60, 0, tmp % 2);
			setBitValue(cmdBuf->optDef[optNo].fieldValue, 60, 1,
						tmp /2%2);
			setBitValue(cmdBuf->optDef[optNo].fieldValue, 60, 2, tmp /2/2 % 2);
			setBitValue(cmdBuf->optDef[optNo].fieldValue, 60, 3, tmp /2/2/2 % 2);
			setBitValue(cmdBuf->optDef[optNo].fieldValue, 60, 4, tmp /2/2/2/2 %2);
			setBitValue(cmdBuf->optDef[optNo].fieldValue, 60, 5, tmp /2/2/2/2/2 %2);
			break;
		case exM_hlrPdp18:
			if (!strcmp(cmdBuf->optDef[optNo].optValue, "X*1Kbps"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 60, 6, 0);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 60, 7, 0);	
			}
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "64Kbps+(X*8Kbps)"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 60, 6, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 60, 7, 0);	
			}
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "576Kbps+(X*64Kbps)"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 60, 6, 0);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 60, 7, 1);	
			}
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "4672Kbps+(X*64Kbps)"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 60, 6, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 60, 7, 1);	
			}
			else
				return (1);
			break;
		case exM_hlrPdp19:
			tmp = atoi(cmdBuf->optDef[optNo].optValue);
			setBitValue(cmdBuf->optDef[optNo].fieldValue, 61, 0, tmp % 2);
			setBitValue(cmdBuf->optDef[optNo].fieldValue, 61, 1,
						tmp % 4 / 2);
			setBitValue(cmdBuf->optDef[optNo].fieldValue, 61, 2, tmp %2%2%2 % 2);
			setBitValue(cmdBuf->optDef[optNo].fieldValue, 61, 3, tmp %2%2%2%2 % 2);
			setBitValue(cmdBuf->optDef[optNo].fieldValue, 61, 4, tmp %2%2%2%2%2 %2);
			setBitValue(cmdBuf->optDef[optNo].fieldValue, 61, 5, tmp %2%2%2%2%2%2 %2);
			break;
		case exM_hlrPdp20:
			if (!strcmp(cmdBuf->optDef[optNo].optValue, "X*1Kbps"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 61, 6, 0);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 61, 7, 0);	
			}
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "64Kbps+(X*8Kbps)"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 61, 6, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 61, 7, 0);	
			}
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "576Kbps+(X*64Kbps)"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 61, 6, 0);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 61, 7, 1);	
			}
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "4672Kbps+(X*64Kbps)"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 61, 6, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 61, 7, 1);	
			}
			else
				return (1);
			break;
		case exM_hlrPdp21:
			if (!strcmp(cmdBuf->optDef[optNo].optValue, "1E_2"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 0, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 1, 0);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 2, 0);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 3, 0);	
			}
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "7E_3"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 0, 0);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 1, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 2, 0);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 3, 0);	
			}
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "1E_3"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 0, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 1, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 2, 0);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 3, 0);	
			}
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "1E_4"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 0, 0);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 1, 0);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 2, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 3, 0);	
			}
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "1E_5"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 0, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 1, 0);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 2, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 3, 0);	
			}
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "1E_6"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 0, 0);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 1, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 2, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 3, 0);	
			}
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "1E_1"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 0, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 1, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 2, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 3, 0);	
			}
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "Reserved"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 0, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 1, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 2, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 3, 1);	
			}
			else
				return (1);
			break;
		case exM_hlrPdp22:
			if (!strcmp(cmdBuf->optDef[optNo].optValue, "5E_2"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 4, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 5, 0);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 6, 0);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 7, 0);	
			}
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "1E_2"))
			{
        setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 4, 0);
        setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 5, 1);
        setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 6, 0);
     		setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 7, 0);	
     	}
     	else if(!strcmp(cmdBuf->optDef[optNo].optValue, "5E_3")) 
     	{ 
     		setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 4, 1); 
     		setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 5, 1); 
     		setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 6, 0); 
     		setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 7, 0);	
			}
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "4E_3"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 4, 0);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 5, 0);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 6, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 7, 0);	
			}
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "1E_3"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 4, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 5, 0);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 6, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 7, 0);	
			}
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "1E_4"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 4, 0);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 5, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 6, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 7, 0);	
			}
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "1E_5"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 4, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 5, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 6, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 7, 0);	
			}
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "1E_6"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 4, 0);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 5, 0);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 6, 0);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 7, 1);	
			}
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "6E_8"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 4, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 5, 0);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 6, 0);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 7, 1);	
			}
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "Reserved"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 4, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 5, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 6, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 62, 7, 1);	
			}
			else
				return (1);
			break;
		case exM_hlrPdp23:
			if (!strcmp(cmdBuf->optDef[optNo].optValue, "Level_1"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 63, 0, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 63, 1, 0);	
			}
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "Level_2"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 63, 0, 0);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 63, 1, 1);	
			}
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "Level_3"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 63, 0, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 63, 1, 1);	
			}
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "Reserved"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 63, 0, 0);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 63, 1, 0);	
			}
			else
				return (1);
			break;
		case exM_hlrPdp24:
			if (!strcmp(cmdBuf->optDef[optNo].optValue, "X*10ms"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 63, 2, 0);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 63, 3, 0);	
			}
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "200ms+X*50ms"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 63, 2, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 63, 3, 0);	
			}
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "1000ms+X*100ms"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 63, 2, 0);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 63, 3, 1);	
			}
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "2600ms+X*100ms"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 63, 2, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 63, 3, 1);	
			}
			else
				return (1);
			break;
		case exM_hlrPdp25:
			tmp = atoi(cmdBuf->optDef[optNo].optValue);
			setBitValue(cmdBuf->optDef[optNo].fieldValue, 64, 0, tmp % 2);
			setBitValue(cmdBuf->optDef[optNo].fieldValue, 64, 1,
						tmp % 4 / 2);
			setBitValue(cmdBuf->optDef[optNo].fieldValue, 64, 2, tmp %2%2%2 % 2);
			setBitValue(cmdBuf->optDef[optNo].fieldValue, 64, 3, tmp %2%2%2%2 % 2);
			setBitValue(cmdBuf->optDef[optNo].fieldValue, 64, 4, tmp %2%2%2%2%2 %2);
			setBitValue(cmdBuf->optDef[optNo].fieldValue, 64, 5, tmp %2%2%2%2%2%2 %2);
			break;
		case exM_hlrPdp26:
			if (!strcmp(cmdBuf->optDef[optNo].optValue, "X*1Kbps"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 64, 6, 0);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 64, 7, 0);	
			}
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "64Kbps+(X*8Kbps)"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 64, 6, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 64, 7, 0);	
			}
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "576Kbps+(X*64Kbps)"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 64, 6, 0);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 64, 7, 1);	
			}
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "4672Kbps+(X*64Kbps)"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 64, 6, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 64, 7, 1);	
			}
			else
				return (1);
			break;
		case exM_hlrPdp27:
			tmp = atoi(cmdBuf->optDef[optNo].optValue);
			setBitValue(cmdBuf->optDef[optNo].fieldValue, 65, 0, tmp % 2);
			setBitValue(cmdBuf->optDef[optNo].fieldValue, 65, 1,
						tmp % 4 / 2);
			setBitValue(cmdBuf->optDef[optNo].fieldValue, 65, 2, tmp %2%2%2 % 2);
			setBitValue(cmdBuf->optDef[optNo].fieldValue, 65, 3, tmp %2%2%2%2 % 2);
			setBitValue(cmdBuf->optDef[optNo].fieldValue, 65, 4, tmp %2%2%2%2%2 %2);
			setBitValue(cmdBuf->optDef[optNo].fieldValue, 65, 5, tmp %2%2%2%2%2%2 %2);
			break;
		case exM_hlrPdp28:
			if (!strcmp(cmdBuf->optDef[optNo].optValue, "X*1Kbps"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 65, 6, 0);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 65, 7, 0);	
			}
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "64Kbps+(X*8Kbps)"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 65, 6, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 65, 7, 0);	
			}
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "576Kbps+(X*64Kbps)"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 65, 6, 0);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 65, 7, 1);	
			}
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "4672Kbps+(X*64Kbps)"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 65, 6, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 65, 7, 1);	
			}
			else
				return (1);
			break;
		case exM_hlrPdp29:
			if (!strcmp(cmdBuf->optDef[optNo].optValue, "Spare"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 66, 0, 0);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 66, 1, 0);	
			}
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "Speech"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 66, 0, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 66, 1, 0);	
			}
			else
				return (1);
			break;
		case exM_hlrPdp30:
			if (!strcmp(cmdBuf->optDef[optNo].optValue, "Not_optimised"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 66, 4, 0);	
			}
			else if (!strcmp(cmdBuf->optDef[optNo].optValue, "Optimised"))
			{
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 66, 4, 1);	
			}
			else
				return (1);
			break;
		case exM_hlrPdp32:
			if (!strcmp(cmdBuf->optDef[optNo].optValue, "<=8600kbps")) {
				cmdBuf->optDef[optNo].fieldValue[134] = '0';
				cmdBuf->optDef[optNo].fieldValue[135] = '0';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "8700kbps")) {
				cmdBuf->optDef[optNo].fieldValue[134] = '0';
				cmdBuf->optDef[optNo].fieldValue[135] = '1';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "16000kbps")) {
				cmdBuf->optDef[optNo].fieldValue[134] = '4';
				cmdBuf->optDef[optNo].fieldValue[135] = 'A';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "17Mbps")) {
				cmdBuf->optDef[optNo].fieldValue[134] = '4';
				cmdBuf->optDef[optNo].fieldValue[135] = 'B';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "128Mbps")) {
				cmdBuf->optDef[optNo].fieldValue[134] = 'B';
				cmdBuf->optDef[optNo].fieldValue[135] = 'A';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "130Mbps")) {
				cmdBuf->optDef[optNo].fieldValue[134] = 'B';
				cmdBuf->optDef[optNo].fieldValue[135] = 'B';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "256Mbps")) {
				cmdBuf->optDef[optNo].fieldValue[134] = 'F';
				cmdBuf->optDef[optNo].fieldValue[135] = 'A';
			}else
				return (1);
			break;
		case exM_hlrPdp33:
			if (!strcmp(cmdBuf->optDef[optNo].optValue, "<=8600kbps")) {
				cmdBuf->optDef[optNo].fieldValue[136] = '0';
				cmdBuf->optDef[optNo].fieldValue[137] = '0';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "8700kbps")) {
				cmdBuf->optDef[optNo].fieldValue[136] = '0';
				cmdBuf->optDef[optNo].fieldValue[137] = '1';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "16000kbps")) {
				cmdBuf->optDef[optNo].fieldValue[136] = '4';
				cmdBuf->optDef[optNo].fieldValue[137] = 'A';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "17Mbps")) {
				cmdBuf->optDef[optNo].fieldValue[136] = '4';
				cmdBuf->optDef[optNo].fieldValue[137] = 'B';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "128Mbps")) {
				cmdBuf->optDef[optNo].fieldValue[136] = 'B';
				cmdBuf->optDef[optNo].fieldValue[137] = 'A';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "130Mbps")) {
				cmdBuf->optDef[optNo].fieldValue[136] = 'B';
				cmdBuf->optDef[optNo].fieldValue[137] = 'B';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "256Mbps")) {
				cmdBuf->optDef[optNo].fieldValue[136] = 'F';
				cmdBuf->optDef[optNo].fieldValue[137] = 'A';
			}else
				return (1);
			break;
		case exM_hlrPdp34:
			if (!strcmp(cmdBuf->optDef[optNo].optValue, "<=8600kbps")) {
				cmdBuf->optDef[optNo].fieldValue[138] = '0';
				cmdBuf->optDef[optNo].fieldValue[139] = '0';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "8700kbps")) {
				cmdBuf->optDef[optNo].fieldValue[138] = '0';
				cmdBuf->optDef[optNo].fieldValue[139] = '1';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "16000kbps")) {
				cmdBuf->optDef[optNo].fieldValue[138] = '4';
				cmdBuf->optDef[optNo].fieldValue[139] = 'A';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "17Mbps")) {
				cmdBuf->optDef[optNo].fieldValue[138] = '4';
				cmdBuf->optDef[optNo].fieldValue[139] = 'B';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "128Mbps")) {
				cmdBuf->optDef[optNo].fieldValue[138] = 'B';
				cmdBuf->optDef[optNo].fieldValue[139] = 'A';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "130Mbps")) {
				cmdBuf->optDef[optNo].fieldValue[138] = 'B';
				cmdBuf->optDef[optNo].fieldValue[139] = 'B';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "256Mbps")) {
				cmdBuf->optDef[optNo].fieldValue[138] = 'F';
				cmdBuf->optDef[optNo].fieldValue[139] = 'A';
			}else
				return (1);
			break;
		case exM_hlrPdp35:
			if (!strcmp(cmdBuf->optDef[optNo].optValue, "<=8600kbps")) {
				cmdBuf->optDef[optNo].fieldValue[140] = '0';
				cmdBuf->optDef[optNo].fieldValue[141] = '0';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "8700kbps")) {
				cmdBuf->optDef[optNo].fieldValue[140] = '0';
				cmdBuf->optDef[optNo].fieldValue[141] = '1';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "16000kbps")) {
				cmdBuf->optDef[optNo].fieldValue[140] = '4';
				cmdBuf->optDef[optNo].fieldValue[141] = 'A';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "17Mbps")) {
				cmdBuf->optDef[optNo].fieldValue[140] = '4';
				cmdBuf->optDef[optNo].fieldValue[141] = 'B';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "128Mbps")) {
				cmdBuf->optDef[optNo].fieldValue[140] = 'B';
				cmdBuf->optDef[optNo].fieldValue[141] = 'A';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "130Mbps")) {
				cmdBuf->optDef[optNo].fieldValue[140] = 'B';
				cmdBuf->optDef[optNo].fieldValue[141] = 'B';
			} else if (!strcmp(cmdBuf->optDef[optNo].optValue, "256Mbps")) {
				cmdBuf->optDef[optNo].fieldValue[140] = 'F';
				cmdBuf->optDef[optNo].fieldValue[141] = 'A';
			}else
				return (1);
			break;
		case exM_hlrUserNo:
			//user_no
			if (strcmp(cmdBuf->optDef[optNo].optValue, "\"\"") == 0) {
				memset(cmdBuf->optDef[optNo].fieldValue, 0,
					   sizeof(cmdBuf->optDef[optNo].fieldValue));
			} else {
				sprintf(cmdBuf->optDef[optNo].fieldValue, "%s",
						cmdBuf->optDef[optNo].optValue);
			}
			for (i = strlen(cmdBuf->optDef[optNo].fieldValue); i < 16; i++) {
				cmdBuf->optDef[optNo].fieldValue[i] = 'E';
			}
			break;
		default:
			if (tmpExMode >= 100 && tmpExMode < 200) {
				int byteOffset = (int) ((tmpExMode - 100) / 10);
				int bitOffset = tmpExMode % 10;
				if (strcmp(cmdBuf->optDef[optNo].optValue, "enable") == 0) {
					setBitValue(cmdBuf->optDef[optNo].fieldValue,
								byteOffset, bitOffset, 1);
				} else
					if (strcmp(cmdBuf->optDef[optNo].optValue, "disable")
						== 0) {
					setBitValue(cmdBuf->optDef[optNo].fieldValue,
								byteOffset, bitOffset, 0);
				} else
					return (1);
			} else {
				sprintf(cmdBuf->optDef[optNo].fieldValue, "%s",
						cmdBuf->optDef[optNo].optValue);
			}
			break;
		}
	}							//end of if(cmdBuf->sysTypeNo == 330)

	if (cmdBuf->sysTypeNo == 360||cmdBuf->sysTypeNo == 395) {
		if (tmpExMode == exM_ppsRentType) {
			if (strlen(cmdBuf->optDef[optNo].optValue) != 8)
				return (1);
			for (i = 0; i < 8; i++) {
				if (cmdBuf->optDef[optNo].optValue[i] == '\0')
					break;
				else if (cmdBuf->optDef[optNo].optValue[i] == '1')
					tmpField = tmpField + ldexp(1, (7 - i));
				else if (cmdBuf->optDef[optNo].optValue[i] == '0')
					continue;
				else
					return (1);
			}
			sprintf(cmdBuf->optDef[optNo].fieldValue, "%3.0f", tmpField);
			sprintf(cmdBuf->optDef[optNo].fieldValue, "%2x",
					atoi(cmdBuf->optDef[optNo].fieldValue));
		} else if (tmpExMode == exM_ppsDate) {
			if(strlen(cmdBuf->optDef[optNo].optValue) == 8)
			{
				sprintf(cmdBuf->optDef[optNo].fieldValue, "%s000000", cmdBuf->optDef[optNo].optValue);
			}
			else if(strlen(cmdBuf->optDef[optNo].optValue) == 10)
			{
				sprintf(cmdBuf->optDef[optNo].fieldValue, "%s0000", cmdBuf->optDef[optNo].optValue);
			}
			else if(strlen(cmdBuf->optDef[optNo].optValue) == 12)
			{
				sprintf(cmdBuf->optDef[optNo].fieldValue, "%s00", cmdBuf->optDef[optNo].optValue);
			}
			else if(strlen(cmdBuf->optDef[optNo].optValue) == 14)
			{
				sprintf(cmdBuf->optDef[optNo].fieldValue, "%s", cmdBuf->optDef[optNo].optValue);
			}
			else
			{
				return 1;
			}
		} else if (tmpExMode == exM_ppsCallType) {
			if (strcmp(cmdBuf->optDef[optNo].optValue, "mo_call") == 0)
				strcpy(cmdBuf->optDef[optNo].fieldValue, "00");
			else if (strcmp(cmdBuf->optDef[optNo].optValue, "mt_call") ==
					 0)
				strcpy(cmdBuf->optDef[optNo].fieldValue, "01");
			else if (strcmp(cmdBuf->optDef[optNo].optValue, "mf_call") ==
					 0)
				strcpy(cmdBuf->optDef[optNo].optValue, "02");
			else if (strcmp(cmdBuf->optDef[optNo].optValue, "mo_sms") == 0)
				strcpy(cmdBuf->optDef[optNo].optValue, "03");
			else
				return (1);
		} else if (tmpExMode == exM_ppsPoolAccountType) {
			if (strcmp(cmdBuf->optDef[optNo].optValue, "normal") == 0)
				strcpy(cmdBuf->optDef[optNo].fieldValue, "00");
			else if (strcmp(cmdBuf->optDef[optNo].optValue, "parent") == 0)
				strcpy(cmdBuf->optDef[optNo].fieldValue, "01");
			else if (strcmp(cmdBuf->optDef[optNo].optValue, "child") == 0)
				strcpy(cmdBuf->optDef[optNo].optValue, "02");
			else
				return 1;
		} else if (tmpExMode == exM_ppsSM) {
			sprintf(cmdBuf->optDef[optNo].fieldValue, "%X",
					atoi(cmdBuf->optDef[optNo].optValue));
		} else if (tmpExMode == exM_ppsBalance) {
			if (cmdBuf->optDef[optNo].optValue[0] == '~')
				cmdBuf->optDef[optNo].optValue[0] = '-';
			sprintf(cmdBuf->optDef[optNo].fieldValue, "%s",
					cmdBuf->optDef[optNo].optValue);
		} else if (tmpExMode == exM_ppsCardStatus) {
			if (strcmp(cmdBuf->optDef[optNo].optValue, "Fresh") == 0)
				strcpy(cmdBuf->optDef[optNo].fieldValue, "00");
			else if (strcmp(cmdBuf->optDef[optNo].optValue, "Charged") ==
					 0)
				strcpy(cmdBuf->optDef[optNo].fieldValue, "01");
			else
				return (1);
		} else if (tmpExMode == exM_ppsFFPlanState) {
			if (strcmp(cmdBuf->optDef[optNo].optValue, "normal") == 0)
				strcpy(cmdBuf->optDef[optNo].fieldValue, "00");
			else if (strcmp(cmdBuf->optDef[optNo].optValue, "suspend") == 0)
				strcpy(cmdBuf->optDef[optNo].fieldValue, "01");
			else
				return (1);
		} else {
			sprintf(cmdBuf->optDef[optNo].fieldValue, "%s",
					cmdBuf->optDef[optNo].optValue);
		}
	}
	//20041101 start
	if (cmdBuf->sysTypeNo == 390) {	//vms 
		switch (tmpExMode) {
		case exM_vmsHexDec:
			sprintf(cmdBuf->optDef[optNo].fieldValue, "%X",
					atoi(cmdBuf->optDef[optNo].optValue));
			break;
		case exM_vmsMailboxId:
			sprintf(cmdBuf->optDef[optNo].fieldValue, "%8X",
					atoi(cmdBuf->optDef[optNo].optValue));
			break;
		case exM_vmsGreetingType:
			if (strcmp(cmdBuf->optDef[optNo].optValue, "system") == 0) {
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 0, 0, 0);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 0, 1, 0);
			} else if (strcmp(cmdBuf->optDef[optNo].optValue, "hostname")
					   == 0) {
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 0, 0, 1);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 0, 1, 0);
			} else if (strcmp(cmdBuf->optDef[optNo].optValue, "personal")
					   == 0) {
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 0, 0, 0);
				setBitValue(cmdBuf->optDef[optNo].fieldValue, 0, 1, 1);
			} else
				return (1);

			break;
		default:
			if (tmpExMode >= 100 && tmpExMode < 200) {
				int byteOffset = (int) ((tmpExMode - 100) / 10);
				int bitOffset = tmpExMode % 10;
				if (strcmp(cmdBuf->optDef[optNo].optValue, "enable") == 0) {
					setBitValue(cmdBuf->optDef[optNo].fieldValue,
								byteOffset, bitOffset, 1);
				} else
					if (strcmp(cmdBuf->optDef[optNo].optValue, "disable")
						== 0) {
					setBitValue(cmdBuf->optDef[optNo].fieldValue,
								byteOffset, bitOffset, 0);
				} else
					return (1);
			} else {
				sprintf(cmdBuf->optDef[optNo].fieldValue, "%s",
						cmdBuf->optDef[optNo].optValue);
			}
			break;
		}
	}
	//20041101 end
	if (cmdBuf->sysTypeNo == 370) {	//mnp 
		switch (tmpExMode) {
		case exM_mnpStatus:
			if (strcmp(cmdBuf->optDef[optNo].optValue, "own_ported_out") ==
				0) {
				sprintf(cmdBuf->optDef[optNo].fieldValue, "02");
			} else
				if (strcmp
					(cmdBuf->optDef[optNo].optValue,
					 "foreign_ported_in") == 0) {
				sprintf(cmdBuf->optDef[optNo].fieldValue, "03");
			} else
				if (strcmp
					(cmdBuf->optDef[optNo].optValue,
					 "foreign_ported_to_third_party") == 0) {
				sprintf(cmdBuf->optDef[optNo].fieldValue, "04");
			} else
				return (1);
			//printf("fieldValue=%s\n",cmdBuf->optDef[optNo].fieldValue);
			break;
		case exM_mnpDate:
			sprintf(cmdBuf->optDef[optNo].fieldValue, "%s000000",
					cmdBuf->optDef[optNo].optValue);
		default:
			if (tmpExMode >= 100 && tmpExMode < 200) {
				int byteOffset = (int) ((tmpExMode - 100) / 10);
				int bitOffset = tmpExMode % 10;
				if (strcmp(cmdBuf->optDef[optNo].optValue, "enable") == 0) {
					setBitValue(cmdBuf->optDef[optNo].fieldValue,
								byteOffset, bitOffset, 1);
				} else
					if (strcmp(cmdBuf->optDef[optNo].optValue, "disable")
						== 0) {
					setBitValue(cmdBuf->optDef[optNo].fieldValue,
								byteOffset, bitOffset, 0);
				} else
					return (1);
			} else {
				sprintf(cmdBuf->optDef[optNo].fieldValue, "%s",
						cmdBuf->optDef[optNo].optValue);
			}
			break;
		}
	}
	
	//opps
	if (cmdBuf->sysTypeNo == 375) {
		switch (tmpExMode) {
		case exM_imdmMsisdn:
			if (strcmp(cmdBuf->optDef[optNo].optValue, "\"\"") == 0) {
				memset(cmdBuf->optDef[optNo].fieldValue, 0,
					   sizeof(cmdBuf->optDef[optNo].fieldValue));
			} else {
				sprintf(cmdBuf->optDef[optNo].fieldValue, "%s",
						cmdBuf->optDef[optNo].optValue);
			}
			/*for (i = strlen(cmdBuf->optDef[optNo].fieldValue); i < 16; i++) {
				cmdBuf->optDef[optNo].fieldValue[i] = '0';
			}*/
			break;
		case exM_imdmImei:
			//imei
			if (strlen(cmdBuf->optDef[optNo].optValue) < 15) {
				sprintf(cmdBuf->optDef[optNo].fieldValue, "0%s",
						cmdBuf->optDef[optNo].optValue);

			} else {
				sprintf(cmdBuf->optDef[optNo].fieldValue, "%s",
						cmdBuf->optDef[optNo].optValue);
			}
			if(strlen(cmdBuf->optDef[optNo].optValue) == 0)
				sprintf(cmdBuf->optDef[optNo].fieldValue,"000000000000000");
			break;	
		case exM_imdmImsi:
			//imsi
			if (strlen(cmdBuf->optDef[optNo].optValue) < 15) {
				sprintf(cmdBuf->optDef[optNo].fieldValue, "0%s",
						cmdBuf->optDef[optNo].optValue);

			} else {
				sprintf(cmdBuf->optDef[optNo].fieldValue, "%s",
						cmdBuf->optDef[optNo].optValue);
			}
			if(strlen(cmdBuf->optDef[optNo].optValue) == 0)
				sprintf(cmdBuf->optDef[optNo].fieldValue,"000000000000000");
			break;
		case exM_imdmOprFlag:
			if(strcasecmp(cmdBuf->optDef[optNo].optValue,"OPR_0") == 0)
				sprintf(cmdBuf->optDef[optNo].fieldValue,"0");
			else if(strcasecmp(cmdBuf->optDef[optNo].optValue,"OPR_1") == 0)
				sprintf(cmdBuf->optDef[optNo].fieldValue,"1");
			else if(strcasecmp(cmdBuf->optDef[optNo].optValue,"OPR_2a") == 0)
				sprintf(cmdBuf->optDef[optNo].fieldValue,"2");
			else if(strcasecmp(cmdBuf->optDef[optNo].optValue,"OPR_2b") == 0)
				sprintf(cmdBuf->optDef[optNo].fieldValue,"3");
			else if(strcasecmp(cmdBuf->optDef[optNo].optValue,"IMDX_P1") == 0)
				sprintf(cmdBuf->optDef[optNo].fieldValue,"4");
			else if(strcasecmp(cmdBuf->optDef[optNo].optValue,"IMDX_P2") == 0)
				sprintf(cmdBuf->optDef[optNo].fieldValue,"5");
			else if(strcasecmp(cmdBuf->optDef[optNo].optValue,"IMDX_H") == 0)
				sprintf(cmdBuf->optDef[optNo].fieldValue,"6");
			else
				return 1;
		
			//sprintf(cmdBuf->optDef[optNo].fieldValue,"%s",cmdBuf->optDef[optNo].optValue);
			break;
		case exM_imdmClass:
			if(strcasecmp(cmdBuf->optDef[optNo].optValue,"Ordinary") == 0)
                                sprintf(cmdBuf->optDef[optNo].fieldValue,"0");
                        else if(strcasecmp(cmdBuf->optDef[optNo].optValue,"Premium") == 0)
                                sprintf(cmdBuf->optDef[optNo].fieldValue,"1");
                        else if(strcasecmp(cmdBuf->optDef[optNo].optValue,"VIP") == 0)
                                sprintf(cmdBuf->optDef[optNo].fieldValue,"2");
                        else
                                return 1;
			break;
		case exM_imdmUserType:
			if(strcasecmp(cmdBuf->optDef[optNo].optValue,"OPPS") == 0)
                                sprintf(cmdBuf->optDef[optNo].fieldValue,"0");
                        else if(strcasecmp(cmdBuf->optDef[optNo].optValue,"Reserved") == 0)
                                sprintf(cmdBuf->optDef[optNo].fieldValue,"1");
                        else if(strcasecmp(cmdBuf->optDef[optNo].optValue,"iPALIM") == 0)
                                sprintf(cmdBuf->optDef[optNo].fieldValue,"2");
                        else
                                return 1;
                        break;
		//case exM_imdmType:
		//	sprintf(cmdBuf->optDef[optNo].fieldValue,"%s",cmdBuf->optDef[optNo].optValue);
		//	break;	
		//case exM_imdmStatus:
		//	sprintf(cmdBuf->optDef[optNo].fieldValue,"%s",cmdBuf->optDef[optNo].optValue);
		//	break;		
		}
	}

	//ipalim
	if(cmdBuf->sysTypeNo == 378) {
		switch(tmpExMode) {
		case exM_ipalimImsi:
			if(strlen(cmdBuf->optDef[optNo].optValue) < 15) 
				sprintf(cmdBuf->optDef[optNo].fieldValue, "0%s", cmdBuf->optDef[optNo].optValue);
			else
				sprintf(cmdBuf->optDef[optNo].fieldValue, "%s", cmdBuf->optDef[optNo].optValue);
			if(strlen(cmdBuf->optDef[optNo].optValue) == 0)
				sprintf(cmdBuf->optDef[optNo].fieldValue, "000000000000000");
			break;
		case exM_ipalimMsisdn:
			if(strcmp(cmdBuf->optDef[optNo].optValue, "") == 0) 
				memset(cmdBuf->optDef[optNo].fieldValue, 0, sizeof(cmdBuf->optDef[optNo].fieldValue));
			else
				sprintf(cmdBuf->optDef[optNo].fieldValue, "%s", cmdBuf->optDef[optNo].optValue);
			break;
		case exM_ipalimMsisdnExtern:
                        if(strcmp(cmdBuf->optDef[optNo].optValue, "") == 0)
                                memset(cmdBuf->optDef[optNo].fieldValue, 0, sizeof(cmdBuf->optDef[optNo].fieldValue));
                        else
                                sprintf(cmdBuf->optDef[optNo].fieldValue, "%s", cmdBuf->optDef[optNo].optValue);
                        break;
		case exM_ipalimTmsi:
                        if(strcmp(cmdBuf->optDef[optNo].optValue, "") == 0)
                                memset(cmdBuf->optDef[optNo].fieldValue, 0, sizeof(cmdBuf->optDef[optNo].fieldValue));
                        else
                                sprintf(cmdBuf->optDef[optNo].fieldValue, "%s", cmdBuf->optDef[optNo].optValue);
                        break;
		case exM_ipalimLai:
                        if(strcmp(cmdBuf->optDef[optNo].optValue, "") == 0)
                                memset(cmdBuf->optDef[optNo].fieldValue, 0, sizeof(cmdBuf->optDef[optNo].fieldValue));
                        else
                                sprintf(cmdBuf->optDef[optNo].fieldValue, "%s", cmdBuf->optDef[optNo].optValue);
                        break;
		case exM_ipalimType:
			if(strcasecmp(cmdBuf->optDef[optNo].optValue,"Private") == 0)
				sprintf(cmdBuf->optDef[optNo].fieldValue, "0");
			else if(strcasecmp(cmdBuf->optDef[optNo].optValue, "Public") == 0)
				sprintf(cmdBuf->optDef[optNo].fieldValue, "1");
			else if(strcasecmp(cmdBuf->optDef[optNo].optValue, "Hybrid") == 0)
				sprintf(cmdBuf->optDef[optNo].fieldValue, "2");
			else
				sprintf(cmdBuf->optDef[optNo].fieldValue, "0");
			break;
		}

	}	
	//auc
	if (cmdBuf->sysTypeNo == 340) {
		switch (tmpExMode) {
		case exM_aucImsi:
			//imsi
			if (strlen(cmdBuf->optDef[optNo].optValue) <= 15) {
				sprintf(cmdBuf->optDef[optNo].fieldValue, "0%s",
						cmdBuf->optDef[optNo].optValue);

			} else {
				sprintf(cmdBuf->optDef[optNo].fieldValue, "%s",
						cmdBuf->optDef[optNo].optValue);
			}
			if(strlen(cmdBuf->optDef[optNo].optValue) == 0)
				sprintf(cmdBuf->optDef[optNo].fieldValue,"000000000000000");
			break;
		}
	}
	

	fieldSync(optNo);
	return (0);
}

