Module: sems
Branch: master
Commit: 1b1793996088eb6877f70bd970628382917f18c5
URL: 
https://github.com/sems-server/sems/commit/1b1793996088eb6877f70bd970628382917f18c5

Author: Juha Heinanen <[email protected]>
Committer: Juha Heinanen <[email protected]>
Date: 2016-04-19T14:52:40+03:00

apps/dsm: added size function to mod_conference

---

Modified: apps/dsm/mods/mod_conference/ModConference.cpp
Modified: apps/dsm/mods/mod_conference/ModConference.h
Modified: doc/dsm/mods/Readme.mod_conference.txt

---

Diff:  
https://github.com/sems-server/sems/commit/1b1793996088eb6877f70bd970628382917f18c5.diff
Patch: 
https://github.com/sems-server/sems/commit/1b1793996088eb6877f70bd970628382917f18c5.patch

---

diff --git a/apps/dsm/mods/mod_conference/ModConference.cpp 
b/apps/dsm/mods/mod_conference/ModConference.cpp
index 38aa6f8..6a0d524 100644
--- a/apps/dsm/mods/mod_conference/ModConference.cpp
+++ b/apps/dsm/mods/mod_conference/ModConference.cpp
@@ -47,6 +47,7 @@ MOD_ACTIONEXPORT_BEGIN(MOD_CLS_NAME) {
   DEF_CMD("conference.setPlayoutType", ConfSetPlayoutTypeAction);
   DEF_CMD("conference.teejoin", ConfTeeJoinAction);
   DEF_CMD("conference.teeleave", ConfTeeLeaveAction);
+  DEF_CMD("conference.size", ConfSizeAction);
 
   DEF_CMD("conference.setupMixIn", ConfSetupMixInAction);
   DEF_CMD("conference.playMixIn",  ConfPlayMixInAction);
@@ -232,6 +233,22 @@ EXEC_ACTION_START(ConfRejoinAction) {
   }
 } EXEC_ACTION_END;
 
+CONST_ACTION_2P(ConfSizeAction, ',', true);
+EXEC_ACTION_START(ConfSizeAction) {
+  string channel_id = resolveVars(par1, sess, sc_sess, event_params);
+  string varname = par2;
+
+  if (varname.length() && varname[0] == '$')
+    varname = varname.substr(1);
+
+  size_t res = AmConferenceStatus::getConferenceSize(channel_id);
+
+  sc_sess->var[varname] = int2str((int)res);
+  DBG("set $%s = %s\n", 
+      varname.c_str(), sc_sess->var[varname].c_str());
+
+} EXEC_ACTION_END;
+
 EXEC_ACTION_START(ConfSetPlayoutTypeAction) {
   string playout_type = resolveVars(arg, sess, sc_sess, event_params);
   if (playout_type == "adaptive")
diff --git a/apps/dsm/mods/mod_conference/ModConference.h 
b/apps/dsm/mods/mod_conference/ModConference.h
index fa4714f..643ac86 100644
--- a/apps/dsm/mods/mod_conference/ModConference.h
+++ b/apps/dsm/mods/mod_conference/ModConference.h
@@ -89,6 +89,7 @@ DEF_ACTION_1P(ConfLeaveAction);
 DEF_ACTION_2P(ConfRejoinAction); 
 DEF_ACTION_2P(ConfPostEventAction);
 DEF_ACTION_1P(ConfSetPlayoutTypeAction);
+DEF_ACTION_2P(ConfSizeAction);
 
 DEF_ACTION_2P(ConfTeeJoinAction);
 DEF_ACTION_1P(ConfTeeLeaveAction);
diff --git a/doc/dsm/mods/Readme.mod_conference.txt 
b/doc/dsm/mods/Readme.mod_conference.txt
index f5063d0..9329217 100644
--- a/doc/dsm/mods/Readme.mod_conference.txt
+++ b/doc/dsm/mods/Readme.mod_conference.txt
@@ -55,3 +55,6 @@ conference.playMixInList(string filename [, loop=true])
 
 conference.flushMixInList()
     - flush mix-in playlist
+
+conference.size(string roomname, string resultvar)
+    - set size of conference to result variable

_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to