Browse code

Merge branch 'master' into offer_answer

Raphael Coeffic authored on 18/02/2011 11:36:25
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,55 @@
1
+/*
2
+ * Copyright (C) 2011 Stefan Sayer
3
+ *
4
+ * This file is part of SEMS, a free SIP media server.
5
+ *
6
+ * SEMS is free software; you can redistribute it and/or modify
7
+ * it under the terms of the GNU General Public License as published by
8
+ * the Free Software Foundation; either version 2 of the License, or
9
+ * (at your option) any later version.
10
+ *
11
+ * For a license to use the SEMS software under conditions
12
+ * other than those described here, or to purchase support for this
13
+ * software, please contact iptel.org by e-mail at the following addresses:
14
+ *    info@iptel.org
15
+ *
16
+ * SEMS is distributed in the hope that it will be useful,
17
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
+ * GNU General Public License for more details.
20
+ *
21
+ * You should have received a copy of the GNU General Public License
22
+ * along with this program; if not, write to the Free Software
23
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
24
+ */
25
+
26
+#ifndef _RegexMapper_h_
27
+#define _RegexMapper_h_
28
+
29
+#include "AmUtils.h"
30
+
31
+#include <map>
32
+#include <vector>
33
+#include <string>
34
+#include "AmThread.h"
35
+
36
+struct RegexMapper {
37
+
38
+  RegexMapper() { }
39
+  ~RegexMapper() { }
40
+
41
+  std::map<string, RegexMappingVector> regex_mappings;
42
+  AmMutex regex_mappings_mut;
43
+
44
+  void lock() { regex_mappings_mut.lock(); }
45
+  void unlock() { regex_mappings_mut.unlock(); }
46
+
47
+  bool mapRegex(const string& mapping_name, const char* test_s,
48
+		string& result);
49
+
50
+  void setRegexMap(const string& mapping_name, const RegexMappingVector& r);
51
+
52
+  std::vector<std::string> getNames();
53
+};
54
+
55
+#endif