⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 usertablemodel.java

📁 SIP(Session Initiation Protocol)是由IETF定义
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
      Element element = (Element) elements.item(0);      if (element.hasChildNodes())      {        userData.set(USER_GROUP, element.getFirstChild().getNodeValue());      }    }    // ip address    elements = user.getElementsByTagName("ipaddr");    if (elements.getLength() > 0)    {      Element element = (Element) elements.item(0);      if (element.hasChildNodes())      {        userData.set(IP, element.getFirstChild().getNodeValue());      }    }    // marshalgroup    elements = user.getElementsByTagName("marshalgroup");    if (elements.getLength() > 0)    {      Element element = (Element) elements.item(0);      if (element.hasChildNodes())      {        userData.set(MARSHAL, element.getFirstChild().getNodeValue());      }    }    // load the password element, if it is present in the xml    NodeList passwords = user.getElementsByTagName("password");    if (passwords != null)    {      if (passwords.getLength() > 0)      {        if (passwords.item(0).hasChildNodes())        {          Node password = passwords.item(0).getFirstChild();          if (password != null)          {            userData.set(UserTableModel.PASSWORD, password.getNodeValue());          }        }      }    }    // Call blocking    Element clblNode = null;    NodeList nodeList = user.getElementsByTagName("clbl");    if (nodeList.getLength() > 0)    {      clblNode = (Element) nodeList.item(0);    }    Element block900Node = null;    Element blockLongDistNode = null;    if (clblNode != null)    {      // 900 calls blocked      nodeList = clblNode.getElementsByTagName("nineHundredBlocked");      if (nodeList.getLength() > 0)      {        block900Node = (Element) nodeList.item(0);        userData.set(UserTableModel.BLOCK_900_ADMIN_ENABLED,                     block900Node.getAttribute("adminSet"));        userData.set(UserTableModel.BLOCK_900_USER_SET,                     block900Node.getAttribute("userSet"));      }      // long distance calls blocked      nodeList = clblNode.getElementsByTagName("longDistanceBlocked");      if (nodeList.getLength() > 0)      {        blockLongDistNode = (Element) nodeList.item(0);        userData.set(UserTableModel.BLOCK_LONG_DISTANCE_ADMIN_ENABLED,                     blockLongDistNode.getAttribute("adminSet"));        userData.set(UserTableModel.BLOCK_LONG_DISTANCE_USER_SET,                     blockLongDistNode.getAttribute("userSet"));      }      // feature group      setFeatureGroup(userData, CALL_BLOCK_GROUP, clblNode);      // admin enabled      userData.set(UserTableModel.CALL_BLOCK_ADMIN_ENABLED,                   clblNode.getAttribute("enabled"));      //prefix      nodeList = clblNode.getElementsByTagName("prefix");      if (nodeList.getLength() > 0)      {        Node node = nodeList.item(0);        if (node.hasChildNodes())        {          String data = (String)node.getFirstChild().getNodeValue();          userData.set(UserTableModel.CALL_BLOCK_PREFIX,data);        }        else        {          userData.set(UserTableModel.CALL_BLOCK_PREFIX,"");        }      }    }    // Call screening    Element csNode = null;    nodeList = user.getElementsByTagName("cs");    if (nodeList.getLength() > 0)    {      csNode = (Element) nodeList.item(0);    }    if (csNode != null)    {      // feature group      setFeatureGroup(userData, CALL_SCREEN_GROUP, csNode);      userData.set(UserTableModel.CALL_SCREEN_ADMIN_ENABLED,                   csNode.getAttribute("enabled"));      // get the list of name,numbers for the call screening feature      NodeList csList = csNode.getElementsByTagName("screenfrom");      String screenFrom = "";      for (int i = 0; i < csList.getLength(); i++)      {        Element screen = (Element) csList.item(i);        screenFrom = screenFrom + screen.getAttribute("name");        screenFrom = screenFrom + ",";        screenFrom = screenFrom + screen.getAttribute("number");        screenFrom = screenFrom + ";";      }      userData.set(UserTableModel.CALL_SCREEN_NUMBERS, screenFrom);    }    // forward all calls    Element cfaNode = null;    nodeList = user.getElementsByTagName("cfa");    if (nodeList.getLength() > 0)    {      cfaNode = (Element) nodeList.item(0);    }    if (cfaNode != null)    {      setFeatureGroup(userData, FORWARD_ALL_GROUP, cfaNode);      setSetfeat(userData, FORWARD_ALL_USER_SET, cfaNode);      userData.set(UserTableModel.FORWARD_ALL_ADMIN_ENABLED,                   cfaNode.getAttribute("enabled"));      // destination      nodeList = cfaNode.getElementsByTagName("forwardto");      if (nodeList.getLength() > 0)      {        Node node = nodeList.item(0);        if (node.hasChildNodes())        {          userData.set(FORWARD_ALL_DESTINATION,                       node.getFirstChild().getNodeValue());        }      }    }    // forward no-answer, busy calls    Element fnabNode = null;    nodeList = user.getElementsByTagName("fnab");    if (nodeList.getLength() > 0)    {      fnabNode = (Element) nodeList.item(0);    }    if (fnabNode != null)    {      setFeatureGroup(userData, FORWARD_BUSY_GROUP, fnabNode);      userData.set(UserTableModel.FORWARD_BUSY_ADMIN_ENABLED,                   fnabNode.getAttribute("enabled"));      // call forward busy destination      nodeList = fnabNode.getElementsByTagName("cfb");      if (nodeList.getLength() > 0)      {        Element cfbNode = (Element) nodeList.item(0);        nodeList = cfbNode.getElementsByTagName("forwardto");        if (nodeList.getLength() > 0)        {          Node node = nodeList.item(0);          if (node.hasChildNodes())          {            userData.set(FORWARD_BUSY_DESTINATION,                         node.getFirstChild().getNodeValue());          }        }        // call forward busy set        userData.set(UserTableModel.FORWARD_BUSY_USER_SET,                     cfbNode.getAttribute("set"));      }      // call forward no answer destination      nodeList = fnabNode.getElementsByTagName("fna");      if (nodeList.getLength() > 0)      {        Element fnaNode = (Element) nodeList.item(0);        nodeList = fnaNode.getElementsByTagName("forwardto");        if (nodeList.getLength() > 0)        {          Node node = nodeList.item(0);          if (node.hasChildNodes())          {            userData.set(FORWARD_UNANSWERED_DESTINATION,                         node.getFirstChild().getNodeValue());          }        }        // call forwared no answer set        userData.set(UserTableModel.FORWARD_UNANSWERED_USER_SET,                     fnaNode.getAttribute("set"));      }    }    // load the list of aliases, if present    String aliasesString = "";    NodeList aliases = user.getElementsByTagName("aliases");    if (aliases != null)    {      if (aliases.getLength() > 0)      {        Element aliasesElement = (Element) aliases.item(0);        NodeList aliasList = aliasesElement.getElementsByTagName("alias");        if (aliasList != null)        {          if (aliasList.getLength() > 0)          {            for (int i = 0; i < aliasList.getLength(); i++)            {              Element aliasElement = (Element) aliasList.item(i);              String alias = aliasElement.getAttribute("value");              aliasesString += alias + ";";            }          }        }      }    }    userData.set(UserTableModel.ALIASES, aliasesString);    NodeList fcs = user.getElementsByTagName("failurecase");    if (fcs.getLength() > 0)    {      Node fc = fcs.item(0);      if (fc.hasChildNodes())      {        userData.set(FAILURE_CASE, fc.getFirstChild().getNodeValue());      }    }    // Authentication type and password    NodeList authenticationTypes =      user.getElementsByTagName("authenticationType");    if (authenticationTypes.getLength() > 0)    {      Element authenticationType = (Element) authenticationTypes.item(0);      String type = authenticationType.getAttribute("value");      userData.set(AUTHENTICATION_TYPE, type);      NodeList authPasswords =        authenticationType.getElementsByTagName("authenticationPassword");      if (authPasswords.getLength() > 0)      {        Element authPassword = (Element) authPasswords.item(0);        String pw = authPassword.getAttribute("value");        userData.set(AUTHENTICATION_PASSWORD, pw);      }    }    // static registration    NodeList staticRegs = user.getElementsByTagName("staticRegistration");    if (staticRegs.getLength() > 0)    {      Element staticReg = (Element) staticRegs.item(0);      String enabled = staticReg.getAttribute("value");      userData.set(STATIC_REGISTRATION_ENABLED, enabled);      NodeList contactLists =        staticReg.getElementsByTagName("terminatingContactList");      if (contactLists.getLength() > 0)      {        Element contactList = (Element) contactLists.item(0);        NodeList contacts = contactList.getElementsByTagName("contact");        // need to find the terminating host/port:        for (int i = 0; i < contacts.getLength(); i++)        {          Element contact = (Element) contacts.item(i);          String contactStr = contact.getAttribute("value");          // hopefully, there is only one of these that specifies a host/port          // combination or this is not going to work          if (contactStr.indexOf(":") != -1)          {            String host = contactStr.substring(0, contactStr.indexOf(":"));            String port = contactStr.substring(contactStr.indexOf(":") + 1);            userData.set(UserTableModel.TERMINATING_HOST, host);            userData.set(UserTableModel.TERMINATING_PORT, port);          }        }      }    }    // call return    NodeList callReturns = user.getElementsByTagName("callReturn");    if (callReturns.getLength() > 0)    {      Element callReturn = (Element) callReturns.item(0);      String enabled = callReturn.getAttribute("enabled");      userData.set(UserTableModel.CALL_RETURN_ADMIN_ENABLED, enabled);      NodeList groups = callReturn.getElementsByTagName("featuregroup");      if (groups.getLength() > 0)      {        Element group = (Element) groups.item(0);        if (group.hasChildNodes())        {          String groupName = group.getFirstChild().getNodeValue();          userData.set(UserTableModel.CALL_RETURN_GROUP, groupName);        }      }    }    // caller id blocking    NodeList idBlockings = user.getElementsByTagName("callerIdBlocking");    if (idBlockings.getLength() > 0)    {      Element idBlocking = (Element) idBlockings.item(0);      String enabled = idBlocking.getAttribute("enabled");      userData.set(UserTableModel.CALLER_ID_BLOCKING_ADMIN_ENABLED, enabled);      NodeList groups = idBlocking.getElementsByTagName("featuregroup");      if (groups.getLength() > 0)      {        Element group = (Element) groups.item(0);        if (group.hasChildNodes())        {          String groupName = group.getFirstChild().getNodeValue();

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -