EasyUC
4.8.7

EasyUC for Microsoft Teams

Set up the trunk and voice routes in Teams

Create and synchronise PSTN gateway, voice route and policy in the Teams tenant from within EasyUC.

EasyUC · Version 4.8.7

In EasyUC: EasyUC Teams → Teams → Teams Tenants → tenant → Settings → Set up the trunk in Teams

What it is for

For Teams to send calls to the EasyUC SBC, the Teams tenant needs four objects: a PSTN gateway with the hostname and port of the SBC, a PSTN usage, a voice route with a number pattern and a voice routing policy. EasyUC creates these objects itself through Teams PowerShell and keeps them up to date.

EasyUC builds the number pattern of the voice route from the numbers of the scripts for which Reachable via MS Teams is switched on with this tenant. Teams therefore sends only calls to these script numbers over the trunk. The SBC rejects every other number. Without a script number EasyUC does not create a voice route.

EasyUC changes only its own objects. By default they are named EasyUC- followed by the first label of the SBC hostname. The gateway is explicitly created as enabled, with SIP OPTIONS, without media bypass and with History-Info and P-Asserted-Identity forwarding. EasyUC does not assign the policy to individual users here.

Prerequisites

  • Licence module teams. Without this module the EasyUC Teams workspace does not appear.
  • Role EasyUC Teams (ROLE_APP_TEAMS_WORKSPACE) with the sub-permissions TENANTS (ROLE_APP_TEAMS_TENANTS) to read and TENANTS bearbeiten (ROLE_APP_TEAMS_TENANTS_EDIT) to change.
  • The tenant’s certificate is issued, the SBC service is running, the firewall is open.
  • The domain of the SBC hostname is verified in the Microsoft 365 tenant.
  • EasyUC is signed in to Teams PowerShell or an app registration is stored (chapter “Graph access and Teams admin sign-in”).
  • At least one script is reachable through this tenant and has a number (chapter “Make a script reachable via Microsoft Teams”). Otherwise only the gateway is created, without a voice route.
  • The Teams users who are to call the script numbers have a Teams Phone licence and Enterprise Voice.

Step by step: Set up the trunk for the first time

  1. Open Teams Tenants, click the tenant and, in the Settings section, go to the box Set up the trunk in Teams.
  2. Check that PowerShell service reachable and Signed in or Signs in automatically are shown.
  3. Under Scripts over this trunk, check that your scripts are listed with the status Reachable.
  4. Decide on Enable for all users (global policy). Without the tick, only users to whom you assign the EasyUC policy use the voice routes. If in doubt, leave it unticked.
  5. Click Show what would happen. The preview only reads and changes nothing in the tenant.
  6. Read The preview covers these numbers and These steps would run. Each step carries a label: will be created, will be changed, will be removed or already in place.
  7. Click Set up the trunk now.
  8. Read the confirmation prompt. It names hostname, port and the number of script numbers. Confirm with OK.
  9. Wait for Steps and their result. Each step shows executed, already in place, failed or not run (aborted).
  10. Check the line Set up in Microsoft. It shows yes with hostname, port, enabled and sends SIP OPTIONS.
  11. Wait a few minutes and click the refresh icon at the top right. Reached from Microsoft then shows “Microsoft answers our OPTIONS”, and OPTIONS from Microsoft shows a current time.

Step by step: Assign the voice routing policy to users

  1. Without the global option you must assign the EasyUC policy to the users yourself. EasyUC does not do this during trunk setup.
  2. Open the customer’s Teams admin center and go to the voice routing policies.
  3. Select the policy whose name begins with EasyUC-. The preview in EasyUC shows the exact name.
  4. Assign the policy to the users who are to call script numbers from Teams.
  5. Expect Teams to apply the assignment only after some time.

Step by step: Synchronise voice routes after a change

  1. When you save a script, EasyUC synchronises the route in Teams itself. The script form shows “Updating the route in Teams …” and then “Route in Teams set” with the numbers.
  2. Without an app registration this synchronisation only runs while a Teams administrator is signed in on the tenant page.
  3. For a manual synchronisation, open the box Voice routes for the script numbers and click Synchronise now. This can take up to two minutes.
  4. Read the result: “Route in Teams set: …” or “Teams updated: no script number is reachable over this tenant any more, so no EasyUC route is left there.”
  5. If the gateway or the global policy is to be adjusted as well, click Update routes instead and confirm the prompt. Synchronise now never changes the PSTN gateway or the global policy.

Step by step: Set up the trunk by hand or remove it again

  1. Without the PowerShell service, click Set it up by hand instead. EasyUC shows what has to be created in the Teams tenant, including the complete New-CsOnlinePSTNGateway command with this tenant’s hostname and port.
  2. Then create a voice route for the script numbers in Teams and assign a voice routing policy to the users.
  3. To remove, click Remove the trunk and confirm the prompt. EasyUC removes its objects in reverse order. No calls run over the trunk afterwards.
  4. If the PSTN usage is attached to the global policy, EasyUC removes only its own entry from it. The prompt points this out.

Fields and options

Fields and options
Field / actionMeaning and use
Set up in MicrosoftConfiguration state in Microsoft: not checked yet, not yet, yes or exists, but does not match these settings. After it: hostname, port, enabled/disabled and sends SIP OPTIONS/no SIP OPTIONS.
Reached from MicrosoftMeasured at your own SBC: whether Microsoft answers the SBC’s OPTIONS and when OPTIONS last arrived from Microsoft. Microsoft does not expose this state through any interface.
Routes in TeamsState of the last synchronisation: Up to date, Outdated or Never synchronised, with a timestamp.
Synchronise nowRebuilds the voice routes from the current script numbers. Changes only EasyUC’s voice route, PSTN usage and policy.
Enable for all users (global policy)Attaches this trunk’s PSTN usage to the Global policy. This changes the default policy of all users with Enterprise Voice in this tenant. Applies to Update routes only. Not recommended with scripts that use Operator Connect through Teams forwarding.
Show what would happenRead-only preview with the numbers covered, the steps and notes. Reports “Nothing to do: the trunk in Microsoft already matches these settings.” when everything matches.
Set up the trunk now / Update routesRuns the steps of the preview. The label changes as soon as the gateway exists in Microsoft.
Remove the trunkRemoves EasyUC’s gateway, voice route, PSTN usage and policy from the Teams tenant.
Set it up by hand insteadExpands the guide for setting up without the PowerShell service.
These commands ranList of the executed commands as readable lines, for documentation.

Check the result and narrow down errors

  • Success: Set up in Microsoft shows yes, Reached from Microsoft shows “Microsoft answers our OPTIONS”, Routes in Teams shows Up to date, and the tenant list shows the trunk as active.
  • Microsoft sends OPTIONS only after the SBC’s OPTIONS have arrived. If the trunk is still down or unknown after a few minutes, check certificate, hostname, TLS port and firewall.
  • „Microsoft kennt die Domain dieses SBC-Namens in diesem Tenant nicht. …“ Add the domain in the Microsoft 365 admin center under Settings → Domains and verify it with a TXT record. For a name with two subdomain levels, exactly the domain after the first label must be registered.
  • „Die Anmeldung steht, aber dem Konto fehlen die Rechte. Der App-Registrierung muss die Verzeichnisrolle „Teams-Administrator“ zugewiesen sein.“ Assign the role in Microsoft Entra.
  • „Dem Tenant fehlt eine Voraussetzung an Lizenzen. Für Direct Routing brauchen die Benutzer eine Teams-Phone-Lizenz und Enterprise Voice.“ Check the licences in the tenant.
  • „Erst mit einem Teams-Administrator anmelden oder unter Microsoft Graph eine App-Registrierung hinterlegen, dann meldet sich EasyUC selbst an.“ The buttons are locked until a sign-in exists.
  • „Die Antwort des Abgleichs kam nicht rechtzeitig zurück. Er kann dennoch durchgelaufen sein; der Stand oben wird gleich nachgezogen.“ Wait and reload the page before synchronising again.
  • “The gateway sends no History-Info (ForwardCallHistory off). Operator Connect through Teams forwarding needs it.” Affects only scripts with Teams forwarding. Click Update routes so that EasyUC aligns the gateway with its settings.
  • A call to the script number fails although everything is green: check whether the EasyUC policy is assigned to the calling user, and wait for Teams to apply it.

Related chapters