* Introduced max_participants conference.conf variable.

git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@561 8eb893ce-cfd4-0310-b710-fb5ebe64c474
sayer/1.4-spce2.6
Juha Heinanen 19 years ago
parent 894bc455d2
commit a3c88fe612

@ -63,6 +63,7 @@ string ConferenceFactory::JoinSound;
string ConferenceFactory::DropSound;
string ConferenceFactory::DialoutSuffix;
PlayoutType ConferenceFactory::m_PlayoutType = ADAPTIVE_PLAYOUT;
unsigned int ConferenceFactory::MaxParticipants;
#ifdef USE_MYSQL
mysqlpp::Connection ConferenceFactory::Connection(mysqlpp::use_exceptions);
@ -258,11 +259,23 @@ int ConferenceFactory::onLoad()
DBG("Using adaptive playout buffer as playout technique.\n");
}
MaxParticipants = 0;
string max_participants = cfg.getParameter("max_participants");
if (max_participants.length() && str2i(max_participants, MaxParticipants)) {
ERROR("while parsing max_participants parameter\n");
}
return 0;
}
AmSession* ConferenceFactory::onInvite(const AmSipRequest& req)
{
if ((ConferenceFactory::MaxParticipants > 0) &&
(AmConferenceStatus::getConferenceSize(req.user) >=
ConferenceFactory::MaxParticipants)) {
DBG("Conference is full.\n");
throw AmSession::Exception(486, "Busy Here");
}
return new ConferenceDialog(req.user);
}
@ -582,7 +595,10 @@ string dtmf2str(int event)
void ConferenceDialog::onDtmf(int event, int duration)
{
DBG("ConferenceDialog::onDtmf\n");
if(dialedout || !allow_dialout)
if (dialedout || !allow_dialout ||
((ConferenceFactory::MaxParticipants > 0) &&
(AmConferenceStatus::getConferenceSize(dlg.user) >=
ConferenceFactory::MaxParticipants)))
return;
switch(state){

@ -81,6 +81,7 @@ public:
static string DropSound;
static string DialoutSuffix;
static PlayoutType m_PlayoutType;
static unsigned int MaxParticipants;
#ifdef USE_MYSQL
static mysqlpp::Connection Connection;

@ -18,3 +18,7 @@ dialout_suffix=@iptel.org
# simple : simple (fifo) playout buffer
#
playout_type=adaptive_playout
# Maximum number of participants in a conference
# default = 0 (unlimited)
#max_participants=10

@ -112,6 +112,9 @@ playout_type: adaptive_playout, adaptive_jb, or simple:
See sems core documentation for an explanation of the
methods.
max_participants: Maximum number of participants in a conference.
Default = 0 (unlimited)
Adding participants with "Transfer" REFER:
------------------------------------------
The "Transfer REFER" is a proprietary REFER call flow which transfers a

Loading…
Cancel
Save