Cloudflare Worker to expose voip.ms API in Groundwire format. Build it as a side project to practice knowledge in Github, Node, Express, etc. If you see any opportunity for optimization - pull requests are welcome.
sequenceDiagram
participant GA as Groundwire App
participant D as Cloudflare Worker
participant A as voip.ms API
GA->>D: Check balance
Note over D: Authenticate <br/> against voip.ms API
D->>A: Issue API call to voip.ms
Activate A
A->>D: Return balance as float (12.123432)
Deactivate A
Note over D: Process number and add currency
D->>GA: Return formatted balance
- Go to voip.ms API page and configure API password.
- Enable API by clicking
Enable/Disable API
. Make sure that it showsEnabled
- Configure IP address of the host where your Docker container will be deployed. If you don't have static IP you can configure
0.0.0.0
to allow access from all IPs, but it presents serious security risk.
P.S. After lengthy conversation with voip.ms support team, I could not find the way to permit Cloudflare ranges access only.
Add variable VOIP_PASSWORD
as a secret via wrangler secret put VOIP_PASSWORD
(You have to have wrangler
installed. You still will need it installed to deploy the CF Worker)
Configure in Groundwire settings
Settings -> Select voip.ms number -> Advanced Settings -> Web Services -> Balance Checker