Asterisk is a software implementation of a telephone private branch exchange (PBX); it was created in 1999 by Mark Spencer of Digium. Like any PBX, it allows attached telephones to make calls to one another, and to connect to other telephone services including the public switched telephone network (PSTN) and Voice over Internet Protocol (VoIP) services. Its name comes from the asterisk symbol, “*”. – Source : http://en.wikipedia.org/wiki/Asterisk_(PBX)
When I learned about Asterisk, I wanted to try connecting 2 phones on my local LAN and try making a call between them. I just thought the whole exercise would be fun and it was fun indeed.
Asterisk makes it very easy to build a telephone network just using one computer as the Asterisk Server.
Following are the steps:
I am using Linux Mint as the Asterisk Server and following is the command to install Asterisk:
sudo apt-get install asterisk
All Asterisk configuration files can be found under /etc/asterisk
Edit sip.conf and enter the following:
 type=friend host=dynamic username=1000 secret=1000  type=friend host=dynamic username=1001 secret=1001
We have created 2 users and have set their properties. Consider the 2 users as the 2 telephone extensions in the network.
type=friend - This means that the extension can make and receive calls.
host=dynamic - This is how the devices register with the Asterisk Server. When set to dynamic the devices can be register with a different IP each time the connect to the server.
Edit extensions.conf and enter the following:
[default] exten=>1000,1,Dial(SIP/1000) exten=>1001,1,Dial(SIP/1001)
Once these files have been edited to look as above you can reload the configurations for the Asterisk Server from the Asterisk CLI.
To start the CLI use the following command:
Once you are in you can reload the configurations simply by issuing the “reload” command.
We can now exit from the Asterisk CLI and go ahead and configure the 2 Soft Phones to connect to the server.
I used Linphone softphone for Linux for this. You can install Linphone using the following command:
sudo apt-get install linphone
Once installed start the Linphone Client :
As you can see I have configured a new contact in this client to point to extension 1001. Following is the configuration for extension 1001.
The identity for this client is 1000. Configuration details for the current identity is as follows:
Similarly you can configure another softphone client as identity 1001. Next, you can add the contact details of extension 1000 in the second client. Once you have done this you can call between the two clients. The calls are routed by the Asterisk Server.
I was even able to test this with 2 physical VOIP phones connected to the same network as the server and it worked really well.
It was fun doing this and seeing the phones actually ring !
Do let me know if you need any information.