remove and update patches

Change-Id: I5e348e97ac064f27e7571dafb9778730272aeb58
mr4.0.1
Victor Seva 11 years ago
parent 701aeef9d5
commit 838c2908f3

@ -11,7 +11,7 @@
install-bin:
--- a/apps/dsm/mods/Makefile
+++ b/apps/dsm/mods/Makefile
@@ -41,7 +41,7 @@
@@ -45,7 +45,7 @@
done
.PHONY: install

@ -1,18 +1,6 @@
sipwise/sw_vcs.patch
sipwise/0001-core-advanced_audio-mixin-allow-generic-AmAudio-for-.patch
sipwise/0002-dsm-mod_conference-conference.playMixInList-action.patch
sipwise/0003-dsm-mod_utils-utils.getCountRight-getCountLeft-actio.patch
sipwise/0004-dsm-arrayIndex-action-get-the-index-of-a-string-in-a.patch
sipwise/0005-dsm-clearArray-and-clearStruct-actions.patch
sipwise/0006-rename_xdigits.patch
sipwise/0007-dsm-another-way-for-writing-comments-lines-starting-.patch
sipwise/0008-dsm-helper-functions-macros-for-modules-replaceParam.patch
sipwise/0009-dsm-syntax-allow-and-for-and-in-sets-action.patch
sipwise/0010-dsm-log-event-type-when-processing-events.patch
sipwise/0011-dsm-logs-dgb-info-warn-error-actions-for-easy-loggin.patch
sipwise/0012-b-f-dsm-mod_groups-really-lock-the-groups-list.patch
sipwise/0013-dsm-mod_groups-functions-to-get-group-participants-a.patch
sipwise/0014-dsm-mod_conference-flushMixInList-action-loop-for-mi.patch
sipwise/0015-confpin-simple-pin-conference-app.patch
no_config.patch
py_sems_path.patch

@ -1,100 +0,0 @@
From 74f59b78e447cecd1fb926354ecb7244dbfcc18f Mon Sep 17 00:00:00 2001
From: Stefan Sayer <stefan.sayer@googlemail.com>
Date: Wed, 10 Dec 2014 13:33:05 +0100
Subject: [PATCH 1/4] core:advanced_audio:mixin: allow generic AmAudio for
mixin
---
core/AmAudioMixIn.cpp | 24 ++++++++++++++++--------
core/AmAudioMixIn.h | 6 +++---
2 files changed, 19 insertions(+), 11 deletions(-)
diff --git a/core/AmAudioMixIn.cpp b/core/AmAudioMixIn.cpp
index 4bfa782..7f35077 100644
--- a/core/AmAudioMixIn.cpp
+++ b/core/AmAudioMixIn.cpp
@@ -30,7 +30,7 @@
#define IS_ONLY_ONCE (flags & AUDIO_MIXIN_ONCE)
#define IS_IMMEDIATE_START (flags & AUDIO_MIXIN_IMMEDIATE_START)
-AmAudioMixIn::AmAudioMixIn(AmAudio* A, AmAudioFile* B,
+AmAudioMixIn::AmAudioMixIn(AmAudio* A, AmAudio* B,
unsigned int s, double l,
unsigned int flags)
: A(A),B(B), s(s), l(l),
@@ -71,10 +71,14 @@ int AmAudioMixIn::get(unsigned long long system_ts, unsigned char* buffer,
if (res <= 0) { // B empty
res = A->get(system_ts, buffer, output_sample_rate, nb_samples);
mixing = false;
- if (IS_ONLY_ONCE)
+ if (IS_ONLY_ONCE) {
B = NULL;
- else
- B->rewind();
+ } else {
+ AmAudioFile* B_file = dynamic_cast<AmAudioFile*>(B);
+ if (NULL != B_file) {
+ B_file->rewind();
+ }
+ }
}
B_mut.unlock();
return res;
@@ -110,10 +114,14 @@ int AmAudioMixIn::get(unsigned long long system_ts, unsigned char* buffer,
if (len<0) { // B finished
mixing = false;
- if (IS_ONLY_ONCE)
+ if (IS_ONLY_ONCE) {
B = NULL;
- else
- B->rewind();
+ } else {
+ AmAudioFile* B_file = dynamic_cast<AmAudioFile*>(B);
+ if (NULL != B_file) {
+ B_file->rewind();
+ }
+ }
} else {
for (int i=0; i<(PCM16_B2S(len)); i++) {
pdest[i]+=(short)(((double)mix_buf[i])*l);
@@ -135,7 +143,7 @@ int AmAudioMixIn::put(unsigned long long system_ts, unsigned char* buffer,
return -1;
}
-void AmAudioMixIn::mixin(AmAudioFile* f) {
+void AmAudioMixIn::mixin(AmAudio* f) {
B_mut.lock();
B = f;
mixing = next_start_ts_i = false; /* so that mix in will re-start */
diff --git a/core/AmAudioMixIn.h b/core/AmAudioMixIn.h
index 59b57d2..e8bfdb8 100644
--- a/core/AmAudioMixIn.h
+++ b/core/AmAudioMixIn.h
@@ -52,7 +52,7 @@
class AmAudioMixIn : public AmAudio {
AmAudio* A;
- AmAudioFile* B;
+ AmAudio* B;
unsigned int s;
double l;
int flags;
@@ -68,12 +68,12 @@ class AmAudioMixIn : public AmAudio {
public:
- AmAudioMixIn(AmAudio* A, AmAudioFile* B,
+ AmAudioMixIn(AmAudio* A, AmAudio* B,
unsigned int s, double l,
unsigned int flags = 0);
~AmAudioMixIn();
- void mixin(AmAudioFile* f);
+ void mixin(AmAudio* f);
protected:
// not used
--
1.9.3 (Apple Git-50)

@ -1,123 +0,0 @@
From ef1d8c8f6e74383615f4c7e3d0a72e387134d0cd Mon Sep 17 00:00:00 2001
From: Stefan Sayer <stefan.sayer@googlemail.com>
Date: Wed, 10 Dec 2014 13:33:26 +0100
Subject: [PATCH 2/4] dsm:mod_conference: conference.playMixInList action
uses a playlist to mix in files into a list
---
apps/dsm/mods/mod_conference/ModConference.cpp | 55 +++++++++++++++++++++++++-
apps/dsm/mods/mod_conference/ModConference.h | 2 +
doc/dsm/mods/Readme.mod_conference.txt | 4 ++
3 files changed, 59 insertions(+), 2 deletions(-)
diff --git a/apps/dsm/mods/mod_conference/ModConference.cpp b/apps/dsm/mods/mod_conference/ModConference.cpp
index 07a3e39..6137989 100644
--- a/apps/dsm/mods/mod_conference/ModConference.cpp
+++ b/apps/dsm/mods/mod_conference/ModConference.cpp
@@ -49,7 +49,8 @@ MOD_ACTIONEXPORT_BEGIN(MOD_CLS_NAME) {
DEF_CMD("conference.teeleave", ConfTeeLeaveAction);
DEF_CMD("conference.setupMixIn", ConfSetupMixInAction);
- DEF_CMD("conference.playMixIn", ConfPlayMixInAction);
+ DEF_CMD("conference.playMixIn", ConfPlayMixInAction);
+ DEF_CMD("conference.playMixInList", ConfPlayMixInListAction);
} MOD_ACTIONEXPORT_END;
@@ -175,7 +176,8 @@ EXEC_ACTION_START(ConfJoinAction) {
sc_sess->SET_ERRNO(DSM_ERRNO_UNKNOWN_ARG);
}
} EXEC_ACTION_END;
-
+
+// get conference channel or other object (mixer etc)
template<class T>
static T* getDSMConfChannel(DSMSession* sc_sess, const char* key_name) {
if (sc_sess->avar.find(key_name) == sc_sess->avar.end()) {
@@ -399,3 +401,52 @@ EXEC_ACTION_START(ConfPlayMixInAction) {
m->mixin(af);
} EXEC_ACTION_END;
+
+
+EXEC_ACTION_START(ConfPlayMixInListAction) {
+ string filename = resolveVars(arg, sess, sc_sess, event_params);
+
+ bool has_playlist = true;
+ // get playlist
+ DSMDisposableT<AmPlaylist >* l_obj =
+ getDSMConfChannel<DSMDisposableT<AmPlaylist> >(sc_sess, CONF_AKEY_MIXLIST);
+ if (NULL == l_obj) {
+ // playlist newly setup
+ AmPlaylist* pl = new AmPlaylist(NULL); // no event receiver - no 'clear' event
+ l_obj = new DSMDisposableT<AmPlaylist >(pl);
+ AmArg c_arg;
+ c_arg.setBorrowedPointer(l_obj);
+ sc_sess->avar[CONF_AKEY_MIXLIST] = c_arg;
+
+ // add to garbage collector
+ sc_sess->transferOwnership(l_obj);
+ has_playlist = false;
+ }
+ AmPlaylist* l = l_obj->get();
+
+
+ DSMDisposableAudioFile* af = new DSMDisposableAudioFile();
+ if(af->open(filename,AmAudioFile::Read)) {
+ ERROR("audio file '%s' could not be opened for reading.\n",
+ filename.c_str());
+ delete af;
+
+ throw DSMException("file", "path", filename);
+ }
+ sc_sess->transferOwnership(af);
+
+ DBG("adding file '%s' to mixin playlist\n", filename.c_str());
+ l->addToPlaylist(new AmPlaylistItem(af, NULL));
+
+ if (!has_playlist) {
+ // get mixin mixer
+ DSMDisposableT<AmAudioMixIn >* m_obj =
+ getDSMConfChannel<DSMDisposableT<AmAudioMixIn > >(sc_sess, CONF_AKEY_MIXER);
+ if (NULL == m_obj) {
+ throw DSMException("conference", "cause", "mixer not setup!\n");
+ }
+ AmAudioMixIn* m = m_obj->get();
+ // play from list
+ m->mixin(l);
+ }
+} EXEC_ACTION_END;
diff --git a/apps/dsm/mods/mod_conference/ModConference.h b/apps/dsm/mods/mod_conference/ModConference.h
index c1e29b2..52d59fd 100644
--- a/apps/dsm/mods/mod_conference/ModConference.h
+++ b/apps/dsm/mods/mod_conference/ModConference.h
@@ -39,6 +39,7 @@ DECLARE_MODULE(MOD_CLS_NAME);
#define CONF_AKEY_CHANNEL "conf.chan"
#define CONF_AKEY_DEF_TEECHANNEL "conf.teechan"
#define CONF_AKEY_MIXER "conf.mixer"
+#define CONF_AKEY_MIXLIST "conf.mixlist"
/** holds a conference channel */
class DSMConfChannel
@@ -94,5 +95,6 @@ DEF_ACTION_1P(ConfTeeLeaveAction);
DEF_ACTION_2P(ConfSetupMixInAction);
DEF_ACTION_1P(ConfPlayMixInAction);
+DEF_ACTION_1P(ConfPlayMixInListAction);
#endif
diff --git a/doc/dsm/mods/Readme.mod_conference.txt b/doc/dsm/mods/Readme.mod_conference.txt
index 1df3b3e..71189df 100644
--- a/doc/dsm/mods/Readme.mod_conference.txt
+++ b/doc/dsm/mods/Readme.mod_conference.txt
@@ -48,3 +48,7 @@ conference.setupMixIn(float level, unsigned int seconds)
conference.playMixIn(string filename)
- mix in a file
+
+conference.playMixInList(string filename)
+ - add a file to the mix-in playlist
+ - the list is setup when this is called for the first time and set as mixin source
--
1.9.3 (Apple Git-50)

@ -1,233 +0,0 @@
From 0925459582f1148cfe726fa2fd40068e9d6a6233 Mon Sep 17 00:00:00 2001
From: Stefan Sayer <stefan.sayer@googlemail.com>
Date: Wed, 10 Dec 2014 14:06:36 +0100
Subject: [PATCH 3/4] dsm:mod_utils: utils.getCountRight / getCountLeft actions
to get number filenames
---
apps/dsm/mods/mod_utils/ModUtils.cpp | 147 +++++++++++++++++++++++++++++++++++
apps/dsm/mods/mod_utils/ModUtils.h | 5 ++
doc/dsm/mods/Readme.mod_utils.txt | 16 +++-
3 files changed, 167 insertions(+), 1 deletion(-)
diff --git a/apps/dsm/mods/mod_utils/ModUtils.cpp b/apps/dsm/mods/mod_utils/ModUtils.cpp
index 987ed79..8856204 100644
--- a/apps/dsm/mods/mod_utils/ModUtils.cpp
+++ b/apps/dsm/mods/mod_utils/ModUtils.cpp
@@ -41,6 +41,11 @@ MOD_ACTIONEXPORT_BEGIN(MOD_CLS_NAME) {
DEF_CMD("utils.playCountRight", SCUPlayCountRightAction);
DEF_CMD("utils.playCountLeft", SCUPlayCountLeftAction);
+ DEF_CMD("utils.getCountRight", SCUGetCountRightAction);
+ DEF_CMD("utils.getCountLeft", SCUGetCountLeftAction);
+ DEF_CMD("utils.getCountRightNoSuffix", SCUGetCountRightNoSuffixAction);
+ DEF_CMD("utils.getCountLeftNoSuffix", SCUGetCountLeftNoSuffixAction);
+
DEF_CMD("utils.getNewId", SCGetNewIdAction);
DEF_CMD("utils.spell", SCUSpellAction);
DEF_CMD("utils.rand", SCURandomAction);
@@ -57,6 +62,47 @@ MOD_ACTIONEXPORT_BEGIN(MOD_CLS_NAME) {
MOD_CONDITIONEXPORT_NONE(MOD_CLS_NAME);
+vector<string> utils_get_count_files(DSMSession* sc_sess, unsigned int cnt,
+ const string& basedir, const string& suffix, bool right) {
+
+ vector<string> res;
+
+ if (cnt <= 20) {
+ res.push_back(basedir+int2str(cnt)+suffix);
+ return res;
+ }
+
+ for (int i=9;i>1;i--) {
+ div_t num = div(cnt, (int)pow(10.,i));
+ if (num.quot) {
+ res.push_back(basedir+int2str(int(num.quot * pow(10.,i)))+suffix);
+ }
+ cnt = num.rem;
+ }
+
+ if (!cnt)
+ return res;
+
+ if ((cnt <= 20) || (!(cnt%10))) {
+ res.push_back(basedir+int2str(cnt)+suffix);
+ return res;
+ }
+
+ div_t num = div(cnt, 10);
+ if (right) {
+ // language has single digits before 10s
+ res.push_back(basedir+int2str(num.quot * 10)+suffix);
+ res.push_back(basedir+("x"+int2str(num.rem))+suffix);
+ } else {
+ // language has single digits before 10s
+ res.push_back(basedir+("x"+int2str(num.rem))+suffix);
+ res.push_back(basedir+int2str(num.quot * 10)+suffix);
+ }
+
+ return res;
+}
+
+
bool utils_play_count(DSMSession* sc_sess, unsigned int cnt,
const string& basedir, const string& suffix, bool right) {
@@ -131,6 +177,107 @@ EXEC_ACTION_START(SCUPlayCountLeftAction) {
sc_sess->CLR_ERRNO;
} EXEC_ACTION_END;
+
+CONST_ACTION_2P(SCUGetCountRightAction, ',', true);
+EXEC_ACTION_START(SCUGetCountRightAction) {
+ string cnt_s = resolveVars(par1, sess, sc_sess, event_params);
+ string basedir = resolveVars(par2, sess, sc_sess, event_params);
+
+ unsigned int cnt = 0;
+ if (str2i(cnt_s,cnt)) {
+ ERROR("could not parse count '%s'\n", cnt_s.c_str());
+ sc_sess->SET_ERRNO(DSM_ERRNO_UNKNOWN_ARG);
+ sc_sess->SET_STRERROR("could not parse count '"+cnt_s+"'\n");
+ return false;
+ }
+
+ vector<string> filenames = utils_get_count_files(sc_sess, cnt, basedir, ".wav", true);
+
+ cnt=0;
+ for (vector<string>::iterator it=filenames.begin();it!=filenames.end();it++) {
+ sc_sess->var["count_file["+int2str(cnt)+"]"]=*it;
+ cnt++;
+ }
+
+ sc_sess->CLR_ERRNO;
+} EXEC_ACTION_END;
+
+
+CONST_ACTION_2P(SCUGetCountLeftAction, ',', true);
+EXEC_ACTION_START(SCUGetCountLeftAction) {
+ string cnt_s = resolveVars(par1, sess, sc_sess, event_params);
+ string basedir = resolveVars(par2, sess, sc_sess, event_params);
+
+ unsigned int cnt = 0;
+ if (str2i(cnt_s,cnt)) {
+ ERROR("could not parse count '%s'\n", cnt_s.c_str());
+ sc_sess->SET_ERRNO(DSM_ERRNO_UNKNOWN_ARG);
+ sc_sess->SET_STRERROR("could not parse count '"+cnt_s+"'\n");
+ return false;
+ }
+
+ vector<string> filenames = utils_get_count_files(sc_sess, cnt, basedir, ".wav", false);
+
+ cnt=0;
+ for (vector<string>::iterator it=filenames.begin();it!=filenames.end();it++) {
+ sc_sess->var["count_file["+int2str(cnt)+"]"]=*it;
+ cnt++;
+ }
+
+ sc_sess->CLR_ERRNO;
+} EXEC_ACTION_END;
+
+
+CONST_ACTION_2P(SCUGetCountRightNoSuffixAction, ',', true);
+EXEC_ACTION_START(SCUGetCountRightNoSuffixAction) {
+ string cnt_s = resolveVars(par1, sess, sc_sess, event_params);
+ string basedir = resolveVars(par2, sess, sc_sess, event_params);
+
+ unsigned int cnt = 0;
+ if (str2i(cnt_s,cnt)) {
+ ERROR("could not parse count '%s'\n", cnt_s.c_str());
+ sc_sess->SET_ERRNO(DSM_ERRNO_UNKNOWN_ARG);
+ sc_sess->SET_STRERROR("could not parse count '"+cnt_s+"'\n");
+ return false;
+ }
+
+ vector<string> filenames = utils_get_count_files(sc_sess, cnt, basedir, "", true);
+
+ cnt=0;
+ for (vector<string>::iterator it=filenames.begin();it!=filenames.end();it++) {
+ sc_sess->var["count_file["+int2str(cnt)+"]"]=*it;
+ cnt++;
+ }
+
+ sc_sess->CLR_ERRNO;
+} EXEC_ACTION_END;
+
+
+CONST_ACTION_2P(SCUGetCountLeftNoSuffixAction, ',', true);
+EXEC_ACTION_START(SCUGetCountLeftNoSuffixAction) {
+ string cnt_s = resolveVars(par1, sess, sc_sess, event_params);
+ string basedir = resolveVars(par2, sess, sc_sess, event_params);
+
+ unsigned int cnt = 0;
+ if (str2i(cnt_s,cnt)) {
+ ERROR("could not parse count '%s'\n", cnt_s.c_str());
+ sc_sess->SET_ERRNO(DSM_ERRNO_UNKNOWN_ARG);
+ sc_sess->SET_STRERROR("could not parse count '"+cnt_s+"'\n");
+ return false;
+ }
+
+ vector<string> filenames = utils_get_count_files(sc_sess, cnt, basedir, "", false);
+
+ cnt=0;
+ for (vector<string>::iterator it=filenames.begin();it!=filenames.end();it++) {
+ sc_sess->var["count_file["+int2str(cnt)+"]"]=*it;
+ cnt++;
+ }
+
+ sc_sess->CLR_ERRNO;
+} EXEC_ACTION_END;
+
+
EXEC_ACTION_START(SCGetNewIdAction) {
string d = resolveVars(arg, sess, sc_sess, event_params);
sc_sess->var[d]=AmSession::getNewId();
diff --git a/apps/dsm/mods/mod_utils/ModUtils.h b/apps/dsm/mods/mod_utils/ModUtils.h
index aaf89c7..744e2ea 100644
--- a/apps/dsm/mods/mod_utils/ModUtils.h
+++ b/apps/dsm/mods/mod_utils/ModUtils.h
@@ -37,6 +37,11 @@ DECLARE_MODULE(MOD_CLS_NAME);
DEF_ACTION_2P(SCUPlayCountRightAction);
DEF_ACTION_2P(SCUPlayCountLeftAction);
+DEF_ACTION_2P(SCUGetCountRightAction);
+DEF_ACTION_2P(SCUGetCountLeftAction);
+DEF_ACTION_2P(SCUGetCountRightNoSuffixAction);
+DEF_ACTION_2P(SCUGetCountLeftNoSuffixAction);
+
DEF_ACTION_1P(SCGetNewIdAction);
DEF_ACTION_2P(SCUSpellAction);
DEF_ACTION_2P(SCURandomAction);
diff --git a/doc/dsm/mods/Readme.mod_utils.txt b/doc/dsm/mods/Readme.mod_utils.txt
index 413f670..09a668a 100644
--- a/doc/dsm/mods/Readme.mod_utils.txt
+++ b/doc/dsm/mods/Readme.mod_utils.txt
@@ -7,10 +7,24 @@ Actions:
* sets $errno (arg)
utils.playCountLeft(int cnt [, string basedir])
- play count for laguages that have single digits befire the 10s (like german)
+ play count for laguages that have single digits before the 10s (like german)
* Throws "file" exeption with #path if file can not be opened
* sets $errno (arg)
+ utils.getCountRight(int cnt [, string basedir])
+ get filenames for a number for laguages that have single digits after the 10s (like english)
+ into count_file[n] (i.e. count_file[0] .. count_file[n])
+ * sets $errno (arg)
+
+ utils.getCountLeft(int cnt [, string basedir])
+ get filenames for a number for laguages that have single digits before the 10s (like german)
+ into count_file[n] (i.e. count_file[0] .. count_file[n])
+ * sets $errno (arg)
+
+ utils.getCountRightNoSuffix(int cnt [, string basedir])
+ utils.getCountLeftNoSuffix(int cnt [, string basedir])
+ as above but without .wav suffix
+
utils.spell(string word[, string basedir])
plays each character in the word (e.g. utils.spell(321,wav/digits/) plays
wav/digits/3.wav, wav/digits/2.wav, wav/digits/1.wav
--
1.9.3 (Apple Git-50)

@ -1,89 +0,0 @@
From ec1d1de937adcba32d34cebf2eb7b398b385dc50 Mon Sep 17 00:00:00 2001
From: Stefan Sayer <stefan.sayer@googlemail.com>
Date: Mon, 24 Nov 2014 22:03:44 +0100
Subject: [PATCH 1/2] dsm: arrayIndex action: get the index of a string in a
var array
---
apps/dsm/DSMCoreModule.cpp | 30 ++++++++++++++++++++++++++++++
apps/dsm/DSMCoreModule.h | 1 +
doc/dsm/dsm_syntax.txt | 3 +++
3 files changed, 34 insertions(+)
diff --git a/apps/dsm/DSMCoreModule.cpp b/apps/dsm/DSMCoreModule.cpp
index 95453ec..fc9e43b 100644
--- a/apps/dsm/DSMCoreModule.cpp
+++ b/apps/dsm/DSMCoreModule.cpp
@@ -99,6 +99,7 @@ DSMAction* DSMCoreModule::getAction(const string& from_str) {
DEF_CMD("clear", SCClearAction);
DEF_CMD("clearArray", SCClearArrayAction);
DEF_CMD("size", SCSizeAction);
+ DEF_CMD("arrayIndex", SCArrayIndexAction);
DEF_CMD("logVars", SCLogVarsAction);
DEF_CMD("logParams", SCLogParamsAction);
DEF_CMD("logSelects", SCLogSelectsAction);
@@ -881,6 +882,35 @@ EXEC_ACTION_START(SCSizeAction) {
DBG("set $%s=%s\n", dst_name.c_str(), res.c_str());
} EXEC_ACTION_END;
+CONST_ACTION_2P(SCArrayIndexAction, ',', false);
+EXEC_ACTION_START(SCArrayIndexAction) {
+ string array_name = par1;
+ if (array_name.length() && array_name[0]=='$')
+ array_name.erase(0,1);
+
+ string val = resolveVars(par2, sess, sc_sess, event_params);
+ unsigned int i = 0;
+ bool found = false;
+ while (true) {
+ VarMapT::iterator lb = sc_sess->var.find(array_name+"["+int2str(i)+"]");
+ if (lb == sc_sess->var.end())
+ break;
+ if (val == lb->second) {
+ found = true;
+ break;
+ }
+ i++;
+ }
+
+ string res = found ? int2str(i) : "nil";
+ if (par2[0]=='$') {
+ sc_sess->var[par2.substr(1)+".index"] = res;
+ DBG("set %s=%s\n", (par2+".index").c_str(), res.c_str());
+ } else {
+ sc_sess->var["index"] = res;
+ DBG("set $index=%s\n", res.c_str());
+ }
+} EXEC_ACTION_END;
CONST_ACTION_2P(SCAppendAction,',', false);
EXEC_ACTION_START(SCAppendAction) {
diff --git a/apps/dsm/DSMCoreModule.h b/apps/dsm/DSMCoreModule.h
index b5eefc3..a65616e 100644
--- a/apps/dsm/DSMCoreModule.h
+++ b/apps/dsm/DSMCoreModule.h
@@ -94,6 +94,7 @@ DEF_ACTION_1P(SCIncAction);
DEF_ACTION_1P(SCClearAction);
DEF_ACTION_1P(SCClearArrayAction);
DEF_ACTION_2P(SCSizeAction);
+DEF_ACTION_2P(SCArrayIndexAction);
DEF_ACTION_2P(SCSetTimerAction);
DEF_ACTION_1P(SCRemoveTimerAction);
DEF_ACTION_1P(SCRemoveTimersAction);
diff --git a/doc/dsm/dsm_syntax.txt b/doc/dsm/dsm_syntax.txt
index c104654..8bb6bb6 100644
--- a/doc/dsm/dsm_syntax.txt
+++ b/doc/dsm/dsm_syntax.txt
@@ -109,6 +109,9 @@ DSM flow
set variable $dst to size of array
(e.g. $arrayname[0], $arrayname[1] set, $dst set to 2)
+ arrayIndex($array, key) - find key in $array, set $index to its index, or "nil" if not found
+ arrayIndex($array, $var) - find $var in $array, set $var.index to its index, or "nil" if not found
+
inc($var)
clear($var)
clearArray($var)
--
1.9.3 (Apple Git-50)

@ -1,97 +0,0 @@
From c8976619b1d32e1f433c166dfe04ab375932d253 Mon Sep 17 00:00:00 2001
From: Stefan Sayer <stefan.sayer@googlemail.com>
Date: Mon, 24 Nov 2014 22:40:20 +0100
Subject: [PATCH 2/2] dsm: clearArray and clearStruct actions
---
apps/dsm/DSMCoreModule.cpp | 26 ++++++++++++++++++++++++--
apps/dsm/DSMCoreModule.h | 1 +
doc/dsm/dsm_syntax.txt | 5 ++++-
3 files changed, 29 insertions(+), 3 deletions(-)
diff --git a/apps/dsm/DSMCoreModule.cpp b/apps/dsm/DSMCoreModule.cpp
index fc9e43b..6f1633f 100644
--- a/apps/dsm/DSMCoreModule.cpp
+++ b/apps/dsm/DSMCoreModule.cpp
@@ -97,6 +97,7 @@ DSMAction* DSMCoreModule::getAction(const string& from_str) {
DEF_CMD("inc", SCIncAction);
DEF_CMD("log", SCLogAction);
DEF_CMD("clear", SCClearAction);
+ DEF_CMD("clearStruct", SCClearStructAction);
DEF_CMD("clearArray", SCClearArrayAction);
DEF_CMD("size", SCSizeAction);
DEF_CMD("arrayIndex", SCArrayIndexAction);
@@ -838,10 +839,10 @@ EXEC_ACTION_START(SCClearAction) {
sc_sess->var.erase(var_name);
} EXEC_ACTION_END;
-EXEC_ACTION_START(SCClearArrayAction) {
+EXEC_ACTION_START(SCClearStructAction) {
string varprefix = (arg.length() && arg[0] == '$')?
arg.substr(1) : arg;
- DBG("clear variable array '%s.*'\n", varprefix.c_str());
+ DBG("clear variable struct '%s.*'\n", varprefix.c_str());
varprefix+=".";
@@ -857,6 +858,27 @@ EXEC_ACTION_START(SCClearArrayAction) {
} EXEC_ACTION_END;
+
+EXEC_ACTION_START(SCClearArrayAction) {
+ string varprefix = (arg.length() && arg[0] == '$')?
+ arg.substr(1) : arg;
+ DBG("clear variable array '%s[*'\n", varprefix.c_str());
+
+ varprefix+="[";
+
+ VarMapT::iterator lb = sc_sess->var.lower_bound(varprefix);
+ while (lb != sc_sess->var.end()) {
+ if ((lb->first.length() < varprefix.length()) ||
+ strncmp(lb->first.c_str(), varprefix.c_str(),varprefix.length()))
+ break;
+ // fixme: check whether it's really an array index
+ VarMapT::iterator lb_d = lb;
+ lb++;
+ sc_sess->var.erase(lb_d);
+ }
+
+} EXEC_ACTION_END;
+
CONST_ACTION_2P(SCSizeAction, ',', false);
EXEC_ACTION_START(SCSizeAction) {
string array_name = par1;
diff --git a/apps/dsm/DSMCoreModule.h b/apps/dsm/DSMCoreModule.h
index a65616e..6ad0a91 100644
--- a/apps/dsm/DSMCoreModule.h
+++ b/apps/dsm/DSMCoreModule.h
@@ -92,6 +92,7 @@ DEF_ACTION_2P(SCAppendAction);
DEF_ACTION_2P(SCSubStrAction);
DEF_ACTION_1P(SCIncAction);
DEF_ACTION_1P(SCClearAction);
+DEF_ACTION_1P(SCClearStructAction);
DEF_ACTION_1P(SCClearArrayAction);
DEF_ACTION_2P(SCSizeAction);
DEF_ACTION_2P(SCArrayIndexAction);
diff --git a/doc/dsm/dsm_syntax.txt b/doc/dsm/dsm_syntax.txt
index 8bb6bb6..3cc8143 100644
--- a/doc/dsm/dsm_syntax.txt
+++ b/doc/dsm/dsm_syntax.txt
@@ -114,9 +114,12 @@ DSM flow
inc($var)
clear($var)
- clearArray($var)
+ clearStruct($var)
clears all var.* variables
+ clearArray($var)
+ clears all var[* variables
+
Playing prompts and file I/O
----------------------------
--
1.9.3 (Apple Git-50)

@ -4,11 +4,9 @@ Date: Thu Jan 29 12:04:00 2015 +0100
rename prompts x1..9.wav to 1..9-and.wav
diff --git a/apps/dsm/mods/mod_utils/ModUtils.cpp b/apps/dsm/mods/mod_utils/ModUtils.cpp
index 03acf43..1a8f649 100644
--- a/apps/dsm/mods/mod_utils/ModUtils.cpp
+++ b/apps/dsm/mods/mod_utils/ModUtils.cpp
@@ -90,10 +90,10 @@ vector<string> utils_get_count_files(DSMSession* sc_sess, unsigned int cnt,
@@ -97,10 +97,10 @@
if (right) {
// language has single digits before 10s
res.push_back(basedir+int2str(num.quot * 10)+suffix);
@ -21,7 +19,7 @@ index 03acf43..1a8f649 100644
res.push_back(basedir+int2str(num.quot * 10)+suffix);
}
@@ -129,10 +129,10 @@ bool utils_play_count(DSMSession* sc_sess, unsigned int cnt,
@@ -136,10 +136,10 @@
if (right) {
// language has single digits before 10s
sc_sess->playFile(basedir+int2str(num.quot * 10)+suffix, false);

@ -1,46 +0,0 @@
From 0f3accb12d7179653e31890fe4e26682815cc3a7 Mon Sep 17 00:00:00 2001
From: Stefan Sayer <stefan.sayer@googlemail.com>
Date: Thu, 20 Nov 2014 19:45:43 +0100
Subject: [PATCH 1/3] dsm: another way for writing comments: lines starting
with # (hash)
---
apps/dsm/DSMStateDiagramCollection.cpp | 6 +++---
doc/dsm/dsm_syntax.txt | 2 ++
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/apps/dsm/DSMStateDiagramCollection.cpp b/apps/dsm/DSMStateDiagramCollection.cpp
index 79c5ff0..749d223 100644
--- a/apps/dsm/DSMStateDiagramCollection.cpp
+++ b/apps/dsm/DSMStateDiagramCollection.cpp
@@ -50,11 +50,11 @@ bool DSMStateDiagramCollection::readFile(const string& filename, const string& n
while (ifs.good() && !ifs.eof()) {
string r;
getline(ifs, r);
- // skip comments
+ // skip comments: lines starting with -- or #
size_t fpos = r.find_first_not_of(" \t");
if (fpos != string::npos) {
- if (r.length() > fpos+1 &&
- r.substr(fpos, 2) == "--")
+ if ((r.length() > fpos+1 && r.substr(fpos, 2) == "--") ||
+ ((r.length() >= fpos+1 && r.substr(fpos, 1) == "#" && r.substr(fpos, 8) != "#include") ))
continue;
if (r.length() > fpos+1 &&
diff --git a/doc/dsm/dsm_syntax.txt b/doc/dsm/dsm_syntax.txt
index 3a4019e..cf29e6e 100644
--- a/doc/dsm/dsm_syntax.txt
+++ b/doc/dsm/dsm_syntax.txt
@@ -4,6 +4,8 @@ DSM quick reference
Syntax
======
-- comment
+# also comment
+
#include "script.dsm"
#include "/path/to/anotherscript.dsm"
import(mod_name);
--
1.9.3 (Apple Git-50)

@ -14,26 +14,22 @@ e.g. myAction($myvar) - resolveVars
apps/dsm/DSMSession.h | 12 ++++++++++++
2 files changed, 16 insertions(+)
diff --git a/apps/dsm/DSMCoreModule.h b/apps/dsm/DSMCoreModule.h
index 328e18e..ff8cee3 100644
--- a/apps/dsm/DSMCoreModule.h
+++ b/apps/dsm/DSMCoreModule.h
@@ -160,4 +160,8 @@ class TestDSMCondition
map<string,string>* event_params);
};
@@ -175,4 +175,8 @@
string replaceParams(const string& q, AmSession* sess, DSMSession* sc_sess,
map<string,string>* event_params);
+/** return string q with variables/params/selects replaced */
+string replaceParams(const string& q, AmSession* sess, DSMSession* sc_sess,
+ map<string,string>* event_params);
+
#endif
diff --git a/apps/dsm/DSMSession.h b/apps/dsm/DSMSession.h
index 5607c9d..f7841a7 100644
--- a/apps/dsm/DSMSession.h
+++ b/apps/dsm/DSMSession.h
@@ -97,6 +97,18 @@ using std::map;
#define CLR_STRERROR \
var["strerror"] = "";
@@ -111,6 +111,18 @@
s->CLR_STRERROR; \
} while (0)
+#define SET_ERROR(s, errno, errstr) \
+ do { \
@ -50,6 +46,3 @@ index 5607c9d..f7841a7 100644
typedef map<string, string> VarMapT;
typedef map<string, AmArg> AVarMapT;
--
1.9.3 (Apple Git-50)

@ -1,46 +0,0 @@
From 34b7598451dc639ed1a526d244b496adff9a130b Mon Sep 17 00:00:00 2001
From: Stefan Sayer <stefan.sayer@googlemail.com>
Date: Thu, 20 Nov 2014 20:50:20 +0100
Subject: [PATCH 3/3] dsm:syntax - allow @@,## and $$ for @, # and $$ in sets()
action
Conflicts:
doc/dsm/dsm_syntax.txt
---
apps/dsm/DSMCoreModule.cpp | 4 ++++
doc/dsm/dsm_syntax.txt | 5 ++++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/apps/dsm/DSMCoreModule.cpp b/apps/dsm/DSMCoreModule.cpp
index 37c2344..c4f18af 100644
--- a/apps/dsm/DSMCoreModule.cpp
+++ b/apps/dsm/DSMCoreModule.cpp
@@ -627,6 +627,10 @@ string replaceParams(const string& q, AmSession* sess, DSMSession* sc_sess,
repl_pos = rstart+1;
if (rstart == string::npos)
break;
+ if (rstart && (res.length() > rstart) && (res[rstart]==res[repl_pos])) {
+ res.erase(rstart, 1);
+ continue;
+ }
if (rstart && res[rstart-1] == '\\') // escaped
continue;
size_t rend;
diff --git a/doc/dsm/dsm_syntax.txt b/doc/dsm/dsm_syntax.txt
index cf29e6e..05fd2db 100644
--- a/doc/dsm/dsm_syntax.txt
+++ b/doc/dsm/dsm_syntax.txt
@@ -89,6 +89,9 @@ DSM flow
e.g. set($var="text"); set($var=$var2); set($var=#key)
sets($var=value)
e.g. sets($var="text and some $variable and some #param");
+ sets($var="$(variable1)$(variable2)");
+ sets($var="this is a single hash: ##")
+ sets($var="a single at on a date with a single dollar: @@$$")
var($dstvar=srcvarname)
e.g. var($dstvar=$var_counter)
param($dstvar=srcparamname)
--
1.9.3 (Apple Git-50)

@ -1,97 +0,0 @@
--- a/apps/dsm/DSMStateEngine.cpp
+++ b/apps/dsm/DSMStateEngine.cpp
@@ -37,6 +37,57 @@
#include "DSM.h" // for DSMFactory::MonitoringFullCallgraph
+const char* DSMCondition::type2str(EventType event) {
+#define rt(e) case e: return #e;
+
+ switch (event) {
+ rt(Any);
+ rt(Invite);
+ rt(SessionStart);
+ rt(Ringing);
+ rt(EarlySession);
+ rt(FailedCall);
+ rt(SipRequest);
+ rt(SipReply);
+
+ rt(Hangup);
+ rt(Hold);
+ rt(UnHold);
+
+ rt(B2BOtherReply);
+ rt(B2BOtherBye);
+
+ rt(SessionTimeout);
+ rt(RtpTimeout);
+ rt(RemoteDisappeared);
+
+ rt(Key);
+ rt(Timer);
+
+ rt(NoAudio);
+ rt(PlaylistSeparator);
+
+ rt(DSMEvent);
+ rt(DSMException);
+
+ rt(XmlrpcResponse);
+
+ rt(JsonRpcResponse);
+ rt(JsonRpcRequest);
+
+ rt(Startup);
+ rt(Reload);
+ rt(System);
+
+ rt(SIPSubscription);
+
+ rt(RTPTimeout);
+
+ default: return "<unknown>";
+#undef rt
+ };
+}
+
DSMStateDiagram::DSMStateDiagram(const string& name)
: name(name) {
}
@@ -526,14 +577,14 @@
map<string,string> exception_params;
bool is_exception = run_exception;
- DBG("o v DSM processing event, current state '%s' v\n", current->name.c_str());
+ DBG("o v DSM current state '%s', processing '%s' event v\n",
+ current->name.c_str(), DSMCondition::type2str(event));
+
bool is_consumed = true;
do {
try {
is_consumed = true;
-
- DBG(" > state '%s'\n", current->name.c_str());
for (vector<DSMTransition>::iterator tr = current->transitions.begin();
tr != current->transitions.end();tr++) {
if (tr->is_exception != is_exception)
@@ -617,7 +668,6 @@
break;
}
}
- DBG(" >>o arrived in state '%s'\n", current->name.c_str());
break;
}
--- a/apps/dsm/DSMStateEngine.h
+++ b/apps/dsm/DSMStateEngine.h
@@ -128,6 +128,8 @@
#endif
};
+ static const char* type2str(EventType event);
+
bool invert;
DSMCondition() : invert(false) { }

@ -1,128 +0,0 @@
From b1dfeab659a0188304bcc6715672af462f75afae Mon Sep 17 00:00:00 2001
From: Stefan Sayer <stefan.sayer@googlemail.com>
Date: Fri, 20 Feb 2015 20:49:31 +0100
Subject: [PATCH 2/7] dsm: logs(), dgb(), info(), warn(), error() actions for
easy logging
---
apps/dsm/DSMCoreModule.cpp | 40 ++++++++++++++++++++++++++++++++++++++--
apps/dsm/DSMCoreModule.h | 5 +++++
doc/dsm/dsm_syntax.txt | 7 ++++++-
3 files changed, 49 insertions(+), 3 deletions(-)
diff --git a/apps/dsm/DSMCoreModule.cpp b/apps/dsm/DSMCoreModule.cpp
index 1da9ad1..b4ae758 100644
--- a/apps/dsm/DSMCoreModule.cpp
+++ b/apps/dsm/DSMCoreModule.cpp
@@ -92,6 +92,11 @@ DSMAction* DSMCoreModule::getAction(const string& from_str) {
DEF_CMD("substr", SCSubStrAction);
DEF_CMD("inc", SCIncAction);
DEF_CMD("log", SCLogAction);
+ DEF_CMD("logs", SCLogsAction);
+ DEF_CMD("dbg", SCDbgAction);
+ DEF_CMD("info", SCInfoAction);
+ DEF_CMD("warn", SCWarnAction);
+ DEF_CMD("error", SCErrorAction);
DEF_CMD("clear", SCClearAction);
DEF_CMD("clearStruct", SCClearStructAction);
DEF_CMD("clearArray", SCClearArrayAction);
@@ -516,6 +521,37 @@ EXEC_ACTION_START(SCLogAction) {
l_line.c_str());
} EXEC_ACTION_END;
+CONST_ACTION_2P(SCLogsAction, ',', false);
+EXEC_ACTION_START(SCLogsAction) {
+ unsigned int lvl;
+ if (str2i(resolveVars(par1, sess, sc_sess, event_params), lvl)) {
+ ERROR("unknown log level '%s'\n", par1.c_str());
+ EXEC_ACTION_STOP;
+ }
+ string l_line = replaceParams(par2, sess, sc_sess, event_params);
+ _LOG((int)lvl, "FSM: '%s'\n", l_line.c_str());
+} EXEC_ACTION_END;
+
+EXEC_ACTION_START(SCDbgAction) {
+ string l_line = replaceParams(arg, sess, sc_sess, event_params);
+ DBG("FSM: '%s'\n", l_line.c_str());
+} EXEC_ACTION_END;
+
+EXEC_ACTION_START(SCInfoAction) {
+ string l_line = replaceParams(arg, sess, sc_sess, event_params);
+ INFO("FSM: '%s'\n", l_line.c_str());
+} EXEC_ACTION_END;
+
+EXEC_ACTION_START(SCWarnAction) {
+ string l_line = replaceParams(arg, sess, sc_sess, event_params);
+ WARN("FSM: '%s'\n", l_line.c_str());
+} EXEC_ACTION_END;
+
+EXEC_ACTION_START(SCErrorAction) {
+ string l_line = replaceParams(arg, sess, sc_sess, event_params);
+ ERROR("FSM: '%s'\n", l_line.c_str());
+} EXEC_ACTION_END;
+
void log_vars(const string& l_arg, AmSession* sess,
DSMSession* sc_sess, map<string,string>* event_params) {
unsigned int lvl;
@@ -1199,7 +1235,7 @@ EXEC_ACTION_START(SCDIAction) {
p.erase(0, 8);
AmArg var_struct;
string varprefix = p+".";
- bool has_vars = false;
+ //bool has_vars = false;
map<string, string>::iterator lb = sc_sess->var.lower_bound(varprefix);
while (lb != sc_sess->var.end()) {
if ((lb->first.length() < varprefix.length()) ||
@@ -1213,7 +1249,7 @@ EXEC_ACTION_START(SCDIAction) {
string2argarray(varname, lb->second, var_struct);
lb++;
- has_vars = true;
+ //has_vars = true;
}
di_args.push(var_struct);
} else if (p.length() > 7 &&
diff --git a/apps/dsm/DSMCoreModule.h b/apps/dsm/DSMCoreModule.h
index a91a10f..a74241b 100644
--- a/apps/dsm/DSMCoreModule.h
+++ b/apps/dsm/DSMCoreModule.h
@@ -98,6 +98,11 @@ DEF_ACTION_2P(SCSetTimerAction);
DEF_ACTION_1P(SCRemoveTimerAction);
DEF_ACTION_1P(SCRemoveTimersAction);
DEF_ACTION_2P(SCLogAction);
+DEF_ACTION_2P(SCLogsAction);
+DEF_ACTION_1P(SCDbgAction);
+DEF_ACTION_1P(SCInfoAction);
+DEF_ACTION_1P(SCWarnAction);
+DEF_ACTION_1P(SCErrorAction);
DEF_ACTION_1P(SCLogVarsAction);
DEF_ACTION_1P(SCLogParamsAction);
DEF_ACTION_1P(SCLogSelectsAction);
diff --git a/doc/dsm/dsm_syntax.txt b/doc/dsm/dsm_syntax.txt
index 9c42ead..8b45676 100644
--- a/doc/dsm/dsm_syntax.txt
+++ b/doc/dsm/dsm_syntax.txt
@@ -246,6 +246,7 @@ B2B call control
log(level, text)
e.g. log(1, $var1)
+ logs(level, "text with $(variable_name) and #(paramname) replacements")
-- log all variables:
logVars(level)
-- log all selects:
@@ -253,7 +254,11 @@ B2B call control
-- log all Params (only in actions of a transition):
logParams(level)
-- log everything:
- logAll(level)
+ logAll(level)
+ dbg("some debug with $(replaced_var)")
+ info("some info $(message)")
+ warn("warn #(message_parameter)")
+ error("error in call @(local_tag)")
Timers
------
--
1.9.3 (Apple Git-50)

@ -1,25 +0,0 @@
From 7392ee5ea6b27f3d8b06d854dd9be2311b528ef5 Mon Sep 17 00:00:00 2001
From: Stefan Sayer <stefan.sayer@googlemail.com>
Date: Fri, 20 Feb 2015 21:17:44 +0100
Subject: [PATCH 3/7] b/f: dsm:mod_groups: really lock the groups list
---
apps/dsm/mods/mod_groups/ModGroups.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/apps/dsm/mods/mod_groups/ModGroups.cpp b/apps/dsm/mods/mod_groups/ModGroups.cpp
index 15a19f1..60a1edd 100644
--- a/apps/dsm/mods/mod_groups/ModGroups.cpp
+++ b/apps/dsm/mods/mod_groups/ModGroups.cpp
@@ -144,7 +144,7 @@ EXEC_ACTION_START(GroupsPostEventAction) {
DBG("posting event to group '%s'\n", groupname.c_str());
- GroupsModule::groups_mut.unlock();
+ GroupsModule::groups_mut.lock();
GroupMap::iterator grp = GroupsModule::groups.find(groupname);
bool posted = false;
if (grp != GroupsModule::groups.end()) {
--
1.9.3 (Apple Git-50)

@ -1,101 +0,0 @@
From a94e8565eabf8e5269c7d2b86b5ecfa09971bfc0 Mon Sep 17 00:00:00 2001
From: Stefan Sayer <stefan.sayer@googlemail.com>
Date: Fri, 20 Feb 2015 21:18:15 +0100
Subject: [PATCH 4/7] dsm:mod_groups: functions to get group participants and
size
---
apps/dsm/mods/mod_groups/ModGroups.cpp | 40 +++++++++++++++++++++++++++++++++-
apps/dsm/mods/mod_groups/ModGroups.h | 3 ++-
doc/dsm/mods/Readme.mod_groups.txt | 3 +++
3 files changed, 44 insertions(+), 2 deletions(-)
diff --git a/apps/dsm/mods/mod_groups/ModGroups.cpp b/apps/dsm/mods/mod_groups/ModGroups.cpp
index 60a1edd..9af9a79 100644
--- a/apps/dsm/mods/mod_groups/ModGroups.cpp
+++ b/apps/dsm/mods/mod_groups/ModGroups.cpp
@@ -47,7 +47,8 @@ MOD_ACTIONEXPORT_BEGIN(MOD_CLS_NAME) {
DEF_CMD("groups.join", GroupsJoinAction);
DEF_CMD("groups.leave", GroupsLeaveAction);
DEF_CMD("groups.leaveAll", GroupsLeaveAllAction);
- // DEF_CMD("groups.get", GroupsGetAction);
+ DEF_CMD("groups.get", GroupsGetAction);
+ DEF_CMD("groups.getSize", GroupsGetSizeAction);
// DEF_CMD("groups.getMembers", GroupsGetMembersAction);
DEF_CMD("groups.postEvent", GroupsPostEventAction);
@@ -125,6 +126,43 @@ EXEC_ACTION_START(GroupsLeaveAllAction) {
GroupsModule::leave_all_groups(ltag);
} EXEC_ACTION_END;
+CONST_ACTION_2P(GroupsGetAction, '=', false);
+EXEC_ACTION_START(GroupsGetAction) {
+ string var = par1;
+ if (var.size() && var[0]=='$') var.erase(0,1);
+ string groupname = resolveVars(par2, sess, sc_sess, event_params);
+ GroupsModule::groups_mut.lock();
+ GroupMap::iterator grp = GroupsModule::groups.find(groupname);
+ int i=0;
+ if (grp != GroupsModule::groups.end()) {
+ for (set<string>::iterator it =
+ grp->second.begin(); it != grp->second.end(); it++) {
+ sc_sess->var[var+"["+int2str(i)+"]"] = *it;
+ i++;
+ }
+ }
+ GroupsModule::groups_mut.unlock();
+ DBG("get %d group members of '%s' in $%s[]\n", i, groupname.c_str(), var.c_str());
+
+} EXEC_ACTION_END;
+
+CONST_ACTION_2P(GroupsGetSizeAction, '=', false);
+EXEC_ACTION_START(GroupsGetSizeAction) {
+ string var = par1;
+ if (var.size() && var[0]=='$') var.erase(0,1);
+ string groupname = resolveVars(par2, sess, sc_sess, event_params);
+ DBG("posting event to group '%s'\n", groupname.c_str());
+ GroupsModule::groups_mut.lock();
+ int size = 0;
+ GroupMap::iterator grp = GroupsModule::groups.find(groupname);
+ if (grp != GroupsModule::groups.end()) {
+ size = grp->second.size();
+ }
+ GroupsModule::groups_mut.unlock();
+ sc_sess->var[var] = int2str(size);
+ DBG("get group '%s' size $%s=%d\n", groupname.c_str(), var.c_str(), size);
+} EXEC_ACTION_END;
+
CONST_ACTION_2P(GroupsPostEventAction, ',', true);
EXEC_ACTION_START(GroupsPostEventAction) {
string groupname = resolveVars(par1, sess, sc_sess, event_params);
diff --git a/apps/dsm/mods/mod_groups/ModGroups.h b/apps/dsm/mods/mod_groups/ModGroups.h
index 4305e9a..37c1c0f 100644
--- a/apps/dsm/mods/mod_groups/ModGroups.h
+++ b/apps/dsm/mods/mod_groups/ModGroups.h
@@ -60,7 +60,8 @@ DECLARE_MODULE_END;
DEF_ACTION_1P(GroupsJoinAction);
DEF_ACTION_1P(GroupsLeaveAction);
DEF_ACTION_1P(GroupsLeaveAllAction);
-/* DEF_ACTION_1P(GroupsGetAction); */
+DEF_ACTION_2P(GroupsGetAction);
+DEF_ACTION_2P(GroupsGetSizeAction);
/* DEF_ACTION_1P(GroupsGetMembersAction); */
DEF_ACTION_2P(GroupsPostEventAction);
diff --git a/doc/dsm/mods/Readme.mod_groups.txt b/doc/dsm/mods/Readme.mod_groups.txt
index 63248a1..4551229 100644
--- a/doc/dsm/mods/Readme.mod_groups.txt
+++ b/doc/dsm/mods/Readme.mod_groups.txt
@@ -21,6 +21,9 @@ Actions:
groups.postEvent(groupname, var1;var2) - post event to groupname with var1 and var2
groups.postEvent(groupname, var) - post event to groupname with all variables
+ groups.get(arrayname=groupname) - get all ltags of troupname in arrayname
+ groups.getSize(varname=groupname) - get size of group in varname
+
Example:
import(mod_groups);
--
1.9.3 (Apple Git-50)

@ -1,98 +0,0 @@
From 63d6e04f30e86f6d973dfe55ac6765c442ade026 Mon Sep 17 00:00:00 2001
From: Stefan Sayer <stefan.sayer@googlemail.com>
Date: Fri, 20 Feb 2015 21:36:49 +0100
Subject: [PATCH 6/7] dsm:mod_conference: flushMixInList action, loop for mix
in list
---
apps/dsm/mods/mod_conference/ModConference.cpp | 24 ++++++++++++++++++++----
apps/dsm/mods/mod_conference/ModConference.h | 4 ++--
doc/dsm/mods/Readme.mod_conference.txt | 5 ++++-
3 files changed, 26 insertions(+), 7 deletions(-)
diff --git a/apps/dsm/mods/mod_conference/ModConference.cpp b/apps/dsm/mods/mod_conference/ModConference.cpp
index 236cdd2..0028a14 100644
--- a/apps/dsm/mods/mod_conference/ModConference.cpp
+++ b/apps/dsm/mods/mod_conference/ModConference.cpp
@@ -51,6 +51,7 @@ MOD_ACTIONEXPORT_BEGIN(MOD_CLS_NAME) {
DEF_CMD("conference.setupMixIn", ConfSetupMixInAction);
DEF_CMD("conference.playMixIn", ConfPlayMixInAction);
DEF_CMD("conference.playMixInList", ConfPlayMixInListAction);
+ DEF_CMD("conference.flushMixInList", ConfFlushMixInListAction);
} MOD_ACTIONEXPORT_END;
@@ -402,9 +403,10 @@ EXEC_ACTION_START(ConfPlayMixInAction) {
} EXEC_ACTION_END;
-
+CONST_ACTION_2P(ConfPlayMixInListAction, ',', true);
EXEC_ACTION_START(ConfPlayMixInListAction) {
- string filename = resolveVars(arg, sess, sc_sess, event_params);
+ string filename = resolveVars(par1, sess, sc_sess, event_params);
+ bool loop = resolveVars(par2, sess, sc_sess, event_params) == "true";
bool has_playlist = true;
// get playlist
@@ -434,9 +436,10 @@ EXEC_ACTION_START(ConfPlayMixInListAction) {
throw DSMException("file", "path", filename);
}
sc_sess->transferOwnership(af);
+ af->loop.set(loop);
- DBG("adding file '%s' to mixin playlist\n", filename.c_str());
- l->addToPlaylist(new AmPlaylistItem(af, NULL));
+ DBG("adding file '%s' to mixin playlist\n", filename.c_str());
+ l->addToPlaylist(new AmPlaylistItem(af, NULL));
if (!has_playlist) {
// get mixin mixer
@@ -450,3 +453,16 @@ EXEC_ACTION_START(ConfPlayMixInListAction) {
m->mixin(l);
}
} EXEC_ACTION_END;
+
+EXEC_ACTION_START(ConfFlushMixInListAction) {
+ // get playlist
+ DSMDisposableT<AmPlaylist >* l_obj =
+ getDSMConfChannel<DSMDisposableT<AmPlaylist> >(sc_sess, CONF_AKEY_MIXLIST);
+ if (NULL == l_obj) {
+ DBG("no mix list present - not flushing list\n");
+ EXEC_ACTION_STOP;
+ }
+ AmPlaylist* l = l_obj->get();
+ l->flush();
+ DBG("flushed mixInList\n");
+} EXEC_ACTION_END;
diff --git a/apps/dsm/mods/mod_conference/ModConference.h b/apps/dsm/mods/mod_conference/ModConference.h
index 73c2f5b..c6cdc72 100644
--- a/apps/dsm/mods/mod_conference/ModConference.h
+++ b/apps/dsm/mods/mod_conference/ModConference.h
@@ -95,6 +95,6 @@ DEF_ACTION_1P(ConfTeeLeaveAction);
DEF_ACTION_2P(ConfSetupMixInAction);
DEF_ACTION_1P(ConfPlayMixInAction);
-DEF_ACTION_1P(ConfPlayMixInListAction);
-
+DEF_ACTION_2P(ConfPlayMixInListAction);
+DEF_ACTION_1P(ConfFlushMixInListAction);
#endif
diff --git a/doc/dsm/mods/Readme.mod_conference.txt b/doc/dsm/mods/Readme.mod_conference.txt
index f4c0acc..a626c96 100644
--- a/doc/dsm/mods/Readme.mod_conference.txt
+++ b/doc/dsm/mods/Readme.mod_conference.txt
@@ -49,6 +49,9 @@ conference.setupMixIn(float level, unsigned int seconds)
conference.playMixIn(string filename)
- mix in a file
-conference.playMixInList(string filename)
+conference.playMixInList(string filename [, loop=true])
- add a file to the mix-in playlist
- the list is setup when this is called for the first time and set as mixin source
+
+conference.flushMixInList()
+ - flush mix-in playlist
--
1.9.3 (Apple Git-50)

@ -38,9 +38,6 @@ Subject: [PATCH 7/7] confpin: simple pin conference app
create mode 100755 apps/confpin/tools/fetch_file
create mode 100755 apps/confpin/tools/push_file
diff --git a/apps/confpin/confpin.conf b/apps/confpin/confpin.conf
new file mode 100644
index 0000000..2af4d14
--- /dev/null
+++ b/apps/confpin/confpin.conf
@@ -0,0 +1,39 @@
@ -83,9 +80,6 @@ index 0000000..2af4d14
+run_invite_event=yes
+set_param_variables=yes
+run_system_dsms=sw_audio_api
diff --git a/apps/confpin/lib/confpin.dsm b/apps/confpin/lib/confpin.dsm
new file mode 100644
index 0000000..2f4f6de
--- /dev/null
+++ b/apps/confpin/lib/confpin.dsm
@@ -0,0 +1,237 @@
@ -326,9 +320,6 @@ index 0000000..2f4f6de
+transition "bye_recvd" (START,COLLECT_PIN,PLAY_FIN,TESTPINRESULT) - hangup / stop(false) -> END;
+
+state END;
diff --git a/apps/confpin/lib/sw_audio.dsm b/apps/confpin/lib/sw_audio.dsm
new file mode 100644
index 0000000..322266b
--- /dev/null
+++ b/apps/confpin/lib/sw_audio.dsm
@@ -0,0 +1,50 @@
@ -383,9 +374,6 @@ index 0000000..322266b
+ swPlayFile();
+};
\ No newline at end of file
diff --git a/apps/confpin/lib/sw_audio_api.dsm b/apps/confpin/lib/sw_audio_api.dsm
new file mode 100644
index 0000000..aba8d25
--- /dev/null
+++ b/apps/confpin/lib/sw_audio_api.dsm
@@ -0,0 +1,66 @@
@ -456,9 +444,6 @@ index 0000000..aba8d25
+
+state SW_AUDIO_END;
\ No newline at end of file
diff --git a/apps/confpin/prompts/Makefile b/apps/confpin/prompts/Makefile
new file mode 100644
index 0000000..25028e8
--- /dev/null
+++ b/apps/confpin/prompts/Makefile
@@ -0,0 +1,22 @@
@ -485,65 +470,38 @@ index 0000000..25028e8
+clean:
+ rm -f *.dbs *.wav
\ No newline at end of file
diff --git a/apps/confpin/prompts/conference_first.txt b/apps/confpin/prompts/conference_first.txt
new file mode 100644
index 0000000..1589216
--- /dev/null
+++ b/apps/confpin/prompts/conference_first.txt
@@ -0,0 +1 @@
+you are the first participant in the conference.
diff --git a/apps/confpin/prompts/conference_greeting.txt b/apps/confpin/prompts/conference_greeting.txt
new file mode 100644
index 0000000..ac5cadc
--- /dev/null
+++ b/apps/confpin/prompts/conference_greeting.txt
@@ -0,0 +1 @@
+welcome to the conference, please enter your pin number
diff --git a/apps/confpin/prompts/conference_join.txt b/apps/confpin/prompts/conference_join.txt
new file mode 100644
index 0000000..58e771a
--- /dev/null
+++ b/apps/confpin/prompts/conference_join.txt
@@ -0,0 +1 @@
+someone joined the conference
diff --git a/apps/confpin/prompts/conference_joined.txt b/apps/confpin/prompts/conference_joined.txt
new file mode 100644
index 0000000..29a4feb
--- /dev/null
+++ b/apps/confpin/prompts/conference_joined.txt
@@ -0,0 +1 @@
+you joined the conference
diff --git a/apps/confpin/prompts/conference_leave.txt b/apps/confpin/prompts/conference_leave.txt
new file mode 100644
index 0000000..2a5a881
--- /dev/null
+++ b/apps/confpin/prompts/conference_leave.txt
@@ -0,0 +1 @@
+someone left the conference
diff --git a/apps/confpin/prompts/conference_music.txt b/apps/confpin/prompts/conference_music.txt
new file mode 100644
index 0000000..d075594
--- /dev/null
+++ b/apps/confpin/prompts/conference_music.txt
@@ -0,0 +1 @@
+bum bada bum bum bamm, bamm bada bamm bamm bamm, hum di dum di dum dum dumm
diff --git a/apps/confpin/prompts/conference_pin_wrong.txt b/apps/confpin/prompts/conference_pin_wrong.txt
new file mode 100644
index 0000000..16a203a
--- /dev/null
+++ b/apps/confpin/prompts/conference_pin_wrong.txt
@@ -0,0 +1 @@
+sorry, that pin is wrong. please try again
diff --git a/apps/confpin/prompts/goodbye.txt b/apps/confpin/prompts/goodbye.txt
new file mode 100644
index 0000000..024d23d
--- /dev/null
+++ b/apps/confpin/prompts/goodbye.txt
@@ -0,0 +1 @@
+good bye
diff --git a/apps/confpin/tools/clear_file b/apps/confpin/tools/clear_file
new file mode 100755
index 0000000..a3bf106
--- /dev/null
+++ b/apps/confpin/tools/clear_file
@@ -0,0 +1,14 @@
@ -562,9 +520,6 @@ index 0000000..a3bf106
+#print s.di('sbc','loadProfile',p)
+print s.di('dsm', 'postDSMEvent', 'sw_audio', [['cmd', 'clearFile'],['audio_id', sys.argv[1]],['sound_set_id', sys.argv[2]]])
\ No newline at end of file
diff --git a/apps/confpin/tools/fetch_file b/apps/confpin/tools/fetch_file
new file mode 100755
index 0000000..bb54ae6
--- /dev/null
+++ b/apps/confpin/tools/fetch_file
@@ -0,0 +1,14 @@
@ -583,9 +538,6 @@ index 0000000..bb54ae6
+#print s.di('sbc','loadProfile',p)
+print s.di('dsm', 'postDSMEvent', 'sw_audio', [['cmd', 'fetchFile'],['audio_id', sys.argv[1]],['sound_set_id', sys.argv[2]]])
\ No newline at end of file
diff --git a/apps/confpin/tools/push_file b/apps/confpin/tools/push_file
new file mode 100755
index 0000000..d949d99
--- /dev/null
+++ b/apps/confpin/tools/push_file
@@ -0,0 +1,14 @@
@ -603,6 +555,3 @@ index 0000000..d949d99
+#p ={ 'name' : sys.argv[1], 'path' : sys.argv[2] }
+#print s.di('sbc','loadProfile',p)
+print s.di('dsm','postDSMEvent', 'sw_audio', [['cmd', 'pushFile'],['audio_id', sys.argv[1]],['sound_set_id', sys.argv[2]]])
--
1.9.3 (Apple Git-50)

Loading…
Cancel
Save