1) SIP section [general]
Before we start registering endpoint devices, let's define the basic variables that will enable the registration of those devices. Below you will find a basic list with a brief explanation.
2) Local SIP extension
Below you will find a basic list of variables necessary to register a telephone, gateway, or other receiving endpoint device.
3) Connection to an external VOIP server
Below you will find a basic list of variables that will enable you to connect to an external VOIP server. You can enable communication e.g. with your VOIP service provider or another Asterisk server in another location (for the purpose of eg. making free local calls between units).
Depending on the configuration, authorization can be achieved in several ways.
3.1) Authorization by IP address
Here, the matter is very simple, because for communication it is enough to indicate the IP address of the target device.
3.2) Authorization with username and password
In this case, two changes to the
sip.conf file are necessary.
First, in the [general] section, add the registration string. The full entry seems quite complicated:
register => [peer?][transport://]user[@domain][:secret[:authuser]]@host[:port][/extension][~expiry]
The easiest way would be the following structure:
username:password@host, e.g .:
register => username:email@example.com
Next, add the device according to the table below.
All of that, in the file (
/etc/asterisk/sip.conf by default) will look like this:
register => CarrierUSERNAME:CarrierSECRET@188.8.131.52
callerid="My name" <100>
If we enter the actual data in the file and reload the module, in Asterisk (
asterisk -r command) we can execute commands that will display our configuration.
sip reload # configuration reload
sip show peers # list of peers
sip show registry # list of external registrations
Let us emphasize once again that the above configuration of SIP accounts, operators, etc … does not contain any security rules. They will be described in a separate post.