Using Session Initiation Protocol
Session Initiation Protocol (SIP) is a signaling protocol used for initiating, maintaining, modifying, and terminating real-time communication sessions between two or more endpoints.
In this documentation, you will learn:
When SIP is enabled, you cannot use calling-related Graph API endpoints, and calling-related webhooks will not be sent.
Additionally, for debugging purposes, please note that as soon as the user presses the voice call button, Meta immediately attempts to connect with the SIP server defined—leaving no opportunity to intercept or inspect the request beforehand.
Before starting
Make sure you have enabled and configured SIP on the business phone number. Please note that Meta generates a unique SIP user password for each business phone number + app combination.
For business-initiated calls, SIP INVITE from your SIP server will be challenged using digest auth.
For user-initiated calls, it is highly recommended that you challenge SIP INVITE requests from Meta to use digest auth for more security.
Configure/Update SIP settings
Update call settings configuration for the phone number, using the endpoint:
POST
https://waba-v2.360dialog.io/calling/settings
--header 'D360-API-KEY: ••••••'
Request body
{
"calling": {
... // other calling api settings
"sip": {
"status": "ENABLED",
"servers": [
{
"hostname": SIP_SERVER_HOSTNAME
"port": SIP_SERVER_PORT,
"request_uri_user_params": {
"KEY1": "VALUE1", // for cases like trunk groups (tgrp)
"KEY2": "VALUE2",
}
}
]
}
},
// Other non calling api feature configurations
}
How to configure SDES for SRTP key exchange protocol
You can configure SRTP key exchange to one of two options:
DTLS (default) — Industry-standard encrypted key exchange. Recommended.
SDES — Plain text key is defined in the SDP which is sent over secure signaling protocol (SIP).
To proceed, use the following request syntax:
POST
https://waba-v2.360dialog.io/calling/settings
Request body:
{
"calling": {
"status": "ENABLED",
"call_icon_visibility": "DEFAULT"
. . .
"srtp_key_exchange_protocol": "DTLS (default) | SDES",
. . .
}
. . .
}
Get phone number calling settings (SIP)
Use this endpoint to check the configuration of your Calling API feature settings, including SIP values:
GET
https://waba-v2.360dialog.io/calling/settings
--header 'D360-API-KEY: ••••••'
Response Body
{
"calling": {
"status": "ENABLED",
"call_icon_visibility": "DEFAULT",
"callback_permission_status": "ENABLED",
"sip": {
"status": "ENABLED",
"servers": [
{
"hostname": "sip.example.com",
"sip_user_password": "{SIP_USER_PASSWORD}"
}
]
}
}
}
Include SIP User Password (Optional)
Optionally, you can include SIP user credentials in your response body by adding the SIP credentials query parameter in the POST request:
GET
https://waba-v2.360dialog.io/calling/settings
?include_sip_credentials=true
--header 'D360-API-KEY: ••••••'
Response Body
{
"calling": {
"status": "ENABLED",
"call_icon_visibility": "DEFAULT",
"callback_permission_status": "ENABLED",
"sip": {
"status": "ENABLED",
"servers": [
{
"hostname": "sip.example.com",
"sip_user_password": "{SIP_USER_PASSWORD}"
}
]
}
}
}
Troubleshooting SIP Configuration Errors
If your SIP server is not receiving SIP INVITE requests from Meta, a common issue is a mismatch between the hostname you configured and the domain name in your TLS certificate. Meta performs strict validation of the server’s certificate.
To test your certificate setup, run:
openssl s_client -quiet -verify_hostname {hostname} -connect {hostname}:{port}
Replace {hostname}
and {port}
with the values used in your SIP configuration (typically port 5061).
If you have other issues or doubts, please contact our support team:
Last updated
Was this helpful?