Module: sems Branch: master Commit: c352ac61a1ca9d642d81b3e0951faa1ebf714296 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=c352ac61a1ca9d642d81b3e0951faa1ebf714296
Author: Stefan Sayer <[email protected]> Committer: Stefan Sayer <[email protected]> Date: Sat Dec 21 16:01:34 2013 +0100 dsm: closePlaylist() -> flushPlaylist() in examples/docs --- apps/dsm/DSMCoreModule.cpp | 6 ++++++ apps/dsm/DSMCoreModule.h | 1 + doc/dsm/dsm_syntax.txt | 3 +-- doc/dsm/mods/Readme.mod_conference.txt | 2 +- doc/dsm/mods/Readme.mod_py.txt | 2 +- .../tutorials/quizconnect/quizconnect_callee.dsm | 4 ++-- .../tutorials/quizconnect/quizconnect_caller.dsm | 2 +- .../tutorials/quizconnect/quizconnect_tutorial.txt | 8 ++++---- 8 files changed, 17 insertions(+), 11 deletions(-) diff --git a/apps/dsm/DSMCoreModule.cpp b/apps/dsm/DSMCoreModule.cpp index 8902c45..29b58b1 100644 --- a/apps/dsm/DSMCoreModule.cpp +++ b/apps/dsm/DSMCoreModule.cpp @@ -67,6 +67,7 @@ DSMAction* DSMCoreModule::getAction(const string& from_str) { DEF_CMD("getRecordLength", SCGetRecordLengthAction); DEF_CMD("getRecordDataSize", SCGetRecordDataSizeAction); DEF_CMD("flushPlaylist", SCFlushPlaylistAction); + DEF_CMD("closePlaylist", SCClosePlaylistAction); // deprecated DEF_CMD("setInOutPlaylist", SCSetInOutPlaylistAction); DEF_CMD("setInputPlaylist", SCSetInputPlaylistAction); DEF_CMD("setOutputPlaylist", SCSetOutputPlaylistAction); @@ -398,6 +399,11 @@ EXEC_ACTION_START(SCFlushPlaylistAction) { sc_sess->flushPlaylist(); } EXEC_ACTION_END; +EXEC_ACTION_START(SCClosePlaylistAction) { + WARN("closePlaylist() is deprecated - please use flushPlaylist() instead\n"); + sc_sess->flushPlaylist(); +} EXEC_ACTION_END; + EXEC_ACTION_START(SCSetInOutPlaylistAction) { sc_sess->setInOutPlaylist(); diff --git a/apps/dsm/DSMCoreModule.h b/apps/dsm/DSMCoreModule.h index c463051..62efe1a 100644 --- a/apps/dsm/DSMCoreModule.h +++ b/apps/dsm/DSMCoreModule.h @@ -55,6 +55,7 @@ DEF_ACTION_1P(SCStopRecordAction); DEF_ACTION_1P(SCGetRecordDataSizeAction); DEF_ACTION_1P(SCGetRecordLengthAction); DEF_ACTION_1P(SCFlushPlaylistAction); +DEF_ACTION_1P(SCClosePlaylistAction); DEF_ACTION_1P(SCSetInOutPlaylistAction); DEF_ACTION_1P(SCSetInputPlaylistAction); DEF_ACTION_1P(SCSetOutputPlaylistAction); diff --git a/doc/dsm/dsm_syntax.txt b/doc/dsm/dsm_syntax.txt index 185c0d0..b574ee7 100644 --- a/doc/dsm/dsm_syntax.txt +++ b/doc/dsm/dsm_syntax.txt @@ -142,8 +142,7 @@ Playing prompts and file I/O stopRecord() getRecordLength([dst_varname]) -- only while recording! default dst var: record_length getRecordDataSize([dst_varname]) -- only while recording! default dst var: record_data_size - closePlaylist(notify=true) - if notify=true, send an event + flushPlaylist() setInOutPlaylist() set playlist as input and output setInputPlaylist() diff --git a/doc/dsm/mods/Readme.mod_conference.txt b/doc/dsm/mods/Readme.mod_conference.txt index 060434a..1df3b3e 100644 --- a/doc/dsm/mods/Readme.mod_conference.txt +++ b/doc/dsm/mods/Readme.mod_conference.txt @@ -4,7 +4,7 @@ Actions: Throws "conference" Exception if conference can not be joined (currently never). conference.leave() - destroy conference channel. Close playlist first!!!!! + destroy conference channel. Flush playlist with flushPlaylist() first!!!!! * Sets $errno (script). conference.rejoin(string roomname [, string mode]) diff --git a/doc/dsm/mods/Readme.mod_py.txt b/doc/dsm/mods/Readme.mod_py.txt index b6ad114..a448e8b 100644 --- a/doc/dsm/mods/Readme.mod_py.txt +++ b/doc/dsm/mods/Readme.mod_py.txt @@ -115,7 +115,7 @@ FUNCTIONS addSeparator(string name[, bool front]) add a named separator to playlist - closePlaylist(bool notify) + flushPlaylist() close the playlist connectMedia() diff --git a/doc/dsm/tutorials/quizconnect/quizconnect_callee.dsm b/doc/dsm/tutorials/quizconnect/quizconnect_callee.dsm index 7d31616..89ad70f 100644 --- a/doc/dsm/tutorials/quizconnect/quizconnect_callee.dsm +++ b/doc/dsm/tutorials/quizconnect/quizconnect_callee.dsm @@ -18,10 +18,10 @@ state ENTER_PIN; transition "got cancel from A leg" (START, RUN_INVITE, ENTER_PIN) - event(#a_status==CANCEL) / stop(true) -> END; transition "pressed a number" ENTER_PIN - key(#key<10) / { - closePlaylist(false); + flushPlaylist(); append($entered_pin, #key); } -> TEST_PIN; -transition "pressed hash or start" ENTER_PIN - key / closePlaylist(false) -> TEST_PIN_FINAL; +transition "pressed hash or start" ENTER_PIN - key / flushPlaylist() -> TEST_PIN_FINAL; state TEST_PIN enter { diff --git a/doc/dsm/tutorials/quizconnect/quizconnect_caller.dsm b/doc/dsm/tutorials/quizconnect/quizconnect_caller.dsm index 7421854..0f977b1 100644 --- a/doc/dsm/tutorials/quizconnect/quizconnect_caller.dsm +++ b/doc/dsm/tutorials/quizconnect/quizconnect_caller.dsm @@ -133,7 +133,7 @@ transition "one more to cancel" CANCEL_OTHER_CALLEES - test($callee_counter<$db. } -> CANCEL_OTHER_CALLEES; transition "canceled all" CANCEL_OTHER_CALLEES - test($callee_counter==$db.rows) / { - closePlaylist(false); + flushPlaylist(); dlg.acceptInvite(200, OK); conference.join(@local_tag); } -> CONNECTED; diff --git a/doc/dsm/tutorials/quizconnect/quizconnect_tutorial.txt b/doc/dsm/tutorials/quizconnect/quizconnect_tutorial.txt index 577c4bc..6400da5 100644 --- a/doc/dsm/tutorials/quizconnect/quizconnect_tutorial.txt +++ b/doc/dsm/tutorials/quizconnect/quizconnect_tutorial.txt @@ -502,14 +502,14 @@ transition "pin doesn't match" TEST_PIN_FINAL - test($pin!=$entered_pin) / { state MATCHING_PIN; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -That works, but we want to break the prompt when the user enters a key, so we add closePlaylist(false), which stops playback of currently playing items in the playlist, but doesn't generate an event: +That works, but we want to break the prompt when the user enters a key, so we add flushPlaylist(), which stops playback of currently playing items in the playlist (and doesn't generate an event): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ transition "pressed a number" ENTER_PIN - key(#key<10) / { - closePlaylist(false); + flushPlaylist(); append($entered_pin, #key); } -> TEST_PIN; -transition "pressed hash or start" ENTER_PIN - key / closePlaylist(false) -> TEST_PIN_FINAL; +transition "pressed hash or start" ENTER_PIN - key / flushPlaylist() -> TEST_PIN_FINAL; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Now I realize we need to pass the id of the caller leg to the callee leg as well, so we can post back events: @@ -564,7 +564,7 @@ transition "one more to cancel" CANCEL_OTHER_CALLEES - test($callee_counter<$db. } -> CANCEL_OTHER_CALLEES; transition "canceled all" CANCEL_OTHER_CALLEES - test($callee_counter==$db.rows) / { - closePlaylist(false); + flushPlaylist(); dlg.acceptInvite(200, OK); conference.join(@local_tag); } -> CONNECTED; _______________________________________________ Semsdev mailing list [email protected] http://lists.iptel.org/mailman/listinfo/semsdev
