Obstruction of the salivary glands or ducts prevents the flow of saliva, resulting in pain and swelling. The pain and swelling will get worse over time if left untreated. Often the affected salivary gland also becomes infected.