Rate this page:

How to debug scenarios

An the important process during app development is debugging. Learn how to use the built-in Voximplant debugger in development.

Tracing

The debugger is available while you open a scenario in our cloud IDE. To open a scenario, go to the Applications section, click your target application, switch to the Scenarios tab, and click on a scenario. In the upper right corner, you will see a Debug button with a dropdown menu to set debugging parameters before the first run and adjust them as needed.

Scenario debug

When you click Debug, the Debug parameters dialog will appear. If you click Use last settings, the debugger runs immediately.

Being in Debug parameters, you should specify the rule for debugging purposes and one of the three debugging criteria, which are available in the dropdown:

  • Calls from a specific IP address – the debugger will be connected to a session started by a call from the specified IP address.

  • Calls from a specific phone number – the debugger will be connected to a session started by a call to/from the specified phone number.

  • All calls – the debugger will be connected to a session started by any call that matches the specified Rule.

After that, you can check the Run the rule checkbox to run your rule along with the debugger. If needed, you can pass custom data to the scenario using the input field below.

Debug parameters

The debugger will be launched after the Debug button click; you can see its interface on the image below:

Debugger interface

The interface and functionality are very similar to Developer tools (like Firebug) for web browsers that are used to debug Javascript apps and contain Scripts, Watch Expressions, Call Stack, Breakpoints and Console sections. The debugger will be waiting for a new session that matches specified parameters (Application, Rule, Criteria) to appear after pressing the 'START' button. If a breakpoint is specified, script execution is paused at the line with breakpoint and Controls can be used for step-by-step debugging or to resume execution.

Softphone

In the Debug dropdown menu you can also find our Softphone. It is developed with the Voximplant Web SDK. Use this softphone to make and receive calls when testing your app.

Follow the steps below:

  1. Create a user in your Voximplant application and remember its credentials:
User
  1. Open your scenario and in the upper right corner, click DebugSoftphone.
  2. Accept the microphone permission if needed.
  3. Log into the softphone with the created user’s credentials:
Softphone login
  1. The Debug parameters window will open. Check that everything is set up correctly, specify the username in the Custom data to call if needed.
  2. Click Debug and receive a call in the browser via the softphone or make one using the dialpad.

You can also launch the softphone from Test tools in the Routing tab:

Test tools

Debug keyword

The debugger recognizes the debugger keyword in scenarios so you can use it as in regular JS development.

Note that a JavaScript scenario can output into the Debug Console via the trace() function:

a trace() call

a trace() call