mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-14 09:05:48 -04:00
fixed VOIP plugin to work with v0.6
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7288 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
ca6b463a31
commit
160e04fe9a
10 changed files with 94 additions and 100 deletions
|
@ -32,6 +32,8 @@
|
|||
|
||||
#include "services/rsvoipitems.h"
|
||||
#include "services/p3service.h"
|
||||
#include "serialiser/rstlvbase.h"
|
||||
#include "serialiser/rsconfigitems.h"
|
||||
#include "plugins/rspqiservice.h"
|
||||
#include <interface/rsvoip.h>
|
||||
|
||||
|
@ -42,9 +44,9 @@ class VorsPeerInfo
|
|||
{
|
||||
public:
|
||||
|
||||
bool initialisePeerInfo(std::string id);
|
||||
bool initialisePeerInfo(const RsPeerId &id);
|
||||
|
||||
std::string mId;
|
||||
RsPeerId mId;
|
||||
double mCurrentPingTS;
|
||||
double mCurrentPingCounter;
|
||||
bool mCurrentPongRecvd;
|
||||
|
@ -72,22 +74,22 @@ class p3VoRS: public RsPQIService, public RsVoip
|
|||
|
||||
/***** overloaded from rsVoip *****/
|
||||
|
||||
virtual uint32_t getPongResults(std::string id, int n, std::list<RsVoipPongResult> &results);
|
||||
virtual uint32_t getPongResults(const RsPeerId &id, int n, std::list<RsVoipPongResult> &results);
|
||||
|
||||
// Call stuff.
|
||||
//
|
||||
|
||||
// Sending data. The client keeps the memory ownership and must delete it after calling this.
|
||||
virtual int sendVoipData(const std::string& peer_id,const RsVoipDataChunk& chunk) ;
|
||||
virtual int sendVoipData(const RsPeerId &peer_id,const RsVoipDataChunk& chunk) ;
|
||||
|
||||
// The server fill in the data and gives up memory ownership. The client must delete the memory
|
||||
// in each chunk once it has been used.
|
||||
//
|
||||
virtual bool getIncomingData(const std::string& peer_id,std::vector<RsVoipDataChunk>& chunks) ;
|
||||
virtual bool getIncomingData(const RsPeerId& peer_id,std::vector<RsVoipDataChunk>& chunks) ;
|
||||
|
||||
virtual int sendVoipHangUpCall(const std::string& peer_id) ;
|
||||
virtual int sendVoipRinging(const std::string& peer_id) ;
|
||||
virtual int sendVoipAcceptCall(const std::string& peer_id) ;
|
||||
virtual int sendVoipHangUpCall(const RsPeerId& peer_id) ;
|
||||
virtual int sendVoipRinging(const RsPeerId& peer_id) ;
|
||||
virtual int sendVoipAcceptCall(const RsPeerId &peer_id) ;
|
||||
|
||||
/***** overloaded from p3Service *****/
|
||||
/*!
|
||||
|
@ -126,7 +128,10 @@ class p3VoRS: public RsPQIService, public RsVoip
|
|||
* chat msg items and custom status are saved
|
||||
*/
|
||||
virtual bool saveList(bool& cleanup, std::list<RsItem*>&) ;
|
||||
virtual bool loadList(std::list<RsItem*>& load) ;
|
||||
virtual bool loadList(std::list<RsItem*>& load) ;
|
||||
virtual std::string configurationFileName() const { return "voip.cfg" ; }
|
||||
|
||||
virtual RsServiceInfo getServiceInfo() ;
|
||||
|
||||
private:
|
||||
int sendPackets();
|
||||
|
@ -136,24 +141,24 @@ class p3VoRS: public RsPQIService, public RsVoip
|
|||
int handlePing(RsVoipPingItem *item);
|
||||
int handlePong(RsVoipPongItem *item);
|
||||
|
||||
int storePingAttempt(std::string id, double ts, uint32_t mCounter);
|
||||
int storePongResult(std::string id, uint32_t counter, double ts, double rtt, double offset);
|
||||
int storePingAttempt(const RsPeerId &id, double ts, uint32_t mCounter);
|
||||
int storePongResult(const RsPeerId& id, uint32_t counter, double ts, double rtt, double offset);
|
||||
|
||||
void handleProtocol(RsVoipProtocolItem*) ;
|
||||
void handleData(RsVoipDataItem*) ;
|
||||
|
||||
RsMutex mVorsMtx;
|
||||
|
||||
VorsPeerInfo *locked_GetPeerInfo(std::string id);
|
||||
VorsPeerInfo *locked_GetPeerInfo(const RsPeerId& id);
|
||||
|
||||
static RsTlvKeyValue push_int_value(const std::string& key,int value) ;
|
||||
static int pop_int_value(const std::string& s) ;
|
||||
|
||||
std::map<std::string, VorsPeerInfo> mPeerInfo;
|
||||
std::map<RsPeerId, VorsPeerInfo> mPeerInfo;
|
||||
time_t mSentPingTime;
|
||||
uint32_t mCounter;
|
||||
|
||||
p3LinkMgr *mLinkMgr;
|
||||
RsServiceControl *mServiceControl;
|
||||
PluginNotifier *mNotify ;
|
||||
|
||||
int _atransmit ;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue