           util.log("#{deviceId}: inform (#{reqParams.eventCodes}); retry count #{reqParams.retryCount}")
 
         updateDevice(deviceId, {'inform' : true, 'parameterValues' : reqParams.informParameterValues}, (err) ->
-          res = tr069.response(reqParams.sessionId, resParams, cookies)
+          res = tr069.response(sessionId, resParams, cookies)
           writeResponse response, res
         )
         return


  if Object.keys(resParams).length > 0
    memcached.set(String(task._id), task, config.CACHE_DURATION, (err, result) ->
      res = tr069.response(reqParams.sessionId, resParams, {task : String(task._id)})
      writeResponse response, res
    )
    return


      if count == 0
        util.log("#{deviceId}: new device detected")
        devicesCollection.update({'_id' : deviceId}, {'$set' : updates}, {upsert: true, safe: true}, (err) ->
          if err?
            callback(err) if callback?
            return
