Take your headphones and insert and remove them several times. If that doesn't work then do the same thing with the 30 pin dock connector (don't have it plugged in) several times.
Basically those are the two areas, when water damaged, that cause that issue. So if you don't have water damage, then it is possible you have something that is shorting across the connector and by plugging and unplugging it might cause the debris to clear.