Exemple #1
0
bool BoardGSM::KhompPvtGSM::validContexts(
    MatchExtension::ContextListType & contexts, std::string extra_context)
{
    DBG(FUNC,PVT_FMT(_target,"(GSM) c"));

    if(!_group_context.empty())
    {
        contexts.push_back(_group_context);
    }

    if (!extra_context.empty())
    {
        if (!_group_context.empty())
        {
            std::string pvt_context(_group_context);
            pvt_context += "-";
            pvt_context += extra_context;
            contexts.push_back(pvt_context);
        }

        if (!Opt::_options._context_gsm_call().empty())
        {
            std::string context(Opt::_options._context_gsm_call());
            context += "-";
            context += extra_context;
            contexts.push_back(_group_context);
        }

        if (!Opt::_options._context2_gsm_call().empty())
        {
            std::string context(Opt::_options._context2_gsm_call());
            context += "-";
            context += extra_context;
            contexts.push_back(_group_context);
        }
    }

    contexts.push_back(Opt::_options._context_gsm_call());
    contexts.push_back(Opt::_options._context2_gsm_call());

    for (MatchExtension::ContextListType::iterator i = contexts.begin(); i != contexts.end(); i++)
        replaceTemplate((*i), "CC", _target.object);

    bool ret = Board::KhompPvt::validContexts(contexts,extra_context);

    DBG(FUNC,PVT_FMT(_target,"(GSM) r"));

    return ret;
}
Exemple #2
0
bool BoardFXO::KhompPvtFXO::validContexts(
        MatchExtension::ContextListType & contexts, std::string extra_context)
{
    DBG(FUNC,PVT_FMT(_target,"(FXO) c"));

    if(!_group_context.empty())
    {
        contexts.push_back(_group_context);
    }

    contexts.push_back(Opt::_options._context_fxo());
    contexts.push_back(Opt::_options._context2_fxo());

    for (MatchExtension::ContextListType::iterator i = contexts.begin(); i != contexts.end(); i++)
    {
        replaceTemplate((*i), "CC", _target.object);
    }

    bool ret = Board::KhompPvt::validContexts(contexts,extra_context);

    DBG(FUNC,PVT_FMT(_target,"(FXO) r"));

    return ret;
}