Commit 59a897a0 authored by Simon Pastor's avatar Simon Pastor
Browse files

add or remove ue triggers cell change for rnis and for loc-serv

parent 5382ac81
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -130,6 +130,8 @@ func processActiveScenarioTerminate() {
func processActiveScenarioUpdate() {
	log.Debug("processActiveScenarioUpdate")

	formerUeNameList := sbi.activeModel.GetNodeNames("UE")

	// Sync with active scenario store
	sbi.activeModel.UpdateScenario()

@@ -161,6 +163,22 @@ func processActiveScenarioUpdate() {
		uePerNetLocMap[netLoc]++
	}

	//only find UEs that were removed, check that former UEs are in new UE list
	foundOldInNewList := false
	for _, oldUe := range formerUeNameList {
		foundOldInNewList = false
		for _, newUe := range ueNameList {
			if newUe == oldUe {
				foundOldInNewList = true
				break
			}
		}
		if !foundOldInNewList {
			sbi.updateUserInfoCB(oldUe, "", "")
			log.Info("Ue removed : ", oldUe)
		}
	}

	// Update POA-CELL info
	poaNameList := sbi.activeModel.GetNodeNames("POA-CELL")
	for _, name := range poaNameList {
+7 −8
Original line number Diff line number Diff line
@@ -321,7 +321,6 @@ func checkNotificationRegisteredUsers(oldZoneId string, newZoneId string, oldApI

	//check all that applies
	for subsId, value := range userSubscriptionMap {

		if value == userId {

			subsIdStr := strconv.Itoa(subsId)
@@ -339,7 +338,7 @@ func checkNotificationRegisteredUsers(oldZoneId string, newZoneId string, oldApI
			zonal.CallbackData = subscription.ClientCorrelator

			if newZoneId != oldZoneId {
				if userSubscriptionEnteringMap[subsId] != "" {
				if userSubscriptionEnteringMap[subsId] != "" && newZoneId != "" {
					zonal.ZoneId = newZoneId
					zonal.CurrentAccessPointId = newApId
					event := new(clientNotifOMA.UserEventType)
@@ -1266,12 +1265,12 @@ func updateUserInfo(address string, zoneId string, accessPointId string) {
		oldZoneId = userInfo.ZoneId
		oldApId = userInfo.AccessPointId

		if zoneId != "" {
		//	if zoneId != "" {
		userInfo.ZoneId = zoneId
		}
		if accessPointId != "" {
		//	}
		//	if accessPointId != "" {
		userInfo.AccessPointId = accessPointId
		}
		//	}

		//updateDB
		_ = rc.JSONSetEntry(baseKey+typeUser+":"+address, ".", convertUserInfoToJson(userInfo))
+19 −5
Original line number Diff line number Diff line
@@ -133,14 +133,13 @@ func processActiveScenarioTerminate() {
}

func processActiveScenarioUpdate() {

	log.Debug("processActiveScenarioUpdate")

	formerUeNameList := sbi.activeModel.GetNodeNames("UE")

	sbi.activeModel.UpdateScenario()
	processScenarioUpdate()
}

func processScenarioUpdate() {
	// Update scenario Name that needs to be accessed by the NBI
	scenarioName := sbi.activeModel.GetScenarioName()
	sbi.updateScenarioNameCB(scenarioName)

@@ -172,13 +171,28 @@ func processScenarioUpdate() {
							cellId = domain.CellularDomainConfig.DefaultCellId
						}
					}

					sbi.updateUeEcgiInfoCB(name, mnc, mcc, cellId)
				}
			}
		}
	}

	//only find UEs that were removed, check that former UEs are in new UE list
	foundOldInNewList := false
	for _, oldUe := range formerUeNameList {
		foundOldInNewList = false
		for _, newUe := range ueNameList {
			if newUe == oldUe {
				foundOldInNewList = true
				break
			}
		}
		if !foundOldInNewList {
			sbi.updateUeEcgiInfoCB(oldUe, "", "", "")
			log.Info("Ue removed : ", oldUe)
		}
	}

	// Update Edge App info
	meAppNameList := sbi.activeModel.GetNodeNames("EDGE-APP")
	ueAppNameList := sbi.activeModel.GetNodeNames("UE-APP")
+16 −5
Original line number Diff line number Diff line
@@ -159,7 +159,6 @@ func updateUeEcgiInfo(name string, mnc string, mcc string, cellId string) {
		oldPlmnMcc = ecgiInfo.Plmn.Mcc
		oldCellId = ecgiInfo.CellId[0]
	}

	//updateDB if changes occur
	if newEcgi.Plmn.Mnc != oldPlmnMnc || newEcgi.Plmn.Mcc != oldPlmnMcc || newEcgi.CellId[0] != oldCellId {
		//updateDB
@@ -305,8 +304,10 @@ func checkNotificationRegisteredSubscriptions(appId string, assocId *AssociateId

			if match && ((sub.FilterCriteria.Plmn == nil) || (sub.FilterCriteria.Plmn != nil && ((newPlmn != nil && newPlmn.Mnc == sub.FilterCriteria.Plmn.Mnc && newPlmn.Mcc == sub.FilterCriteria.Plmn.Mcc) || (oldPlmn != nil && oldPlmn.Mnc == sub.FilterCriteria.Plmn.Mnc && oldPlmn.Mcc == sub.FilterCriteria.Plmn.Mcc)))) {
				match = true

			} else {
				match = false

			}

			//loop through all cellIds
@@ -351,14 +352,24 @@ func checkNotificationRegisteredSubscriptions(appId string, assocId *AssociateId

				var newEcgi clientNotif.Ecgi
				var notifNewPlmn clientNotif.Plmn
				if newPlmn != nil {
					notifNewPlmn.Mnc = newPlmn.Mnc
					notifNewPlmn.Mcc = newPlmn.Mcc
				} else {
					notifNewPlmn.Mnc = ""
					notifNewPlmn.Mcc = ""
				}
				newEcgi.Plmn = &notifNewPlmn
				newEcgi.CellId = []string{newCellId}
				var oldEcgi clientNotif.Ecgi
				var notifOldPlmn clientNotif.Plmn
				if oldPlmn != nil {
					notifOldPlmn.Mnc = oldPlmn.Mnc
					notifOldPlmn.Mcc = oldPlmn.Mcc
				} else {
					notifOldPlmn.Mnc = ""
					notifOldPlmn.Mcc = ""
				}
				oldEcgi.Plmn = &notifOldPlmn
				oldEcgi.CellId = []string{oldCellId}

+1 −1
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ var redisTable = 0

const (
	NodeTypePoa     = "POA"
	NodeTypePoaCell = "POA CELLULAR"
	NodeTypePoaCell = "POA-CELL"
	NodeTypeUE      = "UE"
)