Vonage voice API

Viewed 94

We built an application using Vonage voice API, in which the inbound call is received on the webpage. However, we are not finding a way to fetch and display caller ID/caller phone number from the backend to the web page. Any help from anyone for the above-mentioned issue will be greatly appreciated Thank you in advance

1 Answers

This link could be usefull to you: https://developer.vonage.com/voice/voice-api/webhook-reference

basically you need to configure the answer web hook specifing the url of your server and the http verb (POST or GET), so evey time you are gonna received a call, your back end is gonna be notified (asking you from the ncco).

from that docs, the from parameter is gonna be the number of the caller (in the body if you are using post, in the query params of the url if you are using a get).

You may save this in your database and retrive it when needed.

But if you simply need to display the caller number on your browser, you may not need that.

probably your code looks like this: https://github.com/nexmo-community/client-sdk-tutorials/blob/main/phone-to-app-js/client_js.html#L25

the second parameter of the member:call listener is an nxmCall. this should have a from property with the info you are interested in

(more info here: https://developer.vonage.com/sdk/stitch/javascript/Application.html#event:member:call)

Related