Example Test Environment Setup
This document outlines a sample test environment and configuration that you can use as a reference when setting up your own integration.
Would you like to start using the Calling API but aren’t sure where to begin? Already familiar with the requirements but looking for guidance on the setup? A good way to start is by setting up a test environment!
Initial setup
We’ll use the SIP method to integrate with the Calling API. For this setup, you can either create your own virtual private server (VPS) or use an existing test environment.
Below are the tools you will need:
Configuring the server
Now that you already have everything to start, let’s configure the environment:
Creating a SIP Trunk
A SIP Trunk in FreePBX is a virtual connection that links your FreePBX system to external networks, such as a telephone service provider or another PBX system.
In this integration, the trunk will connect your FreePBX server directly to Meta, enabling the Calling API to route calls between WhatsApp and your test environment.
To properly handle call flows, you need to create two separate trunks:
This separation ensures that each call direction can be configured and monitored independently, providing better control and easier troubleshooting.
When creating the trunks:
Checking Asterisk SIP Settings
Asterisk is the core software engine that FreePBX uses to handle all the actual call processing. FreePBX is essentially a user-friendly interface that sits on top of Asterisk, making it much easier to configure and manage.
Important notes:
You don’t need to change anything in the General SIP Settings.
Make sure that you’re using the correct certificate in the SSL settings and select TLSv1.2 in the SSL Method.
Confirm that the TLS transport is enabled and listening on port 5061. It must match the port configured in the calling settings.
Testing the Calls
Now you´re able to go to the MicroSIP softphone software and add the Extensions using the name and the secret (password) generated in step 1.
SIP Server
VPS public IPv4 address
Username
Extension username
Password
Extension secret
Domain
VPS hostname/IPv4 address
Media Encryption
Mandatory SRTP (RTP/SAVP)
Transport
TLS
Allow IP Rewrite
True
After that, you can make a user-initiated call and/or get the permissions and start a business-initiated call.
Troubleshooting
It’s important to test calls directly through the terminal to verify that the configuration is working as expected.
By monitoring the logs in real time, you can:
Confirm that the calls are correctly established between FreePBX and Meta.
Identify errors or warnings that may indicate misconfigurations or connection issues.
Gather detailed information about SIP messages and call flow for troubleshooting.
Tip:
Use the Asterisk CLI command below to start monitoring logs:
asterisk -rvvv
During a test call, look for any failed registrations, authentication errors, or SIP negotiation problems. This information will help you determine the root cause of any issue and make the necessary adjustments before moving forward.
Last updated
Was this helpful?