title: call event in iphone using Core Telephony
body: <p>I am trying to get call events in my iPhone app.
  For that I am trying to register to Core Telephony notification, but I am getting below error. I am testing this on iPhone 3GS.</p>
  
  <pre><code>Undefined symbols for architecture armv7:
    "CTTelephonyCenterGetDefault()", referenced from:
    -[CallEventAppDelegate application:didFinishLaunchingWithOptions:] in CallEventAppDelegate.o
  ld: symbol(s) not found for architecture armv7
  </code></pre>
  
  <p>Here is my sample code:-</p>
  
  <pre><code>    void (*CTTelephonyCenterAddObserver) (id,id,CFNotificationCallback,NSString*,void*,int);
  
      - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
     {
  
  // register for all Core Telephony notifications
  
  
  id ct = CTTelephonyCenterGetDefault();
  
  CTTelephonyCenterAddObserver(ct,   // center
                               NULL, // observer
                               telephonyEventCallback,  // callback
                               NULL,                    // event name (or all)
                               NULL,                    // object
                               CFNotificationSuspensionBehaviorDeliverImmediately);
  
  return YES;
      }
  
   static void telephonyEventCallback(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo)
  {
  
  NSString *notifyname = (__bridge NSString*)name;
  if ([notifyname isEqualToString:@"kCTCallIdentificationChangeNotification"])
  {
      NSDictionary* info = (__bridge NSDictionary*)userInfo;
      //CTCall* call = (CTCall*)[[[info objectForKey:@"kCTCall"] stringValue] isEqualToString:@"4"];
  
      CTCall* call = (CTCall*)[info objectForKey:@"kCTCall"];
  
      //NSString* caller = CTCallCopyAddress(NULL, call);
  
      if (call.callState == CTCallStateDisconnected)
      {
          NSLog(@"Call has been disconnected");
      }
      else if (call.callState == CTCallStateConnected)
      {
          NSLog(@"Call has just been connected");
      }
      else if (call.callState == CTCallStateIncoming)
      {
          NSLog(@"Call is incoming");
  
      }
      else if (call.callState == CTCallStateDialing)
      {
          NSLog(@"Call is Dialing");
      }
      else
      {
          NSLog(@"None of the conditions");
      }
  }
   }
  </code></pre>
  
  <p>Thanks in advance.</p>