can we make an application to hang up the dialed call for x amount of second from our application iphone sdk - ios4

I want to develop an iPhone application whose main function is to hang up an outgoing phone call after X amount of seconds/minutes have passed since the call was placed, not from when the call was connected. After hanging up, the application will automatically redial to continue the phone call without any user intervention. The application will only redial in the case the same application has hanged up the call. If any of the parties hang up the call, the application will not redial.
Expected features to be developed are:
Add and update a list of phone numbers to monitor
The user must be able to type in directly a phone number or select it from the address book. The list will show the name and phone number monitored like “Roberto Ibarra: 33 5555 5555”. This list will serve as the database of phone numbers the application will identify as outgoing calls that must be hanged up and redialed automatically after X amount of minutes have passed. The application must not affect incoming calls or outgoing calls to numbers other than the ones on this list.
If possible, the application must fully integrate with the OS dialing system so that calls placed from any part of the phone will be monitored. For example, if a call is dialed with voice commands it should be monitored by this application.
Alert and hang up
The application must send a BEEP 5 seconds before hanging up, so as to both parties in the call can hear it and be aware the call will be about to end. This will not be configurable by the user, it will always happen 5 seconds before ending the monitored call. If the call is an outgoing call and the number is part of the list of numbers to monitor, the application will then hangup the call once the X amount of minutes/seconds have been reached. This beep can be a DTMF tone.
Automatically redial a monitored call that was ended by the application
The application will automatically redial the number that was being called to continue the call ONLY if the call was automatically ended by the application because the time limit was reached. If the call was ended by the user, then the call must NOT be redialed.
Copy protection mechanism
The application must have a copy protection mechanism based on the phone's IMEI. The application must ask the first time for a code and show the phone's IMEI. The code will be generated by a third party website by entering the IMEI and if correctly entered in the phone, then the application will work.
The algorithm will be based on a hash from the IMEI and some seed to be determined. The crypt function should be something like MD5 or some other function available in the OS in the majority of the phones using the OS.

You cannot do this. You have no access to calls made from the device and certainly can't hangup any in process calls. The closest you can come is asking the phone application to dial a number.

Related

android.bluetooth.le changing advertiding data (UUID) periodically

I made an app that advertises an iBeacon. The UUID changes every 30 seconds. Within the UUID is the androidID of the phone and a timestamp. Both are encrypted. My smarthome system decrypts the UUID and gets the timestamp and the androidID.If both are valid the front door opens.
The app creates an UUID and starts advertising, stops after 30 seconds an creates a new one and restarts the advertising. This goes on for ever until the app (running in backround) doesn't get closed.
I wonder if it is possible to change the advertising data (UUID) without stopping and restarting the advertising??
Thanks!
Is starting with AdvertisingSet a solution??
The way to do this is via the setAdvertisingData() method. Calling this in the middle of advertising shouldn't be an issue (as long as you are on API 26 or later). From the Android developer website:-
Set/update data being Advertised. Make sure that data doesn't exceed
the size limit for specified AdvertisingSetParameters. This method
returns immediately, the operation status is delivered through
callback.onAdvertisingDataSet().
Advertising data must be empty if non-legacy scannable advertising is
used. For apps targeting Build.VERSION_CODES#R or lower, this requires
the Manifest.permission#BLUETOOTH_ADMIN permission which can be gained
with a simple manifest tag. For apps targeting
Build.VERSION_CODES#S or or higher, this requires the
Manifest.permission#BLUETOOTH_ADVERTISE permission which can be gained
with Activity.requestPermissions(String[], int). Requires
Manifest.permission.BLUETOOTH_ADVERTISE
Have a look at the links below for more information:-
How do you update the Android BLE advertising data at runtime
Dynamically changing BLE data in Android
BLE advertisements changing in Android

Production-ready WebSocket IOT System - Software Design Advice

I'm developing a system to control a range of IoT devices. Each set of devices is grouped into a "system" that monitors/controls a real-world process. For example system A may be managing process A and have:
3 cameras
1 accelerometer
1 magnetometer
5 thermocouples
The webserver maintains socket connections to each device. Users can connect (via a UI - again with WebSockets) to the webserver and receive updates about systems to which they are subscribed.
When a user wants to begin process A, they should press a 'start' button on the interface. This will start up the cameras, accelerometer, magnetometer, and thermocouples. These will begin sending data to the server. It also triggers the server to set the recording mode to true for each device, which means the server will write output to a database. My question:
Should I send a single 'start' request from javascript code in my UI to the server, and allow the server to start each device individually (how do I then handle an error, for example, if a single sensor isn't working - what about if two sensors don't work?). Or do I send individual requests from the UI to the server for each device, i.e. start camera 1, start camera 2, start accelerometer, start recording camera1, etc. and handle each success/error state individually?
My preference throughout the system so far has been the latter approach - one request, one response; with an HTTP error code. However, programming becomes more complex when there are many devices to control, for example - System B has 12 thermocouples.
Some components of the system are not vital - e.g. if 1 camera fails we can continue, however, if the accelerometer fails the whole system cannot run and so human monitoring is required. If the server started the devices individually from a single 'start' message, should I return an array of errors, or should the server know which components are vital and return a single error if a vital component fails? And in a failure state, should the server then handle stopping each sensor and returning to the original state - and what if that then fails? I foresee this code becoming quite complex with this approach.
I've been going back and forth over the best way to approach this for months, but I can't find much advice online around building complex, production-ready IoT systems for the real world. If anybody has any advice or could point me towards any papers/books/etc. I would really appreciate it.
Thanks in advance,
Tom

Thermostat to nest.com connection rate

I'm using REST GET calls from a google script to build a temperature profile of my house during the day. The function triggers every 15min. last_connection (and the rest of the data) will sometimes be the same 3-4 calls in a row, other times can be different each time for several hours running, suggesting variable rates at which the thermostat sends data up to the server.
Does anyone know what governs the thermostat's connections to nest.com or if there is a way to force a connection in order to get an up to date profile?
The thermostat connects to Nest's cloud under the following circumstances:
A 'significant' even has occurred (ie the furnace turning on)
A timeout has occurred (ie a scheduled check in appointment)
A thermostat will be considered offline if it misses its check in window, there is more detail on why that would happen in Nest's Troubleshooting Offline Status in the Nest apps support article.
You can force a thermostat to come online by sending a change to it, for example changing the target temperature will necessarily force the thermostat to wake up so the new value can be set, while awake the thermostat will update the cloud service with updated information. Forcing a thermostat to wake as way to get updated data from the thermostat is not recommended as you will run into an API rate limit designed to protect the battery on the thermostat. Charging rates on thermostats are rather limited, wake it too often and it will go offline for a while, annoying the user.
Rest assured, if the ambient temperature or humidity changes by a 'significant' amount, the thermostat will wake up and update the cloud service. The thresholds of what signifies a significant amount are harder to predict as they are partially determined by charging rate. If you want to know why that can vary, Nest has filed a patent which goes into great detail.

J2ME(LWUIT)- Interrupting the response from server

I have developed an mobile application with J2ME(LWUIT), in that I have to update an value in my mobile RMS after receiving a response from server with a completion of updation in server side, in that case when I hit call end button- red button in my mobile after hitting server and before receiving a response the mobile application get closed and the server side value is updated but mobile RMS value is not yet updated kindly let me know is any body have a idea about this.
The red button usually kills the application instantly and doesn't really leave you a chance to fix that. You can potentially require a callback to the server to actually commit the data there.
#arun Well what you can do is.
1)Update changes at server.
2)Send the data that you wish to push to the RMS to the MIDlet along with a uniqueID. Unique id identifies every transaction uniquely.
3)At this point, the server keeps waiting for a confirmation from the MIDlet whether the MIDlet has received the data or not (lets say it waits for 20 secs)
4)Once the MIDlet receives the data, it stores it in the memory and immediately sends a confirmation to the server along with the uniqueID received (and waits for ..say.25 secs). The MIDlet also stores a count of the number of times the server has sent data with a particular unique id. So the count is initially 0 and incremented every time the server sends data with same unique id.
5)If the server receives the confirmation within 20 secs, it does nothing. After 25 secs elapse, the MIDlet will write the data to the RMS. your job is done!
5.1)If server DOES NOT receive the confirmation,it will again send the data with the same unique id (at the 21st second). The MIDlet recognizes the unique id and increments the counter which keeps track of the number of times the server has sent the same data. It again sends a confirmation and waits for 25 secs.
Now...this process can go on and on.
What you need to do is...decide when you decide to call quits on this process.
6)Ultimately,if the confirmation is not received by the server ,it rolls back the changes and sends message to the MIDlet "roll back data for unique id so and so"
7)if the midlet has not committed the data for that unique id, it ignores the messages and also the changes associated with that unique id . If already committed, it just rolls back the data for that unique id. if the request for rollback is repeated for same unique id, ignore and send a message to the server that changes have been rolled back.
8)Note: you need to send a message to the server saying that changes to RMS have been rolled back else the server will keep sending a message to rollback the changes.
Yes, this is quite complex. Check out the book. Communication Network or some thing similar by the author Behrouz Forouzan. He explains this fab.

General question about parallel threading in C++

I haven't used threading in my program before. But there is a problem I am having with this 3rd party application.
It is an offsite backup solution and it has a server and many clients. We have an admin console to manage all the clients and that is where there is a problem.
If one of the client side application gets stuck, or is running in a broken condition, the admin console waits forever to get a response and does not display anything.
$for(client= client1; client < last_client; client++){
if (getOServConnection(client, &socHandler)!=NULL) { .. }
}
I want two solutions to this. I want to know if there is anyway, I can set a timeout for the function getOServConnection, so that I get a response within X seconds.
And, I want to know how to call this function in parallel for all clients, so that I get the response from all clients within X seconds.
the getOServConnection contains a WSAConnect call, and I don't want to use any options on the socket, since it is used by other modules and it will affect the application severely.
First.. If you move the call that hangs into a separate thread you can use the main thread for starting a timer an waiting for the timeout. If you are using Visual C++ and if you are in Win32 you can use the (rather old) MFC based timer. Once this timer expires it will launch a function call OnTimer. This timer does not affect your application's main thread as it works in a different system based thread.
Second.. If you need to start any number of threads with that connection you should start thinking of a design pattern to use for that. You could use a fixed number of threads, and in that case you may want to use a object pool. Or if the number of threads is (relatively) limitless you may want to use a factory method

Resources