The idea that there ought to be a hotline between the White House and the Kremlin was a direct consequence of the Cuban crisis. It was discussed by JFK as early as 12 December 1962.
A memorandum to that effect was signed between the two superpowers on 23 June 1963.
There was no such thing as a "red telephone", but, in order to avoid any possible and dangerous misunderstanding between the two powers, a teletypewriter was activated on 30 August 1963.
It was used for the first time during the June 1967 Arab-Israeli war.
In 1984, President Reagan suggested that a fax be added.
A new line between the respective Departments of Defence was activated ten years later, and similar connexions were established between Moscow and Beijing, Moscow and Paris, Moscow and Berlin, as well as between Washington and Beijing.