📜 ⬆️ ⬇️

MS Lync: Personal Call Identification

Our office recently switched to using MS Lync as a telephony solution: Siemens' PABX (by the way, very high-quality and reliable) has long been outdated and should have been replaced. It turned out that of all the alternatives to MS Lync with Enterprise Voice is the most profitable. In addition to the price, the choice was influenced by the fact that some branches of the company in other countries already used Lync, though without telephony, since this is Lync Online from Office 365. Nevertheless, the possibility of coexistence of these systems (Lync Hybrid) seemed useful to the management.

One way or another, the decision was made; and besides many other problems, it became necessary to identify personal calls. Employees are allowed to use the phone for personal use, but, of course, pay for it themselves. With the “old” PABX, the implementation was as follows: after entering a personal PIN code, before dialing the number, it was required to enter 0 for a call “for work” or 1 for personal calls. This information was saved and periodically exported in CSV format for subsequent import into SAP using WinShuttle. With MS Lync, you can implement everything in the same way (or almost), but there is one significant feature: unlike classic telephony, most calls from Lync are not dialing numbers, but by searching for a contact (for example, by name) or even by clicking across the sender's email field in Outlook - so, identifying personal numbers with a prefix no longer seems like the perfect solution. In addition, since the Lync client uses the same contact database as, for example, the user's mobile phone connected to the corporate Exchange server, adding a prefix to the contact number will prevent / complicate making normal (non-Lync) calls using a mobile phone.

We have come to three solutions to this problem. Details under the cut.

Option number 1 - Using prefixes


Lync Version - Lync 2013 Standard Edition
Gateway - Audiocodes Mediant 1000
Exit to PSTN - E1 or SIP trunk via the Internet with authorization by IP
Source of information on billing: Lync Server Monitoring Reports + billing provider
')
In this solution to the problem, we will use two replacements, namely, 1) “normalization” of the number entered by the user in the Lync Control Panel; and, 2) normalization of the number before transferring the call to the SIP trunk to the Audiocodes SBC. The reason is simple: Lync understands only the standard e.164 numbers, so the call to the number “10041221234567” will not work. To get around this, it will be possible to use this replacement: numbers with a prefix of 0 (work calls) are converted to standard e.164 (for example, 00041221234567 -> +41221234567) and transmitted to the trunk as is, and with a prefix 1 (personal calls) to pseudo- e.164 replacing the prefix with +83 or any of the unused ones (for example, 10041221234567 -> +8341221234567) and then on the SBC are deleted completely, leaving only the real e.164 number. The difference will be that personal calls will be recorded in the Lync database with the +83 prefix, with the help of which these calls can be easily identified by comparing with the list of calls / invoice provided by the telephony operator.
The block diagram of this solution looks like this:



How to do?

The normalization rule for personal calls like "10041221234567 -> +8341221234567" is created in the Lync Control Panel in the Voice Routing section:



So this replacement will look in the Lync client when dialing a number with the prefix:



Further, in order for this call to reach the required subscriber, we replace “+83” with “+” before transferring the call to Audiocodes Mediant 1000. For E1 trunk, this is configured in the Voip> GW and IP to IP> Manipulations> Dest Number IP- section > Tel :



Pros : the procedure for dialing a "personal" number is the same as it was on the old PABX
Disadvantages : It is inconvenient to use saved contacts if it is impossible to add a prefix to address book numbers from through unincorporated channels, for example, from a mobile phone with the same contact database.

Option number 2 - "Manual Mode"


Lync Version - Lync 2013 Standard Edition
Gateway is not important
PSTN access doesn't matter
Source of information on billing: Lync Server Monitoring Reports + billing provider

This option is quite simple: on .Net, a web-based application that reads information about calls from the database and allows users to “mark” which of the calls are personal. I can add nothing more here, since it is more a development field. I can only note that the numbers marked as personal calls are remembered by the system and are applied to future calls automatically, so users will spend less time with each process.

Web application interface


Pros : no change in dialplan and call flow
Cons : you have to rely on the consciousness of users - not all bother, especially if there are many calls

Option number 3 - FreeSwitch + outbound IVR


Lync Version - Lync 2013 Standard Edition
Gateway - FreeSwitch
Access to PSTN - SIP trunk via the Internet with authorization by IP and billing ID support
Source of information on billing: billing provider SIP
The idea is this: for every call to the PSTN, the system will ask if it is a personal call. The user sends a DTMF 0 (if not) or 1 (if the call is personal), then the call is transmitted to the provider's gateway: in the first case unchanged (for example 41221234567), in the second case with a special prefix billing ID (for example 6001001 41221234567). Billing ID (in our example - 6001001) is ignored by the provider when routing a call, but is recorded in the base for billing. Further, when processing invoices from the provider, we simply filter the entire call-log and all expenses for calls with a prefix of 6001001 are uploaded to the appropriate user.

The route of the call in this case will look like this:



How to do?

We will not describe the integration of FreeSwitch with MS Lync, it is well described here (they themselves were guided by this article, thanks to olegbaturin ). To activate an outbound IVR, add the following segments to the configuration file:

To section section dialplan

<!--   "from_Lync"    "Lync"     Lync --> <context name="from_Lync"> <!--     gateway    to_PSTN --> <extension name="RouteToPSTN"> <condition field="destination_number" expression="^\+?(\d{11})"> <action application="ivr" data="outbound_ivr"/> </condition> </extension> </context> 


In the menus section

 <menu name="outbound_ivr" greet-long="ivr/menu.wav" greet-short="ivr/menu.wav" invalid-sound="ivr/invalid.wav" exit-sound="ivr/goodbye.wav" timeout="10000" inter-digit-timeout="2000" max-failures="3" max-timeouts="3" digit-len="4"> <!-- Business call - not doing anything --> <entry action="menu-exec-app" digits="0" param="bridge sofia/gateway/to_PSTN/${destination_number}"/> <!-- Personal call - add a prefix to distinguish --> <entry action="menu-exec-app" digits="1" param="bridge sofia/gateway/to_PSTN/6001001${destination_number}"/> </menu> 


Do not forget to record and place the corresponding wav files in the ivr folder (the menu.wav should report options: “type 1 if it is a personal call ...”)

Pros : it is quite convenient for the user (one additional step), you do not need to change the phone numbers in the contacts database, which means that you can use contacts outside Lync.
Cons : the provider must support billing id prefix *, it is impossible to use the existing gateway from AudioCodes (I had to raise VM for freeswitch).

* - if the provider does not support billing id prefix, this option may still be applicable: in this case, call information can be recorded on any web server via REST api by turning on the curl module for freeswitch, and then comparing this data with the billing from provider (it will be necessary to match the call time and numbers)

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


All Articles