Unverified Commit 3074039b authored by Kevin Di Lallo's avatar Kevin Di Lallo Committed by GitHub
Browse files

Merge pull request #91 from pastorsx/sp_dev_loc-serv-rnis-remove-ue

Dynamic Addition/Removal UE triggers a cell change for RNIS and Location service
parents 5382ac81 209f5bab
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 {
+3 −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,8 @@ func updateUserInfo(address string, zoneId string, accessPointId string) {
		oldZoneId = userInfo.ZoneId
		oldApId = userInfo.AccessPointId

		if zoneId != "" {
		userInfo.ZoneId = zoneId
		}
		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")
+14 −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
@@ -351,14 +350,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"
)