We need to develop a SIP voice gateway for WhatsApp to send some calls from our PBX.
The gateway must be able to transmit incoming voice calls via SIP and redirect them through WhatsApp to complete the call to the destination WhatsApp number.
- We will provide the phone number/numbers and images for the WhatsApp account.
- The project must be multi-channel. I would like to be able to initiate multiple calls (you can run multiple WhatsApp accounts with multiple phone numbers or use just one WhatsApp account with multiple calls.)
- The development platform/operating system does not matter. You can use Asterix, Freeswitch, FreePBX against...
- The implementation must return the correct call error codes to the SIP backend, such as CALL SUCCESS (200 OK), BUSY (486 Busy Here), UNAVAILABLE (503 Service Unavailable), etc., to try other rounds on another SIP switch.
Functional flow
1) Calls from the PBX/sip gateway will be redirected to the WhatsApp gateway.
2) The WhatsApp gateway converts SIP to the WhatsApp protocol.
3) If necessary, the WhatsApp gateway has multi-channel WhatsApp accounts, and your code selects any of the available accounts to make the call. You can run multiple WhatsApp accounts/channels with multiple phone numbers in the WhatsApp gateway or use just one WhatsApp account/channel (if multiple calls can be made from one account) for multiple calls simultaneously.
4) If all WhatsApp accounts are busy, send back the error code "600 Busy Everywhere" or "503 Service Unavailable".
5) If the number is not used in WhatsApp, if there is no WhatsApp account linked to the called number, then it sends the error "503 Service Unavailable", and we redirect to other gateways.
6) The called number specified in the call header will be checked by the WhatsApp gateway. If there is a WhatsApp account associated with this number and the number is online, the call in WhatsApp will be completed.
7) If the call is successfully completed or the called number does not answer, then the call will be disconnected.
The system must return the appropriate sip error code if the call is busy or there is no answer.
9) The source code must be provided to us with explanations for debugging purposes in the future.