You should make the judgment about the degree of rotational restraint available at the ends which can be based on calculations, intuition or experience. It depends on the end conditions:
single span with both ends of beam supported on masonry >>> no rotational restraint
beam's end is supported on RCC columns>>> rotational restraint is available and depends on the relative stiffness of column to beam; one can use software, moment distribution method (MDM), or experience to get the distribution of moment between support and midspan.
beam's end is continuous over support, meaning there is another beam on adjacent span>>> rotational restraint is available and depends on the span and depth of adjacent beam; again use software, MDM or moment coefficients from ACI or other similar source for moment coefficients.