SIP Tester documentation
Table of Contents
Introduction...........................................................................................................................................2
Test scenarios.........................................................................................................................................2
Outbound- inbound call.....................................................................................................................2
Description.....................................................................................................................................2
Test flow.........................................................................................................................................3
Simultaneous ring...............................................................................................................................3
Description.....................................................................................................................................3
Test flow.........................................................................................................................................3
Media escalation................................................................................................................................4
Description.....................................................................................................................................4
Test flow.........................................................................................................................................4
Consultative transfer..........................................................................................................................4
Description.....................................................................................................................................4
Test flow.........................................................................................................................................5
Setup......................................................................................................................................................5
Input parameters..............................................................................................................................5
Simultaneous Ring.......................................................................................................................6
Media Escalation..........................................................................................................................6
Consultative Transfer...................................................................................................................6
Important considerations about TeamsOut and TeamsIn users....................................................7
Output parameters..........................................................................................................................7
Examples...........................................................................................................................................8
Outbound-inbound call...............................................................................................................8
Simultaneous ring........................................................................................................................8
Media escalation..........................................................................................................................8
Consultative transfer....................................................................................................................8
Introduction
SIP Tester client is a sample PowerShell script that you can use to test Direct Routing Session Border
Controller (SBC) connections in Microsoft Teams. The script tests basic functionality of a customer-
paired Session Initiation Protocol (SIP) trunk with Direct Routing.
The script submits an SIP test to the test runner, waits for the result, and then presents it in a human-
readable format. You can use this script to test the following scenarios:
Outbound-inbound call
Simultaneous ring
Media escalation
Consultative transfer
Test scenarios
Outbound- inbound call
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 identify possible
configuration issues.
Description
To validate outbound and inbound calls in the absence of a PSTN endpoint that the test runner can
control, this scenario uses two Teams users talking to each other and call setup and media runs
through the SIP trunk and SBC. During the test, one Teams user calls another Teams user. After the call
is established, the test runner validates audio by playing, recording, and then playing back the test
audio stream.
You can test the following two approaches in this scenario.
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 signaling to go to the external PSTN partner.
The call setup is as follows:
1. TeamsOut user places an outbound call to a number belonging to TeamsIn user in a different
tenant. For example, +5550101. The call goes to the SBC being tested.
2. SBC routes the call back to Teams by creating a new call to the +5550101 number as it knows
the number belongs to Teams.
3. TeamsIn user who owns the +5550101 number receives an incoming call and picks it up.
4. Media is sent in both directions and media verification is performed.
Use two Teams users in the same tenant
The call setup is as follows:
1. TeamsOut user places an outbound call to a number with a special prefix/suffix. For example,
+4255550189. The call goes to the SBC being tested.
2. A routing rule and a message manipulation rule removes the prefix/suffix and creates a new call
back to Teams. For example, +5550189.
3. TeamsIn user who owns the +5550189 number receives an incoming call and picks it up.
4. Media is sent in both directions and media verification is performed.
2
Test flow
From the test runner perspective, the test sequence is as follows:
1. Test runner invokes SignIn with TeamsIn user and instructs the user to pick up the incoming call.
2. Test runner instructs TeamsOut user to dial TeamsIn.incomingNumber.
3. TeamsIn user receives the call and picks it up, notifying the test runner about it.
4. Test runner validates audio in a call by doing the following:
a. Instructs TeamsIn user to record audio.
b. Instructs TeamsOut user to play audio.
c. Validates recorded file.
d. Instructs TeamsOut user to record audio.
e. Instructs TeamsIn user to play audio.
f. Validates recorded audio.
5. Test runner terminates all sessions.
6. Test runner fetches data from CDRs for TeamsOut/TeamsIn calls.
Simultaneous ring
This test scenario validates the Teams functionality of ringing multiple endpoints (for example, various
devices with call forwarding enabled) for incoming calls.
Description
In this test scenario, forking support on the customer’s SBC that’s configured in bypass mode is tested
to make sure that in an inbound PSTN to Teams call, multiple relevant Teams endpoints will ring at the
same time.
Three test users are used in this scenario: two test users for a 1:1 call (similar to the outbound-
inbound call scenario) and one user with an inbound number that’s configured similar to the inbound
number in the outbound- inbound call scenario. The idea is that when dialing TeamsIn user, its call
forwarding settings are manipulated in such a way that calls are also forked to TeamsInSimulring
user(s) and multiple provisional SIP dialogues are created and surfaced to the SBC.
Test flow
1. TeamsIn user call redirection settings are updated to simultaneously ring TeamsInSimulring
user(s).
2. Test runner invokes SignIn with TeamsInSimulring user(s) and instructs it to ring but not pickup
incoming call
3. Test runner invokes SignIn with TeamsIn user and instructs it to ring but not pick up incoming
call.
4. Test runner instructs TeamsOut user to dial TeamsIn.incomingNumber.
5. TeamsInSimulring user(s) receive new call and notify the test runner.
6. Test runner instructs TeamsIn user to accept the call.
7. Test runner validates audio in a call by doing the following:
a. Instructs TeamsIn user to record audio.
b. Instructs TeamsOut user to play audio.
c. Validates recorded file.
d. Instructs TeamsOut user to record audio.
e. Instructs TeamsIn user to play audio.
f. Validates recorded audio.
8. Test runner terminates all sessions.
9. Test runner fetches data from CDRs for TeamsOut/TeamsIn calls.
10. Test runner resets call redirection settings.
3
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.
Description
In this test scenario, the 1:1 call is established first and then an additional user is added to the call. The
user can be a Teams user or a user with a PSTN number. This scenario supports two cases: escalating
to a Teams user (for Direct Routing customers) and escalating to a PSTN number (for business voice
partners). After the additional user is added, audio is validated by the test runner by playing and
recording and then playing back the test audio stream for all users.
For the test, three users are needed: two users for the initial 1:1 call and one test user, who has an
inbound number configured similarly to the inbound number in the outbound- inbound call scenario
to test escalation to a PSTN number. Otherwise, any Teams user can be used.
Test flow
1. Establish outbound and inbound call (as in the outbound- inbound call scenario).
2. Test runner invokes SignIn with TeamsInEscalation user and instructs it to pick up the incoming
call.
3. Test runner adds a PSTN participant or Teams user (depending on the value of
TeamsInEscalation.incomingNumber) to the established call. If
TeamsInEscalationIncomingNumber is empty, the Teams participant is added. Otherwise, the
relevant PSTN participant is added.
4. TeamsInEscalation user receives new call, picks it up and notifies the test runner.
5. Test runner validates audio in conference call by doing the following”
a. Instructs TeamsIn user to record audio.
b. Instructs TeamsOut user to play audio.
c. Validates recorded file.
d. Instructs TeamsOut user to record audio.
e. Instructs TeamsInEscalation user to play audio.
f. Validates recorded file.
g. Instructs TeamsInEscalation to record audio.
h. Instructs TeamsIn user to play audio.
i. Validates recorded file.
6. Test runner terminates all sessions.
7. Test runner fetches data from CDRs for all calls.
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 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.
Description
In this test scenario, call transfer functionality is tested. The consultative transfer flow also covers the
basic transfer flow. Because most users use transfer for inbound calls, the test scenario covers only
consultative transfer for inbound calls.
4
In a consultative transfer, because the call between the party who initiates the transfer and the transfer
target is always outbound, this test scenario assumes SBC supports INVITE with Replaces header.
Test flow
1. Establish outbound-inbound call (as in the outbound- inbound call scenario).
2. Test runner invokes SignIn with TeamsInTransferTarget user and instructs it to pick up
incoming call.
3. Test runner transfers inbound call with consultation to PSTN number
(TeamsInTransferTarget.incomingNumber).
4. TeamsInTransferTarget user receives new call, picks it up and notifies the test runner.
5. TeamsOut user leaves call and notifies the test runner.
6. Test runner validates audio in conference call:
a. Instructs TeamsIn user to record audio.
b. Instruct TeamsInTransferTarget user to play audio.
c. Validate recorded file.
d. Instruct TeamsInTransferTarget user to record audio.
e. Instructs TeamsIn user to play audio.
f. Validates recorded audio.
7. Test runner terminates all sessions.
8. Test runner fetches data from CDRs for all calls.
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). SIP Tester client
script only supports adal.ps version 3.19.8.1.
You must disable MFA (Multi Factor Authentication) for test users, otherwise an error message will be
returned.
To launch certain test scenarios, relevant input parameters should be included. To learn more, see the
Input parameters and Examples sections.
Input parameters
The following call flows are common to all tests:
Outbound call is placed by TeamsOut user to a number specified in DestinationNumber
SBC receives INVITE and places outbound call back to TeamsIn user's phone number.
Call to TeamsIn user is accepted.
Media is played and recorded in sequence both ways and validated.
Test Case Parameter Description
All TeamsOutUsername Username of caller in Teams (used to
make outbound call)
TeamsOutPassword Password of caller in Teams (used to
make outbound call)
TeamsInUsername User principal name of the recipient
of the call in Teams (used to receive
inbound call).
TeamsInPassword Password of the recipient of the call
in Teams (used to receive inbound
5
call)
DestinationNumber PSTN number that’s routed to
TeamsIn user
TeamsInSimulringUsername User principal name of the
simultaneous ring target in Teams
(used for simultaneous ring)
Simultaneous TeamsInSimulringPassword Password of the simultaneous ring
Ring target in Teams (used for
simultaneous ring)
TeamsInSimulringIncomingNumber PSTN number that’s routed to
TeamsInSimulring user
TeamsInEscalationUsername User principal name of the
escalation target in Teams (used to
escalate call)
TeamsInEscalationPassword Password of the escalation target
Media Teams (used to escalate call)
Escalation TeamsInEscalationIncomingNumber PSTN number that’s routed to
TeamsInEscalation user (needed
when testing escalation to PSTN
number. If left empty, Teams
participant is added)
TeamsInTransferTargetUsername User principal name of the transfer
target Teams (used to transfer call)
TeamsInTransferTargetPassword Password of the transfer target
Consultative
Teams (used to transfer call)
Transfer
TeamsInTransferTargetIncomingNumber PSTN number that’s routed to
TeamsInTransferTarget user
Optional TeamsOutDataCenter Preferred location of Teams client
parameters used to make outbound call, valid
values: [APAC-SG, APAC-HK, EMEA-
DB, EMEA-AM, NOAM-BL, NOAM-
DM]
TeamsInDataCenter Preferred location of Teams client
used to receive inbound call, valid
values: [APAC-SG, APAC-HK, EMEA-
DB, EMEA-AM, NOAM-BL, NOAM-
DM]
CertificateContent Base64 Certificate content for
authentication
ProviderId Used to verify call records for BV
users
CallDurationMinutes Duration of the test call in minutes.
For example, if set to 4 minutes, the
call will be terminated 4 minutes
after the call is established
MediaValidationFrequencyMinutes Specifies how often media should be
validated (play/record, validation)
during the call. For example, if
CallDurationMinutes is set to 4 and
MediaValidationFrequencyMinutes is
6
set to 1, media is validated each
minute - 4 times (max value – 9
minutes)
HideTable If specified, will not print out table of
test results.
EndpointUrl The URL of the SIP tester backend
service
Verbose If specified, the script prints out all
intermediate steps (e.g. “Acquiring
AAD token, Test in 'scheduled' state,
…”, etc.)
UseUserCredentials If set to True, TeamsOut user
credentials are automatically used
for script execution
Important considerations about TeamsOut and TeamsIn users
It’s recommended that users are in different tenants (all TeamsIn users might be in the same
tenant though).
This shouldn't require special configuration on the PSTN partner's SBC being tested and
therefore more closely replicates a real-life call flow. In this case, DestinationNumber and all
TeamsIn users' IncomingNumbers are real numbers assigned to respective users in the Teams
backend.
These users might be in the same tenant in which case additional configuration is required on
the PSTN partner's SBC being tested.
Specifically, DestinationNumber and all TeamsIn users' IncomingNumbers must not be assigned
to users in the Teams backend but rather contain special prefixes and suffixes that the SBC will
strip and route the calls back to Teams. As an example, if TeamsIn user's assigned phone
number is +5550175, message manipulation and routing rules can be setup on the SBC to route
calls placed to +4255550175 back to Teams and to +5550175.
If the same test users are used for multiple test scenarios, it’s recommended to run tests in sequence.
Start consecutive test execution only after the previous one is finished. Running multiple tests with the
same test users in parallel may result in failures because of internal test runner limitations on parallel
executions. Fair Usage Policy check returns “429 Too Many Requests” if a test is already running for a
test user. At the same time, multiple tests can be executed in parallel if different test users are used.
Output parameters
Each test run is represented in the output as a series of rows. Each row indicates the result of the call
made as part of the test. Overall, the script returns a value of True if the test passes and a value of
False if the test fails.
Parameter Description
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
7
Examples
Outbound-inbound call
.\SipTesterClient.ps1 -TeamsOutUsername user1 -TeamsOutPassword pass1 -TeamsInUsername
user2 -TeamsInPassword pass2 -DestinationNumber +5550100 -Verbose
Simultaneous ring
.\SipTesterClient.ps1 -TeamsOutUsername user1 -TeamsOutPassword pass1 -TeamsInUsername
user2 -TeamsInPassword pass2 -DestinationNumber +5550100 -TeamsInSimulringUsername user3 -
TeamsInSimulringPassword pass3 -TeamsInSimulringIncomingNumber +5550199 -Verbose
Media escalation
.\SipTesterClient.ps1 -TeamsOutUsername user1 -TeamsOutPassword pass1 -TeamsInUsername
user2 -TeamsInPassword pass2 -DestinationNumber +5550100 -TeamsInEscalationUsername user3 -
TeamsInEscalationPassword pass3 -TeamsInEscalationIncomingNumber +5550199
Consultative transfer
.\SipTesterClient.ps1 -TeamsOutUsername user1 -TeamsOutPassword pass1 -TeamsInUsername
user2 -TeamsInPassword pass2 -DestinationNumber +5550100 -TeamsInTransferTargetUsername
user3 -TeamsInTransferTargetPassword pass3 -TeamsInTransferTargetIncomingNumber +5550199 -
Verbose