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.

teams1

Requirements

  • To use number resolution, the Direct Routing telephony variant must be used for Microsoft Teams.
  • 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

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.

audiocodes_rest_1

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:

audiocodes_rest_2

Create a new HTTP Remote Host from the current Remote Web Service data set with the following parameters:

audiocodes_rest_3

audiocodes_rest_4

  • 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):

audiocodes_rest_5

  • 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:

audiocodes_rest_6

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:

anynode_rest_13

Link the desired fields with the display name. Hold down the Ctrl key to perform a multiple assignment:

anynode_rest_14

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).

anynode_rest_15

Troubleshooting

API Test

To test the function of the API independently of the Session Border Controller, the tool Postman can be used, for example.

anynode_rest_16

anynode_rest_17

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:

audiocodes_rest_7

Proceed as follows:
  1. Prepare a test call.

  2. Open the message log window. Execute Stop and Clear.

  3. Then press Start and immediately make the test call.

  4. As soon as you see the Microsoft Teams caller display, press Stop.

  5. Copy the output of the message log into a text editor (e.g. Notepad++)

  6. 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:

audiocodes_rest_8

Suggestions for improvement welcome

Have you discovered an error on this page or found an unclear formulation?
Please send your comments and suggestions for improvement to doku@c4b.de.
Thank you for your help!