Purchase in a specialty store a standard telephone socket. Install it. If in the future you will change phone, then you do not need to understand the Pinout of the cables.
Telephone line connect to the red and green wiresm, located in the outlet is standard. In connector RJ-11/RJ-12 is consistent with the average, 3 and 4 contacts. Currently, there are telephones in which the connection is made through the 2 and 5 contacts. Most of these machines are made in Germany. They occur very rarely. Illustrative example - Actron AB with digital answering machine and menu in German language. This handset is unlikely to succeed plugging in a standard way. Cable replacement will also not help. The machine is used 2 and 5 pins in the connector, and phone cable 1-to-1. To connect such a device, you must open the socket and instead of a green wire to use black. Also instead of the red wire – yellow. Using the red lead goes to "minus" on the phone line, and through the green, plus. The vast majority of cases, the polarity of inclusion is not so important. However, sometimes you can find such phones, which won't work if connected incorrectly.
To determine the polarity in a phone line you can use a normal Chinese tester. If connected incorrectly, it will show a negative voltage value. If the tester at hand, use ordinary potatoes. Cut it in half and insert the two wires. About "plus" end has to change color. Most often, the polarity of the no one pays attention.