Commit 43d5b9e3 authored by Simon Pastor's avatar Simon Pastor
Browse files

pulling out location service changes, since it fits any POA

parent aac10688
Loading
Loading
Loading
Loading
+2 −12
Original line number Diff line number Diff line
@@ -263,18 +263,8 @@ func getNetworkLocation(name string) (zone string, netLoc string, err error) {
		err = errors.New("Error casting context for: " + name)
		return
	}
	if sbi.activeModel.GetNodeType(name) == mod.NodeTypeUE {
		if sbi.activeModel.GetNodeType(nodeCtx.Parents[mod.NetLoc]) == mod.NodeTypePoaCell { 
	zone = nodeCtx.Parents[mod.Zone]
	netLoc = nodeCtx.Parents[mod.NetLoc]
		} else {
			zone = ""
			netLoc = ""
		}
	} else {
		zone = nodeCtx.Parents[mod.Zone]
                netLoc = nodeCtx.Parents[mod.NetLoc]
	}
	return zone, netLoc, nil
}

+11 −19
Original line number Diff line number Diff line
@@ -349,11 +349,6 @@ func checkNotificationRegisteredZoneStatus(zoneId string, apId string, nbUsersIn

func checkNotificationRegisteredUsers(oldZoneId string, newZoneId string, oldApId string, newApId string, userId string) {

	//if a zone is null, means going in/out of the 3gpp network, so no notification
	if newZoneId == "" || oldZoneId == "" {
		return
	}

	//check all that applies
	for subsId, value := range userSubscriptionMap {
		if value == userId {
@@ -373,7 +368,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)
@@ -382,6 +377,7 @@ func checkNotificationRegisteredUsers(oldZoneId string, newZoneId string, oldApI
					sendNotification(subscription.CallbackReference.NotifyURL, context.TODO(), subsIdStr, zonal)
					log.Info("User Notification" + "(" + subsIdStr + "): " + "Entering event in zone " + newZoneId + " for user " + userId)
				}
				if oldZoneId != "" {
					if userSubscriptionLeavingMap[subsId] != "" {
						zonal.ZoneId = oldZoneId
						zonal.CurrentAccessPointId = oldApId
@@ -391,6 +387,7 @@ func checkNotificationRegisteredUsers(oldZoneId string, newZoneId string, oldApI
						sendNotification(subscription.CallbackReference.NotifyURL, context.TODO(), subsIdStr, zonal)
						log.Info("User Notification" + "(" + subsIdStr + "): " + "Leaving event in zone " + oldZoneId + " for user " + userId)
					}
				}
			} else {
				if newApId != oldApId {
					if userSubscriptionTransferringMap[subsId] != "" {
@@ -457,11 +454,6 @@ func sendStatusNotification(notifyUrl string, ctx context.Context, subscriptionI

func checkNotificationRegisteredZones(oldZoneId string, newZoneId string, oldApId string, newApId string, userId string) {

	//if a zone is null, means going in/out of the 3gpp network, so no notification
	if newZoneId == "" || oldZoneId == "" {
		return
	}

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