Set Call

Set Call allows you to set the SIP trunk information that you wish to get the incoming calls.

This can only work once our support team enabled the WhatsApp calling feature for your account.


Important information

  • In this endpoint you need to provide the SIP server information and enable the calling feature.

  • The WhatsApp calling feature is only available for numbers that their daily limit is at least 2000 conversations.

  • Your SIP server must be reachable from the internet at the public hostname or public IPv4.

  • All incoming calls will be coming (SIP signaling) and RTP media from IP: 34.165.246.158 , so don't forget to whitelist it.

  • Default codecs are PCMU and PCMA (G.711). You can change them with codec_pref parameter.

  • By default, you can have 1 concurrent call. if you need to upgrade your plan please contact support. calls above your limit are rejected.

  • Only the 'from' in the body is mandatory. send only what you want to change. everything you leave out stays as it is.


Settings:

URL

https://api.99digital.co.il/whatsapp/v2/setCall

Method

JSON via POST

Header

Key

Value

apiKey

Your API key for the service


Body:

Parameter

Description / Example

Maximum length

Remarks

from

your WhatsApp account. international number without +. for example: 972771234567


mandatory

status

boolean.

true to enable calling (show the calling icon)

false to disable the calling


Your settings are kept. this is purely the call icon on the top.

sip_host

Public hostname or IPv4 of your SIP server. cannot be empty. private/internal addresses are refused

256

Hostname or IP. for example: 153.265.210.652

sip_port

The port number for your SIP host.

5

Must be between 1-65535.

Usually the default is 5060 (UDP/TCP) or 5061 (TLS).

Cannot be empty.

sip_transport

The SIP transport value

available values:

udp / tcp / tls

3

Cannot be empty.

client_auth

{"username": "some-username", "password": "some-password"}

This is the username and password for digest authentication.

Letters, digits and -.@!#&*+=~:/?

128 each

This value is in case your server required authentication. this is not mandatory, but if username is provided, password must be provided too.

codec_pref

Comma-separated codecs in order of preference. Default is PCMU,PCMA.

Letters, digits and @.-

50

Cannot be empty.

for example: PCMU,PCMA,OPUS

call_hours





Example request:


{
  "from": "972501234567",
  "sip_host": "sip.your-company.com",
  "sip_port": 5060,
  "sip_transport": "udp",
  "codec_pref": "PCMU,PCMA",
  "client_auth": {
    "username": "whatsapp",
    "password": "Str0ng-Pass!"
  }
}


Response:

{
  "status": "OK",
  "from": "972501234567",
  "calling": {
    "status": true,
    "sip_host": "sip.your-company.com",
    "sip_port": 5060,
    "sip_transport": "udp",
    "client_auth": null,
    "codec_pref": "PCMU,PCMA",
    "call_hours": null
  },
  "reason": 1
}

The response always carries the complete current settingsץ

Response-Explain:

Parameter

Description

status

OK or FAIL

returnedData

An object that will show all the parameters you sent

(address, description,email, type, website, about, profilePic)

reason

'reason' is the status explanation in case of FAIL

1

not FAIL. the status is OK

2

Your "from" number account does not exist or invalid JSON

3

wrong apiKey

4

'status' must be true/false

5

sip_host is empty, invalid or not reachable.

6

'email' is too long, or invalid email address

7

'type' must be integer from 1 to 17

8

'website' is too long or invalid website address

10

'profilePic' URL is invalid

11

'about' is invalid or too long

12

Uknown error - please contact support

16

Support team did not enable calling for your number, please contact support