My wife's iPhone had a hard life from our 18 month and four year old granddaughters constantly watching Sesame Street videos or playing educational apps. It was in an OtterBox which had protected it from dozens of falls, but the speaker audio finally quit. It was a blessing of sorts, ("Sorry sweetie, Elmo lost his voice" ;-( ) but it then became useless as my wife's phone because it couldn't ring, either.
I eliminated an open speaker by ohming that out, then tried every trick on the web to bring the speaker audio back. I was able to rule out a stuck headphone indication (by the lack of the screen indication when adjusting the volume with phones plugged in,) but not a short in the dock connector creating a permanently docked condition. The connector was full of crud, slobber, and food particles and no doubt had a few thousand mate/unmate cycles on it. I cleared it with compressed air, then alcohol on a small swab but to no avail. The price of the replacement part on iFixit was right, so I replaced it on speculation. The replacement connector was new and worked just fine, but didn't bring Elmo's voice or the ringer back.
Never throw an old iPhone away. My iPhone 4 was eligible for an upgrade so AT&T re-provisioned it to my wife's number and it became hers (no value in letting the kids play with a new iPhone 5.) The silent iPhone 3 was one of our original two that had suffered a cracked screen and been replaced by an earlier upgrade but which I had kept for parts. Its logic board followed the new dock connector into the silent phone and voila!, sound. The phone went back into the OtterBox. Even without a SIM card, it still runs the educational apps and Elmo videos as long as it has a WiFi connection - better yet, the girls can't burn through the cellular data plan when with Grandma in the car! I further disabled the GSM antenna lest the younger one accidentally dial 911, at least unless she's right beneath a cell site. The 4-year old knows how and when to do that, but will have to be told to find Mom or Grandma's phone first. Hopefully, she'll never need to.