Return warning strings about a potential conflicting value */
| 741 | |
| 742 | /** Return warning strings about a potential conflicting value */ |
| 743 | vector<string> configurationCrossCheck(const string& key) { |
| 744 | vector<string> warnings; |
| 745 | ostringstream warning; |
| 746 | |
| 747 | // GSM.Timer.T3113 should equal SIP.Timer.B |
| 748 | if (key.compare("GSM.Timer.T3113") == 0 || key.compare("SIP.Timer.B") == 0) { |
| 749 | string gsm = gConfig.getStr("GSM.Timer.T3113"); |
| 750 | string sip = gConfig.getStr("SIP.Timer.B"); |
| 751 | if (gsm.compare(sip) != 0) { |
| 752 | warning << "GSM.Timer.T3113 (" << gsm << ") and SIP.Timer.B (" << sip << ") should usually have the same value"; |
| 753 | warnings.push_back(warning.str()); |
| 754 | warning.str(std::string()); |
| 755 | } |
| 756 | |
| 757 | // Control.VEA depends on GSM.CellSelection.NECI |
| 758 | } else if (key.compare("Control.VEA") == 0 || key.compare("GSM.CellSelection.NECI") == 0) { |
| 759 | if (gConfig.getBool("Control.VEA") && gConfig.getStr("GSM.CellSelection.NECI").compare("1") != 0) { |
| 760 | warning << "Control.VEA is enabled but will not be functional until GSM.CellSelection.NECI is set to \"1\""; |
| 761 | warnings.push_back(warning.str()); |
| 762 | warning.str(std::string()); |
| 763 | } |
| 764 | |
| 765 | // GSM.Timer.T3212 should be a factor of six and shorter than SIP.RegistrationPeriod |
| 766 | } else if (key.compare("GSM.Timer.T3212") == 0 || key.compare("SIP.RegistrationPeriod") == 0) { |
| 767 | int gsm = gConfig.getNum("GSM.Timer.T3212"); |
| 768 | int sip = gConfig.getNum("SIP.RegistrationPeriod"); |
| 769 | if (key.compare("GSM.Timer.T3212") == 0 && gsm % 6) { |
| 770 | warning << "GSM.Timer.T3212 should be a factor of 6"; |
| 771 | warnings.push_back(warning.str()); |
| 772 | warning.str(std::string()); |
| 773 | } |
| 774 | if (gsm >= sip) { |
| 775 | warning << "GSM.Timer.T3212 (" << gsm << ") should be shorter than SIP.RegistrationPeriod (" << sip << ")"; |
| 776 | warnings.push_back(warning.str()); |
| 777 | warning.str(std::string()); |
| 778 | } |
| 779 | |
| 780 | // GPRS.ChannelCodingControl.RSSI should normally be 10db more than GSM.Radio.RSSITarget |
| 781 | } else if (key.compare("GPRS.ChannelCodingControl.RSSI") == 0 || key.compare("GSM.Radio.RSSITarget") == 0) { |
| 782 | int gprs = gConfig.getNum("GPRS.ChannelCodingControl.RSSI"); |
| 783 | int gsm = gConfig.getNum("GSM.Radio.RSSITarget"); |
| 784 | if ((gprs - gsm) != 10) { |
| 785 | warning << "GPRS.ChannelCodingControl.RSSI (" << gprs << ") should normally be 10db greater than GSM.Radio.RSSITarget (" << gsm << ")"; |
| 786 | warnings.push_back(warning.str()); |
| 787 | warning.str(std::string()); |
| 788 | } |
| 789 | |
| 790 | // TODO : This NEEDS to be an error not a warning. OpenBTS will fail to start because of an assert if an invalid value is used. |
| 791 | // GSM.Radio.C0 needs to be inside the valid range of ARFCNs for GSM.Radio.Band |
| 792 | } else if (key.compare("GSM.Radio.C0") == 0 || key.compare("GSM.Radio.Band") == 0) { |
| 793 | int c0 = gConfig.getNum("GSM.Radio.C0"); |
| 794 | string band = gConfig.getStr("GSM.Radio.Band"); |
| 795 | string range; |
| 796 | if (band.compare("850") == 0 && (c0 < 128 || 251 < c0)) { |
| 797 | range = "128-251"; |
| 798 | } else if (band.compare("900") == 0 && (c0 < 1 || 124 < c0)) { |
| 799 | range = "1-124"; |
| 800 | } else if (band.compare("1800") == 0 && (c0 < 512 || 885 < c0)) { |