i'm implementing message_filter/message_list profile variables for dsm
mod_sbc.  i got it working, but i needed to convert req.method to lower
case before comparison, because when method list is created, its methods
are converted to lower case.  in sbc/HeaderFilter.cpp readFilter:

    vector<string> elems = explode(cfg.getParameter(cfg_key_list), ",");
    for (vector<string>::iterator it=elems.begin(); it != elems.end(); it++) {
        string c = *it;
        std::transform(c.begin(), c.end(), c.begin(), ::tolower);
        hf.filter_list.insert(c);
    }

so i had to convert also in SBCCallLeg.cpp req.method to lower case
before method search.

original:

    bool is_filtered = (it->filter_type == Whitelist) ^ 
      (it->filter_list.find(req.method) != it->filter_list.end());

modified:

    string c = req.method;
    std::transform(c.begin(), c.end(), c.begin(), ::tolower);
    bool is_filtered = (it->filter_type == Whitelist) ^
      (it->filter_list.find(c) != it->filter_list.end());

how it is possible that the above original code has worked or has it?

-- juha
_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to