title: how to handle the application on outgoing and incoming calls in ios phone phonegap programming?
body: <p>Can any one suggest me how to handle a application in iOS phonegap if any outgoing calls and incoming phone calls. Actually I m new to phone-gap based applications</p>
  
  <p>Currently I m developing an application to track the location in background. If any incoming or outgoing call appears ,I need to stop my application background location tracking(incoming/outgoing call) and start the location tracking after call ends.</p>
  
  <p>I have referred this link:
  <a href="https://stackoverflow.com/questions/9681475/how-detect-incoming-and-outgoing-call-end-state-iphone">How detect incoming and outgoing call end state? iphone</a></p>
  
  <pre><code>   [[NSNotificationCenter defaultCenter] addObserver:self  selector:@selector(callReceived:) name:CTCallStateIncoming object:nil];
  
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(callEnded:) name:CTCallStateDisconnected object:nil];
  
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(callConnected:) name:CTCallStateConnected object:nil];
  </code></pre>