Ejemplo n.º 1
0
 @Override
 public void setDefaultParams(PreferencesWrapper prefs) {
   super.setDefaultParams(prefs);
   prefs.setPreferenceBooleanValue(SipConfigManager.ENABLE_DNS_SRV, true);
   prefs.setPreferenceStringValue(SipConfigManager.KEEP_ALIVE_INTERVAL_MOBILE, "60");
   prefs.setPreferenceStringValue(SipConfigManager.KEEP_ALIVE_INTERVAL_WIFI, "60");
 }
Ejemplo n.º 2
0
  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
      case MENU_TEST_AUDIO:
        /*
        Thread t = new Thread() {
        	public void run() {
        		pjsua.test_audio_dev(8000, 20);
        		pjsua.test_audio_dev(16000, 20);
        		pjsua.test_audio_dev(8000, 40);
        		pjsua.test_audio_dev(16000, 40);

        	};
        };

        t.start();
        */
        startActivity(new Intent(this, AudioTester.class));
        return true;
      case MENU_RESET_VIEW:
        prefsWrapper.resetAllDefaultValues();
        return true;
      case MENU_EXPERT_VIEW:
        prefsWrapper.toogleExpertMode();

        return true;
      default:
        break;
    }
    return super.onOptionsItemSelected(item);
  }
Ejemplo n.º 3
0
 private void setCodecPriority(String codecName, short priority) {
   if (useCodecsPerSpeed) {
     prefsWrapper.setCodecPriority(codecName, bandtype, Short.toString(priority));
   } else {
     prefsWrapper.setCodecPriority(codecName, SipConfigManager.CODEC_NB, Short.toString(priority));
     prefsWrapper.setCodecPriority(codecName, SipConfigManager.CODEC_WB, Short.toString(priority));
   }
 }
Ejemplo n.º 4
0
  @Override
  public void setDefaultParams(PreferencesWrapper prefs) {
    super.setDefaultParams(prefs);
    // Disable ICE and turn on STUN!!!
    prefs.setPreferenceBooleanValue(SipConfigManager.ENABLE_STUN, true);
    String provider = providerListPref.getValue();
    if (provider != null) {
      String[] set = providers.get(provider);
      if (!TextUtils.isEmpty(set[1])) {
        prefs.addStunServer(set[1]);
      }
    }

    prefs.setPreferenceBooleanValue(SipConfigManager.ENABLE_ICE, false);
  }
Ejemplo n.º 5
0
  @Override
  public boolean onPrepareOptionsMenu(Menu menu) {

    menu.findItem(MENU_EXPERT_VIEW).setTitle(getToogleExpertTitle());
    menu.findItem(MENU_TEST_AUDIO).setVisible(prefsWrapper.isAdvancedUser());
    return super.onPrepareOptionsMenu(menu);
  }
Ejemplo n.º 6
0
  /** Initialize datas list */
  private void initDatas() {
    if (codecsList == null) {
      codecsList = new ArrayList<Map<String, Object>>();
    } else {
      codecsList.clear();
    }

    bandtype = (String) getArguments().get(BAND_TYPE);
    mediatype = (Integer) getArguments().get(MEDIA_TYPE);

    String[] codecNames;
    if (mediatype == MEDIA_AUDIO) {
      codecNames = prefsWrapper.getCodecList();
    } else {
      codecNames = prefsWrapper.getVideoCodecList();
    }

    int current_prio = 130;
    for (String codecName : codecNames) {
      Log.d(THIS_FILE, "Fill codec " + codecName + " for " + bandtype);
      String[] codecParts = codecName.split("/");
      if (codecParts.length >= 2) {
        HashMap<String, Object> codecInfo = new HashMap<String, Object>();
        codecInfo.put(CODEC_ID, codecName);
        if (mediatype == MEDIA_AUDIO) {
          codecInfo.put(
              CODEC_NAME,
              codecParts[0]
                  + " "
                  + codecParts[1].substring(0, codecParts[1].length() - 3)
                  + " kHz");
        } else if (mediatype == MEDIA_VIDEO) {
          codecInfo.put(CODEC_NAME, codecParts[0]);
        }
        codecInfo.put(
            CODEC_PRIORITY,
            prefsWrapper.getCodecPriority(codecName, bandtype, Integer.toString(current_prio)));
        codecsList.add(codecInfo);
        current_prio--;
        Log.d(THIS_FILE, "Found priority is " + codecInfo.get(CODEC_PRIORITY));
      }
    }

    Collections.sort(codecsList, codecsComparator);
  }
Ejemplo n.º 7
0
 @Override
 public void setDefaultParams(PreferencesWrapper prefs) {
   super.setDefaultParams(prefs);
   prefs.setPreferenceBooleanValue(SipConfigManager.ENABLE_TLS, true);
 }
Ejemplo n.º 8
0
 @Override
 public void setDefaultParams(PreferencesWrapper prefs) {
   super.setDefaultParams(prefs);
   prefs.setPreferenceBooleanValue(SipConfigManager.ENABLE_STUN, true);
   prefs.setPreferenceStringValue(SipConfigManager.STUN_SERVER, "stun.wimobile.it");
 }
Ejemplo n.º 9
0
 @Override
 public void setDefaultParams(PreferencesWrapper prefs) {
   super.setDefaultParams(prefs);
   prefs.setPreferenceStringValue(SipConfigManager.USER_AGENT, "Optimus-SoftPhone/7.0.1.4124");
 }
Ejemplo n.º 10
0
  public void setDefaultParams(PreferencesWrapper prefs) {
    super.setDefaultParams(prefs);

    // prefs.setPreferenceBooleanValue(PreferencesWrapper.IS_ADVANCED_USER, true);

    prefs.setPreferenceBooleanValue(SipConfigManager.ENABLE_DNS_SRV, true);
    prefs.setPreferenceBooleanValue(SipConfigManager.ECHO_CANCELLATION, true);
    // prefs.setPreferenceBooleanValue(SipConfigManager.ENABLE_TLS, true);
    prefs.setPreferenceBooleanValue(SipConfigManager.ENABLE_STUN, false);
    prefs.setPreferenceBooleanValue(SipConfigManager.ENABLE_ICE, false);
    // prefs.setPreferenceStringValue(SipConfigManager.LOG_LEVEL, "4");

    // wb codecs
    prefs.setCodecPriority("PCMA/8000/1", SipConfigManager.CODEC_WB, "245");
    prefs.setCodecPriority("G729/8000/1", SipConfigManager.CODEC_WB, "244");
    prefs.setCodecPriority("GSM/8000/1", SipConfigManager.CODEC_WB, "243");
    prefs.setCodecPriority("iLBC/8000/1", SipConfigManager.CODEC_WB, "242");
    prefs.setCodecPriority("PCMU/8000/1", SipConfigManager.CODEC_WB, "241");
    prefs.setCodecPriority("G722/16000/1", SipConfigManager.CODEC_WB, "240");
    prefs.setCodecPriority("speex/16000/1", SipConfigManager.CODEC_WB, "239");
    prefs.setCodecPriority("speex/8000/1", SipConfigManager.CODEC_WB, "0");
    prefs.setCodecPriority("speex/32000/1", SipConfigManager.CODEC_WB, "0");

    // nb codecs
    prefs.setCodecPriority("G729/8000/1", SipConfigManager.CODEC_NB, "245");
    prefs.setCodecPriority("PCMA/8000/1", SipConfigManager.CODEC_NB, "244");
    prefs.setCodecPriority("PCMU/8000/1", SipConfigManager.CODEC_NB, "243");
    prefs.setCodecPriority("iLBC/8000/1", SipConfigManager.CODEC_NB, "242");
    prefs.setCodecPriority("GSM/8000/1", SipConfigManager.CODEC_NB, "241");
    prefs.setCodecPriority("speex/8000/1", SipConfigManager.CODEC_NB, "240");
    prefs.setCodecPriority("G722/16000/1", SipConfigManager.CODEC_NB, "0");
    prefs.setCodecPriority("speex/16000/1", SipConfigManager.CODEC_NB, "0");
    prefs.setCodecPriority("speex/32000/1", SipConfigManager.CODEC_NB, "0");
  }
Ejemplo n.º 11
0
 @Override
 public void setDefaultParams(PreferencesWrapper prefs) {
   super.setDefaultParams(prefs);
   prefs.setCodecPriority("G729/8000/1", SipConfigManager.CODEC_WB, "245");
   prefs.setCodecPriority("G729/8000/1", SipConfigManager.CODEC_NB, "245");
 }
Ejemplo n.º 12
0
  @Override
  public void setDefaultParams(PreferencesWrapper prefs) {
    super.setDefaultParams(prefs);

    // codecs WiFi: G711a, G711u, G722
    prefs.setCodecPriority("G722/16000/1", SipConfigManager.CODEC_WB, "220");
    prefs.setCodecPriority("PCMU/8000/1", SipConfigManager.CODEC_WB, "230");
    prefs.setCodecPriority("PCMA/8000/1", SipConfigManager.CODEC_WB, "240");
    prefs.setCodecPriority("G729/8000/1", SipConfigManager.CODEC_WB, "0");
    prefs.setCodecPriority("iLBC/8000/1", SipConfigManager.CODEC_WB, "0");
    prefs.setCodecPriority("speex/8000/1", SipConfigManager.CODEC_WB, "0");
    prefs.setCodecPriority("speex/16000/1", SipConfigManager.CODEC_WB, "0");
    prefs.setCodecPriority("speex/32000/1", SipConfigManager.CODEC_WB, "0");
    prefs.setCodecPriority("GSM/8000/1", SipConfigManager.CODEC_WB, "0");
    prefs.setCodecPriority("SILK/8000/1", SipConfigManager.CODEC_WB, "0");
    prefs.setCodecPriority("SILK/12000/1", SipConfigManager.CODEC_WB, "0");
    prefs.setCodecPriority("SILK/16000/1", SipConfigManager.CODEC_WB, "0");
    prefs.setCodecPriority("SILK/24000/1", SipConfigManager.CODEC_WB, "0");
    prefs.setCodecPriority("G726-16/8000/1", SipConfigManager.CODEC_WB, "0");
    prefs.setCodecPriority("G726-24/8000/1", SipConfigManager.CODEC_WB, "0");
    prefs.setCodecPriority("G726-32/8000/1", SipConfigManager.CODEC_WB, "0");
    prefs.setCodecPriority("G726-40/8000/1", SipConfigManager.CODEC_WB, "0");

    // codecs 3G: GSM, speex, (G729a - not possible license)
    prefs.setCodecPriority("G722/16000/1", SipConfigManager.CODEC_NB, "0");
    prefs.setCodecPriority("PCMU/8000/1", SipConfigManager.CODEC_NB, "0");
    prefs.setCodecPriority("PCMA/8000/1", SipConfigManager.CODEC_NB, "220");
    prefs.setCodecPriority("G729/8000/1", SipConfigManager.CODEC_NB, "0");
    prefs.setCodecPriority("iLBC/8000/1", SipConfigManager.CODEC_NB, "0");
    prefs.setCodecPriority("speex/8000/1", SipConfigManager.CODEC_NB, "230");
    prefs.setCodecPriority("speex/16000/1", SipConfigManager.CODEC_NB, "0");
    prefs.setCodecPriority("speex/32000/1", SipConfigManager.CODEC_NB, "0");
    prefs.setCodecPriority("GSM/8000/1", SipConfigManager.CODEC_NB, "240");
    prefs.setCodecPriority("SILK/8000/1", SipConfigManager.CODEC_NB, "0");
    prefs.setCodecPriority("SILK/12000/1", SipConfigManager.CODEC_NB, "0");
    prefs.setCodecPriority("SILK/16000/1", SipConfigManager.CODEC_NB, "0");
    prefs.setCodecPriority("SILK/24000/1", SipConfigManager.CODEC_NB, "0");
    prefs.setCodecPriority("G726-16/8000/1", SipConfigManager.CODEC_NB, "0");
    prefs.setCodecPriority("G726-24/8000/1", SipConfigManager.CODEC_NB, "0");
    prefs.setCodecPriority("G726-32/8000/1", SipConfigManager.CODEC_NB, "0");
    prefs.setCodecPriority("G726-40/8000/1", SipConfigManager.CODEC_NB, "0");
  }
Ejemplo n.º 13
0
 private int getToogleExpertTitle() {
   return prefsWrapper.isAdvancedUser()
       ? R.string.advanced_preferences
       : R.string.expert_preferences;
 }