Browse code

sbc:dsm: support for noAudio event

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