Usm asterisk EN: различия между версиями

Материал из WiKi - UserSide
Нет описания правки
Нет описания правки
Строка 27: Строка 27:
== Capabilities ==
== Capabilities ==


For each operator, the internal SIP number to be monitored should be specified. For example, an operator has a device telephone with internal number 5007 ''(or program telephone)'' on his desk. So in the operator's account, its number 5007 must be specified.
For each user, the internal SIP number to be monitored should be specified. For example, an user has a device telephone with internal number 5007 ''(or program telephone)'' on his desk. So in the user's account, its number 5007 must be specified.


***
***


When a call is received to the operator's number - the browser will display information about the incoming call. In this case, if the incoming number will be searched in the user base and, if found, the information about the user will be displayed.
When a call is received to the user's number - the browser will display information about the incoming call. In this case, if the incoming number will be searched in the user base and, if found, the information about the user will be displayed.


***
***
Строка 41: Строка 41:
***
***


Notifications are displayed one at a time and in all open ERP "UserSide" tabs at the operator's location
Notifications are displayed one at a time and in all open ERP "UserSide" tabs at the user's location


***
***
Строка 53: Строка 53:
***
***


It is possible to specify the same monitored numbers for several operators. But it is better not to use it, because it will be difficult to understand which operator received the call in the call report.
It is possible to specify the same monitored numbers for several users. But it is better not to use it, because it will be difficult to understand which user received the call in the call report.


== Settings==
== Settings==
Строка 94: Строка 94:
1. For the module requires perl modules: EV, Asterisk::AMI, Time::Local, LWP::UserAgent, HTTP::Request::Common, FindBin
1. For the module requires perl modules: EV, Asterisk::AMI, Time::Local, LWP::UserAgent, HTTP::Request::Common, FindBin
   
   
2. In the "UserSide" assign internal phone numbers to the operators, when calling to which notifications should be displayed
2. In the "UserSide" assign internal phone numbers to the users, when calling to which notifications should be displayed


3. Copy the three files ''(usm_asterisk.pl, usm_asterisk_control.pl, usm_asterisk.conf)'' to a directory such as: ''/usr/local/us_modules/usm_asterisk/''
3. Copy the three files ''(usm_asterisk.pl, usm_asterisk_control.pl, usm_asterisk.conf)'' to a directory such as: ''/usr/local/us_modules/usm_asterisk/''
Строка 162: Строка 162:
  Response: Success Message: Authentication accepted
  Response: Success Message: Authentication accepted


Make an incoming call that goes to the operator group (Queue), after which the operator must answer and hang up.
Make an incoming call that goes to the user group (Queue), after which the user must answer and hang up.
When you have finished working with AMI, execute:
When you have finished working with AMI, execute:



Версия от 17:43, 29 марта 2024

en | ru

USM_ASTERISK - module that interacts with Asterisk and processes information about incoming calls from users

This module is a replacement for the obsolete win-module us_asteriskcall

Recommendations for configuring the Asterisk system

General information

Module Language: Perl

Current version: see page: Modules

Minimum Asterisk version: 10.x

Module Status: Paid

Required Perl modules:

EV
Asterisk::AMI
Time::Local
LWP::UserAgent
HTTP::Request
FindBin

Capabilities

For each user, the internal SIP number to be monitored should be specified. For example, an user has a device telephone with internal number 5007 (or program telephone) on his desk. So in the user's account, its number 5007 must be specified.

When a call is received to the user's number - the browser will display information about the incoming call. In this case, if the incoming number will be searched in the user base and, if found, the information about the user will be displayed.

In addition to users, you can also search by phone numbers of employees.

Notifications are displayed one at a time and in all open ERP "UserSide" tabs at the user's location

Under "Messages - Call List", you can view a list of all calls

Also in user's card, the "Tech support" tab shows all of his calls

It is possible to specify the same monitored numbers for several users. But it is better not to use it, because it will be difficult to understand which user received the call in the call report.

Settings

Configuring Asterisk

The Asterisk system uses the Manager module for interaction, which is configured in the /etc/asterisk/manager.conf file

In this file it is necessary to add a block of settings for the user on behalf of whom the interaction between Asterisk and usm_asterisk will take place

Example of a block to be added to the manager.conf file

[userside]
secret = usm_asterisk_secret
deny = 0.0.0.0/0.0.0.0
permit = 192.168.1.2/255.255.255.255
read = all,system,call,log,verbose,command,agent,user,config
write = all,system,call,log,verbose,command,agent,user,config
Here:
userside - username
usm_asterisk_secret - password
192.168.1.2 - address of the server on which the usm_asterisk module is functioning

After executing this command, you need to enter the asterisk console and execute the command to reload the configuration

$ asterisk -r
> reload
> exit

UserSide Configuration

Make sure that the API key is specified in the ERP "UserSide" configuration file.

Next, this key will be needed in the usm_asterisk module configuration file.


Configuring the usm_asterisk module

1. For the module requires perl modules: EV, Asterisk::AMI, Time::Local, LWP::UserAgent, HTTP::Request::Common, FindBin

2. In the "UserSide" assign internal phone numbers to the users, when calling to which notifications should be displayed

3. Copy the three files (usm_asterisk.pl, usm_asterisk_control.pl, usm_asterisk.conf) to a directory such as: /usr/local/us_modules/usm_asterisk/

4. Specify settings in the usm_asterisk.conf file

- Connection to asterisk-manager
- Connection to api UserSide
- Log storage path, if necessary
- In the $zastertype variable, specify a value according to the Asterisk version you are using:
 1 - Asterisk == 11 (AMI v1)
 2 - Asterisk <= 10 (AMI v1)
 3 - Asterisk >= 12 (AMI v2)
- List in the value of the @zasterfromcontexts variable all trunks on which processing of incoming connections is required.
 Record format, for example: ("from-gsm", "from-pstn", "from-external")

5. In the usm_asterisk_control.pl file, specify the correct path to perl (you can find out which perl)

6. in CRON add a line that starts the controller, for example, every 2 minutes (again, the full path to perl for your system)

*/2     *       *       *       *       user    /usr/local/bin/perl /usr/local/us_modules/usm_asterisk/usm_asterisk_control.pl >> /var/log/usm_asterisk-restart.log 2>&1

7. Wait for the controller to execute, which will run the module to execute (or you can run it manually: perl usm_asterisk.pl &)

8. After running, the log files usm_asterisk.log and usm_asterisk.err should be created - examine their contents to make sure there are no errors. The usm_asterisk.pid file will also be created in the directory with the module files.

9. Configure the newslog daemon (/etc/newslog.conf) to rotate the module logs. Simply add the line:

/var/log/usm_asterisk.*        644  10     200  *     GJC

10. Check the module operation by making a telephone call. The module operation can be monitored by watching the real-time logs:

tail -f /var/log/usm_asterisk.log

Running in a Docker environment

If you use USERSIDE in a Docker environment, you will probably be interested in running usm external modules in separate Docker containers.

We provide a docker environment to run usm_asterisk module (the environment does not contain the module file - you need to download it from your personal account yourself).

You can download the docker-environment at the following link: https://github.com/userside/usm_asterisk-docker-env/releases.


Actions required to debug the usm_asterisk module

  • Disable controller startup in CRON
  • Stop the running application and make sure that no other copies of the application are running
ps ax | grep usm_asterisk
  • Change the parameters $ps_consolelog = 1 in the usm_asterisk.conf module configuration file if you want to output the log to the screen instead of to a file, and/or $ps_apianswlog = 1 if you want to output API server responses
  • Start the module manually using the following command. When started, the module will display information about it on the screen
perl usm_asterisk.pl
  • After debugging work is completed, stop the module Ctrl+C, change parameters $ps_consolelog and $ps_apianswlog, setting them to 0, activate the controller startup in CRON

Connecting to AMI Asterisk (for information)

telnet 127.0.0.1 5038 | tee ami.log

Authentication (copy the text and paste it into the AMI session, changing the name and password previously):

Action: login
Username: admin
Secret: passwd1234

Press Enter twice

With the right input should see:

Response: Success Message: Authentication accepted

Make an incoming call that goes to the user group (Queue), after which the user must answer and hang up. When you have finished working with AMI, execute:

Action: logoff

Send the result (ami.log file) to us, archived previously.