To totally unlock this section you need to Log-in
Login
Asterisk allows people to communicate using the internet. It is one of the cheapest ways to talk. The PC clients connect to each other through an Asterisk server which uses a Linux/Unix OS.
Asterisk calls can be passed through different channel protocols. The most popular forms of calls are H323, SIP, IAX or Zap. Depending on the type of channel you use, the user must have the appropriate software to handle the call type.
Example:
If you are a registered on an Asterisk PBX(or other PBX) as a SIP user, you are required to use a SIP phone client such as Idefisk 2.0 or SIPPS. Or, if you are registered as an IAX user you must use an IAX phone client such as iaxcomm.
SIP/IAX Client Configuration
Now, we will describe how you can register SIP and IAX users. This includes the adjustment of all Asterisk and client phone settings.
First, make sure Asterisk is installed. Most of the files to be modified are stored in /etc/asterisk.
To make calls with this kind of telephone system you should have the following:
- Connectivity to a Asterisk PBX for call handling.
- Users using PCs with SoftPhones for calling internally and externally.
All configuration information for the Asterisk PBX knows is written to the conf files located in /etc/asterisk.
Example:
All information for SIP users is stored in sip.conf and for IAX users in iax.conf. Numbers are read from extensions.conf. Voicemails are stored in voicemail.conf etc.
To place a call through Asterisk, registration to Asterisk is not required. However, you do need a username and password which will allow you to call someone who is registered.
To receive a call, you must be a registered user and have an extension.
To Register SIP Users
All users must be registered in sip.conf and all valid extensions must be declared in extensions.conf.
Follow these steps for:
- Registering a user in sip.conf.
- Registering a number in extensions.conf.
Go to the /etc/asterisk directory on your Asterisk server. Open sip.conf and register the following test user.
Note that ALL characters after ‘;’ (semi-colomn) are interpreted by Asterisk as a comment.
- [ivan]: This means we are registering user 'ivan'.
- type=friend: This means the user can place or receive calls. For INBOUND calls only, use ‘peer’ as type. For OUTBOUND calls only use ‘user’ as type.
- username=ivan: This declares that our user will be named 'ivan'.
- secret=pwd_ivan: This creates the password for the user to login/authenticate on Asterisk.
- host=dynamic: This sets dynamic IP for the host. You may also define this as a static IP.
- context=tutorial: This defines the dial context for the user which in this case is tutorial. In Asterisk, outgoing numbers are divided in groups called contexts in order to separate/define different needs for different user types. For example, a context for local calls, another for within the city, and another for international calls and so on.
This completes the user registration process on Asterisk. Now let us register an extension for the user.
Go to /etc/asterisk and open extensions.conf:
- [tutorial]: This registers the context ‘tutorial’.
- exten => 1234,1,Dial(SIP/ivan): When dialing number 1234, Asterisk will first Dial the user through SIP protocol.
The command is : exten => number, priority, Dial(protocol/user). The priority determines the sequence in which the extensions will be executed.
We now have a registered SIP user and extension on Asterisk. Follow this same process to register another SIP user and extension in order to place test calls.
Start by registering the second user in the same way in /etc/asterisk/sip.conf:
Register the extension (4321) in /etc/asterisk/extensions.conf in the same context = tutorial.
Now when user 'ivan' or any other user from the tutorial context dials 4321, the user 'test' will be called.
The final step is to register the user to a compatible softphone. However, softphones will be reviewed later. For now, just make sure you have registered the users and extensions.
To Register IAX Users
IAX (Inter Asterisk Exchange) is another imortant protocol supported by Asterisk. To use this type of communication the users must be registered in /etc/asterisk/iax.conf.
Follow these steps for:
- Registering a user in iax.conf
- Registering a number in extensions.conf
To Register a user in iax.conf:
Create user 'ivan_iax' with the same username and join it to the tutorial context. Set the host IP to dynamic and create a password as described previously.
The user is 'ivan_iax' and type is 'friend' again (Inbound/Oubound calls allowed). Secret equals your chosen password, host equals 'dynamic IP' and context is 'tutorial'.
Now register a second IAX user following the same steps.
To call the first user 'ivan_iax' dial 1111. Note that the Dial command when using IAX2 protocol is : Dial(IAX2/username@username):
To call the second registered user, create extension 2222.
You have completed the registration of 4 users (2 SIP/2 IAX) and 4 extensions. Now, you must reload Asterisk. When any change is made in conf files from /etc/asterisk/ or changes that relate with some of these files, you must type 'reload' in the Asterisk Command Line Interface (CLI) to make the changes effective.
The users and extensions are now registered on Asterisk but the users must also be registered on a SIP or IAX client softphone.