Beispiel #1
0
 void writeConfig(Writer wtr, AuthCodeSettings settings, Domain domain, int freeswithPort)
     throws IOException {
   KeyValueConfiguration config = KeyValueConfiguration.equalsSeparated(wtr);
   config.write(settings.getSettings().getSetting("acccode-config"));
   config.write("freeswitch.eventSocketPort", freeswithPort);
 }
Beispiel #2
0
  void write(
      Writer wtr,
      IvrSettings settings,
      Domain domain,
      Location location,
      String mwiAddresses,
      int mwiPort,
      Address restApi,
      Address adminApi,
      Address apacheApi,
      Address imApi,
      Address imbotApi,
      Address fsEvent)
      throws IOException {
    KeyValueConfiguration config = KeyValueConfiguration.equalsSeparated(wtr);
    config.writeSettings(settings.getSettings());
    config.write("freeswitch.eventSocketPort", fsEvent.getPort());

    // potential bug: name "operator" could be changed by admin. this should be configurable
    // and linked with vm dialing rule
    config.write("ivr.operatorAddr", "sip:operator@" + domain.getName());

    // required services
    if (mwiAddresses == null) {
      throw new ConfigException("MWI feature needs to be enabled. No addresses found.");
    }
    config.write("ivr.mwiAddresses", mwiAddresses);
    config.write("ivr.mwiPort", mwiPort);
    if (adminApi == null) {
      throw new ConfigException("Admin feature needs to be enabled. No addresses found.");
    }
    config.write("ivr.configUrl", adminApi.toString());
    if (apacheApi != null) {
      config.write("ivr.emailAddressUrl", apacheApi.toString());
    }

    // optional services
    if (restApi != null) {
      config.write("ivr.3pccSecureUrl", restApi.toString());
      config.write("ivr.callHistoryUrl", restApi.toString() + "/cdr/");
    }
    if (imApi != null) {
      config.write("ivr.openfireHost", imApi.getAddress());
      config.write("ivr.openfireXmlRpcPort", imApi.getPort());
    }
    if (imbotApi != null) {
      config.write("ivr.sendIMUrl", imbotApi.toString());
    }
  }