Browse code

sbc:dsm: support for noAudio event

Stefan Sayer authored on 12/01/2014 20:39:06
Showing 1 changed files
... ...
@@ -336,6 +336,23 @@ CCChainProcessing SBCDSMInstance::onEvent(SBCCallLeg* call, AmEvent* event) {
336 336
     map<string, string> params;
337 337
     params["id"] = int2str(sep_ev->event_id);
338 338
     engine.runEvent(call, this, DSMCondition::PlaylistSeparator, &params);
339
+
340
+    if (params[DSM_SBC_PARAM_STOP_PROCESSING]==DSM_TRUE)
341
+      return StopProcessing;
342
+    return ContinueProcessing;
343
+  }
344
+
345
+  AmAudioEvent* audio_event = dynamic_cast<AmAudioEvent*>(event);
346
+  if(audio_event &&
347
+     ((audio_event->event_id == AmAudioEvent::cleared) ||
348
+      (audio_event->event_id == AmAudioEvent::noAudio))){
349
+    map<string, string> params;
350
+    params["type"] = audio_event->event_id == AmAudioEvent::cleared?"cleared":"noAudio";
351
+    engine.runEvent(call, this, DSMCondition::NoAudio, &params);
352
+
353
+    if (params[DSM_SBC_PARAM_STOP_PROCESSING]==DSM_TRUE)
354
+      return StopProcessing;
355
+    return ContinueProcessing;
339 356
   }
340 357
 
341 358
   // todo: process JsonRPCEvents (? see DSMCall::process)