~aleteoryx/muditaos

ref: 09bab001d0d0479d6dc773b1ccc785277f4fd402 muditaos/module-services/service-cellular/src/volte/VolteAllowedUSList.cpp -rw-r--r-- 2.0 KiB
09bab001 — Mateusz Piesta [MOS-807] Update scripts 3 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "VolteAllowedUSList.hpp"
#include <log/log.hpp>
#include <array>
#include <algorithm>

namespace cellular::service
{

    constexpr auto allowedOperatorsCount = 12;
    const std::array<OperatorInfo, allowedOperatorsCount> allowedOperators{OperatorInfo{"310", "053"},
                                                                           OperatorInfo{"310", "120"},
                                                                           OperatorInfo{"310", "260"},
                                                                           OperatorInfo{"310", "530"},
                                                                           OperatorInfo{"310", "770"},
                                                                           OperatorInfo{"311", "490"},
                                                                           OperatorInfo{"311", "660"},
                                                                           OperatorInfo{"311", "880"},
                                                                           OperatorInfo{"311", "882"},
                                                                           OperatorInfo{"312", "190"},
                                                                           OperatorInfo{"312", "250"},
                                                                           OperatorInfo{"312", "530"}};

    auto VolteAllowedUSList::isVolteAllowed(const OperatorInfo &operatorInfo) -> bool
    {
        LOG_INFO("[VoLTE] trying to find MCC: %s, MNC: %s", operatorInfo.MCC.c_str(), operatorInfo.MNC.c_str());

        if (std::find(std::begin(allowedOperators), std::end(allowedOperators), operatorInfo) ==
            std::end(allowedOperators)) {
            LOG_ERROR("[VoLTE] unable to find MCC+MNC on list - VoLTE not allowed");
            return false;
        }
        return true;
    }
} // namespace cellular::service