Beispiel #1
0
  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();
    }
  }
Beispiel #2
0
 public void toggleHoldCall(View view) {
   if (myVoip == null || myVoip.getCall().getState() == CallState.IDLE) return;
   if (myVoip.getCall().getState() == CallState.ACTIVE) {
     Log.d(TAG, "trying to hold the call...");
     this.myVoip.holdCall();
   } else if (myVoip.getCall().getState() == CallState.HOLDING) {
     Log.d(TAG, "trying to unhold the call...");
     this.myVoip.unholdCall();
   }
 }
Beispiel #3
0
 private void subscribeBuddies() {
   String buddyExtension = "ste";
   String buddyExtension2 = "ste2";
   Log.d(TAG, "adding buddies...");
   myVoip.getAccount().addBuddy(getBuddyUri(buddyExtension));
   myVoip.getAccount().addBuddy(getBuddyUri(buddyExtension2));
 }
Beispiel #4
0
  public void addInfoLine(String info) {
    String callStatus = "N.A";
    if (this.myVoip != null) {
      Log.d(TAG, "Voip Lib is not NULL: Test with multiple calls!");
      callStatus = myVoip.getCall().getState().name();
    }

    String msg = "CallState:(" + callStatus + "):" + info;
    this.infoArray.add(msg);
    if (arrayAdapter != null) arrayAdapter.notifyDataSetChanged();
  }
Beispiel #5
0
 private void updateServerStateInfo() {
   TextView labBuddyState = (TextView) findViewById(R.id.labServerState);
   labBuddyState.setText(myVoip.getServer().getState().toString());
 }