Vonage VoiceAPI Real time integration with VoiceAI
- Setup vonage account.
- Create an application with Voice APIs enabled.
- Create private and public key to use with SDK.
- Install ngrok
pip install -r requirements.txt
ngrok http 9999
In a separate terminal export NGROK_URL and NS_API_KEY and start the uvicorn server. In order to get NS_API_KEY refer here.
export NGROK_URL=<ngrok public url>
export NS_API_KEY=<APIKEY>
uvicorn answer_server:app --host 0.0.0.0 --port 9999
In a separate terminal run the following command.
python vonage_make_call.py --answer_url <ngrok url>/answer --application_id <application id> --private_key <local path to private key> --to_number <tonumber> --from_number <from number>
SAMPLE
python vonage_make_call.py --answer_url https://300b-2406-7400-56-cf0d-4125-592-ecad-817f.ngrok.io/answer --application_id 77bf5a13-8f46-48be-9ec5-4d09b8ba380b --private_key private_1.key --to_number 1234567891 --from_number 1234567899
You should be able to see the results in the logs of the server.
And for reference the recorded audio file of the conversation is saved by the server as tempfile.wav