DEFINITION CPT_1501_840000616 1501
DEFINITION TYPE_EDS_ZB_E_840000616 0x01
DEFINITION MODULE_TRAIT_840000616 0x5000
DEFINITION ERR_TAILLE_840000616 0x050
DEFINITION ERR_SYNTAX_840000616 0x070
DEFINITION ERR_CROISE_840000616 0x0F0
REGISTRE ENTIER erreur_840000616
REGISTRE ENTIER callEvStarTime_present_840000616
REGISTRE ENTIER recEntityType_present_840000616
REGISTRE ENTIER sender_present_840000616
REGISTRE ENTIER IMSI_present_840000616
REGISTRE ENTIER val_modifList_840000616
REGISTRE ENTIER val_defCallHand_840000616
REGISTRE ENTIER val_servLevel_840000616
REGISTRE ENTIER val_recEntityType_840000616
REGISTRE ENTIER val_recEntityCode_840000616
REGISTRE ENTIER recEntityCode_present_840000616
REGISTRE ENTIER val_bearerCode_840000616
REGISTRE ENTIER val_tlservCode_840000616
REGISTRE ENTIER val_radioChnlUsed_840000616
REGISTRE ENTIER indice_octet_840000616
REGISTRE ENTIER taille_callRefNb_840000616
REGISTRE ENTIER caract_840000616
REGISTRE POINTEUR pt_str_840000616
REGISTRE POINTEUR pt_codetype_840000616
REGISTRE ENTIER code_rejet_840000616
REGISTRE ENTIER EFFICACE_840000616
REGISTRE ENTIER MODULE_840000616
REGISTRE ENTIER ERREUR_840000616
####################################################################
#	Traitement: Ttap310ZB_E_trt.src,  Article EDS Zones Blanches Entrant (TAP 3.10)
#
#	Creation : 15/09/05 Par : AE
# 19/01/11 - BEA - G3R1 lot4 Verification/Correction des variables (constantes, entiers, pointeurs)
# 07/02/11 - QC821 : modifification pointeur pt_codetype de 2000 (evolution spec)
####################################################################





trace("Ttap310ZB_E : Debut Traitement")

# Initialisations

EFFICACE_840000616 = 1
MODULE_840000616 = MODULE_TRAIT_840000616
ERREUR_840000616 = 0
code_rejet_840000616 = 0

pt_codetype_840000616="pt_codetype123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"
i_strcpy(pt_codetype_840000616,"")

pt_str_840000616 = "pt_str7890123456789012345678901234567890123456789012345678901234"
i_strcpy(pt_str_840000616,"")

#####################################################################
# Controle syntaxique de l'article
#####################################################################

#
# Test de la validite du champ callEvStarTime
# Si champ absent -> errone

callEvStarTime_present_840000616 = i_valid_field_n(g_iartin,$Ttap310ZB_E::callEvStarTime)
SI (!callEvStarTime_present_840000616)
ALORS
	trace("Ttap310ZB_E :champ callEvStarTime absent => ERRONE")
	ERREUR_840000616 = ERR_SYNTAX_840000616
	code_rejet_840000616 = MODULE_840000616 + ERREUR_840000616 + EFFICACE_840000616
	erreur_840000616=i_PlvMessEmettre(8060, 2 , g_iartin, "", 2, code_rejet_840000616, "callEvStarTime", 0)
	SAUT STOCKE_ERRONE
FINSI

#
# Test de la validite du champ sender
# Si champ absent -> errone

sender_present_840000616 =  i_valid_field_n(g_iartin,$Ttap310ZB_E::sender)
SI (!sender_present_840000616)
ALORS
	trace("Ttap310ZB_E :champ sender absent => ERRONE")
	ERREUR_840000616 = ERR_SYNTAX_840000616
	code_rejet_840000616 = MODULE_840000616 + ERREUR_840000616 + EFFICACE_840000616
	erreur_840000616=i_PlvMessEmettre(8060, 2 , g_iartin, "", 2, code_rejet_840000616, "sender", 0)
	SAUT STOCKE_ERRONE
FINSI

#
# Test de la validite du champ recEntityType
# Si champ absent -> errone

recEntityType_present_840000616 = i_valid_field_n(g_iartin,$Ttap310ZB_E::recEntityType)
SI (!recEntityType_present_840000616)
ALORS
	trace("Ttap310ZB_E :champ recEntityType absent => ERRONE")
	ERREUR_840000616 = ERR_SYNTAX_840000616
	code_rejet_840000616 = MODULE_840000616 + ERREUR_840000616 + EFFICACE_840000616
	erreur_840000616=i_PlvMessEmettre(8060, 2 , g_iartin, "", 2, code_rejet_840000616, "recEntityType", 0)
	SAUT STOCKE_ERRONE
FINSI

#
# Test de la validite du champ recEntityCode
# Si champ absent -> errone

recEntityCode_present_840000616 = i_valid_field_n(g_iartin,$Ttap310ZB_E::recEntityCode)
SI (!recEntityCode_present_840000616)
ALORS
	trace("Ttap310ZB_E :champ recEntityCode absent => ERRONE")
	ERREUR_840000616 = ERR_SYNTAX_840000616
	code_rejet_840000616 = MODULE_840000616 + ERREUR_840000616 + EFFICACE_840000616
	erreur_840000616=i_PlvMessEmettre(8060, 2 , g_iartin, "", 2, code_rejet_840000616, "recEntityCode", 0)
	SAUT STOCKE_ERRONE
FINSI


#
# Test de la validite du champ IMSI
# Si champ IMSI absent -> errone

IMSI_present_840000616 = i_valid_field_n(g_iartin,$Ttap310ZB_E::IMSI)
SI (!IMSI_present_840000616)
ALORS
	trace("Ttap310ZB_E :champ IMSI absent => ERRONE")
	ERREUR_840000616 = ERR_SYNTAX_840000616
	code_rejet_840000616 = MODULE_840000616 + ERREUR_840000616 + EFFICACE_840000616
	erreur_840000616=i_PlvMessEmettre(8061, 2 , g_iartin, "", 2, code_rejet_840000616, "IMSI", 0)
	SAUT STOCKE_ERRONE
FINSI

#
# Test de validite du champ recEntityCode
#

SI(!i_valid_field_n(g_iartin,$Ttap310ZB_E::recEntityCode))
ALORS
	trace("Ttap310 ZB ,Champ recEntityCode absent =>ERRONE")
	ERREUR_840000616 = ERR_SYNTAX_840000616
	code_rejet_840000616 = MODULE_840000616 + ERREUR_840000616 + EFFICACE_840000616
	erreur_840000616=i_PlvMessEmettre(8061, 2 , g_iartin, "", 2, code_rejet_840000616, "recEntityCode", 0)
	SAUT STOCKE_ERRONE
FINSI

#####################################################################
# Fin controle syntaxique de l'article
#####################################################################

#####################################################################
# Controles semantiques de l'article
#####################################################################
#
# Test semantique champ callRefNb
#
SI (i_valid_field_n(g_iartin,$Ttap310ZB_E::callRefNb))
ALORS
	taille_callRefNb_840000616 = i_get_art_field(g_iartin,$Ttap310ZB_E::callRefNb-1)
	SI (taille_callRefNb_840000616 > 32)
	ALORS
		trace("Ttap310ZB_E :Erreur champ callRefNb depassement la taille du champ en sortie")
		ERREUR_840000616 = ERR_TAILLE_840000616
		code_rejet_840000616 = MODULE_840000616 + ERREUR_840000616 + EFFICACE_840000616
		erreur_840000616=i_PlvMessEmettre(8063, 2 , g_iartin, "", 3, code_rejet_840000616, "callRefNb",taille_callRefNb_840000616)
		SAUT STOCKE_ERRONE
	FINSI

# cas ou callRefNb est de taille impaire => erreur
	SI ((taille_callRefNb_840000616 % 2) == 1)
	ALORS
		trace("Ttap310ZB_E :Erreur champ callRefNb de taille impaire")
		ERREUR_840000616 = ERR_TAILLE_840000616
		code_rejet_840000616 = MODULE_840000616 + ERREUR_840000616 + EFFICACE_840000616
		erreur_840000616=i_PlvMessEmettre(8064, 2 , g_iartin, "", 3, code_rejet_840000616, "callRefNb",taille_callRefNb_840000616)
		SAUT STOCKE_ERRONE
	FINSI

	indice_octet_840000616 = 0
	POINT BOUCLE_CALLREFNB

	SI (indice_octet_840000616 < taille_callRefNb_840000616)
	ALORS
		caract_840000616 = i_get_field_char_780042429(g_iartin,$Ttap310ZB_E::callRefNb,indice_octet_840000616)
		#caract = i_get_art_fieldtab(g_iartin,$Ttap310ZB_E::callRefNb,indice_octet)
		SI ( ((caract_840000616 < 0x30)||(caract_840000616 > 0x39))&&((caract_840000616 < 0x61) || (caract_840000616 > 0x66))&&((caract_840000616 < 0x41)||(caract_840000616 > 0x46)) )
		ALORS
			trace("Ttap310ZB_E :Erreur champ callRefNb contient un digit incorrect")
			ERREUR_840000616 = ERR_SYNTAX_840000616
			code_rejet_840000616 = MODULE_840000616 + ERREUR_840000616 + EFFICACE_840000616
			erreur_840000616=i_PlvMessEmettre(8065, 2 , g_iartin, "", 2, code_rejet_840000616, "callRefNb", 0)
			SAUT STOCKE_ERRONE
		FINSI
		indice_octet_840000616 = indice_octet_840000616 + 1
		SAUT BOUCLE_CALLREFNB
	FINSI
FINSI

#
# Test semantique champ recEntityType
#
val_recEntityCode_840000616 =  i_get_art_field(g_iartin,$Ttap310ZB_E::recEntityCode)
#-- appel a la fonction getType pour extraire le recEntityType correspondant a recEntityCode=recEntityCode_CDR
erreur_840000616=i_get_field_str(g_iartin,"recEntityType",pt_codetype_840000616)
val_recEntityType_840000616=getType_780042429(pt_codetype_840000616,val_recEntityCode_840000616)
SI(val_recEntityType_840000616 !=0x01)
ALORS
	trace1("Ttap310ZB_E :Mauvaise valeur champ recEntityType: <0x%x>",val_recEntityType_840000616)
	SAUT STOCKE_ELIMINE
FINSI

#
# Test semantique champ sender
#
erreur_840000616 = i_get_field_str(g_iartin,"sender",pt_str_840000616)
SI ( (i_strcmp(pt_str_840000616,"FRAF3")) && (i_strcmp(pt_str_840000616,"FRAF2")) )
ALORS
	trace("Ttap310ZB_E : Mauvaise valeur champ sender")
	SAUT STOCKE_ELIMINE
FINSI

#
# Test semantique si tlservCode et bearerCode sont renseignes => Erreur
#
val_tlservCode_840000616 = i_get_art_field(g_iartin,$Ttap310ZB_E::tlservCode)
SI ((val_tlservCode_840000616 & 0xFF) != 0xFF)
ALORS
	val_bearerCode_840000616 = i_get_art_field(g_iartin,$Ttap310ZB_E::bearerCode)
	SI ((val_bearerCode_840000616 & 0xFF) != 0xFF)
	ALORS
		ERREUR_840000616 = ERR_CROISE_840000616
		code_rejet_840000616 = MODULE_840000616 + ERREUR_840000616 + EFFICACE_840000616
		erreur_840000616=i_PlvMessEmettre(8067, 2 , g_iartin, "", 3, code_rejet_840000616, val_tlservCode_840000616, val_bearerCode_840000616)
		SAUT STOCKE_ERRONE
	FINSI
FINSI

#
# Test semantique champ tlservCode
#
SI (i_valid_field_n(g_iartin,$Ttap310ZB_E::tlservCode))
ALORS
	val_tlservCode_840000616 = i_get_art_field(g_iartin,$Ttap310ZB_E::tlservCode)
	SI ( (val_tlservCode_840000616!=0x11) && (val_tlservCode_840000616!=0x12) && (val_tlservCode_840000616!=0x21)
		&& (val_tlservCode_840000616!=0x22) && (val_tlservCode_840000616!=0x61) && (val_tlservCode_840000616!=0x62)
		&& (val_tlservCode_840000616!=0x63) && (val_tlservCode_840000616!=0xFF) )
	ALORS
		trace1("Ttap310ZB_E :Mauvaise valeur champ tlservCode : <0x%x>",val_tlservCode_840000616)
		SAUT STOCKE_ELIMINE
	FINSI
FINSI

#
# Test semantique champ radioChnlUsed
#
SI (i_valid_field_n(g_iartin,$Ttap310ZB_E::radioChnlUsed))
ALORS
	val_radioChnlUsed_840000616 = i_get_art_field(g_iartin,$Ttap310ZB_E::radioChnlUsed)
	SI ( (val_radioChnlUsed_840000616!=0x00) && (val_radioChnlUsed_840000616!=0x01) )
	ALORS
		trace1("Ttap310ZB_E : Mauvaise valeur champ radioChnlUsed : <0x%x>",val_radioChnlUsed_840000616)
		SAUT STOCKE_ELIMINE
	FINSI
FINSI

#
# Test semantique champ C_servLevel
#
SI (i_valid_field_n(g_iartin,$Ttap310ZB_E::C_servLevel))
ALORS
	val_servLevel_840000616 = i_get_art_field(g_iartin,$Ttap310ZB_E::C_servLevel)
	SI ( (val_servLevel_840000616!=0x00) && (val_servLevel_840000616!=0x01)
		&& (val_servLevel_840000616!=0x02) && (val_servLevel_840000616!=0x03) )
	ALORS
		trace1("Ttap310ZB_E : Mauvaise valeur champ C_servLevel : <0x%x>",val_servLevel_840000616)
		SAUT STOCKE_ELIMINE
	FINSI
FINSI

#
# Test semantique champ defCallHand
#
SI (i_valid_field_n(g_iartin,$Ttap310ZB_E::defCallHand))
ALORS
	val_defCallHand_840000616 = i_get_art_field(g_iartin,$Ttap310ZB_E::defCallHand)
	SI ( (val_defCallHand_840000616!=0x00) && (val_defCallHand_840000616!=0x01) )
	ALORS
		trace1("Ttap310ZB_E : Mauvaise valeur champ defCallHand : <0x%x>",val_defCallHand_840000616)
		SAUT STOCKE_ELIMINE
	FINSI
FINSI

#
# Test semantique champ C_modifList
#
SI (i_valid_field_n(g_iartin,$Ttap310ZB_E::C_modifList))
ALORS
	val_modifList_840000616 = i_get_art_field(g_iartin,$Ttap310ZB_E::C_modifList)
	SI ( (val_modifList_840000616 < 0x00) || (val_modifList_840000616 > 0x07) )
	ALORS
		trace1("Ttap310ZB_E : Mauvaise valeur champ C_modifList : <0x%x>",val_modifList_840000616)
		SAUT STOCKE_ELIMINE
	FINSI
FINSI


#####################################################################
# FIN tests semantiques
#####################################################################

trace( "Ttap310ZB_E :Fin Traitement Stockage de l article en OK" )
#erreur = i_isolate_large_PDU(g_iartin)
erreur_840000616 = i_stocke_art(g_iartin, 0, PT_OK, 0)
erreur_840000616=i_incr_cpt(CPT_1501_840000616, TYPE_EDS_ZB_E_840000616, g_ieec, 0, i_DHgetLocalTime(4, 7, i_date_audit()), 1)
RETOUR TRAIT_OK

POINT STOCKE_ERRONE
trace( "Ttap310ZB_E :Fin Traitement Stockage de l article en ERRONE" )
#erreur = i_isolate_large_PDU(g_iartin)
erreur_840000616 = i_make_art_rej(g_iartin, g_iartout, code_rejet_840000616)
erreur_840000616 = i_stocke_art(g_iartout, 0, PT_ERRONE, 0)
RETOUR TRAIT_OK

POINT STOCKE_ELIMINE
trace( "Ttap310ZB_E :Fin Traitement Stockage de l article en ELIMINE" )
#erreur = i_isolate_large_PDU(g_iartin)
erreur_840000616 = i_stocke_art(g_iartin, 0, PT_DIVERS, 0)
RETOUR TRAIT_OK
#---------------------------------- Fin Ttap310ZB_E_trt.src ----------------------------
