Asterisk - teams. Work with the Asterisk console

The modern rhythm of life is inconceivable without creating a clear and tuned communication system between representatives of various fields of production, services, and any business. Providing telephone support is one of the important steps in creating feedback or advisory services. The Asterisk project is an optimal solution for deploying computer telephony.

So what is an Asterisk?

If it’s simple, then Asterisk is a classic PBX with a wide range of functions, plug-ins, modules and extensions that can increase the range of capabilities. The software package is distributed under an open source license, which allows many free enthusiastic developers to support and develop the project.

The operating system does not matter for the full functioning of the complex, since the product is cross-platform. The flexibility of Asterisk is that it has the ability to create custom modules based on the built-in language.

asterisk team

The system supports many well-known protocols, for example, SIP, MGCP, SCCP.

Asterisk also has its own IAX protocol, which allows the exchange of information between servers on the same system.

Work principles

Some special equipment for the operation of Asterisk is not required. All known devices connect to the system without any problems. In some cases, it makes sense to use proprietary equipment from Digium, the creators of the system.

All system operation occurs due to reading from configuration files. The most important of them is sip.conf. Its bowels contain information about the operation of the SIP protocol, NAT settings, and other key functions.

asterisk cli teams

By default, it is immediately ready to work and allows the use of Asterisk in its full functionality. However, account information must be filled out. There are three flavors in sip.conf:

  • user;
  • peer;
  • friend.

The latter includes the two previous ones, so many experts almost always use it.

Asterisk CLI

A special command line interface is used to control and analyze the operation of the system. You can enter it using rasterisk. The asterisk -rvvv command will give the same effect. The -rvvv switch is needed to change the logging level.

First, consider the common CLI Asterisk commands:

  • sip show peers - extensive information about all subscribers of the system, their numbers, ip addresses, pings and many others. others;
  • sip show registry - shows all available SIP registrations;
  • sip reload - the command is used after certain changes have been made to the sip.conf configuration file. In fact, it reboots the module;
  • sip show channels - shows currently active channels with user information, call IDs and more;
  • sip show settings - displays all global SIP settings;
  • sip set debug - enables debugging mode. You can specify a specific address or feast;
  • dialplan show - displays the used dialplan;
  • dialplan reload - will reboot it;
  • core show codecs - displays information about all codecs installed in the Asterisk system;
  • core restart now - will immediately restart Asterisk;
  • core show help - a list of commands used in Asterisk.

The following commands are used less frequently, but they are also important and may be needed when setting up and analyzing:

  • keys show - display all RSA keys;
  • keys init - set a password for an individual RSA key;
  • indication show - displays a list of indicators and countries;
  • http show status - displays the status of the HTTP server;
  • database showkey - displays information from the database by key;
  • database del - removes the key and values ​​from the database;
  • core show threads - displays information about running applications;
  • core show function - shows information about special functions of the current dialplan.

AMI - Asterisk teams

To control the system from external applications, a special interface was invented. It is called AMI. And this process happens by entering special Asterisk AMI commands. They are transmitted over TCP. This is a very convenient mechanism for remote control of the system from various software solutions.

asterisk ami teams

Briefly tell: a connection is established between the client application and the server, using the Asterisk commands, the settings are changed. To do this, a string is passed to it, which consists of the following elements:

  • key - a keyword that contains a description for the information in the incoming line;
  • value - the key value.

In order to be able to send commands to the Asterisk server, you must first connect to it. After the connection is established, packets can be sent. They can be transferred in any order. The key must indicate one of the following words: Action, Event, Response. Now a little more about them:

  • Action After the server receives this type of package, an action will be taken. On one package - one action.
  • Response Here is the server response after the completed action.
  • Event Information about the event that occurred on the server.

Response can take several values, depending on what action the server performed. For example, successful completion will be triggered by the word Success, error - Error, Follows - server response information will be transmitted in the following packets.

Usage and Examples

To understand how to use Asterisk commands, you need to consider a few examples.

Action: login Username: admin Secret: secret12

On this line, the Action packet containing the username with password is passed. The login keyword means that you need to log in to the system with the specified parameters. In response, the server may send something like this: Response: Success Message: Authentification accepted.

asterisk console command

This line indicates that the operation was successful.

You can disconnect from Asterisk by issuing the Action: logoff command. The response will receive a farewell message.

The following example shows how to use the Asterisk and AMI commands to make a call: Action: Originate Channel: SIP / 2001 Context: incoming Exten: 2001 Priority: 1 Callerid: 2001 Variable: ANSWER = 1 Variable: _ACC = 1.

The command transmits data about the user making the call. This is reflected in the Callerid and Channel.

asterisk rvvv team

In fact, many different operations and functions can be implemented through AMI. You can see the full list in the official manual on the manufacturer's website.

Conclusion

Using Asterisk console commands gives the system flexibility and versatility. This means that you can use it remotely. At the same time, it is possible to save all the functionality of the complex.

Among other things, the developer company has a software solution for those users who do not like the command line. It has a convenient graphical interface and has all the necessary functions.

For some solutions, third-party developers use the web version of the program. It does not require installation on a computer, but at the same time allows you to fully use the Asterisk system. For its operation, you only need a PC connected to the network and a browser installed on it.


All Articles