Reputation: 443
I have a server that listens to NCCO request from nexmo. My nexmo application is configured to forward all incoming calls to this server. When an NCCO is requested for an incoming call, I return an NCCO with "connect" action along with a websocket url and the call gets connected.
But in certain cases, I want to decline the call. What should be a correct NCCO response for that.
Right now when I write back empty string to NCCO request, then on the calling phone(my phone, not nexmo number) I hears one or two rings and then it just stays on "Calling screen" on my phone and nothing happens. No ringing sound comes and call also stays connected.
Upvotes: 5
Views: 422
Reputation: 156
Returning either an empty NCCO for an incoming call you do not wish to answer, or providing the user with a rejection message, is the idiomatic Nexmo/Vonage way to decline the call.
Right now when I write back empty string to NCCO request, then on the calling phone(my phone, not nexmo number) I hears one or two rings and then it just stays on "Calling screen" on my phone and nothing happens. No ringing sound comes and call also stays connected.
This behavior does not sound like the desired behavior. If possible, please email customer support, [email protected], and they can look into your specific account details to see why you are experiencing that specific issue.
Upvotes: 3
Reputation: 1159
You could just return a talk action telling the caller that you are declining the call. E.g.
[{"action":"talk", "text":"Call declined because your number is not recognized"}]
Upvotes: 0