Nexmo API: Is there any method or API to cancel ongoing outbound or inbound call in Nexmo? - vonage

I want to disconnect an ongoing call from my server based on some circumstances. Is there any Nexmo API through which I can do the same?

Got answer to my query. Bit of more searching and study found my answer.
I can modify in-progress call by making a PUT call to below URL.
https://api.nexmo.com/v1/calls/:uuid
where UUID is uuid of call.
have to give action = 'hangup'

Related

Does Twilio provide any APIs or services that can detect if call has been placed on hold by the receiver?

I'm placing a call from my React Native application using Twilio and the outbound call works fine. Now I want to create something that will detect when I am put on hold by the receiver. The idea here is to make my app hold for me and get back to the caller once the hold has ended.
I searched the twilio docs and services but could not find any thing regarding this use case. How would I go about doing this?
Twilio developer evangelist here.
Unfortunately, there is no mechanism to make this happen, even if there were something in the SIP signaling from the carrier, such as a re-INVITE.
In the world of SIP, putting a call on hold often involves sending a re-INVITE with different media parameters, such as saying a=sendonly in the session description. Even if this were passed end-to-end through the PSTN to Twilio, we do not generate webhooks to inform the customer’s app of this fact.
There are some good SO questions about placing a Twilio call on hold and retrieving it later--the Enqueue verb might be helpful.

How to make an asynchronous http call from bot-composer?

I'm creating a bot in botcomposer(v1.4.0) which involves an http request. What I'm looking for is an asynchronous call so that I don't have to wait for the response from the http call, while the user can continue to chat with the bot.
Also, I want to prompt the user when the response comes.
Thank you in advance.
Proactive messages would be the best option. Unfortunately, they are not implemented in Composer at this time. You might be able to create a custom action and accomplish your goal (my assumption without knowing more of what your requirements are).

Can't seem to figure out how to perform an incoming call using Twilio?

So, I'm new to Twilio and have been trying to build a full VoIP app. I can make outbound calls, but I'm not sure how to get an incoming call to be answered with Twilio and talking to a real person. I've scrolled through what seems like most of their documentation and can't seem to figure this out, and there doesn't seem to be any tutorials out there to help either.
I have the basic incoming function that is provided:
function incoming() {
const voiceResponse = new VoiceResponse();
voiceResponse.say("Congratulations! You have received your first inbound call! Good bye.");
console.log('Response:' + voiceResponse.toString());
return voiceResponse.toString();
}
I know how to do call forwarding, but for this VoIP application that isn't really what I want. I am using the Twilio trial account still. I am trying to set this VoIP app up on iOS if that makes a difference.
Thank you so much in advance!

nexmo: forward to application and callers number

We have 3 options to connect to get inbound call.
Forward to Phone
Forward to application
Forward to SIP
Forward to Phone: When we call LVN then provided number gets call and callers number is seen in incoming call.
Forward to application: When we call LVN, then it goes to answer URL webhook. From answer url webhook, we provide connect ncco to call to my number. This time I am seeing LVN number in incoming call.
So is there any way in "Forward to application" method, that we will be able to see callers number in incoming call.
Yes you can forward the number of the incoming call by dynamically generating the NCCO when the call comes in and setting the from field in the connect action.
There are some examples in different coding languages available on the Nexmo developer portal and check the NCCO reference on connection actions for exact examples but in a nutshell set the "from field at the same level as the action and endpoint fields in the NCCO response to contain the "to" number that is in the GET parameter of the incoming webhook to your answer_url.
Hopefully that makes sense, good luck :)

Webhooks are not fired. API nexmo

I use the nexmo api to redirect all call to a virtual us number to a real number.
To implement i use this request :
https://developer.nexmo.com/api/developer/numbers#update-a-number
With params below:
moHttpUrl : an url (https) on my server which respond 200 OK
country : US
misdn : the us virtual number
voiceCallbackType : tel
voiceCallbackValue : the real forward
voiceStatusCallback : an url (https) on my server which respond 200 OK
(The data is well recorded, i can see it on nexmo backoffice)
Problem : when i call the us number with my phone, the redirection is ok. I stay on line 10 seconds and stop the call.
At the moment nexmo should call my voiceStatusCallback but do nothing.
Furthermore i have no idea on which informations are passing with the webhook.
Thx for your help.
It looks like your problem is related to https, the simple call forwarding is part of our deprecated voice API and as such that only supports SHA-1 certs on https, so I'm imagining this is your problem.
https://help.nexmo.com/hc/en-us/articles/115005461928
There are 2 options, either use http for your callback (not great I know) or take a look at our new Voice API which will give you a lot more control, if you want to do a simple call forward you would just need to host a JSON file on a URL somewhere that contains a connect action see https://developer.nexmo.com/api/voice/ncco#connect You will then get a whole bunch of call event webhooks such as when the call starts, is answered and ends.
Rgds
Sam
Nexmo Developer Advocate

Resources