One of our Developer has a question on :
Every inbound call has many legs for the different extensions, which is normal. problem is that there's no way for me to know who actually spoke to the customer!
Problem
Typically with a Call-Centre type application, where we have many extensions/users associated with the Main Company Number. How is it possible to identify which Extension/User answered the call.
Scenario
Let's say a Customer calling in the Main Company Number is redirected to a particular extension using the IVR . The Service Web would display the Call-Legs associated with the call in the "Detailed" view section of the Call-Logs but how do i see them via API response.
Goal
To match the Account level Call-Log records to specific extension/user call-log entries to identify the user who picked up the call
Solution
In-order to identify the extension who picked up the call you would need to retrieve the Account Call-Logs :
API Endpoint : /v1.0/account/{accountId}/call-log
Parameters : 'view' = 'Detailed'
An example of the API response containing the legs would be as below :
"legs": [
{
"startTime": "2016-05-13T18:13:20.000Z",
"duration": 53,
"type": "Voice",
"direction": "Inbound",
"action": "Phone Call",
"result": "Accepted",
"to": {
"phoneNumber": "+11234567890",
"name": "Sample Digital Line Only"
},
"from": {
"phoneNumber": "+11212121212",
"name": "Sample Company Number",
"location": "Millbrae, CA"
},
"transport": "PSTN",
"legType": "Accept",
"extension": {
"uri": "https://platform.ringcentral.com/restapi/v1.0/account/665427020/extension/734191020",
"id": 734191020
}
}
]
For more information on the Account level Call Log Endpoint, please take a look at our API Explorer :
https://developer.ringcentral.com/api-explorer/latest/index.html#/!/Call_Log/loadExtensionCallLog
Please be reminded the endpoint would be/v1.0/account/{accountId}/call-log
From above the Account level Call-Logs would return the legs within the Detailed view which would contain the "to" information about the extension which picked up the Call.
At the moment, our API response would contain the name of the extension who picked up the call using which we could map it to the extension number ( the extension number ( xxx - xxxxx ) assigned to the extension.
The name parameter returned in the API response is the 'First Name' + space + 'Last Name' which is assigned to the extension in the Service Web ( https://service.ringcentral.com/ )
name = ( string ) 'First Name' + space + 'Last Name'
Take a look at our tutorial on adding / creating extensions : https://support.ringcentral.com/mvp/admin/adding-setting-up-users.html
Pre-Requisites
So in order to implement this solution, your application would need to have a mapping of the extensions name to an extension number.
Consider an extension 102 with the details as below :
Extension Number : 102
First Name : John
Last Name : Petrucci
So you can create a mapping which could be a key-value pair matching of :
"Key" : "John" + " " + "Petrucci"
"value" : "102"
Resources
API Explorer : https://developer.ringcentral.com/api-explorer/latest/index.html
API Developer Guide : https://developer.ringcentral.com/api-docs/latest/index.html
If you have any questions or concerns and would like to address any issue with our support team, you could alternatively open a support case with "developer.ringcentral.com"