/**
  * New IP call invitation
  *
  * @param session IP call session
  */
 @Override
 public void handleIPCallInvitation(IPCallStreamingSession session) {
   if (logger.isActivated()) {
     logger.debug("Handle event IP call invitation");
   }
   // Broadcast the invitation
   ipcallApi.receiveIPCallInvitation(session);
 }
  @Override
  public void onDestroy() {
    // Unregister account changed broadcast receiver
    if (accountChangedReceiver != null) {
      try {
        unregisterReceiver(accountChangedReceiver);
      } catch (IllegalArgumentException e) {
        // Nothing to do
      }
    }

    // Unregister SMS receiver for network initiated configuration
    if (reconfSMSReceiver != null) {
      try {
        reconfSMSReceiver.unregisterSmsProvisioningReceiver();
      } catch (IllegalArgumentException e) {
        // Nothing to do
      }
    }

    // Close APIs
    imsApi.close();
    termsApi.close();
    presenceApi.close();
    capabilityApi.close();
    richcallApi.close();
    ipcallApi.close();
    messagingApi.close();
    sipApi.close();

    // Stop the core
    Thread t =
        new Thread() {
          /** Processing */
          public void run() {
            stopCore();
          }
        };
    t.start();
  }