📜 ⬆️ ⬇️

Elastix as an automatic message recording system with sending them to performers

Objective: to make people able to call a multichannel city number, choose the area of ​​their residence, choose the service to which this appeal relates and then write a message about, say broken lanterns on the street, or leaked water supply in the yard and similar problems. This message is transmitted to the appropriate authorities that will deal with the elimination of this problem.

When solving this task, the functionality of the FreePBX system was used to the maximum so that it was more convenient to change something when changing the menu structure, etc.

Interested in how it works please under the 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 out:

Trunk Name: trunk name
Outbound CallerID: the phone number that the provider requires (here it is only 1) XXXXXX
In Outgoing Settings> Trunk Name: Trunk Name

PEER Details:
host = sip.farline.net
username = login gives provider
secret = provider also gives the password
type = peer
qualify = no
disallow = all
allow = ulaw
canreinvite = no
nat = yes
fromuser = login here too
fromdomain = here is a white IP address from which your Asterisk goes to the Internet
insecure = invite

Incoming Settings:
USER Context: Trunk Name

USER Details:
host = sip.farline.net
username = provider's login
secret = provider gives the password
type = user

In the registration field enter:
:@sip.farline.net/

Everything, the trunk is configured and the lines work.
We create one phone for tests and checks. Applications> Extensions> Submit

Enter User Extension - say 100, Display Name - Name, secret - password and click Submit. Next, we install any SIP client to your taste, and in its settings we specify the Asterisk's IP address, 100 - as the login and password that was specified earlier. Now you can start recording.

For the voice menu, we will need recordings, and in large numbers, I advise you to sketch out a scheme of how this will work and think over how many recordings will be needed. To create recordings, it’s convenient to use Admin> System Recordings, and after the inscription “If you want your phone number, please enter your softphone number 100 and click Go. Now, calling the number * 77 from the phone and following the voice prompts, you can record a message. Then enter in the Name field this Recording - the name of the record and save. Further in the same vein.

By the way, if your voice data does not differ in melodiousness and as a result the recording will be done by a professional girl, then you should also protect yourself from a long and tedious process of remaking them. You can do this by going to the entry on the right in the list and ticking the Optional Feature Code, after a brief deliberation, the Asterisk will give you the type number * 295 and then you can save it. Calling to this number, the system will give the opportunity to listen to this record, overwrite and save it to hot. Later you can make a list of records and a label which of them relates to which item, then put a professional girl at the computer, give her a microphone with headphones and set up a SIP client. Now she can be armed with these things and the “Wishlist” of the authorities themselves to change all the records according to the phone number name plate for changing the record and its location in the structure. This will greatly facilitate the work. Regarding the quality of the recording, I want to say one thing - if the microphone is normal, then the recording quality will also be quite bearable. Studio recordings don't 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 number.

Go to Applications> Announcement and enter:

Description: the name of the greeting, Recording: selection of the recording from the list, well, and Destination after playback: where the call will go after the greeting, this will be an IVR for us that we have not yet created.

Create an IVR, go to Applications> IVR> Add new IVR and fill in the fields you need, in the tips it is quite clear what is what. Or you can read about it in my article . From the bottom, we choose which button to press (Ext), and where the subscriber will go after pressing this button.

The menu scheme can be made as many branched as possible, 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 that the responsible persons will then listen to, and it is desirable that these individuals receive an email with a reminder that the recording has arrived and you can listen to it at the “such” address. Going along a simple path with the use of a ready-made functional, we will use not quite standard approaches.

We go to the 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 will not even enter them. But be sure, in the section of each Voicemail, we set the status to Enabled and set the mailbox password, and of course the Email address to which the message will be sent (and it can send files to the records themselves, but we did not use this functionality in order not to overload the mail, there is a tick Voicemail mailbox).

Now, at the end of the IVR at the end of the IVR, it will naturally be turned off and the call will go to voicemail. Now we will deal with solving problems.

Problem number 1. The customer had a Microsoft Exchange server and they decided to use it as a gateway so that letters did not go directly from Asterisk. In order to achieve this, we need to register in the /etc/postfix/main.cf config (I have the Elastix build and here postfix is ​​set) the relayhost = ip address: port parameter. This problem has been resolved.

Problem number 2. In the message that arrives in the mail you may not like the English text, or else you will need to change the link by which you need to enter the Voicemail account, if you publish it. Therefore, we go into the /etc/asterisk/vm_email.inc template and edit our health for what you need to send.

Or you can go to Settings> Voicemail admin> Settings and edit the same there via the FreePBX web interface. By the way, it is immediately displayed in the format field through the separator "|" the formats in which the voice mail will be stored, I used to replace the records, that is, you can register there wav49 | wav | ulaw | gsm, and each message received by voice mail will be stored immediately in all these formats. It is necessary to solve the 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 the messages were duplicated to several organizations, for example, the district housing and utility station and Vodokanal. This problem can be solved using Voicemail Blasting groups. There you can group several mailboxes in one group, and records will come to it, and physically they will be stored in one copy, and the second mailbox will simply be a link to the file. Plus, you can select the Beep Only - No confirmation item, that is, after a waiting time of 3 seconds (set in IVR), after the message in the IVR voice menu, it goes to the Voicemail Blasting group. With the original Voicemail, it didn’t work out for me, that after pronouncing the greeting on the IVR point, a signal would sound after 3 seconds and record immediately. Therefore, I redid everything into groups, even single boxes (having set just 1 box in the Voicemail Blasting group).

Then a problem appears, though in a small amount, after recording, Asterisk starts speaking English with the client by offering to listen to the recording, save or re-record, if you hang up, the recording is still created and sent a letter to the post, but it was decided to leave the functionality. Rolling Russian voice files on the server did not help much, because the voice in the files was different from the rest of the menu. We decided to overwrite these files. But here is a nuance - some are stored only in the gsm format, some are in the ulaw format, and somewhere in the configs such file formats are registered, therefore changing the format is not so easy, and I decided that it is easier to replace the sound files than to edit the FreePBX configs. This is where the solution with the recording formats in the Voicemail config will help us. We expose there all formats at once, as I wrote in the previous paragraph. Then we do the making. We call this mail and during the call we look into the console of Asterisk, there we will see which files it launches. We write out these files and memorize the text that they say, there are only about 5 of them. Then run the search and see where they lie. Immediately I give a hint: this will most likely be / var / lib / asterisk / sounds / and there may already be in en or ru folders, depending on which language is set.

In general, we call voicemail, force a professional girl to utter the necessary phrase, look in the console what file number is in the recording and what mailbox has dropped (my records in mailboxes are stored in / var / spool / asterisk / voicemail / default / number extensions / INBOX /), and replace this file with the desired format - the file that you found. Everything. 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 is not enough space on the server, and there are a lot of files with access. 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. We share a folder on Windows, create a user under which we will work with it and give this user full access to this folder on the network. Now we need to mount it in Asterisk.

So that it was mounted immediately upon loading, I registered the mount in / etc / fstab. The line looks like this:

// ip_server_windows__/folder_in_which_will_to go to / where_mount_in_A_ asterisk / folder_with_captions cifs username = if_do_name / user_name, password = password 0 0

Now, when we load the ball from Windows, it is mounted on Asterisk, we need to transfer the recordings of conversations there. We will not change Asterisk's configs, and simply prescribe a symlink:

ln -s / where_mounted_in_Asterisk / Folder_with_cards / var / spool / asterisk / voicemail / default

Actually now everything is ready. Records can be viewed from the Windows Server, and physically they are there.

Log in to the interface with records located at ip--Asterisk/recordings ip--Asterisk/recordings . Logging in is done 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 necessary service, dictate the message (even if you hang up in the middle, it will be recorded anyway) A letter arrives using the Microsoft Exchange gateway, which states that a new call was received, from which number, its duration and the link to which you need to go in to listen to it. From there you can save it to your computer, if there is such a need.

Source: https://habr.com/ru/post/169605/


All Articles