Browse code

sbc: b/f: lower case before searching in message filter

Raphael Coeffic authored on 13/05/2014 09:30:35
Showing 1 changed files
... ...
@@ -516,8 +516,11 @@ void SBCCallLeg::onSipRequest(const AmSipRequest& req) {
516 516
 	 it != call_profile.messagefilter.end(); it++) {
517 517
 
518 518
       if (isActiveFilter(it->filter_type)) {
519
+	string method = req.method;
520
+	std::transform(method.begin(), method.end(), method.begin(), ::tolower);
521
+
519 522
 	bool is_filtered = (it->filter_type == Whitelist) ^ 
520
-	  (it->filter_list.find(req.method) != it->filter_list.end());
523
+	  (it->filter_list.find(method) != it->filter_list.end());
521 524
 	if (is_filtered) {
522 525
 	  DBG("replying 405 to filtered message '%s'\n", req.method.c_str());
523 526
 	  dlg->reply(req, 405, "Method Not Allowed", NULL, "", SIP_FLAGS_VERBATIM);