Telephone transmit speech messages along wires by means of electrical signals. They were invented as long ago as 1876. In the handset of a telephone are a loudspeaker and a very small microphone, which contains granules of carbon. When you talk into the microphone the sound waves of your voice cause a metal diaphragm to vibrate and it presses against the carbon granules. The vibrations vary depending on the sound. They change the very small amount of current flowing out along the wires to the receiver of another telephone.
When the electric current carrying the signal reaches the receiver handset, the same variations in the current run through an electromagnet. This causes another diaphragm to vibrate in the earpiece, accurately reproducing the sound of the speaker’s voice.
Complex switching is needed to allow the call you make to reach the right person.