Tom Talks Microsoft Teams and Microsoft 365 news and opinions

Microsoft Teams Direct Routing SIP Tester PowerShell Script

Just last week I blogged that this was coming on the roadmap, now here it is:

https://docs.microsoft.com/en-us/microsoftteams/sip-tester-powershell-script

“SIP Tester” is a sample PowerShell script from Microsoft that you can use to test Direct Routing Session Border Controller (SBC) connections in Microsoft Teams. This script tests the basic functionality of a customer-paired Session Initiation Protocol (SIP) trunk with Direct Routing.

The script submits a SIP test to the test runner (a Microsoft Service, https://calltester.pstnhub.microsoft.com), waits for the result, and then presents it in a human-readable format.

image

You can use this script to test the following 4 scenarios:

Outbound and inbound calls

This test scenario validates that outbound and inbound calls work and that media can travel all the way through in both directions between two participants. This scenario helps to identify possible configuration issues.

Use two Teams users in different tenants. This is the preferred approach as it doesn’t require any manipulation on the SBC being tested, and therefore, verifies call setup and media in conditions that are close to production. Different tenants are required as this approach removes the possibility of short-circuiting the call on the Teams backend infrastructure and forces the signalling to go to the external PSTN partner.

Simultaneous ring

This test scenario validates the Teams functionality of ringing multiple endpoints (for example, various devices with call forwarding enabled) for incoming calls.

Media escalation

This test scenario validates the situation when more participants are added to the initial 1:1 call, which makes it an ad-hoc meeting with a mixer being introduced to mix the multi-party audio.

Consultative transfer

This test scenario validates the Teams functionality to transfer the call as soon as a 1:1 call is established. This functionality allows one participant to initiate a transfer (basic or consultative), transferring the call to another test user. In a consultative transfer, the party who initiates the transfer establishes a new call with the transfer target (the new party that’s introduced into the call) for consultation before the transfer actually takes place.

Test setup

Download the SipTesterClient.ps script. Execute the script in PowerShell in administrator mode.
The script needs the Adal.ps package for execution. If it’s not present, the script will try to install it automatically. For this, run the script in administrator mode (first execution-only).

You must disable MFA (Multi Factor Authentication) for test users, otherwise, an error message will be returned.

Input Parameters

  • TeamsOutUsername – Username of the caller in Teams (used to make an outbound call)
  • TeamsOutPassword – Password of the caller in Teams (used to make an outbound call)
  • TeamsInUsername – User principal name of the recipient of the call in Teams (used to receive an inbound call).
  • TeamsInPassword – Password of the recipient of the call in Teams (used to receive inbound call)
  • DestinationNumber – PSTN number that is routed to TeamsIn user
  • TeamsOutDataCenter – (Optional) Preferred location of Teams client (used to make outbound call), valid values: [APAC-SG, APAC-HK, EMEA-DB, EMEA-AM, NOAM-BL, NOAM-DM]
  • TeamsInDataCenter – (Optional) Preferred location of Teams client (used to receive inbound call), valid values: [APAC-SG, APAC-HK, EMEA-DB, EMEA-AM, NOAM-BL, NOAM-DM]
  • TeamsInEscalationUsername – (Optional) User principal name of the escalation target in Teams (used to escalate call)
  • TeamsInEscalationPassword – (Optional) Password of the escalation target in Teams (used to escalate call)
  • TeamsInEscalationIncomingNumber – (Optional) PSTN number that is routed to TeamsInEscalation user
  • TeamsInEscalationDataCenter – (Optional) Preferred location of Teams client (used to escalate call), valid values: [APAC-SG, APAC-HK, EMEA-DB, EMEA-AM, NOAM-BL, NOAM-DM]
  • TeamsInTransferTargetUsername – (Optional) User principal name of the transfer target in Teams (used to transfer call)
  • TeamsInTransferTargetPassword – (Optional) Password of the transfer target in Teams (used to tranfer call)
  • TeamsInTransferTargetIncomingNumber – (Optional) PSTN number that is routed to TeamsInTransferTarget user
  • TeamsInTransferTargetDataCenter – (Optional) Preferred location of Teams client (used to transfer call), valid values: [APAC-SG, APAC-HK, EMEA-DB, EMEA-AM, NOAM-BL, NOAM-DM]
  • TeamsInSimulringUsername – (Optional) User principal name of the simultaneous ring target Teams (used for simultaneous ring)
  • TeamsInSimulringPassword – (Optional) Password of the simultaneous ring target Teams (used for simultaneous ring)
  • TeamsInSimulringIncomingNumber – (Optional) PSTN number that is routed to TeamsInSimulring user
  • TeamsInSimulringDataCenter – (Optional) Preferred location of Teams client (used for simultaneous call), valid values: [APAC-SG, APAC-HK, EMEA-DB, EMEA-AM, NOAM-BL, NOAM-DM]
  • CertificateContent – Base64 Certificate content for authentication
  • ProviderId – (Optional) Used to verify call records for BV users
  • CallDurationMinutes – Duration of the call in minutes
  • MediaValidationFrequencyMinutes – Frequency of media validation during call in minutes
  • HideTable – (Optional) Won’t print out table of test results.
  • UseUserCredentials – (Optional) Uses TeamsOut credentials for authentication.

 

Output Parameters

  • Flow – Call direction relative to Teams backend, outbound or inbound
  • SipCallId – SIP call ID of SBC being tested
  • Code – Call result code, 0 for success, non-0 for failure (internal to Teams backend)
  • TrunkFqdn – The actual SBC used for the test
  • ChainId – The internal Teams call ID
  • State – General test result (succeeded or failed)
  • Phrase – Arbitrary phrase indicating the reason for failure if any

About the author

Tom Arbuthnot

A Microsoft MVP and Microsoft Certified Master, Tom Arbuthnot is Founder and Principal at Empowering.Cloud as well as a Solutions Director at Pure IP.

Tom stays up to date with industry developments and shares news and his opinions on his Tomtalks.blog, UC Today Microsoft Teams Podcast and email list. He is a regular speaker at events around the world.

9 comments

Leave a Reply to Microsoft Teams Direct Routing SIP Tester PowerShell Script – Tom Talks – JC's Blog-O-GibberishCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Tom Talks Microsoft Teams and Microsoft 365 news and opinions