* Much better flow for mciReady in relation to pausing, etc. using callbacks

This commit is contained in:
Bryan Ashby
2015-07-29 22:09:51 -06:00
parent 44a0f87a24
commit a15067fc21
4 changed files with 90 additions and 99 deletions

View File

@@ -55,15 +55,18 @@ LastCallersModule.prototype.enter = function(client) {
}
};
LastCallersModule.prototype.mciReady = function(mciData) {
LastCallersModule.super_.prototype.mciReady.call(this, mciData);
LastCallersModule.prototype.mciReady = function(mciData, cb) {
var self = this;
var vc = self.viewControllers.lastCallers = new ViewController( { client : self.client } );
var loginHistory;
async.series(
[
function callParentMciReady(callback) {
LastCallersModule.super_.prototype.mciReady.call(this, mciData, function parentMciReady(err) {
callback(err);
});
},
function loadFromConfig(callback) {
var loadOpts = {
callingMenu : self,
@@ -155,10 +158,15 @@ LastCallersModule.prototype.mciReady = function(mciData) {
row++;
});
callback(null);
}
],
function complete(err) {
self.client.log.error(err);
if(err) {
self.client.log.error(err);
}
cb(err);
}
);
};

View File

@@ -34,8 +34,8 @@
}
*/
"menus" : {
"art" : "CONNECT",
"connected" : {
"art" : "CONNECT",
"next" : "matrix",
"options" : {
"cls" : true,
@@ -191,24 +191,18 @@
},
"newUserActive" : {
"art" : "SO-CC1.ANS",
"options" : { "cls" : true },
"action" : "@menu:currentUserStats",
"pause" : "end"
"options" : { "cls" : true, "pause" : true },
"action" : "@menu:currentUserStats"
},
"currentUserStats" : {
"art" : "userstats",
//"prompt" : "pause",
"options" : {
// :TODO: implement MCI codes for this
"cls" : true
},
"pause" : true,
"options" : { "cls" : true, "pause" : true },
"action" : "@menu:lastCallers"
},
"lastCallers" :{
"module" : "last_callers",
"art" : "LASTCALL.ANS",
"options" : { "cls" : true },
"options" : { "cls" : true, "pause" : true },
"config" : {
"dateTimeFormat" : "ddd MMM Do H:mm a"
},