Two multifrequency campaigns were carried out on OJ287 in 2005: in April when it was in its pre-outburst state, and in November during the main 12 yr cycle outburst. The wavelength coverage was from radio to X-rays. In the optical-to-ultraviolet range, the differential spectrum between the observations has a bremsstrahlung spectral shape, consistent with gas at 3 × 105 K temperature. Our result supports the hydrogen column density of the OJ287 host galaxy of ∼9.3 × 1020 cm−2, the average value found by Ghosh & Soundararajaperumal. The 3 × 105 K bremsstrahlung radiation was predicted in the binary black hole model of OJ287, and it arises from a hot bubble of gas which is torn off the accretion disc by the impact of the secondary. As this radiation is not Doppler boosted, the brightness of the outburst provides an estimate for the mass of the secondary black hole, ∼1.4 × 108 M⊙. In order to estimate the mass of the primary black hole, we ask what is the minimum mass ratio in a binary system which allows the stability of the accretion disc. By using particle simulations, we find that the ratio is ∼1.3 × 102. This makes the minimum mass of the primary ∼1.8 × 1010 M⊙, in agreement with the mass determined from the orbit solution, 1.84 × 1010 M⊙. With this mass value and the measured K magnitude of the bulge of the host galaxy of OJ287, the system lies almost exactly on the previously established correlation in the black hole mass versus K-magnitude diagram. It supports the extension of this correlation to brighter magnitudes and to more massive black holes than has been done previously.