I suspect its a mating call. The male woodpecker is showing off his work ethic to any female in listening range, hence the pipe medium as water is an excellent conductor of sound.
Thats Right!!!
A bird would never bang her head against a healthy tree because nothing good will come ot of it. Birds look for hollow and sick trees to search for bugs and a pipe sounds like one.