You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sems/apps/webconference/RoomInfo.h

79 lines
1.4 KiB

#ifndef ROOM_INFO_H
#define ROOM_INFO_H
#include <string>
using std::string;
#include <list>
using std::list;
#include <sys/time.h>
#include "AmArg.h"
#include "AmThread.h"
#define PARTICIPANT_EXPIRED_DELAY 10
struct ConferenceRoomParticipant {
enum ParticipantStatus {
Disconnected = 0,
Connecting,
Ringing,
Connected,
Disconnecting,
Finished
};
string localtag;
string number;
ParticipantStatus status;
string last_reason;
int muted;
struct timeval last_access_time;
ConferenceRoomParticipant()
: status(Disconnected), muted(0) { }
~ConferenceRoomParticipant() { }
inline void updateAccess(const struct timeval& now);
inline bool expired(const struct timeval& now);
inline void updateStatus(ParticipantStatus new_status,
const string& reason);
inline void setMuted(int mute);
AmArgArray* asArgArray();
};
struct ConferenceRoom {
string adminpin;
list<ConferenceRoomParticipant> participants;
ConferenceRoom() { }
~ConferenceRoom() { }
void cleanExpired();
AmArgArray* asArgArray();
void newParticipant(const string& localtag, const string& number);
bool updateStatus(const string& part_tag,
ConferenceRoomParticipant::ParticipantStatus newstatus,
const string& reason);
bool hasParticipant(const string& localtag);
void setMuted(const string& localtag, int mute);
};
#endif