Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Data;
- using System.Linq;
- using MonoTouch.CoreTelephony;
- using MonoTouch.Foundation;
- namespace Common
- {
- public class CallHandler
- {
- CTTelephonyNetworkInfo info;
- CTCallCenter ctc;
- string carriername;
- public CallHandler ()
- {
- Console.WriteLine ("Callhandler is active");
- info = new CTTelephonyNetworkInfo ();
- ctc = new CTCallCenter ();
- try {
- carriername = info.SubscriberCellularProvider.CarrierName;
- } catch {
- Console.WriteLine ("No carrier");
- }
- try {
- var calls = ctc.CurrentCalls;
- Console.WriteLine(ctc);
- } catch {
- Console.WriteLine ("No calls");
- }
- try {
- ctc.CallEventHandler += new CTCallEventHandler (delegate(CTCall inCTcall) {
- //Console.WriteLine ("Derp?");
- //calls = ctc.CurrentCalls;
- });
- }
- catch {
- Console.WriteLine ("Could not map incomming calls?");
- }
- try {
- info.CellularProviderUpdatedEventHandler = new CTCarrierEventHandler (delegate(CTCarrier inCTCarrier) {
- Console.WriteLine ("Herp?");
- carriername = inCTCarrier.CarrierName;
- });
- }
- catch{
- Console.WriteLine ("Could not map providerchanges?");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement