How VoIP apps like Viber, Skype,.. work when user's IP changed? - ios

I'm currently researching about how to make an iOS VoIP app and I wondering how user1 of Skype, Viber, Facebook Messengers... can reach to other user in contact list? In my case, the users can request a call to admins. Then admins can call back to them with their IP address they were request to server.
The big problem is if users connected to a Wi-Fi to request a call to server, app will send their ip address to admins. But if they have to connected to another Wi-Fi, their IP address will difference with the older.
I don't know how to check when user's IP was changed. And how to update the IP if it occurs. Does anyone faced this problem and can you guys give me some solution about this problem?

For this you have to configure many things.
Usually Skype, Viber, Facebook Messengers configure things like below.
Ideally there should be target on specific IP or something.
That end point to get connect in video call has to configured and come from server end
https://www.vidyo.com/ is really good platform, though have SDK in C++ so in any technology you can configure it easily
To know online / offline user's, better approach is websocket
list of user will also based on websocket or API response
Good platform for websocket - https://github.com/tidwall/SwiftWebSocket
Pushkit is also required thing, when app is in killed ( Terminated ) state then using pushkit silent notification with local notification you can notify user about incoming call

Related

iOS: Some apps seem to bypass NEPacketTunnelProvider. How to enforce it?

I am working on a NetworkExtension which uses the NEPacketTunnelProvider to provide VPN-like tunnel so I can modify the traffic.
This works great for basically all the apps I tried so far, but Facebook Messenger seems to be able to ignore it. I first see that the traffic goes through the tunnel, should be blocked (for testing), but then the messages are successfully sent anyway.
To me this suggests that Messenger first goes through the tunnel and when that does not work, it has some kind of fallback. This happens whether I am on Wifi or cellular data. At first I thought that it may somehow fallback to cellular when WiFi does not work, but even when I disable cellular on the iOS level, Messenger still works when the tunnel is active.
I tried getting all the system routes (meaning the IPs and masks) and manually setting them to includedRoutes on the NEIPv4Settings but this has no effect.
Does this look like the Messenger is indeed bypassing the VPN tunnel? Or maybe something else is at play?
So far I have tried basically all configuration combinations and nothing seems to affect Messenger in any way. Apps like Signal, Instagram, YouTube and other can be successfully cut off the network with the tunnel.
EDIT: Found this on the official Apple forums: https://developer.apple.com/forums/thread/122330
Actually Facebook Messanger sends traffic to all active interfaces in iOS. It even sends tarffic out trough Cellular, when mobile data is disabled from settings.
EDIT 2: I tried the new iOS 14 configuration option includeAllNetworks which seems to work for Messenger but somehow messes up other apps like Signal or WhatsApp.
When I don't have this flag on, Signal work with my VPN on and I can see its traffic, but when I enable this flag Signal does not send messages nor receives them.
Apps can use low level API and force traffic via some interface (using bind for example), and go outside your VPN.
The way to enforce using the VPN is to enable the flag includeAllNetworks on your VPN configuration -
manager.protocolConfiguration!.includeAllNetworks = true

How to identify IoT devices on WiFi network in Rails production app?

I have an IoT project that I have been developing using Rails. I am using ActionCable to manage websocket connections between my app and Arduino devices. The Arduino's are hardwired to ping into the app and join the websocket channel. In development, it is easy because I tell my server to listen to outside requests and the Arduinos ping localhost:3000. Now that I am trying to deploy, I realized it's tricky to manage this in production.
I would like a user to log in and see a list of smart devices in their home, the same way that many market ready devices work. If my app is on Heroku, is there a way I can configure the Rails app to look for incoming requests that share the same WiFi network as the current user? Otherwise, I would need to set up a form on the Arduinos where users would have to input their login credentials for the app to associate devices to users, but from a user experience perspective that would be a pain.
I would probably try to generate and hardcode a unique token in each arduino, put it on a sticker on the device and then ask the users to register their devices.
Or if there is way for them to input the wifi passwords for the local wifi, then you can do any kind of device identification when you show some secret on the website and ask the user to enter it on the device(s).

XMPP iOS Framework detect internet disconnection issue with OpenFire server

I have implemented chatting application using XMPP iOS Framework with OpenFire server.
Fortunately, application is running successfully but I am facing one issue of internet disconnection in application.
When user is getting logout or went in offline mode manually then it sends stanza to his/her rosters. So his/her rosters knows that user went in offline mode.
Now when internet will disconnect from user's device at that time application is not able to send presence stanza to server due to internet disconnection. So his/her rosters won't get information about that offline user and user will be shown in online mode only.
I thought something like OpenFire server might be able to check connected users and whenever any user gets disconnected it should send presence stanza with offline status to his rosters so they can know that this user is on offline mode.
Can anybody please help me if there is any way through which I can implement this feature.
It will be very helpful for me to solve this issue.
Thanks in advance.
It's the core xmpp feature and Openfire must send unavailable to your contacts on your behalf. So it looks like a bug.
But there is a different problem - users with mobile internet may reconnect too often, and XMPP community developed a Stream Management extension, which allow server to "hibernate" client session when it quickly reconnect and restore it without presence changes. Summarize:
Check if Stream Management is active - in this case user will still online fixed amount of time (typically 5 minutes) and then go offline.
Check if Openfire implements any non-standard extension to maintain user session.
If you are sure none of extensions are "hibernating" user session - then it is a really bug. Try the same with different xmpp server - good candidates are ejabberd and prosody

Porting current number and forwarding to new phone number

So, a little context for you first: Our app only has forwarding and text messaging capabilities for our clients. Basically, we just set up a forwarding number in twilio for our client and they use that as their public number (on websites, advertisements, Google, etc.). Then when their customers call that number we ask them a quick question using the phone menu before forwarding the call onto their regular land line and sending them a text message later.
What do you suggest we do when someone wants to keep their current number (land line or otherwise) as the main phone number (online, website, ads, etc.) instead of using a new forwarding number?
Would they port their current number over to twilio, and then just get a new number with their main phone provider that we'd forward the ported number to?
I'm sure this is a common problem, so wondering what the best way approach it would be.
Thanks!
Twilio evangelist here.
If they want to continue using their POTS equipment then what you described is the only option. If they were able to move over to a pure VoIP system then there are more options.
You could use Twilio Client to build web and/or mobile VoIP apps for them. Or you could stand to a VoIP server (like Astrisk or FreeSWITCH) for them to connect VoIP phones to.
Of course they would still have to have an internet connection with for either of the VoIP options.
Hope that helps
This is an old question but it was at the top of my search for questions about porting for sms capabilities. Having worked 20 years in B2B telecom I can answer the last part of this in case anyone else needs to know.
If you go to any provider and request a number to be ported from the existing provider, the "losing carrier" cannot refuse to port the number as long as the number is active. I stress this point because if they are past-due, they still have to port it. But if the service is temporarily or permanently disconnected they don't and usually won't port it. The port has to come from the company winning the business. Don't contact the existing carrier about it because they can't "push" the number out. Instead, the new carrier will have you fill out a Letter of Authorization (LOA) to port it that gets submitted with the port request. Its very important that all of the details on this form match the billing record or it will get declined. So normally you would provide a copy of the current bill with the LOA.

Codename One how to communicate with other users of an app

I am developing an app that requires communication between other users of the same app. A user might want to invite another user to an event, so the request must be sent directly to a specific user with the event data. If the invitee accepts the invite, the inviter will need to receive a message back to notify and record the acceptance. How would I go about achieving this communication functionality? What are the main pieces to this functionality?
Like you would with any platform, using the network.
The question is how do users discover each other? Vicinity? Common interests?
Either way you will need to create a server to which the apps connect via a web service with the proper information (e.g. location, common interests etc.) then the server can return the identifier for the appropriate match and facilitate communication between them.

Resources