Twilio - Understanding if outbound call is transferred by receiver - node.js

Using Node.JS and the Twilio API I can easily see when a transfer initiated by my Twilio code is answered using Call Status Events. But, what if the person I am calling transfers my call?
Is there anything in the Twilio API that will tell me the call is being transferred, is currently on hold, and when that transfer is answered?
Desired Flow:
Twilio Bot calls Number
Receptionist answers
Twilio Bot asks to speak with a salesperson
Receptionist says they will transfer the call, and begins the transfer
Twilio Bot is put on hold and hears Silence/Ringing/Music/Automated "pease wait. You are # in the que" messages
Salesperson answers
Twilio Bot greets and continues the conversation with Salesperson

This is not possible.
The information is hidden behind the receptionists PBX, and not exposed outside that platform. The transfer is basically invisible to Twilio or any external parties from a signaling perspective.

Related

Payment Notifications to users

I'm building an application in which we have worked on Payment gateway named flutterwave.
And now the scenario is on every success or failure of a payment, I receive a webhook and then we take further actions such as sending emails, SMS and updating the statuses of the payment in the DB.
For now, we have implemented polling in the client side and for a particular time span if the client receives a status (success or fail) we show it otherwise they can check later it in the payment history page.
Now we want to remove this polling and update users in real time about the success or failure of a payment.
What are the ways by which we can achieve this?
The questions are how we will notify a specific user about the same as we have a multiplatform app and the same user can be logged in different platforms.
What you are looking for is a real-time communication pattern with WebSockets a layer 7 protocol in the OSI model which offers bi-directional communication.
This means that you can establish communication between your servers and your user's browser (client). As a result, you can send notification data to the client and consume and react to the notification, by showing visual cues in your UI for the user to see.
Some examples of implementing WebSockets with Socket.io and Nodejs: https://dev.to/novu/sending-real-time-notifications-with-socketio-in-nodejs-1l5j
There are also paid services that can offer this functionality like Pusher, and I would actually recommend that route at the beginning so you can avoid spending too much time implementing this and focus more on the stuff that matters and is part of your roadmap.
Additionally, you can use Push Notifications as another way to notify your users even when they are not using the app.

How to check if the user has the webchat window open?

I am creating a customer support bot using Ms botframework v4 with nodeJS and directline API 3.0. A customer would talk to the bot and on request, the conversation would be handed over to an agent. If the customer requested to talk to a bot, the customer will wait until the agent becomes available. I want to check if the customer is still active before the agent sends a message to him/her.
wireframe of the bot and the webiste As you can see in the image Jack is in the queue I want to find out a way to check if Jack is still waiting, or he close the window and no longer waiting.
Check out this SO solution I provided. The request is similar to yours in that the OP wants to know how the bot can be notified if a user exits.
The short answer is to use an event listener. Before the window (that houses the web chat instance) is closed, an event is fired. This event is picked up by web chat which sends an activity (message, event, or other) to notify that bot.
From this point, you simply need to forward the notification to the agent that the user has exited the conversation.
Hope of help!

Twilio: How to get Programmatical Chat statistics via API?

Question
How can the Twilio API be used to get overall statistics for all channels and messages with given time ranges?
One example of this statistic is: What is the total message count for all channels today?
Bruteforce method (Non-ideal)
Get all channels for a Twilio service. Get all messages for each channel. Check the timestamp of these messages.
The bruteforce method mentioned above is not scalable. Is there a more efficient way this could be done?
Twilio developer evangelist here.
To get that information from the API, you're right you will need to loop through your channels and fetch the messages.
An alternative is to register for the onMessageSent webhook and aggregate the messages in your own database.
Hope this helps.

How to use recording feature using Twilio Client (VoIP)

I am using Twilio Client (VoIP) with nodejs for making a call from my device to a phone.
I want a recording functionality also with this but I don't see this API supports it.I see rest API which supports this but then it not supports VOIP.
can someone please provide a sample code or any help for this.
very sorry for a silly question but I am new to programming.
Thanks in advance.
The JavaScript Client is actually not making the recording but the TwiML does. You setup your device and establish a connection to Twilio. Audio from your device's microphone is sent to Twilio, and Twilio plays audio through your device's speakers, like on a normal phone call.
This is analogous to the way Twilio handles incoming calls from a real phone. All the same TwiML verbs and nouns that are available for handling Twilio Voice calls are also available for handling Twilio Client connections.
So assuming that you are calling a customer's number and want to record the call, you will need to pass this instruction in the TwiML, i.e:
<Response><Dial record=true>[Number to call]</Dial></Response>
Or in node.js:
resp.dial({
record:'true'
});
After the recording is complete, it gets assigned a recording SID just like recordings created via the verb, and you can fetch it via the REST API as documented here:
https://www.twilio.com/docs/api/rest/recording#list

Where/how does Skype queue group chat messages when users are offline?

In this SuperUser.com question and elsewhere, I've read that Skype doesn't store your historical chat messages on their servers in a way that's user-accessible. (Of course, what they do for internal archival and analytical purposes is a different story -- as reflected by their privacy policy).
But the user experience for group chats is: when you've been offline and you sign back into Skype... all the messages you missed appear. Even if it's been a while and there are a lot of messages. (I don't know if there are limits on how long or how many.)
So: how is this UX implemented if the messages don't come from Skype servers?
I've read this offhand description which states:
Syncing of group chats ("More than 2 people in a chat") is done by chat sync partners in those chats, and not provided by Skype servers.
If that's correct, I'd love more details about how this works, like:
Has the protocol been specified or reverse-engineered?
Is it available through an API?
Are requests routed through Skype, or is it direcly peer-to-peer?
If peer-to-peer, how are requests authenticated?
My experience is I can only "see" history back to the time when I joined a chat; can a client request or receive messages farther back in the history?
I understand some of of the protocols are currently in flux -- so, bonus points if you can explain whether/how these details are changing.
When you login your client has the last recieved id of that conversation.
Sends it to the other clients. The client who recieves the id looks up all messages after that one, and then sends it back to you.
That way they don't have to store the messages on their servers.

Resources