While in the classical theory of whispering gallery waves it is assumed that they propagate along a cylindrical perfectly reflecting wall, in many real situations it is important to consider similar waves propagating along penetrable interfaces or curvilinear level sets of the refractive index. An example of waves of the latter kind are whispering gallery modes formed in a shallow-water waveguide due to the horizontal refraction. Such modes are counterpart of quasistationary states in quantum mechanics, as they do not exponentially decay at infinity, and their respective eigenvalues are complex. Recently it was shown that Maslov canonical operator (MCO) theory can be used to compute uniform asymptotic expansions of the solutions to various wave propagation problems. Such approximations admit convenient analytical representation in terms of special functions that can be used for investigating their properties and for other purposes. The MCO theory is applicable only in cases where the solution exponentially decays at infinity, e.g., for computing bound states of a given quantum system. Nevertheless, the technique outlined here allows to obtain analytical expressions for the radial profiles of whispering gallery modes propagating along a penetrable wall or along a curvilinear level set of the refractive index.