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:
csoler 2012-02-26 17:13:54 +00:00
parent af1b90707a
commit 1ee48b68a6
3 changed files with 9 additions and 10 deletions

View file

@ -9,7 +9,6 @@ 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
{ {

View file

@ -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

View file

@ -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() {}