In early episodes of 'I Love Lucy', the Ricardos' phone number was Murray Hill 5-9975, then Circle 7-2099, then Murray Hill 5-9099. Knowing that the numbers would be called by many viewers, Desilu Productions worked with the phone company. They were given numbers to use that had not been assigned to anyone yet. As the numbers were needed, the Ricardos were given new numbers.
In a recent episode of 'Scrubs', Turk gets his ideal cell phone number -- 916-CALL-TURK (actually, CALL TUR, but he hoped people would dial the 'K', to which JD responds, 'I'll always dial the K for you.'). This is an actual number, and many people have called it. It usually gives you a recorded message about Scrubs (including, at one point, a pitch about voting for them for the People's Choice Awards), but it's also sometimes answered by a member of cast or crew. The phone is kept on the set and if somebody's passing by and in the mood, they'll answer it.