
Elastix as an automatic recording system for sending messages to artists
- Tutorial
Objective: to make it possible for people to call a multi-channel city number, choose the area of their residence, choose the service to which this appeal belongs, and then record a message about, say, broken streetlights, or leaking water in the yard and the like. This message is sent to the necessary authorities that will deal with this problem.
When solving this problem, the FreePBX system functionality was used to the maximum, so that it would be more convenient to change something when changing the menu structure, etc.
For those interested in how this works, I ask for cat.
I used the Elastix build, FreePBX was updated via the web interface to FreePBX version 2.10.1.4.
So we need a trunk to get the number and lines. We had a small provider, Farline. Therefore, I will describe the settings for it. In the FreePBX menu, go to Connectivity> Trunks> Add SIP trunk and start filling in:
Trunk Name: name of the trunk
Outbound CallerID: phone number that the provider requires (here it is only 1) XXXXXX
In Outgoing Settings> Trunk Name: Name of the trunk
PEER Details:
host = sip .farline.net
username = login gives the provider
secret = password also gives the provider
type = peer
qualify = no
disallow = all
allow = ulaw
canreinvite = no
nat = yes
fromuser = here too login
fromdomain = here is the white IP address from which your Asterisk goes to the Internet
insecure = invite
Incoming Settings:
USER Context:
USER trunk name Details:
host = sip.farline.net
username = provider login
secret = password is provided by
type = user provider
In the registration field, enter:
Everything, the trunk is configured and the lines are working.
We create one phone for tests and checks. Applications> Extensions> Submit
Enter User Extension - let's say 100, Display Name - Name, secret - password and click Submit. Next, install any SIP client to your taste, and in its settings specify the IP address of the Asterisk, 100 - as the username and password that you specified earlier. Now you can start recording.
For the voice menu, we need records, and in large numbers, I advise you to sketch out a diagram of how this will work and think over how many records will be needed. To create recordings it is convenient to use Admin> System Recordings, there after the inscription “If you wish to make and verify recordings from your phone, please enter your extension number here:” enter your softphone number 100 and press Go. Now by calling * 77 from the phone and following the voice prompts, you can record a message. Then enter in the Name this Recording field - the name of the recording and save. Further in the same vein.
By the way, if your voice data is not different in melody and as a result the recording will be done by a professional girl, then you should also protect yourself from the long and tedious process of remaking them. You can do this by going to the entry on the right of the list and ticking the Optional Feature Code checkbox, after a moment of thought, the Asterisk will issue a type number * 295 and then you can save it. By calling this number, the system will make it possible to listen to this recording, overwrite and save it hot. Later, you can make a list of records and a plate which of them refers to which item, then put the professional girl at the computer, give her a microphone with headphones and configure the SIP client. Now she can armed herself with these things and the “Wishlist” of her bosses herself to change all the records according to the name plate of the phone number to change the record and its location in the structure. This will greatly facilitate the work. As for the recording quality, I want to say one thing - if the microphone is normal, then the recording quality will also be quite tolerable. Studio recordings do not make much sense. through a simple phone you still can not appreciate it.
Now we need to create a greeting that will be pronounced when people call this phone.
Go to Applications> Announcement and enter:
Description: greeting name, Recording: selecting a recording from the list, and Destination after playback: where the call will go after greeting, we will have an IVR that we have not yet created.
We create IVR, go to Applications> IVR> Add new IVR and fill in the fields you need, in the tips it’s quite clear what is what. Or you can read about it in my article . Below we select which button to press (Ext), and where the subscriber will get after pressing this button.
The menu scheme can be made as branched as you like, then I will describe the nuances of using this system with me. If the reader remembers the task, then we need to organize a recording of the message which will then be listened to by the responsible persons, and it is advisable that these persons receive an email reminding that the record has arrived and can be listened to at such an address. Following a simple path using ready-made functionality, we will use not quite standard approaches.
We go into Extensions and create their number - equal to the number of services to which the message will come, I got 11 pieces. Passwords can be specified as any we won’t even enter them. But be sure to set the status of Enabled in the section of each Voicemail and set the password of the mail box, and of course the Email address to which the message will be sent (moreover, it can send the files of the records themselves, but we did not use this functionality so as not to overload the mail, the checkmark is in the settings of the Voicemail mailbox).
Now hanging this Extension at the end of the IVR, it will naturally be turned off and the call will go to voicemail. Now we will deal with problem solving.
Problem number 1. The customer had a Microsoft Exchange server and they decided to use it as a gateway so that letters would not go directly from Asterisk. To achieve this, we need to register /etc/postfix/main.cf in the config (I have an Elastix build and postfix is installed here) relayhost = ip address: port parameter. This problem has been resolved.
Problem number 2. In the message that comes to the mail, you may not like the English text, or you will need to change the link by which you need to go into Voicemail's office if you publish it. Therefore, we go into the /etc/asterisk/vm_email.inc template and edit what we need to send to our health.
Or you can go to Settings> Voicemail admin> Settings and edit the same there through the FreePBX web interface. By the way, it is immediately set in the format field through the separator "|" formats in which voice mail will be stored, I used this to replace records, that is, you can register wav49 | wav | ulaw | gsm there, and each message received to voicemail will be stored immediately in all these formats. Need to solve problem number 3.
Problem number 3 and immediately 4. One came from the other, so I will describe everything at once. The customer set the task - so that in some menu items messages are duplicated to several organizations, for example, the regional housing and economic department and Vodokanal. This problem can be solved using Voicemail Blasting groups. There you can group several mailboxes into one group, and records will come to it, and physically they will be stored in one copy, and in the second box there will just be a link to the file. Plus, here you can select the Beep Only - No confirmation item, that is, after a timeout of 3 seconds (set in IVR), after a message in the IVR voice menu, falls into the Voicemail Blasting group. With the original Voicemail, I didn’t succeed so that after saying the greeting on the IVR point, after 3 seconds, a signal should sound and immediately record.
Then a problem appears, though in a small volume, after the recording, the Asterisk begins to speak in English with the client offering to listen to the recording, save or overwrite, if you hang up, the recording is still created and the letter is sent to the mail, but it was decided to leave the functionality. Rolling Russian voice files on the server helped little, because the voice in the files differed from the rest of the menu. We decided to overwrite these files. But there is a caveat - some are stored only in the gsm format, some are stored in the ulaw format, and somewhere these file formats are written in the configs, so changing the format is not so easy, and I decided that it is easier to replace sound files than editing FreePBX configs. Here the solution with recording formats in the Voicemail config will help us. We set all the formats there at once, as I wrote in the previous paragraph. Then we do the doing. We call this mail and during the call we look at the Asterisk console, it will be visible what files it launches. We write out these files and remember the text that is spoken in them, there are only about 5 of them. Then, starting the search, we look where they are. Immediately I give a hint, it will most likely be / var / lib / asterisk / sounds / and there may already be in folders like en or ru, depending on which language is set.
In general, we call into voicemail, make the professional girl say the necessary phrase, look in the console which file number in the record and which mailbox fell (I have records in the mailboxes in / var / spool / asterisk / voicemail / default / extension number / INBOX /), and replace this file with the desired format - the file that you found. All. Now you will have your files with the voice you need. The operation actually takes about 15 minutes, writing longer than doing.
Problem number 5. There are not enough places on the server, but there are a lot of files with calls. So you need to store them somewhere else. The customer had a server with Windows server 2008 and screws in Raid - they decided to store it there. On Windows, share the folder, create a user under which we will work with it and give this user over the network full access to this folder. Now we need to mount it in Asterisk.
So that it is mounted immediately at boot, I registered the mount in / etc / fstab. The line looks like this:
// ip_server_with_Windows / folder_with_folder / where_to_mount_in_Asterisk / Folder_with records cifs username = domain_if_name_username / username, password = password 0 0
Now, when loading from us, the ball from Windows is mounted on the Asterisk, we need to transfer the conversation records there. We will not change the Asterisk configs, and just write the symlink:
ln -s / where_ mounted_in_Asterisk / Folder_with_records / var / spool / asterisk / voicemail / default
Actually now everything is ready. Records can be viewed from Windows Server, and physically they are there.
Entrance to the interface with records is located at
Summarizing all our actions - what we got: People call the number, listen to the greeting with a warning about recording the conversation, choose their area and the desired service, dictate the message (even if you hang up in the middle - it will still be recorded), after that, to the performer’s mail A letter arrives using the Microsoft Exchange gateway, in which it is reported that a new call has arrived, from which number, its duration, and a link to which you must go to listen to it. From there, you can save it to your computer, if there is such a need.
When solving this problem, the FreePBX system functionality was used to the maximum, so that it would be more convenient to change something when changing the menu structure, etc.
For those interested in how this works, I ask for cat.
I used the Elastix build, FreePBX was updated via the web interface to FreePBX version 2.10.1.4.
So we need a trunk to get the number and lines. We had a small provider, Farline. Therefore, I will describe the settings for it. In the FreePBX menu, go to Connectivity> Trunks> Add SIP trunk and start filling in:
Trunk Name: name of the trunk
Outbound CallerID: phone number that the provider requires (here it is only 1) XXXXXX
In Outgoing Settings> Trunk Name: Name of the trunk
PEER Details:
host = sip .farline.net
username = login gives the provider
secret = password also gives the provider
type = peer
qualify = no
disallow = all
allow = ulaw
canreinvite = no
nat = yes
fromuser = here too login
fromdomain = here is the white IP address from which your Asterisk goes to the Internet
insecure = invite
Incoming Settings:
USER Context:
USER trunk name Details:
host = sip.farline.net
username = provider login
secret = password is provided by
type = user provider
In the registration field, enter:
логин:пароль@sip.farline.net/логин
Everything, the trunk is configured and the lines are working.
We create one phone for tests and checks. Applications> Extensions> Submit
Enter User Extension - let's say 100, Display Name - Name, secret - password and click Submit. Next, install any SIP client to your taste, and in its settings specify the IP address of the Asterisk, 100 - as the username and password that you specified earlier. Now you can start recording.
For the voice menu, we need records, and in large numbers, I advise you to sketch out a diagram of how this will work and think over how many records will be needed. To create recordings it is convenient to use Admin> System Recordings, there after the inscription “If you wish to make and verify recordings from your phone, please enter your extension number here:” enter your softphone number 100 and press Go. Now by calling * 77 from the phone and following the voice prompts, you can record a message. Then enter in the Name this Recording field - the name of the recording and save. Further in the same vein.
By the way, if your voice data is not different in melody and as a result the recording will be done by a professional girl, then you should also protect yourself from the long and tedious process of remaking them. You can do this by going to the entry on the right of the list and ticking the Optional Feature Code checkbox, after a moment of thought, the Asterisk will issue a type number * 295 and then you can save it. By calling this number, the system will make it possible to listen to this recording, overwrite and save it hot. Later, you can make a list of records and a plate which of them refers to which item, then put the professional girl at the computer, give her a microphone with headphones and configure the SIP client. Now she can armed herself with these things and the “Wishlist” of her bosses herself to change all the records according to the name plate of the phone number to change the record and its location in the structure. This will greatly facilitate the work. As for the recording quality, I want to say one thing - if the microphone is normal, then the recording quality will also be quite tolerable. Studio recordings do not make much sense. through a simple phone you still can not appreciate it.
Now we need to create a greeting that will be pronounced when people call this phone.
Go to Applications> Announcement and enter:
Description: greeting name, Recording: selecting a recording from the list, and Destination after playback: where the call will go after greeting, we will have an IVR that we have not yet created.
We create IVR, go to Applications> IVR> Add new IVR and fill in the fields you need, in the tips it’s quite clear what is what. Or you can read about it in my article . Below we select which button to press (Ext), and where the subscriber will get after pressing this button.
The menu scheme can be made as branched as you like, then I will describe the nuances of using this system with me. If the reader remembers the task, then we need to organize a recording of the message which will then be listened to by the responsible persons, and it is advisable that these persons receive an email reminding that the record has arrived and can be listened to at such an address. Following a simple path using ready-made functionality, we will use not quite standard approaches.
We go into Extensions and create their number - equal to the number of services to which the message will come, I got 11 pieces. Passwords can be specified as any we won’t even enter them. But be sure to set the status of Enabled in the section of each Voicemail and set the password of the mail box, and of course the Email address to which the message will be sent (moreover, it can send the files of the records themselves, but we did not use this functionality so as not to overload the mail, the checkmark is in the settings of the Voicemail mailbox).
Now hanging this Extension at the end of the IVR, it will naturally be turned off and the call will go to voicemail. Now we will deal with problem solving.
Problem number 1. The customer had a Microsoft Exchange server and they decided to use it as a gateway so that letters would not go directly from Asterisk. To achieve this, we need to register /etc/postfix/main.cf in the config (I have an Elastix build and postfix is installed here) relayhost = ip address: port parameter. This problem has been resolved.
Problem number 2. In the message that comes to the mail, you may not like the English text, or you will need to change the link by which you need to go into Voicemail's office if you publish it. Therefore, we go into the /etc/asterisk/vm_email.inc template and edit what we need to send to our health.
Or you can go to Settings> Voicemail admin> Settings and edit the same there through the FreePBX web interface. By the way, it is immediately set in the format field through the separator "|" formats in which voice mail will be stored, I used this to replace records, that is, you can register wav49 | wav | ulaw | gsm there, and each message received to voicemail will be stored immediately in all these formats. Need to solve problem number 3.
Problem number 3 and immediately 4. One came from the other, so I will describe everything at once. The customer set the task - so that in some menu items messages are duplicated to several organizations, for example, the regional housing and economic department and Vodokanal. This problem can be solved using Voicemail Blasting groups. There you can group several mailboxes into one group, and records will come to it, and physically they will be stored in one copy, and in the second box there will just be a link to the file. Plus, here you can select the Beep Only - No confirmation item, that is, after a timeout of 3 seconds (set in IVR), after a message in the IVR voice menu, falls into the Voicemail Blasting group. With the original Voicemail, I didn’t succeed so that after saying the greeting on the IVR point, after 3 seconds, a signal should sound and immediately record.
Then a problem appears, though in a small volume, after the recording, the Asterisk begins to speak in English with the client offering to listen to the recording, save or overwrite, if you hang up, the recording is still created and the letter is sent to the mail, but it was decided to leave the functionality. Rolling Russian voice files on the server helped little, because the voice in the files differed from the rest of the menu. We decided to overwrite these files. But there is a caveat - some are stored only in the gsm format, some are stored in the ulaw format, and somewhere these file formats are written in the configs, so changing the format is not so easy, and I decided that it is easier to replace sound files than editing FreePBX configs. Here the solution with recording formats in the Voicemail config will help us. We set all the formats there at once, as I wrote in the previous paragraph. Then we do the doing. We call this mail and during the call we look at the Asterisk console, it will be visible what files it launches. We write out these files and remember the text that is spoken in them, there are only about 5 of them. Then, starting the search, we look where they are. Immediately I give a hint, it will most likely be / var / lib / asterisk / sounds / and there may already be in folders like en or ru, depending on which language is set.
In general, we call into voicemail, make the professional girl say the necessary phrase, look in the console which file number in the record and which mailbox fell (I have records in the mailboxes in / var / spool / asterisk / voicemail / default / extension number / INBOX /), and replace this file with the desired format - the file that you found. All. Now you will have your files with the voice you need. The operation actually takes about 15 minutes, writing longer than doing.
Problem number 5. There are not enough places on the server, but there are a lot of files with calls. So you need to store them somewhere else. The customer had a server with Windows server 2008 and screws in Raid - they decided to store it there. On Windows, share the folder, create a user under which we will work with it and give this user over the network full access to this folder. Now we need to mount it in Asterisk.
So that it is mounted immediately at boot, I registered the mount in / etc / fstab. The line looks like this:
// ip_server_with_Windows / folder_with_folder / where_to_mount_in_Asterisk / Folder_with records cifs username = domain_if_name_username / username, password = password 0 0
Now, when loading from us, the ball from Windows is mounted on the Asterisk, we need to transfer the conversation records there. We will not change the Asterisk configs, and just write the symlink:
ln -s / where_ mounted_in_Asterisk / Folder_with_records / var / spool / asterisk / voicemail / default
Actually now everything is ready. Records can be viewed from Windows Server, and physically they are there.
Entrance to the interface with records is located at
ip-адрес-Asterisk/recordings
. Log in there using the extension number and password for Voicemail, which is set in the extension settings.Summarizing all our actions - what we got: People call the number, listen to the greeting with a warning about recording the conversation, choose their area and the desired service, dictate the message (even if you hang up in the middle - it will still be recorded), after that, to the performer’s mail A letter arrives using the Microsoft Exchange gateway, in which it is reported that a new call has arrived, from which number, its duration, and a link to which you must go to listen to it. From there, you can save it to your computer, if there is such a need.