Secure Signals between iOS and PC - ios

I have a PC and an iOS device. the iOS device is using alljoyn 15.04 and the PC is using alljoyn 15.09. Both implement the same secure interface. We have secure signals as a part of this.
Our strategy includes joining a peer's session as soon as we discover them, then forcing authentication by calling a method on the remote device - using auth mechamism: ALLJOYN_ECDHE_PSK
This all works great!
Now, I can send a secure signal just fine from one ios device from another.
I can also send a secure signal from the iOS device to the PC just fine.
The PC can send a secure signal to another PC, but it cannot send a secure signal to the iOS client
We've compared everything - session options, interface names/options, bus connection options, etc. and everything is the same. Then I found this error in the alljoyn log on the iOS side:
145.449 ****** ERROR ALLJOYN iodisp2_2 .../src/Message_Parse.cc:1078 | Failed to read message on :wYxt8HAP.73: ER_OS_ERROR
I have no idea what to do about this. Can someone help?
I was hoping to not run into any lower level bugs like this with alljoyn. Dang.
Thanks for any help!

This error can occur if you are trying to send a secure signal out on session 0 (sessionless) instead of a valid hosted session. This is because the other end cannot decrypt the signal with your group key for the session. If you are hosting the session then try sending the signal out on ajn::SESSION_ID_ALL_HOSTED and see if that works.

Related

iPhone sending Encrypted Alert packet

Background: I have created a hybrid app in angular using the capacitor library. Everything is working well for the browser and the android mobile app and the iOS mobile app. On the backend, we are using hardware that is acting as a server. The hardware and our mobile are connected to the same router and we are accessing the hardware using an IP address. Also, we have added a self-signed certificate on the hardware and are using HTTPS while communicating with the hardware.
Bug: The only issue we are facing right now with the iOS app is its slowness. I did some digging around the frontend using Wireshark and came to a point where the iOS app is sending the acknowledgment packet followed by an encrypted alert packet when it receives a response from the server. This is happening for every request. After further debugging on the server end I came to know that once it receives an encrypted alert it is closing the socket. Then again it is performing session handshake, opening the socket again and then processing the request. So, basically, the below process is repeated every time:
Performing session handshake
Opening Socket
Processing request
Sending response
Closing the Socket
On the contrary, on an android device, this process is only happening the first time it sends the request and then data transmission is taking place without closing the socket.
Below are the screenshots of Wireshark for Android and iOS:
iOS Screenshot:
Android Screenshot:

Twilio Device Cannot Be Connected : Twilio Js

I have an issue regarding Twilio Javascript SDK and stuck in a
situation where the issue directly involve IOS and RTC support. Right
now, i cannot connect the twilio device after device is ready. There
is no error or anything to track/debug.
Constantly, running the connection.status() return back connecting always. I think the signaling system works when there is an incoming call but again, connection.accept() and status remain connecting like forever.
Application Overview
Cordova/Phonegap app
https://media.twiliocdn.com/sdk/js/client/releases/1.6.9/twilio.min.js
shim:https://webrtc.github.io/adapter/adapter-1.0.2.js
https://github.com/BasqueVoIPMafia/cordova-plugin-iosrtc
Possible reasons: Can this be directly CSP issue? or I have you setup configuration using STUN/TURN?
Let me know if you need any information. It's not going to resolve because there is no error just "connecting" status.

Failure to reconnect after De-authentication from Cisco AP Wifi

Apologizing in advance, I am no 802.11 expert and this is a long winded question...
I am working on an iOS voip client, we use the Cocoaasyncsocket library for our TCP/UDP connections. The app/iDevice is allowed to roam in/out of wifi coverage (for the purposes of this discussion we will assume the app is using wifi only... no cellular connection). We have the appropriate plist settings for backgroundmode (voip, audio) as well as requiring persistent wifi.
We are having a problem that seems particular to Cisco AP's. With the client app in the foreground and roaming out and in of wifi range, we noticed that eventually the iOS device will eventually not automatically rejoin the network. After a great deal of debug the failure to rejoin was noted to have nothing to do with the app. The failure to re-join can ultimately be reproduced by forcing the AP (via config) to deauthenticate the iDevice three times. After the 1st and 2nd deauthentications, the iDevice readily automatically re-joins. But after the 3rd time, iOS does not automatically rejoin the network.
The network will be rejoined if, for example, the iOS email app is put in the foreground.
We were curious if any other VOIP type apps suffered this problem, and ran an experiment with running FaceTime and Skype on the iOS device.
Skype behaved much like our voip app, after the 3rd deauth the connection was lost. Trying to initiate another call resulted in a message to the effect of "must have an internet connection to make a call".
FaceTime did disconnect on the 3rd deauth and failed to automatically rejoin... however, we were able to re-initiate another FaceTime call which caused iOS to rejoin the network and make the call.
We would like to emulate the FaceTime behavior, but so far do not understand what we should be doing differently. To the best of our knowledge, we are properly closing the open sockets when we get disconnected. Is anyone familiar with this issue and have some insight to offer?

PhoneRTC Signal and Turn servers Vs Asteriks server

REQUIREMENTS: I was looking at using PhoneRTC Cordova plugin to broadcast a message from an Android tablet to a speaker/microphone device, where both these devices are in a private network based on an Asteriks server.
So any message from tablet to speaker/microphone device must be routed through the Asteriks server.
QUESTION: The Cordova plugin 'PhoneRTC' requires a SIGNAL server as well as a TURN server. In my case there is only an Asteriks server, so what will be the SIGNAL server and TURN server in above sceanrio? Maybe the Asteriks server can act as both the SIGNAL and TURN server, but not sure.
The challenge is how you can change the PhoneRTC server for another one.
In my case, I would like to use PhoneRTC but I would like to use easyRTC server instead of PhoneRTC server.
Thanks

XCode iDevice app - How to listen for message/request from server?

I have a project where I need to be able to send messages from a server running a web service to a specific iDevice. I have no idea how to do this, so any help is very appreciated.
The scenario: I have a web service which receives some message from an iDevice (could also be a Mac or PC, even an Android device). Depending on the content of this message I need to be able to send a message from the web service to another iDevice (I know the IP-address of the specific iDevice). I know how to use URLRequests to send a message from an iDevice to a server and collect the response from the server. In principle I could every 10 seconds send a request to the server asking if the server has any new messages to the sender (the iDevice sending the request), but I am pretty sure this is not the correct way to do it. Is there a way to have an iDevice listen for server communication on a specific port, so that the iDevice only does something active when it receives a message from the server to do something, e.g. display a message in the app listening for the server communication?
I guess I need to use something similar to the technology used for iMessage, but how is this done?
I am using XCode 4.6.2, iOS 6.1.
EDIT: Just to clarify my needs a bit more: The APNS seems to be TOO unreliable (at least that is what I have read in other threads regarding APN) as the web service in some cases can have the need for sending 2 distinct message to an iDevice within 1 minute (in some cases seconds), and as far as I have read in other threads this will simply not be possible because of how Apple's server handles ASPNS.
The app i am developing only needs to receive messages from the server when the app is active - is there any way, not using APNs, to do this, e.g. making the app listen for communication on a specific port?
Your scenario seems pretty similar to APPLE PUSH NOTIFICATIONs (APNs).
Ideally your server side should write a code in such a way that if there is any change on server side & need to be informed to all associated devices.
Then your server should post notification Apple server which will then send a notification to all the associated devices.
Refer this link
You already have but can use this code to identify the iOS/Mac deivce
NSString *identifierString = [[NSUserDefaults standardUserDefaults] objectForKey:#"myID"];
if (!identifierString) {
CFUUIDRef identifier = CFUUIDCreate(NULL);
identifierString = (NSString*)CFUUIDCreateString(NULL, identifier);
[[NSUserDefaults standardUserDefaults] setObject:identifierString forKey:#"myID"];
}
NSLog(#"%#",identifierString);
this code works till the lifetime of the app only.
After some search I have decided not to use the APNS, because it seems like people are having all sort of experience with it. I cannot use APNS because my project needs 100 % reliability and instant communication with the server.
I have decided to use tcp communication since my project only will be used in a local network. This will obviously mean more power consumption on the iDevices, but reliability is more crucial to the project.

Resources