Commit 12709772 authored by Ikram Haq's avatar Ikram Haq
Browse files

Fix CallbackReference issue

parent 892230c8
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -1258,11 +1258,11 @@ func checkNotificationPeriodicTrigger1() {
			periodicNotif.LocationInfo = &locationInfo
			periodicNotif.IsFinalNotification = false
			periodicNotif.Links = periodicCheck.Subscription.Links
			periodicNotif.NotificationType = "userLocationPeriodicSubscription"
			subsIdStr := strconv.Itoa(subsId)
			periodicNotif.CallbackData = periodicCheck.Subscription.CallbackReference.CallbackData
			var inlinePeriodicSubscriptionNotification InlineUserLocationPeriodicNotification
			inlinePeriodicSubscriptionNotification.UserLocationPeriodicNotification = &periodicNotif
			sendSubscriptionNotification1(periodicCheck.Subscription.CallbackReference.NotifyURL, inlinePeriodicSubscriptionNotification)
			sendSubscriptionNotification1(periodicCheck.Subscription.CallbackReference, inlinePeriodicSubscriptionNotification)
			log.Info("Periodic Notification"+"("+subsIdStr+") For ", periodicCheck.Subscription.Address)
		}
	}
@@ -3718,7 +3718,7 @@ func handleUserLocationPeriodicSubscription(w http.ResponseWriter, requestBody [
			}

			// Validate mandatory properties
			if periodicSub.CallbackReference == nil || periodicSub.CallbackReference.NotifyURL == "" {
			if periodicSub.CallbackReference == "" {
				log.Error("Mandatory CallbackReference parameter not present")
				errHandlerProblemDetails(w, "Mandatory CallbackReference parameter not present", http.StatusBadRequest)
				return
@@ -4144,7 +4144,7 @@ func handleUserLocationPeriodicSubscriptionPut(w http.ResponseWriter, requestBod
				errHandlerProblemDetails(w, err.Error(), http.StatusInternalServerError)
				return
			}
			if periodicSub.CallbackReference == nil || periodicSub.CallbackReference.NotifyURL == "" {
			if periodicSub.CallbackReference == "" {
				log.Error("Mandatory CallbackReference parameter not present")
				errHandlerProblemDetails(w, "Mandatory CallbackReference parameter not present", http.StatusBadRequest)
				return
+3 −2
Original line number Diff line number Diff line
@@ -13,7 +13,8 @@ type UserLocationPeriodicSubscription struct {
	Links *Links `json:"_links,omitempty"`
	// Address of user (e.g. ‘sip’ URI, ‘tel’ URI, ‘acr’ URI) to monitor.
	Address string `json:"address"`
	CallbackReference *CallbackReference `json:"callbackReference"`
	// URI exposed by the client on which to receive notifications via HTTP. See note 1.
	CallbackReference string `json:"callbackReference,omitempty"`
	// A correlator that the client can use to tag this particular resource representation during a request to create a resource on the server. See note 2.
	ClientCorrelator string `json:"clientCorrelator,omitempty"`