mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 14:16:16 -04:00
fixed bug in having two different service ids in VOIP
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4995 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
af1b90707a
commit
1ee48b68a6
3 changed files with 9 additions and 10 deletions
|
@ -8,8 +8,7 @@
|
||||||
class RsVoip ;
|
class RsVoip ;
|
||||||
extern RsVoip *rsVoip;
|
extern RsVoip *rsVoip;
|
||||||
|
|
||||||
static const uint32_t CONFIG_TYPE_VOIP_PLUGIN = 0xe001 ;
|
static const uint32_t CONFIG_TYPE_VOIP_PLUGIN = 0xe001 ;
|
||||||
static const uint32_t RS_SERVICE_TYPE_VOIP_PLUGIN = 0xe001 ;
|
|
||||||
|
|
||||||
class RsVoipPongResult
|
class RsVoipPongResult
|
||||||
{
|
{
|
||||||
|
|
|
@ -238,7 +238,7 @@ RsVoipProtocolItem::RsVoipProtocolItem(void *data, uint32_t pktsize)
|
||||||
|
|
||||||
uint32_t offset = 0;
|
uint32_t offset = 0;
|
||||||
|
|
||||||
if ((RS_PKT_VERSION_SERVICE != getRsItemVersion(rstype)) || (RS_SERVICE_TYPE_VOIP != getRsItemService(rstype)) || (RS_PKT_SUBTYPE_VOIP_PING != getRsItemSubType(rstype)))
|
if ((RS_PKT_VERSION_SERVICE != getRsItemVersion(rstype)) || (RS_SERVICE_TYPE_VOIP_PLUGIN != getRsItemService(rstype)) || (RS_PKT_SUBTYPE_VOIP_PING != getRsItemSubType(rstype)))
|
||||||
throw std::runtime_error("Wrong packet type!") ;
|
throw std::runtime_error("Wrong packet type!") ;
|
||||||
|
|
||||||
if (pktsize < rssize) /* check size */
|
if (pktsize < rssize) /* check size */
|
||||||
|
@ -269,7 +269,7 @@ RsVoipPingItem::RsVoipPingItem(void *data, uint32_t pktsize)
|
||||||
uint32_t offset = 0;
|
uint32_t offset = 0;
|
||||||
|
|
||||||
|
|
||||||
if ((RS_PKT_VERSION_SERVICE != getRsItemVersion(rstype)) || (RS_SERVICE_TYPE_VOIP != getRsItemService(rstype)) || (RS_PKT_SUBTYPE_VOIP_PING != getRsItemSubType(rstype)))
|
if ((RS_PKT_VERSION_SERVICE != getRsItemVersion(rstype)) || (RS_SERVICE_TYPE_VOIP_PLUGIN != getRsItemService(rstype)) || (RS_PKT_SUBTYPE_VOIP_PING != getRsItemSubType(rstype)))
|
||||||
throw std::runtime_error("Wrong packet type!") ;
|
throw std::runtime_error("Wrong packet type!") ;
|
||||||
|
|
||||||
if (pktsize < rssize) /* check size */
|
if (pktsize < rssize) /* check size */
|
||||||
|
@ -350,7 +350,7 @@ RsVoipDataItem::RsVoipDataItem(void *data, uint32_t pktsize)
|
||||||
|
|
||||||
uint32_t offset = 0;
|
uint32_t offset = 0;
|
||||||
|
|
||||||
if ((RS_PKT_VERSION_SERVICE != getRsItemVersion(rstype)) || (RS_SERVICE_TYPE_VOIP != getRsItemService(rstype)) || (RS_PKT_SUBTYPE_VOIP_DATA != getRsItemSubType(rstype)))
|
if ((RS_PKT_VERSION_SERVICE != getRsItemVersion(rstype)) || (RS_SERVICE_TYPE_VOIP_PLUGIN != getRsItemService(rstype)) || (RS_PKT_SUBTYPE_VOIP_DATA != getRsItemSubType(rstype)))
|
||||||
throw std::runtime_error("Wrong packet subtype") ;
|
throw std::runtime_error("Wrong packet subtype") ;
|
||||||
|
|
||||||
if (pktsize < rssize) /* check size */
|
if (pktsize < rssize) /* check size */
|
||||||
|
@ -384,7 +384,7 @@ RsVoipPongItem::RsVoipPongItem(void *data, uint32_t pktsize)
|
||||||
|
|
||||||
uint32_t offset = 0;
|
uint32_t offset = 0;
|
||||||
|
|
||||||
if ((RS_PKT_VERSION_SERVICE != getRsItemVersion(rstype)) || (RS_SERVICE_TYPE_VOIP != getRsItemService(rstype)) || (RS_PKT_SUBTYPE_VOIP_PONG != getRsItemSubType(rstype)))
|
if ((RS_PKT_VERSION_SERVICE != getRsItemVersion(rstype)) || (RS_SERVICE_TYPE_VOIP_PLUGIN != getRsItemService(rstype)) || (RS_PKT_SUBTYPE_VOIP_PONG != getRsItemSubType(rstype)))
|
||||||
throw std::runtime_error("Wrong packet subtype") ;
|
throw std::runtime_error("Wrong packet subtype") ;
|
||||||
|
|
||||||
if (pktsize < rssize) /* check size */
|
if (pktsize < rssize) /* check size */
|
||||||
|
@ -418,7 +418,7 @@ RsItem* RsVoipSerialiser::deserialise(void *data, uint32_t *pktsize)
|
||||||
/* get the type and size */
|
/* get the type and size */
|
||||||
uint32_t rstype = getRsItemId(data);
|
uint32_t rstype = getRsItemId(data);
|
||||||
|
|
||||||
if ((RS_PKT_VERSION_SERVICE != getRsItemVersion(rstype)) || (RS_SERVICE_TYPE_VOIP != getRsItemService(rstype)))
|
if ((RS_PKT_VERSION_SERVICE != getRsItemVersion(rstype)) || (RS_SERVICE_TYPE_VOIP_PLUGIN != getRsItemService(rstype)))
|
||||||
return NULL ;
|
return NULL ;
|
||||||
|
|
||||||
try
|
try
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
|
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
|
|
||||||
const uint16_t RS_SERVICE_TYPE_VOIP = 0xa021;
|
const uint16_t RS_SERVICE_TYPE_VOIP_PLUGIN = 0xa021;
|
||||||
|
|
||||||
const uint8_t RS_PKT_SUBTYPE_VOIP_PING = 0x01;
|
const uint8_t RS_PKT_SUBTYPE_VOIP_PING = 0x01;
|
||||||
const uint8_t RS_PKT_SUBTYPE_VOIP_PONG = 0x02;
|
const uint8_t RS_PKT_SUBTYPE_VOIP_PONG = 0x02;
|
||||||
|
@ -47,7 +47,7 @@ class RsVoipItem: public RsItem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RsVoipItem(uint8_t voip_subtype)
|
RsVoipItem(uint8_t voip_subtype)
|
||||||
: RsItem(RS_PKT_VERSION_SERVICE,RS_SERVICE_TYPE_VOIP,voip_subtype)
|
: RsItem(RS_PKT_VERSION_SERVICE,RS_SERVICE_TYPE_VOIP_PLUGIN,voip_subtype)
|
||||||
{
|
{
|
||||||
setPriorityLevel(QOS_PRIORITY_RS_VOIP) ;
|
setPriorityLevel(QOS_PRIORITY_RS_VOIP) ;
|
||||||
}
|
}
|
||||||
|
@ -136,7 +136,7 @@ class RsVoipSerialiser: public RsSerialType
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RsVoipSerialiser()
|
RsVoipSerialiser()
|
||||||
:RsSerialType(RS_PKT_VERSION_SERVICE, RS_SERVICE_TYPE_VOIP)
|
:RsSerialType(RS_PKT_VERSION_SERVICE, RS_SERVICE_TYPE_VOIP_PLUGIN)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
virtual ~RsVoipSerialiser() {}
|
virtual ~RsVoipSerialiser() {}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue