It could be a simple as changing out the jack.
Or it could be the head set carp attached to the phone if there is one.
I had a phone doing the same thing and i finally tired a different head set after replacing the cable, jack, phone and station port. Bingo it was the headset causing the problem