AudioCodes - REST
This chapter describes the configuration of an AudioCodes Mediant Session Border Controller for caller search in the XPhone Connect Directory and name display in Microsoft Teams using the REST interface.
Requirements
- To use number resolution, the Direct Routing telephony variant must be used for Microsoft Teams.
We assume that Direct Routing for Microsoft Teams is set up and functional.
Number resolution does not work with Operator Connect.
Phone number resolution is only possible for incoming calls. No phone number resolution can be configured for outgoing calls from Microsoft Teams.
Corresponding documentation on direct routing can be found in the AudioCodes partner portal or on the Microsoft website:
- The AudioCodes version was tested:
7.40A.500.357
7.40A.251.284
- At least XPhone Connect Directory in the version:
9.0.344
Contacts by XPhone must be licensed for the maximum number of users who can make calls via the telephone network.
XPhone Connect Directory configuration
First set up the XPhone Connect Directory according to Documentation.
Complete the dialing parameters that are listed under Settings.
Phone number formats
The XPhone Connect Directory recognizes the following phone number formats for caller identification. The prerequisite is that the dialing parameters (see previous section) are configured correctly:
Internal numbers (the length of the internal numbers specified in the dialing parameters is relevant)
Local network numbers (not starting with the digit 0 and longer than internal numbers)
National numbers (starting with the digit 0)
International numbers (starting with the digits 00)
E.164 Phone numbers (beginning with a plus sign)
Hint
E.164 numbers without a plus sign are not recognized. If you have configured your SBC to work with E.164 numbers, add the plus sign in the configuration of the request (see configuration of the request key below). Note that the plus sign in HTTP calls must be formulated as %2B
.
Create API Secret
Create the user name and password for REST access via your directory administration as follows:
Click on the Cloud connection button.
Navigate to Licensing and click on OPEN ADMIN PORTAL.
The Admin Portal opens in a new browser window.
Open the Caller ID API page and click on the Create API Secret button.
This combination of user name and password is required for further configuration in the Anynode SBC.
Audiocodes configuration
Microsoft Teams Direct Routing with AudiCodes must be configured according to the manufacturer’s specifications.
Under Setup > IP Network > Security, create a new TLS Context that will be used to check the API certificate. Set TLS 1.2 (not TLS 1.3) and activate Use default CA Bundle. Make a note of the name of the TLS context, it will be required in the next step for the Remote Web Service.
Create a new Remote Web Service under Setup > IP Network > Web Services > Remote WebServices. Make a note of the selected name (here: ContactSearchREST), as this must be entered later in the Call Setup Rule as Request Target:
Type:
General
Path:
api
Number of connections:
5-10
TLS Context: Previously created TLS Context, (only TLS 1.2, not 1.3)
Username: User name of the directory API
Password: Password of the Directory API
Create a new HTTP Remote Host from the current Remote Web Service data set with the following parameters:
Address:
cbx-release-api.c4b.com
Now create a new rule under Setup > Signaling & Media > SIP Definitions > Call Setup Rules. Assign a unique ID and make a note of it (here 6
):
Request Target: Name of the previously generated Remote Web Service (see above).
- Request Key
'v1/caller-info?MicrosoftTenantID=<your-tenant-id>&CallingPartyNumber='+Func.URL-Encode(Param.Call.Src.User)+'&CalledPartyNumber='+Func.URL-Encode(Param.Call.Dst.User)
Replace <your-tenant-ID> with the Tenant ID of your Microsoft 365 system. You can also find this under Cloud Connection/Licensing in your directory administration. Note the single quotation marks in this expression.
Condition:
HTTP.Response.Status=='200'
Select the IP-to-IP Routing Record that routes from your PSTN-SIP trunk to Microsoft Teams. Activate the Call Setup Rule by entering its ID under Call Setup Rules Set ID:
Advanced settings
Customize display
This chapter shows the configuration of the LDAP attribute displayName in the format:
<Name> <Vorname>, <Firma>
This configuration must be carried out for each data source. This method allows the display format to be adapted to the data source and independently of the configuration of the SBC.
Open the field link of the corresponding data source:
Link the desired fields with the display name. Hold down the Ctrl key to perform a multiple assignment:
Click on the funnel symbol to open the following dialog window. Move the source fields into the desired order and define the separators. There is a space in the text element between first name and last name (invisible in the screenshot).
Troubleshooting
API Test
To test the function of the API independently of the Session Border Controller, the tool Postman can be used, for example.
Replace the values in the angle brackets with your test data:
https://cbx-release-api.c4b.com/api/v1/caller-info?MicrosoftTenantID=<tenant-id>&CallingPartyNumber=<%2B49891234567>&CalledPartyNumber=<%2B49891234568>
AudioCodes Message Log
Use the Message-Log to check the HTTP calls:
- Proceed as follows:
Prepare a test call.
Open the message log window. Execute Stop and Clear.
Then press Start and immediately make the test call.
As soon as you see the Microsoft Teams caller display, press Stop.
Copy the output of the message log into a text editor (e.g. Notepad++)
Use the text search to search for the name of the remote web service that you are using for the search (e.g. ContactSearchREST). Here you will find information on the parameters of the REST call. Check these against the “target values”.
If necessary, set the log level to Detailed:
Suggestions for improvement welcome