📜 ⬆️ ⬇️

FreePBX - forwarding with real-time notifications via XMPP

There is a small IT department in a medium-sized organization with a branch structure. Employees of the IT department are almost constantly traveling around different branches and are not always accessible by mobile phone. For the convenience of the organization, it was decided to make a single (easily remembered) number for technical support. In case technical support is busy or simply no one is in place, the call should be redirected to the mobile phones of engineers and the call should come in the form of a message to Jabber.

Mobile redirection


Go to the web interface, Applications => Ring Groups => Add Ring Group. We create a group of redirection to mobile phones of engineers, for example, “922”:

image

The grid at the end of the number gives us the opportunity to make calls from the main FreePBX context, where outgoing calls are allowed. Fixed CID Value - is needed if your provider beats off incorrect CIDs, because internal subscriber numbers are transmitted. The RingAll strategy allows you to call everyone at the same time, if someone is unavailable, we skip it, if one picks up the phone, the others immediately drop the call.
')
It is better to put pleasant music on the group, as in different versions FreePBX does strange things with beeps in groups. You can check the settings by calling the number 922.

Now we create the main technical support group, for example “911”:

image

Turning on the Skip Buzy Agent allows us to go directly to Destination if no answer if all employees are busy.
In Destination if no answer, select the group of forwarding to mobile.

The result was that the call goes to the 911 group, if the employees are busy or no one picks up the phone for a few seconds, the call goes to group 922. By enrolling at 922, the call tries to call all listed mobile numbers right away, if no one picks up - the call ends .

Problems encountered:
1) People habitually called the direct numbers of engineers. This continued even 3 months after the introduction ... Some due to personal affection, some call engineers immediately "to communicate with more competent people in my question than the first TP line" and so on ... Therefore, we changed the numbers of all IT employees, and as a CID and Name put the same data to everyone so that when an internal outgoing call is made, the TP employee would not see his real number.

Example:

image

As a result, after a month, everybody got used to it, direct calls to engineers practically stopped. Now such a scheme suits even the most zealous supporters of "direct calls", since they start working on the problem right away, and they don’t wait for someone to come back from lunch or after a smoke break.

2) One day, our provider stopped skipping calls with “crooked” CIDs, so I had to urgently find the Fixed CID Value parameter. Now on any outgoing from this group the specified CID was substituted.
3) In case the call is forwarded to the mobile, the conversation almost always began with the phrase “Who are you?”, Because It’s really unclear who is calling, the company number was determined on the mobile ... Not all engineers developed recognition skills by voice with the quality of GSM communication. Solved this problem by the notification in jabber.


Alerts for incoming and missed calls


In the case of redirection to a mobile, only the external number of the organization is visible, it is not clear to whom to call back in case of a break in communication.

After looking at different solutions, it was determined that the fastest among them is XMPP (besides, ejabberd has already been deployed for the monitoring system). Between sending a message and receiving it usually takes less than a second.

1) Create a user on your Jabber server for PBX. In our case, this is user PBX@company-name.su
2) Bring the file /etc/asterisk/jabber.conf to something like the following. In newer versions of Asterisk, this is the file /etc/asterisk/xmpp_custom.conf

[general]
; debug = yes
; autoprune = yes
; autoregister = yes
; auth_policy = accept

[asteriskjabber]
type = client
serverhost = jabber.company-name.su
username=pbx@company-name.su
secret = Pa $$ w0rd
port = 5222
usetls = yes
usesasl = yes
status = available
statusmessage = "I am Asterisk!"
buddy = username1 @ company-name.su, username2 @ company-name.su, username3 @ company-name.su
; timeout = 100


3) Add your number manually in /etc/asterisk/extensions_custom.conf

exten => 9999,1, JabberSend (asteriskjabber, username1 @ company-name.su, $ {CALLERID (all)} called (a) at $ {STRFTIME ($ {EPOCH} ,,% c)}!) / +74951111111 )
exten => 9999, n, JabberSend (asteriskjabber, username2 @ company-name.su, $ {CALLERID (all)} called (a) at $ {STRFTIME ($ {EPOCH} ,,% c)}!) / +74951111111 )
exten => 9999, n, JabberSend (asteriskjabber, username3 @ company-name.su, $ {CALLERID (all)} called (a) at $ {STRFTIME ($ {EPOCH} ,,% c)}!) / +74951111111 )
exten => 9999, n, Hungup ()


We added variables to the message: to display the time of the call, in case the message arrived late and a variable with the internal CID of the subscriber who called. At the end, for convenience, we added a direct office number to call back without getting into the phone book.

4) Restart the asterisk service so that new configs are applied.
service asterisk restart

We look in the asterisk console the result of the jabber show connections command. If there is no word Connected, look for errors. If it fails, enable jabber debug in the /etc/asterisk/jabber.conf file.

Now you can check the work of sending messages to Jabber simply by calling 9999.

5) We go back to the web interface and add the number 9999 # (necessarily with a grid) to the 922 mobile call forwarding group (it is not forbidden to add to other places, such as Folow Me, for example).

Now, starting with the arrival of a call at 922, messages are sent to Jabber along with calls to mobiles. As a rule, messages arrive for a couple of seconds faster than calls. They can be read even after picking up the handset in the telephone alert line.

Notes: if you do not have your own Jabber server, you can use almost any public server. For example, Google.

The most common problem of the asterisk jabber client is that it does not support some encryption methods.

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


All Articles