thanks for writing to us.
the nature of pain seems to be pleuritic. it means the pain seems to be origination from inflammation of the thin membranous covering around lung, known as pleura
. since its there for nearly 2 months and there may be an underlying problem of the lungs (as suggested by presence of cough/phlegm) it is very much advisable to see your physician / pulmonologist and proceed accordingly.
for any issues after consultation, please do write to us.