Browse code

apps/dsm/mod_sbc: added message_filter and message_list profile variables

Juha Heinanen authored on 22/05/2014 05:23:56
Showing 2 changed files
... ...
@@ -210,6 +210,7 @@ CONST_ACTION_2P(MODSBCActionProfileSet, ',', false);
210 210
 EXEC_ACTION_START(MODSBCActionProfileSet) {
211 211
   string profile_param = resolveVars(par1, sess, sc_sess, event_params);
212 212
   string value = resolveVars(par2, sess, sc_sess, event_params);
213
+  FilterEntry mf;
213 214
 
214 215
   ACTION_GET_PROFILE;
215 216
 
... ...
@@ -268,7 +269,6 @@ EXEC_ACTION_START(MODSBCActionProfileSet) {
268 269
 
269 270
   SET_TO_CALL_PROFILE("aleg_next_hop", aleg_next_hop);
270 271
 
271
-  // TODO: message_filter
272 272
   // TODO: header_filter
273 273
   // TODO: sdp_filter
274 274
 
... ...
@@ -312,6 +312,22 @@ EXEC_ACTION_START(MODSBCActionProfileSet) {
312 312
     EXEC_ACTION_STOP;
313 313
   }
314 314
 
315
+  if (profile_param == "message_filter") {
316
+    mf.filter_type = String2FilterType(value.c_str());
317
+    DBG("message_filter set to '%s'\n", value.c_str());
318
+    EXEC_ACTION_STOP;
319
+  }
320
+
321
+  if (profile_param == "message_list") {
322
+    vector<string> elems = explode(value, ",");
323
+    for (vector<string>::iterator it=elems.begin(); it != elems.end(); it++)
324
+      mf.filter_list.insert(*it);
325
+    profile->messagefilter.push_back(mf);
326
+    mf.filter_type = Undefined;
327
+    DBG("message_list set to '%s'\n", value.c_str());
328
+    EXEC_ACTION_STOP;
329
+  }
330
+
315 331
   }
316 332
 
317 333
   // TODO: Transcoder Settings
... ...
@@ -154,19 +154,20 @@ sbc.isDisconnected() / sbc.isNoReply() / sbc.isRinging() / sbc.isConnected() / s
154 154
 Actions
155 155
 -------
156 156
 sbc.profileSet(profile_variable, value)    - set SBC profile options
157
-    *** only meaningful in 'start' event (later, most profile options are not used any more) *** 
158
-    profile_variables: To, RURI, FROM, Call-ID, next_hop, RURI_host, refuse_with,
159
-    outbound_proxy, force_outbound_proxy = "yes" | "no,
157
+    *** only meaningful in 'start' event (later, most profile options
158
+    are not used any more) *** 
159
+    profile_variables: To, RURI, FROM, Call-ID, next_hop, RURI_host,
160
+    refuse_with, outbound_proxy, force_outbound_proxy = "yes" | "no,
160 161
     aleg_outbound_proxy, aleg_force_outbound_proxy = "yes" | "no,
161
-    next_hop_1st_req = "yes" | "no,  patch_ruri_next_hop = "yes" | "no,
162
-    aleg_next_hop,
163
-    append_headers, append_headers_req, 
164
-    rtprelay_enabled  = "yes" | "no,
165
-      force_symmetric_rtp  = "yes" | "no, aleg_force_symmetric_rtp  = "yes" | "no,
166
-      msgflags_symmetric_rtp = "yes" | "no,
167
-      rtprelay_transparent_seqno = "yes" | "no, rtprelay_transparent_ssrc = "yes" | "no, 
168
-      rtprelay_interface, aleg_rtprelay_interface,
169
-      rtprelay_dtmf_detection = "yes" | "no, rtprelay_dtmf_filtering = "yes" | "no
162
+    next_hop_1st_req = "yes" | "no, patch_ruri_next_hop = "yes" | "no,
163
+    aleg_next_hop, append_headers, append_headers_req, 
164
+    rtprelay_enabled  = "yes" | "no, force_symmetric_rtp  = "yes" | "no,
165
+    aleg_force_symmetric_rtp  = "yes" | "no, msgflags_symmetric_rtp =
166
+    "yes" | "no, rtprelay_transparent_seqno = "yes" | "no,
167
+    rtprelay_transparent_ssrc = "yes" | "no,
168
+    rtprelay_interface, aleg_rtprelay_interface,
169
+    rtprelay_dtmf_detection = "yes" | "no, rtprelay_dtmf_filtering =
170
+    "yes" | "no, message_filter, message_list
170 171
 
171 172
 sbc.stopCall(string cause)         - stop both call legs
172 173