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

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.

Related

How to get instant changes in background from private api in mobile app?

I am planning to create a mobile application for android and ios users, i think i will take a try with xamarin since i will be alone on this project and i don't have a lots of time.
I want that the mobile app for both platform get datas from the api, then if there is new datas available we notify the user by a notification.
How the mobile will work in that kind of project? I mean should i make a background service then check every x seconds/minutes by http request? In that case which time interval? Should i use websockets instead for this case?
The app might be used by many people, so i would to know the scenario in this kind of project: Getting very fast changes, without overload the server due to too many connects or whatever else.
I'm confused about this and i need some lights around, any mobile application/server experiences related would be apprecied!
EDIT:
As suggered by an user, here additional infos:
The api is homemade, restful using JWT made in NodeJS.
Each users on their device should get messages from server asap, even when the app is in background/closed.
Maybe in the future a way to send messages between users themselves.
You have to implement push notification.
It is quite easy to implement this in xamarin. just send the push notification to the device and on the notification received call back send the API request to retrieve the updated data.
Here is the document for sending push notification from custom API.
https://learn.microsoft.com/en-us/appcenter/push/pushapi
I'm not a mobile developer, so take this with a grain of salt.
The answer to this really depends on what you're doing, which informs how often to check the API. If it's a messaging app, for example, you could have it check every couple minutes to see if there are undelivered messages, then check more frequently for the next X minutes (to facilitate a conversation in real time).
If it's a GPS navigation app to be used while driving, you'd need much more frequent requests.
As for the API, that also depends on what type of API and the number of requests you can make to it. Is it a commercial API that you get x number of calls per hour on? Is it an API that you built? Etc.
Basically, you need to give more information in order to get more specific answers.

Will Square webhook subscriptions tied to merchant ID (not location ID) work reliably?

The Square documentation for updating webhook events shows this URL format: PUT /v1/{location_id}/webhooks. However, creating a webhook event listener for every merchant location could be a lot of separate API requests, and it would be far easier to use the merchant_id instead of the location_id (even though this is not documented) and make one request for each merchant.
Attempting to do this actually works - when I PUT /v1/{merchant_id}/webhooks the webhook is saved in Square and transactions for any of that merchant's locations successfully send the webhook.
My question is, since this is undocumented (although it works) is it safe to rely on this approach?
While it may work currently, since it's undocumented, the behavior may change in the future and cause unintended side-effects. I strongly encourage you to follow the current documentation for subscribing to webhooks.

Creating new payment method for Bigcommerce

I would like to know if this is possible to add new payment method for Bigcommerce. I tried to contact their support without any luck. If anyone is familiar with bigcommerce and know if this is possible, i would appreciate any advice.
I already read their API docs and didn't found anything useful - only method to obtain list of available payment methods.
I already tried to signup for their partner. Without any luck.
We've done this before for a couple stores to allow clients to process payments through their own processor. The way we achieved this, is essentially through the following high-level steps:
Allow payments by Check (or similar offline method). We are going to replace this with the custom processor.
You'll notice that if you attempt to checkout via Check, that BigCommerce automatically creates the order for you, but sets the order status to Awaiting Payment. Upon submission the user is automatically sent to a 'Thank You' Order Confirmation page that contains both the Order ID and some payment instructions (such as where to send the check to).
Here's the trick -- Modify this 'Order Thank You' page to prompt the user for her or his credit card information. A simple HTML form will suffice here, performing the actual request via JavaScript.
Once you have the user's credit card data, you can then POST it to your own external server, where you would connect to and send data to whichever processor you are using. Additionally, you should make sure to send the Order ID to this program, so that you can connect to the BigCommerce API to load billing information, and then subsequently adjust the order status to either approved or declined depending on the response from your processor. Finally, you should send back some sort of response to the client to inform of the result of the charge attempt.
That's pretty much it in a nutshell. The way you integrate with the payment processor (step 4) is unique to whichever processor you are using. I hope this makes sense.
Although opinion based, I'm a huge fan of serverless technologies, and would suggest looking into AWS Lambda + AWS API Gateway. The benefit here is that you don't need to worry about creating an infrastructure or the associated concerns of security and scale. Rather, AWS Lambda allows you to simply upload your software, and allows it to be executed via an HTTP request to some defined endpoint set through the API Gateway. Lambda will scale automatically for you, and you don't need to worry about system level security concerns - only security at the application level. It's truly a set and forget setup, and a bleeding edge technology. Not to mention dirt cheap!
Implementing a new payment method is unsupported and requires hacky workarounds since we implement payment gateways via the core app. You can do this on blueprint by using an offline payment method and then using the API to update payment statuses, etc. I'd recommend using ActiveMerchant if you do wish to go down this path.

How to verify an account using SMS or Call

I am working on an eCommerce website but our client told us to add functionalists like they want to verify an user account by sms or by call.
I don't know how to do this and how many of websites and apps do this.
Do they use any third party services or can we implement it by our won?
If we have to use this service please tell me the name and how much it costs and how to setup?
If there is any alternative please tell em that also.
Moreover I want to use this services for testing also.
Any help would be appreciated.
Some websites/apps build it themselves with SMS / Voice APIs...
Others use a Verification specific API...
With SMS / Voice APIs
You'll need to generate a code
Send it via the channel you use primarily
Set some kind of time delay job (queue, worker, whatever)
Send a fallback message should you get no response from the user
With an SMS API, that likely varies per country,there is a solution that allows you to go globally with an API call for a flat fee of 10 cents per verification, NOT per attempt (unsuccessful attempts will not be charged towards your account)
Nexmo’s Verify API
Make a call to https://api.nexmo.com/verify/json (or /xml)
Add parameters: api_key, api_secret, verified number, brand
Optional parameters: language, length
Take a look at the Nexmo's Verify documentation here!
Verification code should arrive to your phone as an SMS. If you wait a while, you'll also get a phone call, and the code will be read to you. The timing and channels used depends on the type of number, the country, and the carrier.
Reasons to implement Nexmo's Verify
Landline & Mobile Verification
Failover & Retry Sequences
Simplicity.. Just make one API call
Other alternatives: Enterprises (sign a heavy/clunky contract)
Full disclosure, I work at Nexmo

Cisco call manager api to conference a device

I'm trying to implement some click to dial functionality as follows:
A user finds a number on a webpage (say employee extension)
Clicking that extension will dial a phone number that I've picked
Upon answering that call, I am immediately "conferenced" into
calling the number I actualy wanted to dial.
I've done something very similar using a Twilio API but want to use our corporate Cisco Call Manager capabilities instead of paying per minute for this functionality.
The WebDialerSOAP doesn't seem to be able to give me this functionality. I think doing a conference would work but can't find anything to do that. Possibly an open source call manager wrapper?
why not a FreeSWITCH server alongside the CUCM? It can set up conferences, and it's one of themost programmable products with as much control over API as you want.
It has also an RTMP module, so you can actually run a Flash-based softphone out of your browser
Use TAPI3 or JTAPI
Connect the code using TSP, and Application user
use CreateCall function to the number from HTML page with implementing the trigger.
use CreateCall to the other phone.
use Finish(FINISH_MODE.FM_ASCONFERENCE) to complete conference.

Resources