Ted worries when the Captain contacts him out of the blue on How I Met Your Mother. "The Ashtray" is the 17th episode of the show's eighth season.
Added:

How I Met Your Mother Season 8 Episode 17 Quotes

Ted: That's weird, I have a message.
Marshall: That's weird, you still have an answering machine.

Ted: Oh boy that was a crazy story.
Barney: Oh boy, yeah I remember.
Ted: You weren't there.
Barney: Ted, bubala, if you have a crazy story, I was there. It's just the law of the universe.