Viber Voice Termination via RESTFul API (Tutorial)
Before you begin (Requirements)
- TelecomsXChange Buyer Account. Get one here
- Restcomm Cloud Account. Get one here .
- Purchase Viber Route from Market View
According to this statistics viber has reached over 980 Million subscribers in 2018, Which makes it one of the largest voice and messaging networks in the world, in this tutorial we show you how to send voice calls directly from your application and terminate the calls directly to Viber by passing the whole PSTN network. Once you have a Restcomm Cloud account you will be able to configure BYOC (Bring your Own Carrier), Click on that and add TelecomsXChange SIP settings in Restcomm Cloud to be able to point your traffic to it.
Once BYOC is active and done, all you need to do now initiate an API Call to any number and use Viber's Tech prefix 50724# before the telephone number. For example to route calls to Viber via TelecomsXChange, it has to be dialed like this 50724#19542401111 where (19542401111 is the telephone number) The API request will look like this:
curl -X POST https://[ACCOUNTSID]:[AUTH_TOKEN]@cloud.restcomm.com/restcomm/2012-04-24/Accounts/ACcc38b3e0fcf3d2654cd73e210f5477ce/Calls.json -d “From=%2b19542405000” -d “To=50724%23195424011111” -d “Url=[APPLICATION_URL]”
For full documentation and samples on how to use Restcomm API to initiate Voice calls please go here. You can check CDRs page for more information on failed calls, Viber usually returns SIP error 503 if the Viber user is not online on their network.