In iPhone/iPad applications like Tango and Viber, you can make in app calls like phone calls. I mean when you make a call, the other client's phone rings and the answer option appears on the bottom side of the screen. It is not a push notification, it is a call which can be answered or declined.
It does not differ even if the application is running on the background on the iPhone which is being called, the call appears on the screen with answer option. Also if you cancel the call it disappears on the other phone which is being called. Shortly it is exactly like a phone call but it is not, it is an in-app call.
How can that kind of functionality be implemented?