Add Diva streaming for resource PLCI

This commit is contained in:
MelwareDE 2010-08-23 15:21:52 +00:00
parent 6fda685af2
commit fa4d1ef6ac
3 changed files with 32 additions and 3 deletions

View File

@ -331,6 +331,18 @@ struct capi_pvt *capi_mkresourceif(struct ast_channel *c, unsigned long long con
data_ifc->MessageNumber = get_capi_MessageNumber();
cc_mutex_lock(&data_ifc->lock);
#ifdef DIVA_STREAMING
data_ifc->diva_stream_entry = 0;
if (data_plci_ifc == 0) {
capi_DivaStreamingStreamNotUsed(data_ifc, 1, data_ifc->MessageNumber);
} else {
if (pbx_capi_streaming_supported (data_ifc) != 0) {
capi_DivaStreamingOn(data_ifc, 1, data_ifc->MessageNumber);
}
}
#endif
capi_sendf(data_ifc,
1,
CAPI_MANUFACTURER_REQ,

View File

@ -247,12 +247,29 @@ void capi_DivaStreamingRemoveInfo(struct capi_pvt *i)
"dws", _DI_MANU_ID, _DI_STREAM_CTRL, description);
}
void capi_DivaStreamingStreamNotUsed (struct capi_pvt *i)
/*!
* \brief Send empty stream to inform no Diva streaming is used for this PLCI
*/
void capi_DivaStreamingStreamNotUsed(struct capi_pvt *i, byte streamCommand, _cword messageNumber)
{
byte description[] = { 0x04, 0x00, 0x02, 0x00, 0x00 };
unsigned int effectivePLCI;
MESSAGE_EXCHANGE_ERROR error;
error = capi_sendf (NULL, 0, CAPI_MANUFACTURER_REQ, i->PLCI, get_capi_MessageNumber(),
description[1] = streamCommand;
if (streamCommand == 0) {
messageNumber = get_capi_MessageNumber();
effectivePLCI = i->PLCI;
} else {
/*
PLCI still not assigned. Send to controller and tag with message number
where command receives effective
*/
effectivePLCI = i->controller;
}
error = capi_sendf (NULL, 0, CAPI_MANUFACTURER_REQ, effectivePLCI, messageNumber,
"dws", _DI_MANU_ID, _DI_STREAM_CTRL, description);
}

View File

@ -3,7 +3,7 @@
extern int capi_DivaStreamingSupported(unsigned controller);
extern void capi_DivaStreamingOn(struct capi_pvt *i, unsigned char streamCommand, _cword messageNumber);
extern void capi_DivaStreamingStreamNotUsed (struct capi_pvt *i);
extern void capi_DivaStreamingStreamNotUsed(struct capi_pvt *i, byte streamCommand, _cword messageNumber);
extern void capi_DivaStreamingRemoveInfo(struct capi_pvt *i);
extern void capi_DivaStreamingRemove(struct capi_pvt *i);
extern void divaStreamingWakeup(void);