mirror of https://github.com/sipwise/sems.git
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.
93 lines
1.7 KiB
93 lines
1.7 KiB
|
|
#ifndef ROOM_INFO_H
|
|
#define ROOM_INFO_H
|
|
|
|
#include <string>
|
|
using std::string;
|
|
|
|
#include <list>
|
|
using std::list;
|
|
|
|
#include <vector>
|
|
using std::vector;
|
|
|
|
#include <sys/time.h>
|
|
|
|
|
|
#include "AmArg.h"
|
|
#include "AmThread.h"
|
|
|
|
struct ConferenceRoomParticipant {
|
|
enum ParticipantStatus {
|
|
Disconnected = 0,
|
|
Connecting,
|
|
Ringing,
|
|
Connected,
|
|
Disconnecting,
|
|
Finished
|
|
};
|
|
|
|
string localtag;
|
|
string number;
|
|
ParticipantStatus status;
|
|
string last_reason;
|
|
string participant_id;
|
|
|
|
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,
|
|
struct timeval& now);
|
|
|
|
inline void setMuted(int mute);
|
|
|
|
AmArg asArgArray();
|
|
};
|
|
|
|
struct ConferenceRoom {
|
|
string adminpin;
|
|
|
|
struct timeval last_access_time;
|
|
time_t expiry_time;
|
|
|
|
list<ConferenceRoomParticipant> participants;
|
|
|
|
ConferenceRoom();
|
|
~ConferenceRoom() { }
|
|
|
|
void cleanExpired();
|
|
|
|
AmArg asArgArray();
|
|
|
|
vector<string> participantLtags();
|
|
|
|
void newParticipant(const string& localtag, const string& number,
|
|
const string& participant_id);
|
|
|
|
bool updateStatus(const string& part_tag,
|
|
ConferenceRoomParticipant::ParticipantStatus newstatus,
|
|
const string& reason);
|
|
|
|
bool hasParticipant(const string& localtag);
|
|
|
|
void setMuted(const string& localtag, int mute);
|
|
|
|
bool expired(const struct timeval& now);
|
|
bool expired();
|
|
|
|
bool hard_expired(const struct timeval& now);
|
|
};
|
|
|
|
|
|
#endif
|