DEFINITION NUMTAB_660004477 4
DEFINITION FAUX_660004477 0
DEFINITION VRAI_660004477 1
DEFINITION INCREMENT_660004477 1
DEFINITION CPT_660004477 1501
REGISTRE ENTIER TYPE_OC_660004477
REGISTRE ENTIER TYPE_TC_660004477
REGISTRE ENTIER TYPE_FCC_660004477
REGISTRE ENTIER TYPE_FCI_660004477
REGISTRE ENTIER TYPE_FC_660004477
REGISTRE ENTIER TYPE_IWC_660004477
REGISTRE ENTIER TYPE_RCF_660004477
REGISTRE ENTIER TYPE_VN_660004477
REGISTRE ENTIER TYPE_SMS_660004477
REGISTRE ENTIER inefficacite_660004477
REGISTRE ENTIER erreur_660004477
REGISTRE ENTIER calltype_660004477
REGISTRE ENTIER adrcallingnb_660004477
REGISTRE ENTIER adrcallednb_660004477
REGISTRE ENTIER netcause_660004477
REGISTRE ENTIER typrout_660004477
REGISTRE ENTIER adrorigcallednb_660004477
REGISTRE ENTIER pcinformation_660004477
REGISTRE ENTIER charactcall_660004477
REGISTRE ENTIER adrlocationnb_660004477
REGISTRE ENTIER locationind_660004477
REGISTRE ENTIER adrcmmuserident_660004477
REGISTRE ENTIER adraddcallingnb_660004477
REGISTRE ENTIER adrckcallint_660004477
REGISTRE ENTIER adrtrfnb_660004477
REGISTRE ENTIER adrtransnb_660004477
REGISTRE ENTIER flag_idpart_660004477
REGISTRE ENTIER date_audit_660004477
REGISTRE ENTIER date_audit_gmt_660004477
REGISTRE ENTIER X_660004477
REGISTRE ENTIER Y_660004477
REGISTRE ENTIER Z_660004477
REGISTRE ENTIER date_660004477
REGISTRE ENTIER code_rejet_660004477
REGISTRE ENTIER longueur_660004477
REGISTRE ENTIER index_660004477
REGISTRE ENTIER ICAR_ABS_660004477
REGISTRE ENTIER TYPE_PU_660004477
REGISTRE ENTIER addrpickingupnb_660004477
REGISTRE POINTEUR pt_chp_660004477
REGISTRE POINTEUR pt_1_660004477
REGISTRE POINTEUR pt_deb1_660004477
REGISTRE POINTEUR pt_deb2_660004477
REGISTRE POINTEUR pt_idemet_660004477
REGISTRE POINTEUR pt_CallingNb_660004477
############################################################################
# TRAITEMENT Tvpn5
#   Article DC Tvpn5 en entree de Platine
#   Pcode de traitement
#   Creation le 16/03/2009 (reprise Tvpn40 et adaptation)
# Historique
# 14/09/10 JLG G3R1 lot4 item Differentiation idemet entre CB et CMM par la table VariableContexte
# 20/01/11 - G3R1 lot4 Verification/Correction des variables (constantes, entiers, pointeurs) 
# 22/12/11 - G3R5 lot2 BTelU - interception appels
# 26/12/11 - G3R5 lot2 NetCause
# 18/01/12 - QC998 redimensionnement du champ NOS3_NUM de CONV_URS pour la normalisation de callingNb
# 24/02/12 - QC999 extension de la qc998 sur pb troncature de champs tableau numerique
# 03/10/12 - PKH G3R8 lot1 BtelUSMS console &  BtelU Sonnerie Simultan?e
# 08/01/13 - QC1167 : alarme 1444 sur localNorm, SMSmsisdnNorm et SdmsisdnNorm
# 08/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_660004477 = VRAI_660004477
adrckcallint_660004477 = 0
adrtrfnb_660004477 = 0
TYPE_PU_660004477 = 0
addrpickingupnb_660004477 = 0 

# ALLOCATION DES POINTEURS
pt_chp_660004477		= "111111111111111111111111111111111111111111"
pt_1_660004477			= "2222222222222222222222222222222222222222222222222222222222222222222222222"
pt_deb1_660004477		= "5555555"
pt_deb2_660004477		= "6666666"
pt_idemet_660004477	= "7777777777777777777777"
pt_CallingNb_660004477 = "pt_CallingNb9999999999999999999999999999"
i_strcpy(pt_CallingNb_660004477,"")

#erreur = i_fdump_art(g_iartout)

trace("[Tvpn5_trt] =========== debut Pcode TRAITEMENT  =============")

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

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


################################################################
#   Tests semantiques
################################################################
calltype_660004477 = 0
calltype_660004477 = i_get_art_field(g_iartout, $Tvpn5::CallType)
trace1("[Tvpn5_tr] calltype = 0x%x",calltype_660004477)
SI calltype_660004477 == 0xCB
ALORS
	inefficacite_660004477 = VRAI_660004477
	SAUT STOCKE_ELM
SINON
	inefficacite_660004477 = FAUX_660004477
FINSI

#G3R5 lot2 BtelU ajout du ctrl sur type 0x60
#G3R8 lot1 ajout du controle pour les valeurs 0xFE 0xFF  0x0100 0x105
SI calltype_660004477 != 0x01 && calltype_660004477 != 0x06 && calltype_660004477 != 0x07 && calltype_660004477 != 0x0A && calltype_660004477 != 0x0F && calltype_660004477 != 0x10 && calltype_660004477 != 0x14 && calltype_660004477 != 0x19 && calltype_660004477 != 0x1A && calltype_660004477 != 0x3B && calltype_660004477 != 0x3C && calltype_660004477 != 0x3E && calltype_660004477 != 0x3F && calltype_660004477 != 0x37 && calltype_660004477 != 0x3D && calltype_660004477 != 0x60  
               && calltype_660004477 != 0xFE  && calltype_660004477 != 0xFF && calltype_660004477 != 0x0100 && calltype_660004477 != 0x0105 
ALORS
	trace1("[Tvpn5_tr] NOK calltype = 0x%x",calltype_660004477)
	code_rejet_660004477 = 0x5041
	i_strcpy(pt_chp_660004477,"CallType")
	erreur_660004477 = i_PlvMessEmettre(6100,2,g_iartin,"",2,code_rejet_660004477,pt_chp_660004477, 0)
	SAUT STOCKE_ERRONE
FINSI
 trace1("[Tvpn5_tr] OK calltype = 0x%x",calltype_660004477)



adrcallingnb_660004477 = i_get_art_field(g_iartout, $Tvpn5::AdrCallingNb)

SI adrcallingnb_660004477 != 0x01 && adrcallingnb_660004477 != 0x02 && adrcallingnb_660004477 != 0x03 && adrcallingnb_660004477 != 0x04
ALORS
	trace1("[Tvpn5_tr] NOK adrcallingnb = 0x%x",adrcallingnb_660004477)
	code_rejet_660004477 = 0x5041
	i_strcpy(pt_chp_660004477,"AdrCallingNb")
	erreur_660004477 = i_PlvMessEmettre(6100,2,g_iartin,"",2,code_rejet_660004477,pt_chp_660004477, 0)
	SAUT STOCKE_ERRONE
FINSI
trace1("[Tvpn5_tr] OK adrcallingnb = 0x%x",adrcallingnb_660004477)

adrcallednb_660004477 = i_get_art_field(g_iartout, $Tvpn5::AdrCalledNb)

SI adrcallednb_660004477 < 0x01 || adrcallednb_660004477 > 0x04
ALORS
	trace1("[Tvpn5_tr] NOK adrcallednb = 0x%x",adrcallednb_660004477)
	code_rejet_660004477 = 0x5041
	i_strcpy(pt_chp_660004477,"AdrCalledNb")
	erreur_660004477 = i_PlvMessEmettre(6100,2,g_iartin,"",2,code_rejet_660004477,pt_chp_660004477, 0)
	SAUT STOCKE_ERRONE
FINSI
trace1("[Tvpn5_tr] OK adrcallednb = 0x%x",adrcallednb_660004477)

SI (i_valid_field_n(g_iartout, $Tvpn5::AdrOrigCalledNb))
ALORS
	adrorigcallednb_660004477 = i_get_art_field(g_iartout, $Tvpn5::AdrOrigCalledNb)
	#G5R2 lot2
	#SI adrorigcallednb != 0x03 && adrorigcallednb != 0x04
	SI adrorigcallednb_660004477 != 0x02 && adrorigcallednb_660004477 != 0x03 && adrorigcallednb_660004477 != 0x04
	ALORS
		code_rejet_660004477 = 0x5041
		i_strcpy(pt_chp_660004477,"AdrOrigCalledNb")
		erreur_660004477 = i_PlvMessEmettre(6100,2,g_iartin,"",2,code_rejet_660004477,pt_chp_660004477, 0)
		SAUT STOCKE_ERRONE
	FINSI
FINSI

pcinformation_660004477 = i_get_art_field(g_iartout, $Tvpn5::PCinformation)

SI pcinformation_660004477 > 0x02
ALORS
	code_rejet_660004477 = 0x5041
	i_strcpy(pt_chp_660004477,"PCinformation")
	erreur_660004477 = i_PlvMessEmettre(6100,2,g_iartin,"",2,code_rejet_660004477,pt_chp_660004477, 0)
	SAUT STOCKE_ERRONE
FINSI


typrout_660004477 = i_get_art_field(g_iartout, $Tvpn5::TypeRout)

charactcall_660004477 = i_get_art_field(g_iartout, $Tvpn5::CharactCall)

SI charactcall_660004477 != 0x00 && charactcall_660004477 != 0x01 && charactcall_660004477 != 0x02 && charactcall_660004477 != 0x10 && charactcall_660004477 != 0x20 && charactcall_660004477 != 0x11 && charactcall_660004477 != 0x21 && charactcall_660004477 != 0x12 && charactcall_660004477 != 0x30 && charactcall_660004477 != 0x40
ALORS
	code_rejet_660004477 = 0x5041
	i_strcpy(pt_chp_660004477,"CharactCall")
	erreur_660004477 = i_PlvMessEmettre(6100,2,g_iartin,"",2,code_rejet_660004477,pt_chp_660004477, 0)
	SAUT STOCKE_ERRONE
FINSI

SI (i_valid_field_n(g_iartout, $Tvpn5::AdrLocationNb))
ALORS
	adrlocationnb_660004477 = i_get_art_field(g_iartout, $Tvpn5::AdrLocationNb)
	SI adrlocationnb_660004477 != 0x03 && adrlocationnb_660004477 != 0x04
	ALORS
		trace1("Alarme 6100_9 [Tvpn5_tr] NOK LocationInd = 0x%x",adrlocationnb_660004477)
		code_rejet_660004477 = 0x5041
		i_strcpy(pt_chp_660004477,"AdrLocationNb")
		erreur_660004477 = i_PlvMessEmettre(6100,2,g_iartin,"",2,code_rejet_660004477,pt_chp_660004477, 0)
		SAUT STOCKE_ERRONE
	FINSI
FINSI

SI (i_valid_field_n(g_iartout, $Tvpn5::LocationInd))
ALORS
	
	locationind_660004477 = i_get_art_field(g_iartout, $Tvpn5::LocationInd)
	SI locationind_660004477 != 0x00 && locationind_660004477 != 0x02
	ALORS
		trace1("Alarme 6100_9 [Tvpn5_tr] NOK LocationInd = 0x%x",locationind_660004477)
		code_rejet_660004477 = 0x5041
		i_strcpy(pt_chp_660004477,"LocationInd")
		erreur_660004477 = i_PlvMessEmettre(6100,2,g_iartin,"",2,code_rejet_660004477,pt_chp_660004477, 0)
		SAUT STOCKE_ERRONE
	FINSI
FINSI


SI (i_valid_field_n(g_iartout, $Tvpn5::AdrCMMuserIdent))
ALORS
	adrcmmuserident_660004477 = i_get_art_field(g_iartout, $Tvpn5::AdrCMMuserIdent)
	SI adrcmmuserident_660004477 != 0x03 && adrcmmuserident_660004477 != 0x04
	ALORS
		trace1("Alarme 6100_9 [Tvpn5_tr] NOK adrcmmuserident = 0x%x",adrcmmuserident_660004477)
		code_rejet_660004477 = 0x5041
		i_strcpy(pt_chp_660004477,"adrcmmuserident")
		erreur_660004477 = i_PlvMessEmettre(6100,2,g_iartin,"",2,code_rejet_660004477,pt_chp_660004477, 0)
		SAUT STOCKE_ERRONE
	FINSI
FINSI

SI (i_valid_field_n(g_iartout, $Tvpn5::AdrTransNb))
ALORS
	adrtransnb_660004477 = i_get_art_field(g_iartout, $Tvpn5::AdrTransNb)
	SI adrtransnb_660004477 != 0x02 && adrtransnb_660004477 != 0x03 && adrtransnb_660004477 != 0x04
	ALORS
		code_rejet_660004477 = 0x5041
		i_strcpy(pt_chp_660004477,"AdrTransNb")
		erreur_660004477 = i_PlvMessEmettre(6100,2,g_iartin,"",2,code_rejet_660004477,pt_chp_660004477, 0)
		SAUT STOCKE_ERRONE
	FINSI
FINSI

SI (i_valid_field_n(g_iartout, $Tvpn5::AdrAddCallingNb))
ALORS
	adraddcallingnb_660004477 = i_get_art_field(g_iartout, $Tvpn5::AdrAddCallingNb)
	SI adraddcallingnb_660004477 != 0x03 && adraddcallingnb_660004477 != 0x04
	ALORS
		trace1("Alarme 6100_11 [Tvpn5_tr] NOK AdrAddCallingNb = 0x%x",adraddcallingnb_660004477)
		code_rejet_660004477 = 0x5041
		i_strcpy(pt_chp_660004477,"AdrAddCallingNb")
		erreur_660004477 = i_PlvMessEmettre(6100,2,g_iartin,"",2,code_rejet_660004477,pt_chp_660004477, 0)
		SAUT STOCKE_ERRONE
	FINSI
FINSI

SI (i_valid_field_n(g_iartout, $Tvpn5::AdrCkCallInt))
ALORS
	adrckcallint_660004477 = i_get_art_field(g_iartout, $Tvpn5::AdrCkCallInt)
	SI adrckcallint_660004477 != 0x03 && adrckcallint_660004477 != 0x04
	ALORS
		code_rejet_660004477 = 0x5041
		i_strcpy(pt_chp_660004477,"AdrCkCallInt ni 03 ni 04")
		erreur_660004477 = i_PlvMessEmettre(6100,2,g_iartin,"",2,code_rejet_660004477,pt_chp_660004477, 0)
		SAUT STOCKE_ERRONE
	FINSI
FINSI

SI (i_valid_field_n(g_iartout, $Tvpn5::AdrTrfNb))
ALORS
	adrtrfnb_660004477 = i_get_art_field(g_iartout, $Tvpn5::AdrTrfNb)
	SI adrtrfnb_660004477 != 0x01 && adrtrfnb_660004477 != 0x02 && adrtrfnb_660004477 != 0x03 && adrtrfnb_660004477 != 0x04
	ALORS
		code_rejet_660004477 = 0x5041
		i_strcpy(pt_chp_660004477,"AdrTrfNb")
		erreur_660004477 = i_PlvMessEmettre(6100,2,g_iartin,"",2,code_rejet_660004477,pt_chp_660004477, 0)
		SAUT STOCKE_ERRONE
	FINSI
FINSI

#G3R5 lot2 BTelU controle unitaite 
SI (i_valid_field_n(g_iartout, $Tvpn5::AdrPickingUpNb))
ALORS
    addrpickingupnb_660004477 = i_get_art_field(g_iartout, $Tvpn5::AdrPickingUpNb)
    SI addrpickingupnb_660004477 != 0x01 && addrpickingupnb_660004477 != 0x02 && addrpickingupnb_660004477 != 0x03 && addrpickingupnb_660004477 != 0x04
    ALORS
         code_rejet_660004477 = 0x5041
         i_strcpy(pt_chp_660004477,"AdrPickingUpNb")
         erreur_660004477 = i_PlvMessEmettre(6100,2,g_iartin,"",2,code_rejet_660004477,pt_chp_660004477, 0)
         SAUT STOCKE_ERRONE
   	FINSI
FINSI




#G3R5 lot2 NetCause
netcause_660004477 = i_get_art_field(g_iartout, $Tvpn5::NetCause)

SI (netcause_660004477 != 0x01 && netcause_660004477 != 0x10 && netcause_660004477 != 0x11 && netcause_660004477 != 0x13 && netcause_660004477 != 0x14 && netcause_660004477 != 0x1F && netcause_660004477 != 0xFF) 
ALORS
	code_rejet_660004477 = 0x5041
	i_strcpy(pt_chp_660004477,"NetCause")
	erreur_660004477 = i_PlvMessEmettre(6100,2,g_iartin,"",2,code_rejet_660004477,pt_chp_660004477, 0)
	SAUT STOCKE_ERRONE
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_660004477 = i_get_art_str(g_iartout, $Tvpn5::CalledNb, pt_1_660004477)
longueur_660004477=i_strlen(pt_1_660004477)
i_get_sub_str(pt_1_660004477, 0, 1, pt_deb1_660004477)
SI ( i_strcmp("33", pt_deb1_660004477) == 0 ) && ( longueur_660004477 > 11 )
ALORS
	erreur_660004477 = i_resize_tlv(g_iartout, "T3_CalledNb", "CalledNb", 11*4)
	g_iartout.CalledNb[11] = 0xF
	SAUT RETAILLAGE_TransNb
FINSI

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

POINT RETAILLAGE_TransNb

SI (i_valid_field_n(g_iartout, $Tvpn5::TransNb))
ALORS
	erreur_660004477 = i_get_art_str(g_iartout, $Tvpn5::TransNb, pt_1_660004477)
	longueur_660004477=i_strlen(pt_1_660004477)
	i_get_sub_str(pt_1_660004477, 0, 1, pt_deb1_660004477)
	SI ( i_strcmp("33", pt_deb1_660004477) == 0 ) && ( longueur_660004477 > 11 )
	ALORS
		erreur_660004477 = i_resize_tlv(g_iartout, "T3_TransNb", "TransNb", 11*4)
		g_iartout.TransNb[11] = 0xF
		SAUT FIN_RETAILLAGE_TransNb
	FINSI
	
	SI longueur_660004477 > 20
	ALORS
		erreur_660004477 = i_resize_tlv(g_iartout, "T3_TransNb", "TransNb", 20*4)
	FINSI
FINSI

POINT FIN_RETAILLAGE_TransNb

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

########### ICAR_ABS
date_660004477 =i_get_art_field(g_iartout,$Tvpn5::DATE)
ICAR_ABS_660004477 =i_date_platine(g_ieec,g_iartout,date_660004477)

########### TYPE_OC TYPE_TC TYPE_FCC TYPE_FCI TYPE_FC TYPE_IWC TYPE_RCF TYPE_VN
#G3R8 lot1 BtelUSMS console pour TYPE_SMS
TYPE_OC_660004477 = 0
TYPE_TC_660004477 = 0
TYPE_FCC_660004477 = 0
TYPE_FCI_660004477 = 0
TYPE_FC_660004477 = 0
TYPE_IWC_660004477 = 0
TYPE_RCF_660004477 = 0
TYPE_VN_660004477 = 0
TYPE_SMS_660004477 = 0

SI calltype_660004477 == 0x01 || calltype_660004477 == 0x06 || calltype_660004477 == 0x07 || calltype_660004477 == 0x0A || calltype_660004477 == 0x19 || calltype_660004477 == 0x3B || calltype_660004477 == 0x3C || calltype_660004477 == 0x3E || calltype_660004477 == 0x37 || calltype_660004477 == 0x3D
ALORS
	TYPE_OC_660004477 = 1
FINSI

SI calltype_660004477 == 0x10
ALORS
	TYPE_TC_660004477 = 1
FINSI

SI calltype_660004477 == 0x14
ALORS
	SI typrout_660004477 == 0x08 || typrout_660004477 == 0x02
	ALORS
		TYPE_FCC_660004477 = 1
	SINON
		SI typrout_660004477 == 0x07
		ALORS
			TYPE_FCI_660004477 = 1
		SINON
			code_rejet_660004477 = 0x5041
			i_strcpy(pt_chp_660004477,"TypeRout")
			erreur_660004477 = i_PlvMessEmettre(6100,2,g_iartin,"",2,code_rejet_660004477,pt_chp_660004477, 0)
			SAUT STOCKE_ERRONE
		FINSI
	FINSI
FINSI

#G3R8 lot1 BtelU Sonnerie Simultan?e
SI calltype_660004477 == 0x0105
ALORS
     TYPE_FCC_660004477 = 1
FINSI


SI TYPE_FCI_660004477 || TYPE_FCC_660004477
ALORS
	TYPE_FC_660004477 = 1
FINSI

SI calltype_660004477 == 0x0F
ALORS
	TYPE_IWC_660004477 = 1
FINSI

SI calltype_660004477 == 0x1A
ALORS
	TYPE_RCF_660004477 = 1
FINSI

SI calltype_660004477 == 0x3F
ALORS
	TYPE_VN_660004477 = 1
FINSI

# G3R5 lot1 marquage interception appel
SI calltype_660004477 == 0x60
ALORS
     TYPE_PU_660004477 = 1
FINSI

# G3R8 lot1 G3R8 lot1 BtelUSMS console pour TYPE_SMS
SI calltype_660004477 == 0xFE || calltype_660004477 == 0xFF || calltype_660004477 == 0x0100
ALORS
    TYPE_SMS_660004477 = 1
FINSI

trace1("<<__LINE__>>G3R8 BtelUSMS console=========TYPE_SMS=%d===================",TYPE_SMS_660004477)
trace1("<<__LINE__>>G3R8=========TYPE_FCC=%d===================",TYPE_FCC_660004477)

################################################################
#   Tests croises
################################################################
# QC1287
SI  TYPE_FC_660004477 || TYPE_RCF_660004477 || TYPE_VN_660004477
ALORS
	SI (! i_valid_field_n(g_iartout, $Tvpn5::OrigCalledNb))
	ALORS
		code_rejet_660004477 = 0x5041
		i_strcpy(pt_chp_660004477,"TYPE_FC vrai et OrigCalledNb invalide")
		erreur_660004477 = i_PlvMessEmettre(6101,2,g_iartin,"",2,code_rejet_660004477,pt_chp_660004477, 0)
		SAUT STOCKE_ERRONE
	FINSI
FINSI

SI (i_valid_field_n(g_iartout, $Tvpn5::OrigCalledNb)) && (! i_valid_field_n(g_iartout, $Tvpn5::AdrOrigCalledNb))
ALORS
		code_rejet_660004477 = 0x5041
		i_strcpy(pt_chp_660004477,"TYPE_FC vrai et AdrOrigCalledNb invalide")
		erreur_660004477 = i_PlvMessEmettre(6101,2,g_iartin,"",2,code_rejet_660004477,pt_chp_660004477, 0)
		SAUT STOCKE_ERRONE
FINSI

SI (i_valid_field_n(g_iartout, $Tvpn5::CMMuserIdent)) && (! i_valid_field_n(g_iartout, $Tvpn5::AdrCMMuserIdent))
ALORS
		code_rejet_660004477 = 0x5041
		i_strcpy(pt_chp_660004477,"TYPE_FC vrai et AdrCMMuserIdent invalide")
		erreur_660004477 = i_PlvMessEmettre(6101,2,g_iartin,"",2,code_rejet_660004477,pt_chp_660004477, 0)
		SAUT STOCKE_ERRONE
FINSI

SI TYPE_IWC_660004477
ALORS
	SI (! i_valid_field_n(g_iartout, $Tvpn5::LocationNb))
	ALORS
		code_rejet_660004477 = 0x5041
		i_strcpy(pt_chp_660004477,"TYPE_IWC vrai et LocationNb invalide")
		erreur_660004477 = i_PlvMessEmettre(6101,2,g_iartin,"",2,code_rejet_660004477,pt_chp_660004477, 0)
		SAUT STOCKE_ERRONE
	FINSI
FINSI

SI (i_valid_field_n(g_iartout, $Tvpn5::LocationNb)) && (! i_valid_field_n(g_iartout, $Tvpn5::AdrLocationNb))
ALORS
	code_rejet_660004477 = 0x5041
	i_strcpy(pt_chp_660004477,"LocationNb valide et AdrLocationNb invalide")
	erreur_660004477 = i_PlvMessEmettre(6101,2,g_iartin,"",2,code_rejet_660004477,pt_chp_660004477, 0)
	SAUT STOCKE_ERRONE
FINSI

SI (i_valid_field_n(g_iartout, $Tvpn5::AddCallingNb)) && (! i_valid_field_n(g_iartout, $Tvpn5::AdrAddCallingNb))
ALORS
	code_rejet_660004477 = 0x5041
	i_strcpy(pt_chp_660004477,"AddCallingNb valide et AdrAddCallingNb invalide")
	erreur_660004477 = i_PlvMessEmettre(6101,2,g_iartin,"",2,code_rejet_660004477,pt_chp_660004477, 0)
	SAUT STOCKE_ERRONE
FINSI

SI (i_valid_field_n(g_iartout, $Tvpn5::T3_TransNb))
ALORS
	SI  (! i_valid_field_n(g_iartout, $Tvpn5::TransNb)) && (! i_valid_field_n(g_iartout, $Tvpn5::AdrTransNb))
	ALORS
		code_rejet_660004477 = 0x5041
		i_strcpy(pt_chp_660004477,"TransNb valide et AdrTransNb invalide")
		erreur_660004477 = i_PlvMessEmettre(6101,2,g_iartin,"",2,code_rejet_660004477,pt_chp_660004477, 0)
		SAUT STOCKE_ERRONE
	FINSI
FINSI

#G3R5 lot2 BtelU tests croises
SI  TYPE_PU_660004477 == 1
ALORS
     SI ( !i_valid_field_n(g_iartout, $Tvpn5::PickingUpNb))
	 ALORS
	 	code_rejet_660004477 = 0x5041
	 	i_strcpy(pt_chp_660004477,"PickingUpNb")
	 	erreur_660004477 = i_PlvMessEmettre(6101,2,g_iartin,"",2,code_rejet_660004477,pt_chp_660004477, 0)
		SAUT STOCKE_ERRONE
	FINSI
FINSI

SI ( i_valid_field_n (g_iartout, $Tvpn5::PickingUpNb))
ALORS
	SI ( !i_valid_field_n (g_iartout, $Tvpn5::AdrPickingUpNb))
	ALORS
	     code_rejet_660004477 = 0x5041
	 	i_strcpy(pt_chp_660004477,"AdrPingUpNb")
	 	erreur_660004477 = i_PlvMessEmettre(6101,2,g_iartin,"",2,code_rejet_660004477,pt_chp_660004477, 0)
		SAUT STOCKE_ERRONE
	FINSI
FINSI





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

########################################################
# Mise a jour du T3ace, les T4 pour normalisation
#
########################################################

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

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

SI calltype_660004477 == 0x06 || calltype_660004477 == 0x07 || calltype_660004477 == 0x0A
ALORS
	erreur_660004477 = i_dup_chp_1val(g_iartout, g_iartout9, $Tvpn5::CMMuserIdent, $Conv_URS::NOS1_NUM)
	erreur_660004477 = i_set_art_field(g_iartout9, $Conv_URS::NOS1_INF, adrcmmuserident_660004477)
	trace("[Tvpn5_tr] ***** msisdn 0 = CMMuserIdent normalise")
	erreur_660004477 = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS1,$Tvpn5::msisdnNorm,-$NORM:CMM_USER,0)
	
SINON
	
	SI TYPE_OC_660004477
	ALORS
		SI (i_valid_field_n(g_iartout, $Tvpn5::AddCallingNb))
		ALORS
			erreur_660004477 = i_dup_chp_1val(g_iartout, g_iartout9, $Tvpn5::AddCallingNb, $Conv_URS::NOS1_NUM)
			erreur_660004477 = i_set_art_field(g_iartout9, $Conv_URS::NOS1_INF, adraddcallingnb_660004477)
			trace("[Tvpn5_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,$Tvpn5::msisdnNorm,-$NORM:CMM_NDE,0)
			erreur_660004477 = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS1,$Tvpn5::msisdnNorm,-$NORM:CMM_ADD,0)
		SINON
			erreur_660004477 = i_dup_chp_1val(g_iartout, g_iartout9, $Tvpn5::CallingNb, $Conv_URS::NOS1_NUM)
			erreur_660004477 = i_set_art_field(g_iartout9, $Conv_URS::NOS1_INF, adrcallingnb_660004477)
			trace("[Tvpn5_tr] ***** msisdn 2 = CallingNb normalise")
			erreur_660004477 = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS1,$Tvpn5::msisdnNorm,-$NORM:CMM,0)
		FINSI
	FINSI
#G3R5 lot2 BTelU normalisation ajout TYPE_PU pour Tdpvgsm V3T4 	
	SI TYPE_TC_660004477 || TYPE_IWC_660004477 || TYPE_PU_660004477
	ALORS
		SI (i_valid_field_n(g_iartout, $Tvpn5::TransNb))
		ALORS
			erreur_660004477 = i_dup_chp_1val(g_iartout, g_iartout9, $Tvpn5::TransNb, $Conv_URS::NOS1_NUM)
			erreur_660004477 = i_set_art_field(g_iartout9, $Conv_URS::NOS1_INF, adrtransnb_660004477)
			trace("[Tvpn5_tr] ***** msisdn 3 = TransNb normalise")
			erreur_660004477 = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS1,$Tvpn5::msisdnNorm,-$NORM:CMM_TRANS,0)
		SINON
			erreur_660004477 = i_dup_chp_1val(g_iartout, g_iartout9, $Tvpn5::CalledNb, $Conv_URS::NOS1_NUM)
			erreur_660004477 = i_set_art_field(g_iartout9, $Conv_URS::NOS1_INF, adrcallednb_660004477)
			trace("[Tvpn5_tr] ***** msisdn 4 = CalledNb normalise")
			erreur_660004477 = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS1,$Tvpn5::msisdnNorm,-$NORM:CMM_NDE,0)
		FINSI
	FINSI
	
	SI TYPE_FC_660004477 || TYPE_RCF_660004477 || TYPE_VN_660004477
	ALORS
		erreur_660004477 = i_dup_chp_1val(g_iartout, g_iartout9, $Tvpn5::OrigCalledNb, $Conv_URS::NOS1_NUM)
		erreur_660004477 = i_set_art_field(g_iartout9, $Conv_URS::NOS1_INF, adrorigcallednb_660004477)
		trace("[Tvpn5_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,$Tvpn5::msisdnNorm,-$NORM:CMM,0)
		erreur_660004477 = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS1,$Tvpn5::msisdnNorm,-$NORM:CMM_NDE_ORI,0)
	FINSI
#G3R8 lot1 normalisation CallingNb pour TYPE_SMS
   SI TYPE_SMS_660004477
   ALORS
        erreur_660004477 = i_dup_chp_1val(g_iartout, g_iartout9, $Tvpn5::CallingNb, $Conv_URS::NOS1_NUM)
        erreur_660004477 = i_set_art_field(g_iartout9, $Conv_URS::NOS1_INF, adrcallingnb_660004477)
        trace("[Tvpn5_tr] ***** msisdn 2 = CallingNb normalise")
        erreur_660004477 = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS1,$Tvpn5::msisdnNorm,-$NORM:CMM,0)
   FINSI


FINSI

SI ( erreur_660004477 != 0)
ALORS
	code_rejet_660004477 = 0x5011
	i_strcpy(pt_chp_660004477," champ pour msisdn ")
	erreur_660004477 = i_PlvMessEmettre(6104,2,g_iartin,"",2,code_rejet_660004477,pt_chp_660004477, 0)
	trace("[Tvpn5_tr] :Erreur Normalisation champ pour msisdn")
	SAUT STOCKE_ERRONE
FINSI


############  Sdmsisdn secondaryMSISDN avec NOS2 (lg=200 bits)
# G3R5 lot2 BTelU Normalisation V3t36 SdmsisdnNorm
SI TYPE_PU_660004477
ALORS
	erreur_660004477 = i_dup_chp_1val(g_iartout, g_iartout9, $Tvpn5::PickingUpNb, $Conv_URS::NOS2_NUM)
	erreur_660004477 = i_set_art_field(g_iartout9, $Conv_URS::NOS2_INF,addrpickingupnb_660004477)
	trace("[Tvpn5_tr] ***** secondaryMSISDN   = PickingUpNb normalise ")
	#G5R2 lot2 automate specifique pour PickingUpNb
	#erreur = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS2,$Tvpn5::SdmsisdnNorm,-$NORM:CMM_NDE,0)
	erreur_660004477 = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS2,$Tvpn5::SdmsisdnNorm,-$NORM:CMM_PUNB,0)
	SI ( erreur_660004477 != 0)
	ALORS
		code_rejet_660004477 = 0x5011
		i_strcpy(pt_chp_660004477," champ PickingUpNb pour secondaryMSISDN ")
		erreur_660004477 = i_PlvMessEmettre(6104,2,g_iartin,"",2,code_rejet_660004477,pt_chp_660004477, 0)
		trace("[Tvpn5_tr] :Erreur Normalisation champ PickingUpNb pour secondaryMSISDN")
		SAUT STOCKE_ERRONE
	FINSI
# QC1167, alarme 1444 : entree lg(SdmsisdnNorm)=152 bits, dpvgsm T3t36 lg(secondaryMSISDN)=72bits
	longueur_660004477 = i_get_art_field(g_iartout, $Tvpn5::SdmsisdnNorm -1)
	SI (longueur_660004477 > 9)
	ALORS
		longueur_660004477 = 9
		erreur_660004477 = i_resize_tlv(g_iartout, "T4SdmsisdnNorm", "SdmsisdnNorm", longueur_660004477 * 8)
	FINSI
SINON
#Fin G3R5 lot2 
	SI TYPE_VN_660004477
	ALORS
		erreur_660004477 = i_dup_chp_1val(g_iartout, g_iartout9, $Tvpn5::CallingNb, $Conv_URS::NOS2_NUM)
		erreur_660004477 = i_set_art_field(g_iartout9, $Conv_URS::NOS2_INF, adrcallingnb_660004477)
		#	trace("[Tvpn5_tr] ***** SdmsisdnNorm 1 = CallingNb normalise")
		#G5R2 lot2 utilisation de l'automateCalling Number
		#erreur = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS2,$Tvpn5::SdmsisdnNorm,-$NORM:CMM_NDE,0)
		erreur_660004477 = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS2,$Tvpn5::SdmsisdnNorm,-$NORM:CMM,0)
		SI ( erreur_660004477 != 0)
		ALORS
			code_rejet_660004477 = 0x5011
			i_strcpy(pt_chp_660004477," champ CallingNb pour secondaryMSISDN ")
			erreur_660004477 = i_PlvMessEmettre(6104,2,g_iartin,"",2,code_rejet_660004477,pt_chp_660004477, 0)
			trace("[Tvpn5_tr] :Erreur Normalisation champ CallingNb pour secondaryMSISDN")
			SAUT STOCKE_ERRONE
		FINSI
# QC1167, alarme 1444 : entree lg(SdmsisdnNorm)=152 bits, dpvgsm T3t36 lg(secondaryMSISDN)=72bits
	  longueur_660004477 = i_get_art_field(g_iartout, $Tvpn5::SdmsisdnNorm -1)
	  SI (longueur_660004477 > 9)
	  ALORS
	  	longueur_660004477 = 9
	  	erreur_660004477 = i_resize_tlv(g_iartout, "T4SdmsisdnNorm", "SdmsisdnNorm", longueur_660004477 * 8)
	  FINSI
	SINON
#G3R8 lot1 BtelU Sonnerie Simultan?e
#----		
		SI calltype_660004477 == 0x0105
		ALORS
		 	erreur_660004477 = i_dup_chp_1val(g_iartout, g_iartout9, $Tvpn5::CalledNb, $Conv_URS::NOS1_NUM)
			erreur_660004477 = i_set_art_field(g_iartout9, $Conv_URS::NOS1_INF, adrcallednb_660004477)
			trace("[Tvpn5_tr] ***** secondaryMSISDN = CalledNb normalise")
			erreur_660004477 = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS1,$Tvpn5::SdmsisdnNorm,-$NORM:CMM_NDE,0)
			SI ( erreur_660004477 != 0)
			ALORS
				code_rejet_660004477 = 0x5011
				i_strcpy(pt_chp_660004477," champ CalledNb pour secondaryMSISDN ")
				erreur_660004477 = i_PlvMessEmettre(6104,2,g_iartin,"",2,code_rejet_660004477,pt_chp_660004477, 0)
				trace("[Tvpn5_tr] :Erreur Normalisation champ CalledNb pour secondaryMSISDN")
				SAUT STOCKE_ERRONE
			FINSI
# QC1167, alarme 1444 : entree lg(SdmsisdnNorm)=152 bits, dpvgsm T3t36 lg(secondaryMSISDN)=72bits
			longueur_660004477 = i_get_art_field(g_iartout, $Tvpn5::SdmsisdnNorm -1)
			SI (longueur_660004477 > 9)
			ALORS
				longueur_660004477 = 9
				erreur_660004477 = i_resize_tlv(g_iartout, "T4SdmsisdnNorm", "SdmsisdnNorm", longueur_660004477 * 8)
			FINSI
#\G3R8 lot1 BtelU Sonnerie Simultan?e
#----		
		SINON		
			SI (i_valid_field_n(g_iartout, $Tvpn5::AddCallingNb))
			ALORS
				erreur_660004477 = i_dup_chp_1val(g_iartout, g_iartout9, $Tvpn5::AddCallingNb, $Conv_URS::NOS2_NUM)
				erreur_660004477 = i_set_art_field(g_iartout9, $Conv_URS::NOS2_INF, adraddcallingnb_660004477)
				trace("[Tvpn5_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,$Tvpn5::SdmsisdnNorm,-$NORM:CMM_NDE,0)
				erreur_660004477 = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS2,$Tvpn5::SdmsisdnNorm,-$NORM:CMM_ADD,0)
				SI ( erreur_660004477 != 0)
				ALORS
					code_rejet_660004477 = 0x5011
					i_strcpy(pt_chp_660004477," champ AddCallingNb pour secondaryMSISDN ")
					erreur_660004477 = i_PlvMessEmettre(6104,2,g_iartin,"",2,code_rejet_660004477,pt_chp_660004477, 0)
					trace("[Tvpn5_tr] :Erreur Normalisation champ AddCallingNb pour secondaryMSISDN")
					SAUT STOCKE_ERRONE
				FINSI
# QC1167, alarme 1444 : entree lg(SdmsisdnNorm)=152 bits, dpvgsm T3t36 lg(secondaryMSISDN)=72bits
			  longueur_660004477 = i_get_art_field(g_iartout, $Tvpn5::SdmsisdnNorm -1)
			  SI (longueur_660004477 > 9)
			  ALORS
			  	longueur_660004477 = 9
			  	erreur_660004477 = i_resize_tlv(g_iartout, "T4SdmsisdnNorm", "SdmsisdnNorm", longueur_660004477 * 8)
			  FINSI
			SINON
			#G1R6
				SI (i_valid_field_n(g_iartout, $Tvpn5::TrfNb))
				ALORS
					erreur_660004477 = i_dup_chp_1val(g_iartout, g_iartout9, $Tvpn5::TrfNb, $Conv_URS::NOS2_NUM)
					adrtrfnb_660004477 = i_get_art_field(g_iartout, $Tvpn5::AdrTrfNb)
					erreur_660004477 = i_set_art_field(g_iartout9, $Conv_URS::NOS2_INF, adrtrfnb_660004477)
					trace("[Tvpn5_tr] ***** SdmsisdnNorm 1 = TrfNb normalise")
					#G5R2 lot2 automate specifique pour TrfNb
					#erreur = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS2,$Tvpn5::SdmsisdnNorm,-$NORM:CMM_NDE,0)
					erreur_660004477 = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS2,$Tvpn5::SdmsisdnNorm,-$NORM:CMM_TRF,0)
					SI ( erreur_660004477 != 0)
					ALORS
						code_rejet_660004477 = 0x5011
						i_strcpy(pt_chp_660004477," champ TrfNb pour secondaryMSISDN ")
						erreur_660004477 = i_PlvMessEmettre(6104,2,g_iartin,"",2,code_rejet_660004477,pt_chp_660004477, 0)
						trace("[Tvpn5_tr] :Erreur Normalisation champ TrfNb pour secondaryMSISDN")
						SAUT STOCKE_ERRONE
					FINSI
# QC1167, alarme 1444 : entree lg(SdmsisdnNorm)=152 bits, dpvgsm T3t36 lg(secondaryMSISDN)=72bits
			    longueur_660004477 = i_get_art_field(g_iartout, $Tvpn5::SdmsisdnNorm -1)
			    SI (longueur_660004477 > 9)
			    ALORS
			    	longueur_660004477 = 9
			    	erreur_660004477 = i_resize_tlv(g_iartout, "T4SdmsisdnNorm", "SdmsisdnNorm", longueur_660004477 * 8)
			    FINSI
				SINON
					erreur_660004477 = i_supprChamp(g_iartout, "T4SdmsisdnNorm")
				FINSI
			FINSI
		FINSI
	FINSI
FINSI

############  SMSmsisdn SMSrecepMSISDN avec NOS5 (lg=200 bits)
SI (i_valid_field_n(g_iartout, $Tvpn5::Clck2CallInt))
ALORS
	erreur_660004477 = i_dup_chp_1val(g_iartout, g_iartout9, $Tvpn5::Clck2CallInt, $Conv_URS::NOS5_NUM)
	adrckcallint_660004477 = i_get_art_field(g_iartout, $Tvpn5::AdrCkCallInt)
	erreur_660004477 = i_set_art_field(g_iartout9, $Conv_URS::NOS5_INF, adrckcallint_660004477)
	#trace("[Tvpn5_tr] ***** SMSmsisdnNorm 1 = Clck2CallInt normalise")
	#G5R2 lot2 automate specifique pour Clck2CallInt
	#erreur = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS5,$Tvpn5::SMSmsisdnNorm,-$NORM:CMM,0)
	erreur_660004477 = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS5,$Tvpn5::SMSmsisdnNorm,-$NORM:CMM_CALLINT,0)
	SI ( erreur_660004477 != 0)
	ALORS
		code_rejet_660004477 = 0x5011
		i_strcpy(pt_chp_660004477," champ Clck2CallInt pour SMSrecepMSISDN ")
		erreur_660004477 = i_PlvMessEmettre(6104,2,g_iartin,"",2,code_rejet_660004477,pt_chp_660004477, 0)
		trace("[Tvpn5_tr] :Erreur Normalisation champ Clck2CallInt pour SMSrecepMSISDN")
		SAUT STOCKE_ERRONE
	FINSI
# QC1167, alarme 1444 : entree lg(SMSmsisdnNorm)=152 bits, dpvgsm T3t33 lg(SMSrecepMSISDN)=128 bits
	longueur_660004477 = i_get_art_field(g_iartout, $Tvpn5::SMSmsisdnNorm -1)
	SI (longueur_660004477 > 16)
	ALORS
		longueur_660004477 = 16
		erreur_660004477 = i_resize_tlv(g_iartout, "T4SMSmsisdnNorm", "SMSmsisdnNorm", longueur_660004477 * 8)
	FINSI
SINON
	erreur_660004477 = i_supprChamp(g_iartout, "T4SMSmsisdnNorm")
FINSI

############ idpart avec NOS3 (lg=200 bits)
erreur_660004477 = i_get_art_str(g_iartout, $Tvpn5::CalledNb, pt_1_660004477)
i_get_sub_str(pt_1_660004477, 0, 2, pt_deb1_660004477)
i_get_sub_str(pt_1_660004477, 0, 3, pt_deb2_660004477)
flag_idpart_660004477=0
SI TYPE_OC_660004477 
ALORS
	SI ( i_strcmp("706", pt_1_660004477) == 0 )         || ( i_strcmp("0706", pt_1_660004477) == 0 )   ||
		( i_strcmp("756", pt_1_660004477) == 0 )    || ( i_strcmp("0756", pt_1_660004477) == 0 )   ||
		( i_strcmp("888", pt_1_660004477) == 0 )    || ( i_strcmp("0888", pt_1_660004477) == 0 )   ||
		( i_strcmp("712", pt_1_660004477) == 0 )    || ( i_strcmp("0712", pt_1_660004477) == 0 )   ||
		( i_strcmp("118", pt_1_660004477) == 0 )    || ( i_strcmp("0118", pt_1_660004477) == 0 )   ||
		( i_strcmp("118", pt_deb1_660004477) == 0 ) || ( i_strcmp("0118", pt_deb2_660004477) == 0 )
	ALORS
		erreur_660004477 = i_dup_chp_1val(g_iartout, g_iartout9, $Tvpn5::CalledNb, $Conv_URS::NOS3_NUM)
		erreur_660004477 = i_set_art_field(g_iartout9, $Conv_URS::NOS3_INF, adrcallednb_660004477)
		trace("[Tvpn5_tr] ***** idpartNorm SPECIAL 0 = CalledNb special normalise")
		erreur_660004477 = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS3,$Tvpn5::idpartNorm,-$NORM:CMM_SPEC,0)
	SINON
		flag_idpart_660004477=1
	FINSI

FINSI

SI flag_idpart_660004477==1
ALORS
	SI (i_valid_field_n(g_iartout, $Tvpn5::TransNb))
	ALORS
		erreur_660004477 = i_dup_chp_1val(g_iartout, g_iartout9, $Tvpn5::TransNb, $Conv_URS::NOS3_NUM)
		erreur_660004477 = i_set_art_field(g_iartout9, $Conv_URS::NOS3_INF, adrtransnb_660004477)
		trace("[Tvpn5_tr] ***** idpartNorm 0 = TransNb normalise")
		erreur_660004477 = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS3,$Tvpn5::idpartNorm,-$NORM:CMM_TRANS,0)
	SINON
		erreur_660004477 = i_dup_chp_1val(g_iartout, g_iartout9, $Tvpn5::CalledNb, $Conv_URS::NOS3_NUM)
		erreur_660004477 = i_set_art_field(g_iartout9, $Conv_URS::NOS3_INF, adrcallednb_660004477)
		trace("[Tvpn5_tr] ***** idpartNorm 0 = CalledNb normalise")
		erreur_660004477 = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS3,$Tvpn5::idpartNorm,-$NORM:CMM_NDE,0)
	FINSI
FINSI
# G3R5 lot2 BTelU normalisation CallingNb
SI TYPE_FC_660004477 || TYPE_IWC_660004477 || TYPE_TC_660004477 ||TYPE_RCF_660004477 || TYPE_PU_660004477
	ALORS
	erreur_660004477 = i_get_art_str(g_iartout,$Tvpn5::CallingNb,pt_CallingNb_660004477)
	#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_660004477 = i_adequation_chaine_expreg(pt_CallingNb_660004477, "^0*$")
	SI (erreur_660004477 == 0)
		ALORS
		longueur_660004477 = i_strlen(pt_CallingNb_660004477)
		erreur_660004477 = i_resize_tlv(g_iartout9, "T2nos3", "NOS3_NUM", longueur_660004477 * 8)
		erreur_660004477 = i_dup_chp_1val(g_iartout, g_iartout9, $Tvpn5::CallingNb, $Conv_URS::NOS3_NUM)
		erreur_660004477 = i_set_art_field(g_iartout9, $Conv_URS::NOS3_INF, 0x00)
		trace("[Tvpn5_tr] ***** idpartNorm 0 = CallingNb normalise par IDENT2")
		erreur_660004477 = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS3,$Tvpn5::idpartNorm,-$NORM:IDENT2,0)
	SINON
		longueur_660004477 = i_strlen(pt_CallingNb_660004477)
		erreur_660004477 = i_resize_tlv(g_iartout9, "T2nos3", "NOS3_NUM", longueur_660004477 * 8)
		erreur_660004477 = i_dup_chp_1val(g_iartout, g_iartout9, $Tvpn5::CallingNb, $Conv_URS::NOS3_NUM)
		erreur_660004477 = i_set_art_field(g_iartout9, $Conv_URS::NOS3_INF, adrcallingnb_660004477)
		trace("[Tvpn5_tr] ***** idpartNorm 0 = CallingNb normalise")
		erreur_660004477 = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS3,$Tvpn5::idpartNorm,-$NORM:CMM,0)
	FINSI
FINSI

#G3R8 lot1 ajout de TYPE_SMS pour la normalisation de idpart	
SI TYPE_VN_660004477 || TYPE_SMS_660004477
ALORS
	trace ("<<__LINE__>> G3R8 BtelUSMS console ============normalisation CalledNb TYPE_SMS=====================")
	erreur_660004477 = i_dup_chp_1val(g_iartout, g_iartout9, $Tvpn5::CalledNb, $Conv_URS::NOS3_NUM)
	erreur_660004477 = i_set_art_field(g_iartout9, $Conv_URS::NOS3_INF, adrcallednb_660004477)
	trace("[Tvpn5_tr] ***** idpartNorm 0 = CalledNb normalise")
	erreur_660004477 = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS3,$Tvpn5::idpartNorm,-$NORM:CMM_NDE,0)
FINSI

SI ( erreur_660004477 != 0)
ALORS
	code_rejet_660004477 = 0x5011
	i_strcpy(pt_chp_660004477," champ pour idpart ")
	erreur_660004477 = i_PlvMessEmettre(6104,2,g_iartin,"",2,code_rejet_660004477,pt_chp_660004477, 0)
	trace("[Tvpn5_tr] :Erreur Normalisation champ pour idpart")
	SAUT STOCKE_ERRONE
FINSI

############ local  avec NOS4  (lg=200 bits)
SI ( (TYPE_OC_660004477 || TYPE_IWC_660004477 || TYPE_VN_660004477) && (i_valid_field_n(g_iartout, $Tvpn5::LocationNb)))
	ALORS
  #G5R2 lot2 si Location Number 62* ou 63*
	erreur_660004477 = i_get_art_str(g_iartout, $Tvpn5::LocationNb, pt_1_660004477)
	i_get_sub_str(pt_1_660004477, 0, 1, pt_deb1_660004477)
	SI ( i_strcmp("62", pt_deb1_660004477) == 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("[Tvpn5_tr] localNorm  = 20888")
		erreur_660004477 = i_resize_tlv(g_iartout, "T4localNorm", "localNorm", 6*4)
	SINON
		SI ( i_strcmp("63", pt_deb1_660004477) == 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("[Tvpn5_tr] localNorm  = 20813")
			erreur_660004477 = i_resize_tlv(g_iartout, "T4localNorm", "localNorm", 6*4)
		SINON
			erreur_660004477 = i_dup_chp_1val(g_iartout, g_iartout9, $Tvpn5::LocationNb, $Conv_URS::NOS4_NUM)
			erreur_660004477 = i_set_art_field(g_iartout9, $Conv_URS::NOS4_INF, adrlocationnb_660004477)
			trace("[Tvpn5_tr] ***** local 0  = LocationNb normalise")
			erreur_660004477 = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS4,$Tvpn5::localNorm,-$NORM:CMM_LOCAL,0)
			SI ( erreur_660004477 != 0)
				ALORS
				code_rejet_660004477 = 0x5011
				i_strcpy(pt_chp_660004477," champ LocationNb ")
				erreur_660004477 = i_PlvMessEmettre(6104,2,g_iartin,"",2,code_rejet_660004477,pt_chp_660004477, 0)
				trace("[Tvpn5_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_660004477 = i_get_art_field(g_iartout, $Tvpn5::localNorm -1)
		SI (longueur_660004477 > 9)
			ALORS
			longueur_660004477 = 9
			erreur_660004477 = i_resize_tlv(g_iartout, "T4localNorm", "localNorm", longueur_660004477 * 8)
		FINSI
	FINSI
FINSI

SI TYPE_TC_660004477 ||(TYPE_OC_660004477 && (!i_valid_field_n(g_iartout, $Tvpn5::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("[Tvpn5_tr] localNb 1  = 208010000000")
	erreur_660004477 = i_resize_tlv(g_iartout, "T4localNorm", "localNorm", 12*4)

FINSI

SI TYPE_FC_660004477 || TYPE_RCF_660004477
	ALORS
	SI (i_valid_field_n(g_iartout, $Tvpn5::TransNb))
		ALORS
		erreur_660004477 = i_dup_chp_1val(g_iartout, g_iartout9, $Tvpn5::TransNb, $Conv_URS::NOS4_NUM)
		erreur_660004477 = i_set_art_field(g_iartout9, $Conv_URS::NOS4_INF, adrtransnb_660004477)
		trace("[Tvpn5_tr] ***** local 2  = TransNb normalise ")
		erreur_660004477 = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS4,$Tvpn5::localNorm,-$NORM:CMM_TRANS,0)
		SI ( erreur_660004477 != 0)
			ALORS
			code_rejet_660004477 = 0x5011
			i_strcpy(pt_chp_660004477," champ TransNb pour local ")
			erreur_660004477 = i_PlvMessEmettre(6104,2,g_iartin,"",2,code_rejet_660004477,pt_chp_660004477, 0)
			trace("[Tvpn5_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_660004477 = i_get_art_field(g_iartout, $Tvpn5::localNorm -1)
	  SI (longueur_660004477 > 9)
	  ALORS
	  	longueur_660004477 = 9
	  	erreur_660004477 = i_resize_tlv(g_iartout, "T4localNorm", "localNorm", longueur_660004477 * 8)
	  FINSI
	SINON
		erreur_660004477 = i_dup_chp_1val(g_iartout, g_iartout9, $Tvpn5::CalledNb, $Conv_URS::NOS4_NUM)
		erreur_660004477 = i_set_art_field(g_iartout9, $Conv_URS::NOS4_INF, adrcallednb_660004477)
		trace("[Tvpn5_tr] ***** local 3  = CalledNb normalise")
		erreur_660004477 = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS4,$Tvpn5::localNorm,-$NORM:CMM_NDE,0)
		SI ( erreur_660004477 != 0)
			ALORS
			code_rejet_660004477 = 0x5011
			i_strcpy(pt_chp_660004477," champ CalledNb pour local ")
			erreur_660004477 = i_PlvMessEmettre(6104,2,g_iartin,"",2,code_rejet_660004477,pt_chp_660004477, 0)
			trace("[Tvpn5_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_660004477 = i_get_art_field(g_iartout, $Tvpn5::localNorm -1)
	  SI (longueur_660004477 > 9)
	  ALORS
	  	longueur_660004477 = 9
	  	erreur_660004477 = i_resize_tlv(g_iartout, "T4localNorm", "localNorm", longueur_660004477 * 8)
	  FINSI
	FINSI
FINSI
#G3R5 lot2 BTelU normalisation PickingUpNb
SI TYPE_PU_660004477
ALORS
	erreur_660004477 = i_dup_chp_1val(g_iartout, g_iartout9, $Tvpn5::PickingUpNb, $Conv_URS::NOS4_NUM)
	erreur_660004477 = i_set_art_field(g_iartout9, $Conv_URS::NOS4_INF,addrpickingupnb_660004477)
	trace("[Tvpn5_tr] ***** local   = PickingUpNb normalise ")
	#G5R2 lot2 automate specifique pour PickingUpNb
	#erreur = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS4,$Tvpn5::localNorm,-$NORM:CMM_NDE,0)
	erreur_660004477 = i_dup_chp_rnisGSM(g_iartout9, g_iartout,$Conv_URS::NOS4,$Tvpn5::localNorm,-$NORM:CMM_PUNB,0)
	SI ( erreur_660004477 != 0)
	ALORS
		code_rejet_660004477 = 0x5011
		i_strcpy(pt_chp_660004477," champ PickingUpNb pour local ")
		erreur_660004477 = i_PlvMessEmettre(6104,2,g_iartin,"",2,code_rejet_660004477,pt_chp_660004477, 0)
		trace("[Tvpn5_tr] :Erreur Normalisation champ PickingUpNb pour local")
		SAUT STOCKE_ERRONE
	FINSI
# QC1167, alarme 1444 : entree lg(localNorm)=152 bits, dpvgsm T3t3 lg(local)=72 bits
	longueur_660004477 = i_get_art_field(g_iartout, $Tvpn5::localNorm -1)
	SI (longueur_660004477 > 9)
	ALORS
		longueur_660004477 = 9
		erreur_660004477 = i_resize_tlv(g_iartout, "T4localNorm", "localNorm", longueur_660004477 * 8)
	FINSI
FINSI
#/QC999
#/Fin G3R5 lot2 normalisation PickingUpNb

############ ax_idemet
# G3R1 lot4
i_strcpy(pt_idemet_660004477, "")
i_strcpy(pt_1_660004477, "")
erreur_660004477 = i_format_str2( pt_1_660004477, "%s%s", "AX_IDEMET_", i_LireEECSGTQS(g_ieec))

i_strcpy(pt_idemet_660004477, i_get_tab_field("VariableContexte", ICAR_ABS_660004477, pt_1_660004477))

# AX_IDEMET resultat fonction recherchevaleurcleftable T3t1/V3t1.3
SI (i_strcmp(pt_idemet_660004477,g_inull) != 0) 
ALORS
	trace2("[Tvpn5_dis] OK code idemet <%s> trouve dans la table",pt_idemet_660004477,"")
	longueur_660004477= 0
	longueur_660004477=i_strlen(pt_idemet_660004477)
	erreur_660004477 = i_set_art_str(g_iartout9,$Conv_URS::recipAddAlp, pt_idemet_660004477)
	index_660004477=0
	POINT BOUCLE0
	SI (index_660004477 < longueur_660004477)
	ALORS
		SI (g_iartout9.recipAddHex[index_660004477] < 0x3A)
		ALORS
			g_iartout.ax_idemet[index_660004477]=g_iartout9.recipAddHex[index_660004477] - 0x30
		FINSI
		SI (g_iartout9.recipAddHex[index_660004477] > 0x40) && (g_iartout9.recipAddHex[index_660004477] < 0x47)
		ALORS
			g_iartout.ax_idemet[index_660004477]=g_iartout9.recipAddHex[index_660004477] - 0x37
		FINSI
		SI (g_iartout9.recipAddHex[index_660004477] > 0x60) && (g_iartout9.recipAddHex[index_660004477] < 0x67)
		ALORS
			g_iartout.ax_idemet[index_660004477]=g_iartout9.recipAddHex[index_660004477] - 0x57
		FINSI
		index_660004477=index_660004477+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_660004477 = 5
	POINT BOUCLE1
	SI index_660004477 < 11
	ALORS
		g_iartout.ax_idemet[index_660004477]= 0x0
		index_660004477 = index_660004477 + 1
		SAUT BOUCLE1
	FINSI
FINSI


#G3R5 lot2 NetCause les DC inefficaces ne sont pas transmis aux appli - elimine divers

SI (netcause_660004477 == 0x01 || netcause_660004477 == 0x10 || netcause_660004477 == 0x11 || netcause_660004477 == 0x13 || netcause_660004477 == 0x14 || netcause_660004477 ==0xFF) 
ALORS
	SAUT STOCKE_ELM
FINSI




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


########### Date_Audit
date_audit_gmt_660004477 = i_date_audit()
date_audit_660004477 = i_DHgetLocalTime(NUMTAB_660004477, 7, date_audit_gmt_660004477)
trace1("[Tvpn5_tr] date_audit=%x",date_audit_660004477)

#G3R5 lot2 BTelU ajout du Type TYPE_PU (X=0x02) pour incrementer le cpt 

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

Y_660004477=g_ieec
X_660004477=0
Z_660004477=0
# SI TYPE_OC FO 650
SI TYPE_OC_660004477 || TYPE_VN_660004477
ALORS
	X_660004477=0x00
SINON
	SI TYPE_IWC_660004477 || TYPE_TC_660004477
	ALORS
		X_660004477=0x01
	SINON
		SI TYPE_FCC_660004477 || TYPE_RCF_660004477 || TYPE_PU_660004477
		ALORS
			X_660004477=0x02
		SINON
			SI TYPE_FCI_660004477
			ALORS
				X_660004477=0x06
			SINON
			     SI TYPE_SMS_660004477
			     ALORS
				   X_660004477=0x11
			     SINON
				   code_rejet_660004477 = 0x5041
				   i_strcpy(pt_chp_660004477,"TYPE appel non prevu")
				   erreur_660004477 = i_PlvMessEmettre(6102,2,g_iartin,"",2,code_rejet_660004477,pt_chp_660004477, 0)
				   SAUT STOCKE_ERRONE
				FINSI
			FINSI
		FINSI
	FINSI
FINSI

erreur_660004477=i_incr_cpt(CPT_660004477,X_660004477,Y_660004477,Z_660004477,date_audit_660004477,INCREMENT_660004477)
erreur_660004477 = i_stocke_art(g_iartout, 0, PT_OK, 0)
RETOUR TRAIT_OK


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

POINT   STOCKE_ERRONE

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

erreur_660004477 = i_make_art_rej(g_iartin, g_iartout5, code_rejet_660004477)
erreur_660004477 = i_stocke_art(g_iartout5, 0, PT_ERRONE, 0)

RETOUR TRAIT_OK

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

POINT STOCKE_ELM

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

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

#POINT STOCKE_DIV

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