DEFINITION NUMTAB_660004478 4
DEFINITION FAUX_660004478 0
DEFINITION VRAI_660004478 1
DEFINITION INCREMENT_660004478 1
DEFINITION CPT_660004478 1501
REGISTRE ENTIER TYPE_OC_660004478
REGISTRE ENTIER TYPE_TC_660004478
REGISTRE ENTIER TYPE_FCC_660004478
REGISTRE ENTIER TYPE_FCI_660004478
REGISTRE ENTIER TYPE_FC_660004478
REGISTRE ENTIER TYPE_IWC_660004478
REGISTRE ENTIER TYPE_RCF_660004478
REGISTRE ENTIER TYPE_VN_660004478
REGISTRE ENTIER inefficacite_660004478
REGISTRE ENTIER erreur_660004478
REGISTRE ENTIER calltype_660004478
REGISTRE ENTIER adrcallingnb_660004478
REGISTRE ENTIER adrcallednb_660004478
REGISTRE ENTIER netcause_660004478
REGISTRE ENTIER typrout_660004478
REGISTRE ENTIER adrorigcallednb_660004478
REGISTRE ENTIER pcinformation_660004478
REGISTRE ENTIER charactcall_660004478
REGISTRE ENTIER adrlocationnb_660004478
REGISTRE ENTIER locationind_660004478
REGISTRE ENTIER adrcmmuserident_660004478
REGISTRE ENTIER adraddcallingnb_660004478
REGISTRE ENTIER adrckcallint_660004478
REGISTRE ENTIER adrtrfnb_660004478
REGISTRE ENTIER adrtransnb_660004478
REGISTRE ENTIER adrvlrnb_660004478
REGISTRE ENTIER flag_idpart_660004478
REGISTRE ENTIER date_audit_660004478
REGISTRE ENTIER date_audit_gmt_660004478
REGISTRE ENTIER X_660004478
REGISTRE ENTIER Y_660004478
REGISTRE ENTIER Z_660004478
REGISTRE ENTIER date_660004478
REGISTRE ENTIER code_rejet_660004478
REGISTRE ENTIER longueur_660004478
REGISTRE ENTIER index_660004478
REGISTRE ENTIER ICAR_ABS_660004478
REGISTRE ENTIER VlrNb33_660004478
REGISTRE POINTEUR pt_chp_660004478
REGISTRE POINTEUR pt_1_660004478
REGISTRE POINTEUR pt_deb1_660004478
REGISTRE POINTEUR pt_deb2_660004478
REGISTRE POINTEUR pt_idemet_660004478
REGISTRE POINTEUR pt_CallingNb_660004478
############################################################################
# TRAITEMENT Tvpn40_trt.src
#   Article DC Tvpn40 en entree de Platine
#   Pcode de traitement
#   Creation le 24/11/2005
# Historique
# 24/01/06 JLG FO 43, 57, 48, 49
# 30/01/06 JLG evol spec SOF5 (inefficacite, TypeRout, GroupId, CalledGroupNb)
# 07/02/06 JLV FO 80
# 09/02/06 JLG FO 83
# 01/03/06 JLG correction de date=i_date_audit() par date_audit=i_date_audit()
# 07/03/06 JLG date audit en heure metro
# 23/03/06 JLG FO 136, 137
# 04/09/06 JLG FO 240 complements
# 11/05/07 PSA FO 494 : champ CalledNB et TransNB a retailler 
# 18/06/07 DRE FO 538 : mettre un F sur le 12 ieme digits : indispensable dans les cas de troncature a 11 de chaines de longueur = 12 digits
# 09/10/07 PSA G1R4 : TT35 : remplacement g_iartin par g_iartout
# 30/01/07 BEA G1R6
# 26/02/07 BEA G1R6 FO 650
# 03/03/08 BEA FO 656
# 13/03/08 BEA G1R6 VPN S7F4.doc
# 04/04/08 PSA G1R7 ajout controles sur AdrVlrNb et sur VlrNb
# 09/06/08 JLG G1R8 (MIPC) dm2 S1F8
# 21/11/08 JLG G2R1 lot1 QC223
# 14/09/10 JLG G3R1 lot4 item Differentiation idemet entre CB et CMM par la table VariableContexte
# 19/01/11 - BEA - G3R1 lot4 Verification/Correction des variables (constantes, entiers, pointeurs)
# 28/12/11 PKH G3R5 lot2 Nouvelles valeurs pour le champ NetCause
# 24/02/12 - QC999 extension de la qc998 sur pb troncature de champs tableau numerique
# 08/01/13 - QC1167 : alarme 1444 sur localNorm, SMSmsisdnNorm et SdmsisdnNorm
# 12/08/14 RHE G5R2 lot2 elimination des errones CMM
# 20/08/14 JLG G5R2 lot2 : Corrections suite  a VerifPcode (pointeurs et entiers)
# 23/10/14 RHE G5R2 lot2 QC1451 elimination des errones CMM ((V3T2 si tous les digits de callingNb a 0)
# 12/03/15 JLG G5R4C1 QC1287 ajout dans test croise de TYPE_VN, le champ OrigCalledNb devient obligatoire
############################################################################








inefficacite_660004478 = VRAI_660004478
adrckcallint_660004478 = 0
adrtrfnb_660004478 = 0


# ALLOCATION DES POINTEURS
pt_chp_660004478		= "11111111111111111111111111111111111111111134567"
pt_1_660004478		= "2222222222222222222222222222222222222222222222222222222222222222222222222"
pt_deb1_660004478		= "5555555"
i_strcpy(pt_deb1_660004478,"")
pt_deb2_660004478		= "6666666"
i_strcpy(pt_deb2_660004478,"")
pt_idemet_660004478	= "7777777777777777777777"
pt_CallingNb_660004478 = "pt_CallingNb9999999999999999999999999999"
i_strcpy(pt_CallingNb_660004478,"")
trace("[Tvpn40_trt] =========== debut Pcode TRAITEMENT  =============")

#erreur = i_fdump_art(g_iartout)

# Duplication article entree
erreur_660004478 = i_dup_art_id(g_iartin, g_iartout)

################################################################
#   Test syntaxique
################################################################
# neant


################################################################
#   Tests semantiques
################################################################
calltype_660004478 = 0
calltype_660004478 = i_get_art_field(g_iartout, $Tvpn40::CallType)
trace1("[Tvpn40_tr] calltype = 0x%x",calltype_660004478)
SI calltype_660004478 == 0xCB
ALORS
	inefficacite_660004478 = VRAI_660004478
	SAUT STOCKE_ELM
SINON
	inefficacite_660004478 = FAUX_660004478
FINSI

# pour VPN_40
#G1R6 lot 2: 3B, 3C, 3E, 3F
#G1R8 lot 2 : 37, 3D
SI calltype_660004478 != 0x01 && calltype_660004478 != 0x06 && calltype_660004478 != 0x07 && calltype_660004478 != 0x0A && calltype_660004478 != 0x0F && calltype_660004478 != 0x10 && calltype_660004478 != 0x14 && calltype_660004478 != 0x19 && calltype_660004478 != 0x1A && calltype_660004478 != 0x3B && calltype_660004478 != 0x3C && calltype_660004478 != 0x3E && calltype_660004478 != 0x3F && calltype_660004478 != 0x37 && calltype_660004478 != 0x3D
# pour VPN_32
#SI calltype != 0x01 && calltype != 0x0F && calltype != 0x10 && calltype != 0x14
ALORS
	trace1("[Tvpn40_tr] NOK calltype = 0x%x",calltype_660004478)
	code_rejet_660004478 = 0x5041
	i_strcpy(pt_chp_660004478,"CallType")
	erreur_660004478 = i_PlvMessEmettre(6100,2,g_iartin,"",2,code_rejet_660004478,pt_chp_660004478, 0)
	SAUT STOCKE_ERRONE
FINSI
 trace1("[Tvpn40_tr] OK calltype = 0x%x",calltype_660004478)

adrcallingnb_660004478 = i_get_art_field(g_iartout, $Tvpn40::AdrCallingNb)

SI adrcallingnb_660004478 != 0x01 && adrcallingnb_660004478 != 0x02 && adrcallingnb_660004478 != 0x03 && adrcallingnb_660004478 != 0x04
ALORS
	trace1("[Tvpn40_tr] NOK adrcallingnb = 0x%x",adrcallingnb_660004478)
	code_rejet_660004478 = 0x5041
	i_strcpy(pt_chp_660004478,"AdrCallingNb")
	erreur_660004478 = i_PlvMessEmettre(6100,2,g_iartin,"",2,code_rejet_660004478,pt_chp_660004478, 0)
	SAUT STOCKE_ERRONE
FINSI
trace1("[Tvpn40_tr] OK adrcallingnb = 0x%x",adrcallingnb_660004478)

adrcallednb_660004478 = i_get_art_field(g_iartout, $Tvpn40::AdrCalledNb)

SI adrcallednb_660004478 < 0x01 || adrcallednb_660004478 > 0x04
ALORS
	trace1("[Tvpn40_tr] NOK adrcallednb = 0x%x",adrcallednb_660004478)
	code_rejet_660004478 = 0x5041
	i_strcpy(pt_chp_660004478,"AdrCalledNb")
	erreur_660004478 = i_PlvMessEmettre(6100,2,g_iartin,"",2,code_rejet_660004478,pt_chp_660004478, 0)
	SAUT STOCKE_ERRONE
FINSI
trace1("[Tvpn40_tr] OK adrcallednb = 0x%x",adrcallednb_660004478)

SI (i_valid_field_n(g_iartout, $Tvpn40::AdrOrigCalledNb))
ALORS
	adrorigcallednb_660004478 = i_get_art_field(g_iartout, $Tvpn40::AdrOrigCalledNb)
	#SI adrorigcallednb != 0x03 && adrorigcallednb != 0x04
	SI adrorigcallednb_660004478 != 0x02 && adrorigcallednb_660004478 != 0x03 && adrorigcallednb_660004478 != 0x04
	ALORS
		code_rejet_660004478 = 0x5041
		i_strcpy(pt_chp_660004478,"AdrOrigCalledNb")
		erreur_660004478 = i_PlvMessEmettre(6100,2,g_iartin,"",2,code_rejet_660004478,pt_chp_660004478, 0)
		SAUT STOCKE_ERRONE
	FINSI
FINSI

pcinformation_660004478 = i_get_art_field(g_iartout, $Tvpn40::PCinformation)

SI pcinformation_660004478 > 0x02
ALORS
	code_rejet_660004478 = 0x5041
	i_strcpy(pt_chp_660004478,"PCinformation")
	erreur_660004478 = i_PlvMessEmettre(6100,2,g_iartin,"",2,code_rejet_660004478,pt_chp_660004478, 0)
	SAUT STOCKE_ERRONE
FINSI


typrout_660004478 = i_get_art_field(g_iartout, $Tvpn40::TypeRout)
# evol spec S0F5
#SI typrout != 0x02 && typrout != 0x07 && typrout != 0x08
#ALORS
#	code_rejet = 0x5041
#	i_strcpy(pt_chp,"TypeRout")
#	erreur = i_PlvMessEmettre(6100,2,g_iartout,"",2,code_rejet,pt_chp, 0)
#	SAUT STOCKE_ERRONE
#FINSI


charactcall_660004478 = i_get_art_field(g_iartout, $Tvpn40::CharactCall)

SI charactcall_660004478 != 0x00 && charactcall_660004478 != 0x01 && charactcall_660004478 != 0x02 && charactcall_660004478 != 0x10 && charactcall_660004478 != 0x20 && charactcall_660004478 != 0x11 && charactcall_660004478 != 0x21 && charactcall_660004478 != 0x12 && charactcall_660004478 != 0x30 && charactcall_660004478 != 0x40
ALORS
	code_rejet_660004478 = 0x5041
	i_strcpy(pt_chp_660004478,"CharactCall")
	erreur_660004478 = i_PlvMessEmettre(6100,2,g_iartin,"",2,code_rejet_660004478,pt_chp_660004478, 0)
	SAUT STOCKE_ERRONE
FINSI

SI (i_valid_field_n(g_iartout, $Tvpn40::AdrLocationNb))
ALORS
	adrlocationnb_660004478 = i_get_art_field(g_iartout, $Tvpn40::AdrLocationNb)
	SI adrlocationnb_660004478 != 0x03 && adrlocationnb_660004478 != 0x04
	ALORS
		trace1("Alarme 6100_9 [Tvpn40_tr] NOK LocationInd = 0x%x",adrlocationnb_660004478)
		code_rejet_660004478 = 0x5041
		i_strcpy(pt_chp_660004478,"AdrLocationNb")
		erreur_660004478 = i_PlvMessEmettre(6100,2,g_iartin,"",2,code_rejet_660004478,pt_chp_660004478, 0)
		SAUT STOCKE_ERRONE
	FINSI
FINSI

SI (i_valid_field_n(g_iartout, $Tvpn40::LocationInd))
ALORS
	
	locationind_660004478 = i_get_art_field(g_iartout, $Tvpn40::LocationInd)
	SI locationind_660004478 != 0x00 && locationind_660004478 != 0x02
	ALORS
		trace1("Alarme 6100_9 [Tvpn40_tr] NOK LocationInd = 0x%x",locationind_660004478)
		code_rejet_660004478 = 0x5041
		i_strcpy(pt_chp_660004478,"LocationInd")
		erreur_660004478 = i_PlvMessEmettre(6100,2,g_iartin,"",2,code_rejet_660004478,pt_chp_660004478, 0)
		SAUT STOCKE_ERRONE
	FINSI
FINSI

#pour VPN40 uniquement
SI (i_valid_field_n(g_iartout, $Tvpn40::AdrCMMuserIdent))
ALORS
	
	adrcmmuserident_660004478 = i_get_art_field(g_iartout, $Tvpn40::AdrCMMuserIdent)
	SI adrcmmuserident_660004478 != 0x03 && adrcmmuserident_660004478 != 0x04
	ALORS
		trace1("Alarme 6100_9 [Tvpn40_tr] NOK adrcmmuserident = 0x%x",adrcmmuserident_660004478)
		code_rejet_660004478 = 0x5041
		i_strcpy(pt_chp_660004478,"adrcmmuserident")
		erreur_660004478 = i_PlvMessEmettre(6100,2,g_iartin,"",2,code_rejet_660004478,pt_chp_660004478, 0)
		SAUT STOCKE_ERRONE
	FINSI
FINSI


SI (i_valid_field_n(g_iartout, $Tvpn40::AdrTransNb))
ALORS
	adrtransnb_660004478 = i_get_art_field(g_iartout, $Tvpn40::AdrTransNb)
	SI adrtransnb_660004478 != 0x02 && adrtransnb_660004478 != 0x03 && adrtransnb_660004478 != 0x04
	ALORS
		code_rejet_660004478 = 0x5041
		i_strcpy(pt_chp_660004478,"AdrTransNb")
		erreur_660004478 = i_PlvMessEmettre(6100,2,g_iartin,"",2,code_rejet_660004478,pt_chp_660004478, 0)
		SAUT STOCKE_ERRONE
	FINSI
FINSI

SI (i_valid_field_n(g_iartout, $Tvpn40::AdrAddCallingNb))
ALORS
	adraddcallingnb_660004478 = i_get_art_field(g_iartout, $Tvpn40::AdrAddCallingNb)
#pour VPN32
#	SI adraddcallingnb != 0x01 && adraddcallingnb != 0x02 && adraddcallingnb != 0x03 && adraddcallingnb != 0x04
#pour vpn40
	SI adraddcallingnb_660004478 != 0x03 && adraddcallingnb_660004478 != 0x04
	ALORS
		trace1("Alarme 6100_11 [Tvpn40_tr] NOK AdrAddCallingNb = 0x%x",adraddcallingnb_660004478)
		code_rejet_660004478 = 0x5041
		i_strcpy(pt_chp_660004478,"AdrAddCallingNb")
		erreur_660004478 = i_PlvMessEmettre(6100,2,g_iartin,"",2,code_rejet_660004478,pt_chp_660004478, 0)
		SAUT STOCKE_ERRONE
	FINSI
FINSI

#G1R6
SI (i_valid_field_n(g_iartout, $Tvpn40::AdrCkCallInt))
ALORS
	adrckcallint_660004478 = i_get_art_field(g_iartout, $Tvpn40::AdrCkCallInt)
	SI adrckcallint_660004478 != 0x03 && adrckcallint_660004478 != 0x04
	ALORS
		code_rejet_660004478 = 0x5041
		i_strcpy(pt_chp_660004478,"AdrCkCallInt ni 03 ni 04")
		erreur_660004478 = i_PlvMessEmettre(6100,2,g_iartin,"",2,code_rejet_660004478,pt_chp_660004478, 0)
		SAUT STOCKE_ERRONE
	FINSI
FINSI
SI (i_valid_field_n(g_iartout, $Tvpn40::AdrTrfNb))
ALORS
	adrtrfnb_660004478 = i_get_art_field(g_iartout, $Tvpn40::AdrTrfNb)
	SI adrtrfnb_660004478 != 0x01 && adrtrfnb_660004478 != 0x02 && adrtrfnb_660004478 != 0x03 && adrtrfnb_660004478 != 0x04
	ALORS
		code_rejet_660004478 = 0x5041
		i_strcpy(pt_chp_660004478,"AdrTrfNb")
		erreur_660004478 = i_PlvMessEmettre(6100,2,g_iartin,"",2,code_rejet_660004478,pt_chp_660004478, 0)
		SAUT STOCKE_ERRONE
	FINSI
FINSI

#G3R5 lot2 NetCause
netcause_660004478 = i_get_art_field(g_iartout, $Tvpn40::NetCause)
#SI netcause != 0x1F
SI netcause_660004478 != 0x1F && netcause_660004478 != 0x01 && netcause_660004478 != 0x10 && netcause_660004478 != 0x11 && netcause_660004478 != 0x13 && netcause_660004478 != 0x14 && netcause_660004478 != 0xFF
ALORS
	code_rejet_660004478 = 0x5041
	i_strcpy(pt_chp_660004478,"NetCause")
	erreur_660004478 = i_PlvMessEmettre(6100,2,g_iartin,"",2,code_rejet_660004478,pt_chp_660004478, 0)
	SAUT STOCKE_ERRONE
FINSI
#\G3R5 lot2

SI (i_valid_field_n(g_iartout, $Tvpn40::AdrVlrNb))
ALORS
	adrvlrnb_660004478 = i_get_art_field(g_iartout, $Tvpn40::AdrVlrNb)
	SI (adrvlrnb_660004478 != 0x03) && (adrvlrnb_660004478 != 0x04)
	ALORS
		code_rejet_660004478 = 0x5041
		i_strcpy(pt_chp_660004478,"AdrVlrNb")
		erreur_660004478 = i_PlvMessEmettre(6100,2,g_iartin,"",2,code_rejet_660004478,pt_chp_660004478, 0)
		SAUT STOCKE_ERRONE
	FINSI
FINSI

###############################################################################
# Retaillage eventuel des champs CalledNb et TransNb
# Pour le moment, le test sur champ de plus de 20 caract?res est inutile (champ d entree a 20 maxi)
# On le laisse quand meme pour etre homogene avec Tvpn32
###############################################################################
# DEBUT FO 494
erreur_660004478 = i_get_art_str(g_iartout, $Tvpn40::CalledNb, pt_1_660004478)
longueur_660004478=i_strlen(pt_1_660004478)
i_get_sub_str(pt_1_660004478, 0, 1, pt_deb1_660004478)
SI ( i_strcmp("33", pt_deb1_660004478) == 0 ) && ( longueur_660004478 > 11 )
ALORS
	erreur_660004478 = i_resize_tlv(g_iartout, "T3_CalledNb", "CalledNb", 11*4)

	# DEBUT FO 538
	g_iartout.CalledNb[11] = 0xF
	# FIN FO 538

	SAUT RETAILLAGE_TransNb
FINSI

SI longueur_660004478 > 20
ALORS
	erreur_660004478 = i_resize_tlv(g_iartout, "T3_CalledNb", "CalledNb", 20*4)
FINSI

POINT RETAILLAGE_TransNb

SI (i_valid_field_n(g_iartout, $Tvpn40::TransNb))
ALORS
	erreur_660004478 = i_get_art_str(g_iartout, $Tvpn40::TransNb, pt_1_660004478)
	longueur_660004478=i_strlen(pt_1_660004478)
	i_get_sub_str(pt_1_660004478, 0, 1, pt_deb1_660004478)
	SI ( i_strcmp("33", pt_deb1_660004478) == 0 ) && ( longueur_660004478 > 11 )
	ALORS
		erreur_660004478 = i_resize_tlv(g_iartout, "T3_TransNb", "TransNb", 11*4)
		# DEBUT FO 538
		g_iartout.TransNb[11] = 0xF
		# FIN FO 538
		SAUT FIN_RETAILLAGE_TransNb
	FINSI
	
	SI longueur_660004478 > 20
	ALORS
		erreur_660004478 = i_resize_tlv(g_iartout, "T3_TransNb", "TransNb", 20*4)
	FINSI
FINSI

POINT FIN_RETAILLAGE_TransNb
# FIN FO 494


#=============================================================================
# Variables fonctionnelles
#=============================================================================

########### ICAR_ABS
date_660004478 =i_get_art_field(g_iartout,$Tvpn40::DATE)
ICAR_ABS_660004478 =i_date_platine(g_ieec,g_iartout,date_660004478)


########### TYPE_OC TYPE_TC TYPE_FCC TYPE_FCI TYPE_FC TYPE_IWC TYPE_RCF TYPE_VN
TYPE_OC_660004478 = 0
TYPE_TC_660004478 = 0
TYPE_FCC_660004478 = 0
TYPE_FCI_660004478 = 0
TYPE_FC_660004478 = 0
TYPE_IWC_660004478 = 0
TYPE_RCF_660004478 = 0
TYPE_VN_660004478 = 0


#G1R6
#GIR6 lot 3 VPN S7F3.doc retrait de (calltype == 0x3F)
#G1R8 lot 2 ajout 37 et 3D
# TYPE_OC, TYPE_TC : modifs a faire aussi en pcode de distribution
SI calltype_660004478 == 0x01 || calltype_660004478 == 0x06 || calltype_660004478 == 0x07 || calltype_660004478 == 0x0A || calltype_660004478 == 0x19 || calltype_660004478 == 0x3B || calltype_660004478 == 0x3C || calltype_660004478 == 0x3E || calltype_660004478 == 0x37 || calltype_660004478 == 0x3D
ALORS
	TYPE_OC_660004478 = 1
FINSI

SI calltype_660004478 == 0x10
ALORS
	TYPE_TC_660004478 = 1
FINSI

SI calltype_660004478 == 0x14
ALORS
	SI typrout_660004478 == 0x08 || typrout_660004478 == 0x02
	ALORS
		TYPE_FCC_660004478 = 1
	SINON
		SI typrout_660004478 == 0x07
		ALORS
			TYPE_FCI_660004478 = 1
		SINON
			code_rejet_660004478 = 0x5041
			i_strcpy(pt_chp_660004478,"TypeRout")
			erreur_660004478 = i_PlvMessEmettre(6100,2,g_iartin,"",2,code_rejet_660004478,pt_chp_660004478, 0)
			SAUT STOCKE_ERRONE
		FINSI
	FINSI
FINSI

SI TYPE_FCI_660004478 || TYPE_FCC_660004478
ALORS
	TYPE_FC_660004478 = 1
FINSI

SI calltype_660004478 == 0x0F
ALORS
	TYPE_IWC_660004478 = 1
FINSI

SI calltype_660004478 == 0x1A
ALORS
	TYPE_RCF_660004478 = 1
FINSI
#G1R6 lot 3 VPN S7F3.doc
SI calltype_660004478 == 0x3F
ALORS
	TYPE_VN_660004478 = 1
FINSI

########### VlrNb33
# La variable VlrNb33 peut prendre 3 valeurs
# -1 : VlrNb absent
# 0  : VlrNb present et ne commence pas par 33
# 1  : VlrNb present et commence par 33 
SI i_valid_field_n(g_iartin,$Tvpn40::VlrNb)
ALORS
	SI (g_iartin.VlrNb[0] == 3) && (g_iartin.VlrNb[1] == 3)
	ALORS
		VlrNb33_660004478 = 1
	SINON
		VlrNb33_660004478 = 0
	FINSI
SINON
	VlrNb33_660004478 = -1
FINSI


################################################################
#   Tests croises
################################################################

# QC1287
SI  TYPE_FC_660004478 || TYPE_RCF_660004478 || TYPE_VN_660004478
# pour VPN_32
#SI  TYPE_FC
ALORS
	SI (! i_valid_field_n(g_iartout, $Tvpn40::OrigCalledNb))
# pour VPN_32
#	   && (! i_valid_field_n(g_iartout, $Tvpn40::AdrOrigCalledNb))
	ALORS
		code_rejet_660004478 = 0x5041
		i_strcpy(pt_chp_660004478,"TYPE_FC vrai et OrigCalledNb invalide")
		erreur_660004478 = i_PlvMessEmettre(6101,2,g_iartin,"",2,code_rejet_660004478,pt_chp_660004478, 0)
		SAUT STOCKE_ERRONE
	FINSI
FINSI

# pour VPN_40
SI (i_valid_field_n(g_iartout, $Tvpn40::OrigCalledNb)) && (! i_valid_field_n(g_iartout, $Tvpn40::AdrOrigCalledNb))
ALORS
		code_rejet_660004478 = 0x5041
		i_strcpy(pt_chp_660004478,"TYPE_FC vrai et AdrOrigCalledNb invalide")
		erreur_660004478 = i_PlvMessEmettre(6101,2,g_iartin,"",2,code_rejet_660004478,pt_chp_660004478, 0)
		SAUT STOCKE_ERRONE
FINSI

# pour VPN_40
SI (i_valid_field_n(g_iartout, $Tvpn40::CMMuserIdent)) && (! i_valid_field_n(g_iartout, $Tvpn40::AdrCMMuserIdent))
ALORS
		code_rejet_660004478 = 0x5041
		i_strcpy(pt_chp_660004478,"TYPE_FC vrai et AdrCMMuserIdent invalide")
		erreur_660004478 = i_PlvMessEmettre(6101,2,g_iartin,"",2,code_rejet_660004478,pt_chp_660004478, 0)
		SAUT STOCKE_ERRONE
FINSI


SI TYPE_IWC_660004478
ALORS
	SI (! i_valid_field_n(g_iartout, $Tvpn40::LocationNb))
# pour VPN_32
#	   && (! i_valid_field_n(g_iartout, $Tvpn40::AdrLocationNb))
	ALORS
		code_rejet_660004478 = 0x5041
		i_strcpy(pt_chp_660004478,"TYPE_IWC vrai et LocationNb invalide")
		erreur_660004478 = i_PlvMessEmettre(6101,2,g_iartin,"",2,code_rejet_660004478,pt_chp_660004478, 0)
		SAUT STOCKE_ERRONE
	FINSI
FINSI

# pour VPN_40
SI (i_valid_field_n(g_iartout, $Tvpn40::LocationNb)) && (! i_valid_field_n(g_iartout, $Tvpn40::AdrLocationNb))
ALORS
	code_rejet_660004478 = 0x5041
	i_strcpy(pt_chp_660004478,"LocationNb valide et AdrLocationNb invalide")
	erreur_660004478 = i_PlvMessEmettre(6101,2,g_iartin,"",2,code_rejet_660004478,pt_chp_660004478, 0)
	SAUT STOCKE_ERRONE
FINSI


SI  (i_valid_field_n(g_iartout, $Tvpn40::AddCallingNb)) && (! i_valid_field_n(g_iartout, $Tvpn40::AdrAddCallingNb))
ALORS
	code_rejet_660004478 = 0x5041
	i_strcpy(pt_chp_660004478,"AddCallingNb valide et AdrAddCallingNb invalide")
	erreur_660004478 = i_PlvMessEmettre(6101,2,g_iartin,"",2,code_rejet_660004478,pt_chp_660004478, 0)
	SAUT STOCKE_ERRONE
FINSI

SI  (i_valid_field_n(g_iartout, $Tvpn40::T3_TransNb))
ALORS
	SI  (! i_valid_field_n(g_iartout, $Tvpn40::TransNb)) && (! i_valid_field_n(g_iartout, $Tvpn40::AdrTransNb))
	ALORS
		code_rejet_660004478 = 0x5041
		i_strcpy(pt_chp_660004478,"TransNb valide et AdrTransNb invalide")
		erreur_660004478 = i_PlvMessEmettre(6101,2,g_iartin,"",2,code_rejet_660004478,pt_chp_660004478, 0)
		SAUT STOCKE_ERRONE
	FINSI
FINSI

#SI (adrcallednb == 0x01)
#ALORS
#	SI (! i_valid_field_n(g_iartout, $Tvpn40::TransNb))
#	ALORS
#		code_rejet = 0x5041
#		i_strcpy(pt_chp,"adrcallednb=1 et TransNb invalide")
#		erreur = i_PlvMessEmettre(6101,2,g_iartout,"",2,code_rejet,pt_chp, 0)
#		SAUT STOCKE_ERRONE
#	FINSI
#FINSI

SI (i_valid_field_n(g_iartout, $Tvpn40::VlrNb)) && (! i_valid_field_n(g_iartout, $Tvpn40::AdrVlrNb))
ALORS
		code_rejet_660004478 = 0x5041
		i_strcpy(pt_chp_660004478,"VlrNb present et AdrVlrNb absent")
		erreur_660004478 = i_PlvMessEmettre(6101,2,g_iartin,"",2,code_rejet_660004478,pt_chp_660004478, 0)
		SAUT STOCKE_ERRONE
FINSI


#############################################
# Creation article Conv_URS (g_iartout9)
# Sera utile pour VPN
#############################################
erreur_660004478 = i_cree_art("Conv_URS",g_iartout9)


########################################################
# Mise a jour du T3ace, les T4 pour normalisation
#
########################################################
# erreur = i_fdump_art(g_iartout)


# Creation des champs ajout T3ace
erreur_660004478 = i_ajoutChampNum(g_iartout, $Tvpn40::T4msisdnNorm,$Tvpn40::ax_idemet,6)


#QC999
############ T4msisdn avec NOS1 (lg=200 bits)

# pour VPN40
SI calltype_660004478 == 0x06 || calltype_660004478 == 0x07 || calltype_660004478 == 0x0A
ALORS
	erreur_660004478 = i_dup_chp_1val(g_iartout, g_iartout9, $Tvpn40::CMMuserIdent, $Conv_URS::NOS1_NUM)
	erreur_660004478 = i_set_art_field(g_iartout9, $Conv_URS::NOS1_INF, adrcmmuserident_660004478)
	trace("[Tvpn40_tr] ***** msisdn 0 = CMMuserIdent normalise")
	erreur_660004478 = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS1,$Tvpn40::msisdnNorm,-$NORM:CMM_USER,0)
SINON
SI TYPE_OC_660004478
ALORS
	SI (i_valid_field_n(g_iartout, $Tvpn40::AddCallingNb))
	ALORS
		erreur_660004478 = i_dup_chp_1val(g_iartout, g_iartout9, $Tvpn40::AddCallingNb, $Conv_URS::NOS1_NUM)
		erreur_660004478 = i_set_art_field(g_iartout9, $Conv_URS::NOS1_INF, adraddcallingnb_660004478)
		trace("[Tvpn40_tr] ***** msisdn 1 = AddCallingNb normalise")
		#G5R2 lot2 automate specifique pour Additional Calling Party Number
		#erreur = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS1,$Tvpn40::msisdnNorm,-$NORM:CMM_NDE,0)
		erreur_660004478 = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS1,$Tvpn40::msisdnNorm,-$NORM:CMM_ADD,0)
	SINON
		erreur_660004478 = i_dup_chp_1val(g_iartout, g_iartout9, $Tvpn40::CallingNb, $Conv_URS::NOS1_NUM)
		erreur_660004478 = i_set_art_field(g_iartout9, $Conv_URS::NOS1_INF, adrcallingnb_660004478)
		trace("[Tvpn40_tr] ***** msisdn 2 = CallingNb normalise")
		erreur_660004478 = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS1,$Tvpn40::msisdnNorm,-$NORM:CMM,0)
	FINSI
FINSI

SI TYPE_TC_660004478 || TYPE_IWC_660004478
ALORS
	SI (i_valid_field_n(g_iartout, $Tvpn40::TransNb))
	ALORS
		erreur_660004478 = i_dup_chp_1val(g_iartout, g_iartout9, $Tvpn40::TransNb, $Conv_URS::NOS1_NUM)
		erreur_660004478 = i_set_art_field(g_iartout9, $Conv_URS::NOS1_INF, adrtransnb_660004478)
		trace("[Tvpn40_tr] ***** msisdn 3 = TransNb normalise")
		erreur_660004478 = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS1,$Tvpn40::msisdnNorm,-$NORM:CMM_TRANS,0)
	SINON
		erreur_660004478 = i_dup_chp_1val(g_iartout, g_iartout9, $Tvpn40::CalledNb, $Conv_URS::NOS1_NUM)
		erreur_660004478 = i_set_art_field(g_iartout9, $Conv_URS::NOS1_INF, adrcallednb_660004478)
		trace("[Tvpn40_tr] ***** msisdn 4 = CalledNb normalise")
		erreur_660004478 = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS1,$Tvpn40::msisdnNorm,-$NORM:CMM_NDE,0)
	FINSI
FINSI

#pour vpn_32
#SI TYPE_FC
#pour vpn_40
# SI TYPE_FC || TYPE_RCF -> FO 656
SI TYPE_FC_660004478 || TYPE_RCF_660004478 || TYPE_VN_660004478
ALORS
	erreur_660004478 = i_dup_chp_1val(g_iartout, g_iartout9, $Tvpn40::OrigCalledNb, $Conv_URS::NOS1_NUM)
	erreur_660004478 = i_set_art_field(g_iartout9, $Conv_URS::NOS1_INF, adrorigcallednb_660004478)
	trace("[Tvpn40_tr] ***** msisdn 5 = OrigCalledNb normalise")
	#G5R2 lot2 automate specifique pour Original called number
	#erreur = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS1,$Tvpn40::msisdnNorm,-$NORM:CMM,0)
	erreur_660004478 = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS1,$Tvpn40::msisdnNorm,-$NORM:CMM_NDE_ORI,0)
FINSI
#pour vpn_40
FINSI

SI ( erreur_660004478 != 0)
ALORS
	code_rejet_660004478 = 0x5011
	i_strcpy(pt_chp_660004478," champ pour msisdn ")
	erreur_660004478 = i_PlvMessEmettre(6104,2,g_iartin,"",2,code_rejet_660004478,pt_chp_660004478, 0)
	trace("[Tvpn40_tr] :Erreur Normalisation champ pour msisdn")
	SAUT STOCKE_ERRONE
FINSI


############  Sdmsisdn secondaryMSISDN  avec NOS2 (lg=200 bits)
#G1R6 lot 3 VPN S7F3.doc
SI TYPE_VN_660004478
ALORS
	erreur_660004478 = i_dup_chp_1val(g_iartout, g_iartout9, $Tvpn40::CallingNb, $Conv_URS::NOS2_NUM)
	erreur_660004478 = i_set_art_field(g_iartout9, $Conv_URS::NOS2_INF, adrcallingnb_660004478)
#	trace("[Tvpn40_tr] ***** SdmsisdnNorm 1 = CallingNb normalise")
	#G5R2 lot2 utilisation de l'automate Calling Number
	#erreur = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS2,$Tvpn40::SdmsisdnNorm,-$NORM:CMM_NDE,0)
	erreur_660004478 = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS2,$Tvpn40::SdmsisdnNorm,-$NORM:CMM,0)
	SI ( erreur_660004478 != 0)
	ALORS
		code_rejet_660004478 = 0x5011
		i_strcpy(pt_chp_660004478," champ CallingNb pour secondaryMSISDN ")
		erreur_660004478 = i_PlvMessEmettre(6104,2,g_iartin,"",2,code_rejet_660004478,pt_chp_660004478, 0)
		trace("[Tvpn40_tr] :Erreur Normalisation champ CallingNb pour secondaryMSISDN")
#		erreur = i_supprChamp(g_iartout, "T4SdmsisdnNorm")
		SAUT STOCKE_ERRONE
	FINSI
# QC1167, alarme 1444 : entree lg(SdmsisdnNorm)=152 bits, dpvgsm T3t36 lg(secondaryMSISDN)=72bits
	longueur_660004478 = i_get_art_field(g_iartout, $Tvpn40::SdmsisdnNorm -1)
	SI (longueur_660004478 > 9)
	ALORS
		longueur_660004478 = 9
		erreur_660004478 = i_resize_tlv(g_iartout, "T4SdmsisdnNorm", "SdmsisdnNorm", longueur_660004478 * 8)
	FINSI
SINON
	SI (i_valid_field_n(g_iartout, $Tvpn40::AddCallingNb))
	ALORS
		erreur_660004478 = i_dup_chp_1val(g_iartout, g_iartout9, $Tvpn40::AddCallingNb, $Conv_URS::NOS2_NUM)
		erreur_660004478 = i_set_art_field(g_iartout9, $Conv_URS::NOS2_INF, adraddcallingnb_660004478)
		trace("[Tvpn40_tr] ***** SdmsisdnNorm 1 = AddCallingNb normalise")
		#G5R2 lot2 automate specifique pour Additional Calling Party Number
		#erreur = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS2,$Tvpn40::SdmsisdnNorm,-$NORM:CMM_NDE,0)
		erreur_660004478 = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS2,$Tvpn40::SdmsisdnNorm,-$NORM:CMM_ADD,0)
		SI ( erreur_660004478 != 0)
		ALORS
			code_rejet_660004478 = 0x5011
			i_strcpy(pt_chp_660004478," champ AddCallingNb pour secondaryMSISDN ")
			erreur_660004478 = i_PlvMessEmettre(6104,2,g_iartin,"",2,code_rejet_660004478,pt_chp_660004478, 0)
			trace("[Tvpn40_tr] :Erreur Normalisation champ AddCallingNb pour secondaryMSISDN")
	#		erreur = i_supprChamp(g_iartout, "T4SdmsisdnNorm")
			SAUT STOCKE_ERRONE
		FINSI
# QC1167, alarme 1444 : entree lg(SdmsisdnNorm)=152 bits, dpvgsm T3t36 lg(secondaryMSISDN)=72bits
	  longueur_660004478 = i_get_art_field(g_iartout, $Tvpn40::SdmsisdnNorm -1)
	  SI (longueur_660004478 > 9)
	  ALORS
	  	longueur_660004478 = 9
	  	erreur_660004478 = i_resize_tlv(g_iartout, "T4SdmsisdnNorm", "SdmsisdnNorm", longueur_660004478 * 8)
	  FINSI
	SINON
		#G1R6
		SI (i_valid_field_n(g_iartout, $Tvpn40::TrfNb))
		ALORS
			erreur_660004478 = i_dup_chp_1val(g_iartout, g_iartout9, $Tvpn40::TrfNb, $Conv_URS::NOS2_NUM)
			adrtrfnb_660004478 = i_get_art_field(g_iartout, $Tvpn40::AdrTrfNb)
			erreur_660004478 = i_set_art_field(g_iartout9, $Conv_URS::NOS2_INF, adrtrfnb_660004478)
			trace("[Tvpn40_tr] ***** SdmsisdnNorm 1 = TrfNb normalise")
			#G5R2 lot2 automate specifique pour TrfNb
			#erreur = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS2,$Tvpn40::SdmsisdnNorm,-$NORM:CMM_NDE,0)
			erreur_660004478 = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS2,$Tvpn40::SdmsisdnNorm,-$NORM:CMM_TRF,0)
			SI ( erreur_660004478 != 0)
			ALORS
				code_rejet_660004478 = 0x5011
				i_strcpy(pt_chp_660004478," champ TrfNb pour secondaryMSISDN ")
				erreur_660004478 = i_PlvMessEmettre(6104,2,g_iartin,"",2,code_rejet_660004478,pt_chp_660004478, 0)
				trace("[Tvpn40_tr] :Erreur Normalisation champ TrfNb pour secondaryMSISDN")
		#		erreur = i_supprChamp(g_iartout, "T4SdmsisdnNorm")
				SAUT STOCKE_ERRONE
			FINSI
# QC1167, alarme 1444 : entree lg(SdmsisdnNorm)=152 bits, dpvgsm T3t36 lg(secondaryMSISDN)=72bits
	    longueur_660004478 = i_get_art_field(g_iartout, $Tvpn40::SdmsisdnNorm -1)
	    SI (longueur_660004478 > 9)
	    ALORS
	    	longueur_660004478 = 9
	    	erreur_660004478 = i_resize_tlv(g_iartout, "T4SdmsisdnNorm", "SdmsisdnNorm", longueur_660004478 * 8)
	    FINSI
		SINON
			erreur_660004478 = i_supprChamp(g_iartout, "T4SdmsisdnNorm")
		FINSI
	FINSI
FINSI
#G1R6 
############  SMSmsisdn SMSrecepMSISDN  avec NOS5 (lg=200 bits)
SI (i_valid_field_n(g_iartout, $Tvpn40::Clck2CallInt))
ALORS
# BEA 28/02/08 NOS2 -> NOS3 pour longueur Clck2CallInt
	erreur_660004478 = i_dup_chp_1val(g_iartout, g_iartout9, $Tvpn40::Clck2CallInt, $Conv_URS::NOS5_NUM)
	adrckcallint_660004478 = i_get_art_field(g_iartout, $Tvpn40::AdrCkCallInt)
	erreur_660004478 = i_set_art_field(g_iartout9, $Conv_URS::NOS5_INF, adrckcallint_660004478)
	#trace("[Tvpn40_tr] ***** SMSmsisdnNorm 1 = Clck2CallInt normalise")
	#G5R2 lot2 automate specifique pour Clck2CallInt
	#erreur = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS5,$Tvpn40::SMSmsisdnNorm,-$NORM:CMM,0)
	erreur_660004478 = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS5,$Tvpn40::SMSmsisdnNorm,-$NORM:CMM_CALLINT,0)
	SI ( erreur_660004478 != 0)
	ALORS
		code_rejet_660004478 = 0x5011
		i_strcpy(pt_chp_660004478," champ Clck2CallInt pour SMSrecepMSISDN ")
		erreur_660004478 = i_PlvMessEmettre(6104,2,g_iartin,"",2,code_rejet_660004478,pt_chp_660004478, 0)
		trace("[Tvpn40_tr] :Erreur Normalisation champ Clck2CallInt pour SMSrecepMSISDN")
#		erreur = i_supprChamp(g_iartout, "T4SMSmsisdnNorm")
		SAUT STOCKE_ERRONE
	FINSI
# QC1167, alarme 1444 : entree lg(SMSmsisdnNorm)=152 bits, dpvgsm T3t33 lg(SMSrecepMSISDN)=128 bits
	longueur_660004478 = i_get_art_field(g_iartout, $Tvpn40::SMSmsisdnNorm -1)
	SI (longueur_660004478 > 16)
	ALORS
		longueur_660004478 = 16
		erreur_660004478 = i_resize_tlv(g_iartout, "T4SMSmsisdnNorm", "SMSmsisdnNorm", longueur_660004478 * 8)
	FINSI
SINON
	erreur_660004478 = i_supprChamp(g_iartout, "T4SMSmsisdnNorm")
FINSI


############ idpart avec NOS3 (lg=200 bits)
erreur_660004478 = i_get_art_str(g_iartout, $Tvpn40::CalledNb, pt_1_660004478)
i_get_sub_str(pt_1_660004478, 0, 2, pt_deb1_660004478)
i_get_sub_str(pt_1_660004478, 0, 3, pt_deb2_660004478)
flag_idpart_660004478=0
SI TYPE_OC_660004478 
ALORS
	SI ( i_strcmp("706", pt_1_660004478) == 0 )         || ( i_strcmp("0706", pt_1_660004478) == 0 )   ||
		( i_strcmp("756", pt_1_660004478) == 0 )    || ( i_strcmp("0756", pt_1_660004478) == 0 )   ||
		( i_strcmp("888", pt_1_660004478) == 0 )    || ( i_strcmp("0888", pt_1_660004478) == 0 )   ||
		( i_strcmp("712", pt_1_660004478) == 0 )    || ( i_strcmp("0712", pt_1_660004478) == 0 )   ||
		( i_strcmp("118", pt_1_660004478) == 0 )    || ( i_strcmp("0118", pt_1_660004478) == 0 )   ||
		( i_strcmp("118", pt_deb1_660004478) == 0 ) || ( i_strcmp("0118", pt_deb2_660004478) == 0 )
	ALORS
		erreur_660004478 = i_dup_chp_1val(g_iartout, g_iartout9, $Tvpn40::CalledNb, $Conv_URS::NOS3_NUM)
		erreur_660004478 = i_set_art_field(g_iartout9, $Conv_URS::NOS3_INF, adrcallednb_660004478)
		trace("[Tvpn40_tr] ***** idpartNorm SPECIAL 0 = CalledNb special normalise")
		erreur_660004478 = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS3,$Tvpn40::idpartNorm,-$NORM:CMM_SPEC,0)
	SINON
		flag_idpart_660004478=1
	FINSI
#SINON
#	flag_idpart=1
FINSI

SI flag_idpart_660004478==1
ALORS
	SI (i_valid_field_n(g_iartout, $Tvpn40::TransNb))
	ALORS
		erreur_660004478 = i_dup_chp_1val(g_iartout, g_iartout9, $Tvpn40::TransNb, $Conv_URS::NOS3_NUM)
		erreur_660004478 = i_set_art_field(g_iartout9, $Conv_URS::NOS3_INF, adrtransnb_660004478)
		trace("[Tvpn40_tr] ***** idpartNorm 0 = TransNb normalise")
		erreur_660004478 = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS3,$Tvpn40::idpartNorm,-$NORM:CMM_TRANS,0)
	SINON
		erreur_660004478 = i_dup_chp_1val(g_iartout, g_iartout9, $Tvpn40::CalledNb, $Conv_URS::NOS3_NUM)
		erreur_660004478 = i_set_art_field(g_iartout9, $Conv_URS::NOS3_INF, adrcallednb_660004478)
		trace("[Tvpn40_tr] ***** idpartNorm 0 = CalledNb normalise")
		erreur_660004478 = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS3,$Tvpn40::idpartNorm,-$NORM:CMM_NDE,0)
	FINSI
FINSI

# pour vpn_40 
SI TYPE_FC_660004478 || TYPE_IWC_660004478 || TYPE_TC_660004478 ||TYPE_RCF_660004478
# pour Tvpn_32
#SI TYPE_FC || TYPE_IWC || TYPE_TC
	ALORS
	erreur_660004478 = i_get_art_str(g_iartout,$Tvpn40::CallingNb,pt_CallingNb_660004478)
	#G5R2 lot2 QC1451 elimination des errones CMM ((V3T2 si tous les digits de callingNb a 0)
	#trace2("<<<__LINE__<<<__FILE__<< pt_CallingNb=<%s>", pt_CallingNb, "")
	erreur_660004478 = i_adequation_chaine_expreg(pt_CallingNb_660004478, "^0*$")
	SI (erreur_660004478 == 0)
		ALORS
		longueur_660004478 = i_strlen(pt_CallingNb_660004478)
		erreur_660004478 = i_resize_tlv(g_iartout9, "T2nos3", "NOS3_NUM", longueur_660004478 * 8)
		erreur_660004478 = i_dup_chp_1val(g_iartout, g_iartout9, $Tvpn40::CallingNb, $Conv_URS::NOS3_NUM)
		erreur_660004478 = i_set_art_field(g_iartout9, $Conv_URS::NOS3_INF, 0x00)
		trace("[Tvpn40_tr] ***** idpartNorm 0 = CallingNb normalise par IDENT2")
		erreur_660004478 = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS3,$Tvpn40::idpartNorm,-$NORM:IDENT2,0)
	SINON
		longueur_660004478 = i_strlen(pt_CallingNb_660004478)
		erreur_660004478 = i_resize_tlv(g_iartout9, "T2nos3", "NOS3_NUM", longueur_660004478 * 8)
		erreur_660004478 = i_dup_chp_1val(g_iartout, g_iartout9, $Tvpn40::CallingNb, $Conv_URS::NOS3_NUM)
		erreur_660004478 = i_set_art_field(g_iartout9, $Conv_URS::NOS3_INF, adrcallingnb_660004478)
		trace("[Tvpn40_tr] ***** idpartNorm 0 = CallingNb normalise")
		erreur_660004478 = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS3,$Tvpn40::idpartNorm,-$NORM:CMM,0)
	FINSI
FINSI
#G1R6 lot 3 VPN S7F3
SI TYPE_VN_660004478
ALORS
	erreur_660004478 = i_dup_chp_1val(g_iartout, g_iartout9, $Tvpn40::CalledNb, $Conv_URS::NOS3_NUM)
	erreur_660004478 = i_set_art_field(g_iartout9, $Conv_URS::NOS3_INF, adrcallednb_660004478)
	trace("[Tvpn40_tr] ***** idpartNorm 0 = CalledNb normalise")
	erreur_660004478 = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS3,$Tvpn40::idpartNorm,-$NORM:CMM_NDE,0)
FINSI
#
SI ( erreur_660004478 != 0)
ALORS
	code_rejet_660004478 = 0x5011
	i_strcpy(pt_chp_660004478," champ pour idpart ")
	erreur_660004478 = i_PlvMessEmettre(6104,2,g_iartin,"",2,code_rejet_660004478,pt_chp_660004478, 0)
	trace("[Tvpn40_tr] :Erreur Normalisation champ pour idpart")
	SAUT STOCKE_ERRONE
FINSI


############ local   avec NOS4 (lg=200 bits)
# VPN S7F4.doc SI ( (TYPE_OC || TYPE_IWC) && (i_valid_field_n(g_iartout, $Tvpn40::LocationNb)))
SI ( (TYPE_OC_660004478 || TYPE_IWC_660004478 || TYPE_VN_660004478) && (i_valid_field_n(g_iartout, $Tvpn40::LocationNb)))
	ALORS
  #G5R2 lot2 si Location Number 62* ou 63*
	erreur_660004478 = i_get_art_str(g_iartout, $Tvpn40::LocationNb, pt_1_660004478)
	i_get_sub_str(pt_1_660004478, 0, 1, pt_deb1_660004478)
	SI ( i_strcmp("62", pt_deb1_660004478) == 0 )
		ALORS
		g_iartout.localNorm[0]= 0x2
		g_iartout.localNorm[1]= 0x0
		g_iartout.localNorm[2]= 0x8
		g_iartout.localNorm[3]= 0x8
		g_iartout.localNorm[4]= 0x8
		g_iartout.localNorm[5]= 0xF
		trace("[Tvpn40_tr] localNorm  = 20888")
		erreur_660004478 = i_resize_tlv(g_iartout, "T4localNorm", "localNorm", 6*4)
	SINON
		SI ( i_strcmp("63", pt_deb1_660004478) == 0 )
			ALORS
			g_iartout.localNorm[0]= 0x2
			g_iartout.localNorm[1]= 0x0
			g_iartout.localNorm[2]= 0x8
			g_iartout.localNorm[3]= 0x1
			g_iartout.localNorm[4]= 0x3
			g_iartout.localNorm[5]= 0xF
			trace("[Tvpn40_tr] localNorm  = 20813")
			erreur_660004478 = i_resize_tlv(g_iartout, "T4localNorm", "localNorm", 6*4)
		SINON
			erreur_660004478 = i_dup_chp_1val(g_iartout, g_iartout9, $Tvpn40::LocationNb, $Conv_URS::NOS4_NUM)
			erreur_660004478 = i_set_art_field(g_iartout9, $Conv_URS::NOS4_INF, adrlocationnb_660004478)
			trace("[Tvpn40_tr] ***** local 0  = LocationNb normalise")
			erreur_660004478 = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS4,$Tvpn40::localNorm,-$NORM:CMM_LOCAL,0)
			SI ( erreur_660004478 != 0)
				ALORS
				code_rejet_660004478 = 0x5011
				i_strcpy(pt_chp_660004478," champ LocationNb ")
				erreur_660004478 = i_PlvMessEmettre(6104,2,g_iartin,"",2,code_rejet_660004478,pt_chp_660004478, 0)
				trace("[Tvpn40_tr] :Erreur Normalisation champ LocationNb pour local")
				SAUT STOCKE_ERRONE
			FINSI
		FINSI
# QC1167, alarme 1444 : entree lg(localNorm)=152 bits, dpvgsm T3t3 lg(local)=72 bits
		longueur_660004478 = i_get_art_field(g_iartout, $Tvpn40::localNorm -1)
		SI (longueur_660004478 > 9)
			ALORS
			longueur_660004478 = 9
			erreur_660004478 = i_resize_tlv(g_iartout, "T4localNorm", "localNorm", longueur_660004478 * 8)
		FINSI
	FINSI
FINSI


SI TYPE_TC_660004478 ||(TYPE_OC_660004478 && (!i_valid_field_n(g_iartout, $Tvpn40::LocationNb)))
ALORS
#	local: "208010000000"), numero initial 04[1-9]*, final [1-9]*
	g_iartout.localNorm[0]= 0x2
	g_iartout.localNorm[1]= 0x0
	g_iartout.localNorm[2]= 0x8
	g_iartout.localNorm[3]= 0x0
	g_iartout.localNorm[4]= 0x1
	g_iartout.localNorm[5]= 0x0
	g_iartout.localNorm[6]= 0x0
	g_iartout.localNorm[7]= 0x0
	g_iartout.localNorm[8]= 0x0
	g_iartout.localNorm[9]= 0x0
	g_iartout.localNorm[10]= 0x0
	g_iartout.localNorm[11]= 0x0
	trace("[Tvpn40_tr] localNb 1  = 208010000000")
	erreur_660004478 = i_resize_tlv(g_iartout, "T4localNorm", "localNorm", 12*4)

FINSI

SI TYPE_FC_660004478 || TYPE_RCF_660004478
ALORS
	SI (VlrNb33_660004478 == 0)
	ALORS
		erreur_660004478 = i_dup_chp_1val(g_iartout, g_iartout9, $Tvpn40::VlrNb, $Conv_URS::NOS4_NUM)
		erreur_660004478 = i_set_art_field(g_iartout9, $Conv_URS::NOS4_INF, adrvlrnb_660004478)
		#G5R2 lot2 automate specifique pour VlrNb
		#erreur = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS4,$Tvpn40::localNorm,-$NORM:CMM_USER,0)
		erreur_660004478 = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS4,$Tvpn40::localNorm,-$NORM:CMM_VLR,0)
		SI ( erreur_660004478 != 0)
		ALORS
			code_rejet_660004478 = 0x5011
			i_strcpy(pt_chp_660004478," champ VlrNb pour local ")
			erreur_660004478 = i_PlvMessEmettre(6104,2,g_iartin,"",2,code_rejet_660004478,pt_chp_660004478, 0)
			SAUT STOCKE_ERRONE
		FINSI
# QC1167, alarme 1444 : entree lg(localNorm)=152 bits, dpvgsm T3t3 lg(local)=72 bits
	  longueur_660004478 = i_get_art_field(g_iartout, $Tvpn40::localNorm -1)
	  SI (longueur_660004478 > 9)
	  ALORS
	  	longueur_660004478 = 9
	  	erreur_660004478 = i_resize_tlv(g_iartout, "T4localNorm", "localNorm", longueur_660004478 * 8)
	  FINSI
	SINON
		SI (i_valid_field_n(g_iartout, $Tvpn40::TransNb))
		ALORS
			erreur_660004478 = i_dup_chp_1val(g_iartout, g_iartout9, $Tvpn40::TransNb, $Conv_URS::NOS4_NUM)
			erreur_660004478 = i_set_art_field(g_iartout9, $Conv_URS::NOS4_INF, adrtransnb_660004478)
			trace("[Tvpn40_tr] ***** local 2  = TransNb normalise ")
			erreur_660004478 = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS4,$Tvpn40::localNorm,-$NORM:CMM_TRANS,0)
			SI ( erreur_660004478 != 0)
			ALORS
				code_rejet_660004478 = 0x5011
				i_strcpy(pt_chp_660004478," champ TransNb pour local ")
				erreur_660004478 = i_PlvMessEmettre(6104,2,g_iartin,"",2,code_rejet_660004478,pt_chp_660004478, 0)
				trace("[Tvpn40_tr] :Erreur Normalisation champ TransNb pour local")
				SAUT STOCKE_ERRONE
			FINSI
# QC1167, alarme 1444 : entree lg(localNorm)=152 bits, dpvgsm T3t3 lg(local)=72 bits
	    longueur_660004478 = i_get_art_field(g_iartout, $Tvpn40::localNorm -1)
	    SI (longueur_660004478 > 9)
	    ALORS
	    	longueur_660004478 = 9
	    	erreur_660004478 = i_resize_tlv(g_iartout, "T4localNorm", "localNorm", longueur_660004478 * 8)
	    FINSI
		SINON
			erreur_660004478 = i_dup_chp_1val(g_iartout, g_iartout9, $Tvpn40::CalledNb, $Conv_URS::NOS4_NUM)
			erreur_660004478 = i_set_art_field(g_iartout9, $Conv_URS::NOS4_INF, adrcallednb_660004478)
			trace("[Tvpn40_tr] ***** local 3  = CalledNb normalise")
			erreur_660004478 = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS4,$Tvpn40::localNorm,-$NORM:CMM_NDE,0)
			SI ( erreur_660004478 != 0)
			ALORS
				code_rejet_660004478 = 0x5011
				i_strcpy(pt_chp_660004478," champ CalledNb pour local ")
				erreur_660004478 = i_PlvMessEmettre(6104,2,g_iartin,"",2,code_rejet_660004478,pt_chp_660004478, 0)
				trace("[Tvpn40_tr] :Erreur Normalisation champ CalledNb pour local")
				SAUT STOCKE_ERRONE
			FINSI
# QC1167, alarme 1444 : entree lg(localNorm)=152 bits, dpvgsm T3t3 lg(local)=72 bits
	    longueur_660004478 = i_get_art_field(g_iartout, $Tvpn40::localNorm -1)
	    SI (longueur_660004478 > 9)
	    ALORS
	    	longueur_660004478 = 9
	    	erreur_660004478 = i_resize_tlv(g_iartout, "T4localNorm", "localNorm", longueur_660004478 * 8)
	    FINSI
		FINSI
	FINSI
FINSI
#/QC999

############ ax_idemet
# G3R1 lot4
i_strcpy(pt_idemet_660004478, "")
i_strcpy(pt_1_660004478, "")
erreur_660004478 = i_format_str2( pt_1_660004478, "%s%s", "AX_IDEMET_", i_LireEECSGTQS(g_ieec))
i_strcpy(pt_idemet_660004478, i_get_tab_field("VariableContexte", ICAR_ABS_660004478, pt_1_660004478))

# AX_IDEMET resultat fonction recherchevaleurcleftable T3t1/V3t1.3
SI (i_strcmp(pt_idemet_660004478,g_inull) != 0)
ALORS
	longueur_660004478= 0
	longueur_660004478=i_strlen(pt_idemet_660004478)
	erreur_660004478 = i_set_art_str(g_iartout9,$Conv_URS::recipAddAlp, pt_idemet_660004478)
	index_660004478=0
	POINT BOUCLE0
	SI (index_660004478 < longueur_660004478)
	ALORS
		SI (g_iartout9.recipAddHex[index_660004478] < 0x3A)
		ALORS
			g_iartout.ax_idemet[index_660004478]=g_iartout9.recipAddHex[index_660004478] - 0x30
		FINSI
		SI (g_iartout9.recipAddHex[index_660004478] > 0x40) && (g_iartout9.recipAddHex[index_660004478] < 0x47)
		ALORS
			g_iartout.ax_idemet[index_660004478]=g_iartout9.recipAddHex[index_660004478] - 0x37
		FINSI
		SI (g_iartout9.recipAddHex[index_660004478] > 0x60) && (g_iartout9.recipAddHex[index_660004478] < 0x67)
		ALORS
			g_iartout.ax_idemet[index_660004478]=g_iartout9.recipAddHex[index_660004478] - 0x57
		FINSI
		index_660004478=index_660004478+1
		SAUT BOUCLE0
	FINSI
SINON
	#pt_idemet : "33007000000FFFFFFF"
	g_iartout.ax_idemet[0]= 0x3
	g_iartout.ax_idemet[1]= 0x3
	g_iartout.ax_idemet[2]= 0x0
	g_iartout.ax_idemet[3]= 0x0
	g_iartout.ax_idemet[4]= 0x7
	index_660004478 = 5
	POINT BOUCLE1
	SI index_660004478 < 11
	ALORS
		g_iartout.ax_idemet[index_660004478]= 0x0
		index_660004478 = index_660004478 + 1
		SAUT BOUCLE1
	FINSI
FINSI


#G3R5 lot2 NetCause
trace1 ("<<__LINE__>> ========== netcause = 0x%x ==================",netcause_660004478)
SI (netcause_660004478 == 0x01 || netcause_660004478 == 0x10 || netcause_660004478 == 0x11 || netcause_660004478 == 0x13 || netcause_660004478 == 0x14 || netcause_660004478 == 0xFF)
ALORS
	trace ("<<__LINE__>> ===== envoi vers les elimines ====================")
	SAUT STOCKE_ELM
FINSI

#/G3R5 lot2







########################################################
# Cpt applicatifs
########################################################


########### Date_Audit
date_audit_gmt_660004478 = i_date_audit()
date_audit_660004478 = i_DHgetLocalTime(NUMTAB_660004478, 7, date_audit_gmt_660004478)
trace1("[Tvpn40_tr] date_audit=%x",date_audit_660004478)


# CPT = 1501
# X : type de CRA, Y : EEC, Z : inutilise, date : date_audit, Increment : 1

Y_660004478=g_ieec
X_660004478=0
Z_660004478=0
# SI TYPE_OC FO 650
SI TYPE_OC_660004478 || TYPE_VN_660004478
ALORS
	X_660004478=0x00
SINON
	SI TYPE_IWC_660004478 || TYPE_TC_660004478
	ALORS
		X_660004478=0x01
	SINON
#VPN32
#		SI TYPE_FCC
#VPN40
		SI TYPE_FCC_660004478 || TYPE_RCF_660004478
		ALORS
			X_660004478=0x02
		SINON
			SI TYPE_FCI_660004478
			ALORS
				X_660004478=0x06
			SINON
				code_rejet_660004478 = 0x5041
				i_strcpy(pt_chp_660004478,"TYPE appel non prevu")
				erreur_660004478 = i_PlvMessEmettre(6102,2,g_iartin,"",2,code_rejet_660004478,pt_chp_660004478, 0)
				SAUT STOCKE_ERRONE
			FINSI
		FINSI
	FINSI
FINSI

erreur_660004478=i_incr_cpt(CPT_660004478,X_660004478,Y_660004478,Z_660004478,date_audit_660004478,INCREMENT_660004478)
erreur_660004478 = i_stocke_art(g_iartout, 0, PT_OK, 0)
RETOUR TRAIT_OK


########################################################
#   Stockage en errone
########################################################

POINT   STOCKE_ERRONE

trace2("[Tvpn40_trt] Stockage en ERRONE %s", "", "")

erreur_660004478 = i_make_art_rej(g_iartin, g_iartout5, code_rejet_660004478)
erreur_660004478 = i_stocke_art(g_iartout5, 0, PT_ERRONE, 0)

RETOUR TRAIT_OK

#QC223
########################################################
# Stockage en Elimine
########################################################

POINT STOCKE_ELM

trace( "[Tvpn40_trt] Pcode de traitement   Stockage en ELIMINE" )
erreur_660004478 = i_stocke_art( g_iartin, 0, PT_ELIMINE, 0 )
RETOUR TRAIT_OK

########################################################
# Stockage en Elimine Divers
########################################################

#POINT STOCKE_DIV

#trace( "[Tvpn40_trt] Pcode de traitement   Stockage en DIVERS" )
#erreur = i_stocke_art( g_iartin, 0, PT_DIVERS, 0 )
#RETOUR TRAIT_OK
#\QC223
#___________________________ FIN Tvpn40_trt.src_________________________________
