PSTN to Internet - node.js

I'm making a PSTN interface for some voice chat software I use, just for personal use. My current plan is this:
With a mobile phone, I call a number registered with Twilio and input a keypad sequence to authenticate myself.
My server instructs Twilio to forward a SIP call to my server.
I decode the SIP stream and pipe it into my (NodeJS-run) voice bot for the voice chat, and the voice chat data from the other callers are sent back to the phone.
Is there a simpler way to do this, or is this the best plan? If possible I'd like to cut SIP out of the equation since decoding that is probably a pain. The voice bot at the end is necessary, but everything else could be changed. The core requirement is that PSTN data is turned into a computer-readable stream on the Internet and that the Internet stream can be sent back to the phone.

Related

Recommendation on client side echo cancellations

I am developing a MCU based voip service. I think the traditional way of doing MCU is, you have N audio mixers at server and every participant in the call receive a steam that does not have their own voice encoded.
Guess what I wish to do is, have only 1 audio mixer running at server and (on a broadcast kind model) send the final mixer audio to every participant (For scalability obviously).
Now this obviously creates a problem of hearing your own voice coming from speaker as MCU’s output stream.
I am wondering if there is any “client side echo cancellation” project that I can use to cancel the voice of user at desktop/mobile level.
The general approach is to filter/subtract the own voice in the MCU. Doing this on the client side does not work.

instant messaging for apps

I'm developing a web and mobile app using spring mvc and I'm having a problem understanding the different protocols and tools to make instant messaging (like facebook messaging in the website or whatsapp instant notifications). one functionality besides chatting in the project is for a user to send a request and waiting for the other user to respond with notifying them instantly).
However I'm lost cause some say to use GCM or FCM for the mobile and others say there other protocols like STOMP and AQMP and some others. I don't know what to see and use in my rest api so that it works for both browsers and mobiles while taking performance and other issues into consideration and how to consume these messages from client (I mean does the consumption method varies based on the chosen protocol?). should I use multiple protocols and tools based on the source of the request (i.e. if mobile and Android --> GCM or FCM, if browser STOMP for example, if iOS --> don't know what to use).
I know it looks like a general question but I really got lost specially that I don't know what are the right things to choose these days to start with.
Messaging stack consists of multiple components. One of them is message transport - used to pas messages between the server and the client. FCM/GCM/APNS in this context is the transport protocol.
GCM is deprecated in favor of FCM. FCM is going to work for Android, the latest versions of iOS, and even some browsers. However if the user disables notifications for your app, the messaging will stop working. There is also some unpredictable latency with push notifications, particularly if you would like to send high-volume messages like typing notifications.
Message format is another component of the stack. For instance, STOMP is the message format protocol. It's defined for any serial transport, i.e. can be used over FCM or TCP or websocket.
Given the questions you ask it looks completely impractical for you to write your own messaging stack. Just pick something off the shelf, like one of the million XMPP servers or a more modern one like Tinode. Google it.

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

Please Explain Google talk's working as a p2p Application

I was going through some article and found that chat Clients are mostly p2p. If Google Talk is a p2p client then how is it able to save our chat in Gmail ?
The simple answer is that the audio is streamed from browser to browser without any server in between using the Jingle protocol.
So things like text chat and audio chat is peer-to-peer whereas all other functionality is provided by Google servers.
he chat it self uses Jabber (XMPP), but conversation logs are automatically saved to a Chats area in the user's Gmail account. This means that chats involve three parties (your computer, your mates computer and Googles Gmail server cluster)

Is it possible to have a J2ME app get an SMS and send it to a computer?

That's basically my question, I have written the code for sending/receiving SMS but it's basically a "server/client" so I can't get the SMS that are sent directly to the phone number instead of through the j2me program. Is it even possible?
It is quite possible to write an app that receives an incoming SMS, extracts the message and sends it to server through a HTTP call. You can then make that server send that SMS to another phone.
Using the Wireless Messaging API (JSR 120) you can receive SMS to a JavaME application. However, you must register to receive SMS on a particular port, and you cannot read SMS from the phone's standard inbox.
Register:
import javax.wireless.messaging.MessageConnection;
MessageConnection connection =
(MessageConnection) javax.microedition.io.Connector.open("sms://:1234");
There are 2 different methods of receiving SMS:
event-driven using javax.wireless.messaging.MessageListener
using blocking method javax.wireless.messaging.MessageConnection.receive()

Resources