Allow to disable Diva streaming by configuration

This commit is contained in:
MelwareDE 2010-06-30 09:17:09 +00:00
parent 2aeb53c779
commit 0381db531a
3 changed files with 17 additions and 0 deletions

View File

@ -8349,7 +8349,16 @@ static int capi_eval_config(struct ast_config *cfg)
if (ast_true(v->value)) {
capi_capability = AST_FORMAT_ULAW;
}
#ifdef DIVA_STREAMING
} else if (!strcasecmp(v->name, "nodivastreaming")) {
if (ast_true(v->value)) {
capi_DivaStreamingDisable ();
}
#endif
}
}
/* go through all other sections, which are our interfaces */

View File

@ -14,6 +14,7 @@
/*
LOCALS
*/
static int diva_streaming_disabled;
AST_MUTEX_DEFINE_STATIC(stream_write_lock);
static diva_entity_queue_t diva_streaming_new; /* protected by stream_write_lock, new streams */
@ -147,6 +148,9 @@ void capi_DivaStreamingOn(struct capi_pvt *i, byte streamCommand, _cword message
char trace_ident[8];
unsigned int effectivePLCI;
if (diva_streaming_disabled)
return;
pE = malloc (sizeof(*pE));
if (pE == 0)
return;
@ -325,4 +329,7 @@ void capi_DivaStreamUnLock (void)
cc_mutex_unlock(&stream_write_lock);
}
void capi_DivaStreamingDisable (void) {
diva_streaming_disabled = 1;
}

View File

@ -8,6 +8,7 @@ extern void capi_DivaStreamingRemove(struct capi_pvt *i);
extern void divaStreamingWakeup(void);
extern void capi_DivaStreamLock(void);
extern void capi_DivaStreamUnLock (void);
extern void capi_DivaStreamingDisable (void);
typedef enum _diva_stream_state {
DivaStreamCreated = 0,