コード例 #1
0
ファイル: MainActivity.java プロジェクト: nvteam/most-voip
  private void runExample() {
    this.clearInfoLines();
    this.addInfoLine("Local IP Address:" + Utils.getIPAddress(true));

    // Voip Lib Initialization Params

    HashMap<String, String> params = buildParams();

    Log.d(TAG, "Initializing the lib...");
    if (myVoip == null) {
      Log.d(TAG, "Voip null... Initialization.....");
      myVoip = new VoipLibBackend();
      this.voipHandler = new AnswerCallHandler(this, myVoip);

      // Initialize the library providing custom initialization params and an handler where
      // to receive event notifications. Following Voip methods are called form the handleMassage()
      // callback method
      // boolean result = myVoip.initLib(params, new RegistrationHandler(this, myVoip));
      myVoip.initLib(this.getApplicationContext(), params, this.voipHandler);
    } else {
      Log.d(TAG, "Voip is not null... Destroying the lib before reinitializing.....");
      // Reinitialization will be done after deinitialization event callback
      this.voipHandler.reinitRequest = true;
      myVoip.destroyLib();
    }
  }