During the Tanzimat period (1839–1876), the government's series of constitutional reforms led to a fairly modern conscripted army, banking system reforms, the decriminalisation of homosexuality, the replacement of religious law with secular law and guilds with modern factories. The Ottoman Ministry of Post was established in Istanbul in 1840. American inventor Samuel Morse received an Ottoman patent for the telegraph in 1847, which was issued by Sultan Abdülmecid who personally tested the new invention. The reformist period peaked with the Constitution, called the "Kanûn-u Esâsî". The empire's First Constitutional era was short-lived. The parliament survived for only two years before the sultan suspended it.