Rostelecom virtual PBX: what and how can be done through the API

Modern business perceives landline phones as an outdated technology: cellular communication provides mobility and constant availability of employees, social networks and instant messengers are an easier and faster communication channel. In order to keep up with their competitors, office PBXs are becoming more and more like them: they go to the clouds, are managed via the web-interface and are integrated with other systems through the API. In this post we will tell you what functions the Rostelecom virtual PBX API has and how to work with it through the basic functions of a virtual PBX.

The main task of the Rostelecom virtual PBX API is to interact with CRM or company sites. For example, the API includes widgets “call back” and “call from the site” for the main control systems: WordPress, Bitrix, OpenCart. The API allows you to:

  • Receive information, notify about status and make calls upon request from an external system;
  • Get a temporary link to the conversation recording;
  • Manage and receive restriction settings from users;
  • Get information about the user of a virtual PBX;
  • Request a history of charges and charges on calls;
  • Download call log.

How the API Works

The integration API and the external system interact with each other using HTTP requests. In your personal account, the administrator sets the addresses where requests to the API should come and where requests from the API should be sent. The external system must have a public address accessible from the Internet with an SSL certificate installed.

Also, in your personal account, the domain administrator can restrict the IP sources of requests when accessing the API.

We get information about the users of the virtual PBX

To get a list of users or groups, you need to send a request to the virtual PBX using the method / users_info.

{
        "domain":"example.ru"
}

A list will be returned that you can save.

{
"result":0,
"resultMessage":"",
"users":[
                           {
                            "display_name":"test_user_1",
                            "name":"admin",
                            "pin":^_^quotʚquot^_^,
                           "is_supervisor":true,
                            "is_operator":false,
                            "email":"test_user_1@mail.gov","recording":1
                             },
                            {
                            "display_name":"test_user_2",
                            "name":"test",
                            "pin":^_^quotʿquot^_^,
                            "is_supervisor":true,
                            "is_operator":false,
                            "email":"",
                           "recording":1
                            }
              ],
"groups":
              [
                            {
                            "name":"testAPI",
                            "pin":^_^quotǴquot^_^,
                            "email":"Ivanov@mail.gov",
                            "distribution":1,
                           "users_list":[^_^quotʚquot^_^,^_^quotʿquot^_^]
                            }
              ]

In this method, two arrays are passed. One with domain users, one with domain groups. The group also has the ability to specify the email that will be sent in the request.

We process information about an incoming call

Connecting corporate telephony to various CRM systems saves the time of employees who interact with customers and speeds up the processing of incoming calls. For example, on a call from the current client, CRM can open his card, and from CRM, you can send a call to the client and connect it to the employee.

To get information about calls through the API, you need to use the method / get_number_info, which forms a call list with information about the group into which the call is distributed. Suppose that an incoming call from number 1234567890 has arrived at the virtual PBX number. Then a request will be sent from the PBX:

{
        "session_id":"SDsnZugDFmTW7Sec",
        "timestamp":"2019-12-27 15:34:44.461",
        "type":"incoming",
        "state":"new",
        "from_number":"sip:

Next, you need to connect the handler / get_number_info. The request must be executed when an incoming call arrives on an incoming line before routing calls. If the response to the request is not received within the set time, then the call is routed according to the rules established in the domain.

Example handler on the CRM side.

if ($account) {
        	$data = [
            	'result' => 0,
            	'resultMessage' => 'Абонент найден',
            	'displayName' => $account->name,
            	//'PIN' => $crm_users,
        	];
    	} 
        else 
                {
        	$data = [
            	'result' => 0,
            	'resultMessage' => 'Абонент не найден',
            	'displayName' => 'Неизвестный абонент '.$contact,
            	//'PIN' => crm_users,
        	];
    	}
    	return $data;

The response from the handler.

{
        "result":0,
        "resultMessage":"Абонент найден",
        "displayName":"Иванов Иван Иванович +1 234-56-78-90"
}

We monitor the status and download conversation records

In the virtual telephone exchange of Rostelecom, the recording of conversations is activated in your personal account. Using the API, you can track the status of this function. When processing call termination in call_events can see the flag ‘Is_record’, which notifies the user of the status of the record: true means that the user’s conversation recording function is connected.

To download a record, you need to call session ID session_id send request for api.cloudpbx.rt.ru/get_record.

{
        "session_id":"SDsnZugDFmTW7Sec"
}

The response will be a temporary link to download the conversation recording file.

{
        "result": ^_^quotquot^_^,
        "resultMessage": "Операция выполнена успешно",
    	"url": "https://api.cloudpbx.rt.ru/records_new_scheme/record/download/501a8fc4a4aca86eb35955419157921d/188254033036"
}

The file storage time is set in the settings of your personal account. After the file is deleted.

Statistics and Reporting

In your account on a separate page, you can see statistics and reporting for all calls and apply filters by status and time. Through the API, you must first process the call with the method / call_events:

       {
        "session_id":"SDsnZugDFmTW7Sec",
        "timestamp":"2019-12-27 15:34:59.349",
        "type":"incoming",
        "state":"end",
        "from_number":"sip:

Then call the method call_info to process the array and display the call in the CRM system.

     {
        "session_id":"SDsnZugDFmTW7Sec"
}

The response will be an array of data that can be processed to store data in the CRM log.

{
        "result":0,
        "resultMessage":"",
        "info":
        {
                "call_type":1,
                "direction":1,
                "state":1,
                "orig_number":"sip:admin@example.ru",
                "
                  answering_pin":^_^quotɟquot^_^,
                "start_call_date":^_^quotquot^_^,
                "duration":14,
                 "session_log":"0:el:123456789;0:ru:admin;7:ct:admin;9:cc:admin;14:cd:admin;",
                "is_voicemail":false,
                "is_record":true,
                "is_fax":false,
                "status_code":^_^quotquot^_^,
                "status_string":""
        }
}

Other useful virtual PBX features

In addition to the API, the virtual PBX has some more useful functions that you can use. For example, this is an interactive voice menu and a combination of cellular and fixed communications.

Interactive Voice Response (IVR) is what we hear in the receiver before a person answers. In fact, this is an electronic operator that redirects calls to the appropriate departments and answers some of the questions automatically. Soon, it will be possible to work with IVR through the API: now we are developing software that will allow you to track the progress of a call through IVR and receive information about keystrokes when the caller is in the voice menu.

To transfer corporate telephony to mobile phones, you can either use softphone applications or separately connect the Fixed Mobile Convergence (FMC) service. With any of the methods, calls within the network are free, it is possible to work with short numbers, and calls can be recorded and general statistics can be kept on them.

The difference is that softphones need the Internet to communicate, but they are not tied to an operator, and FMC is tied to a specific operator, but can even be used on older push-button phones.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *