Built motion from commit b45d4e0.|0.0.147
[motion.git] / server / models / voice_extension.js
index 441a5ad..a3fe960 100644 (file)
@@ -74,6 +74,24 @@ module.exports = function(sequelize, DataTypes) {
             }
           } else if (this.getDataValue('app') === 'Set' || this.getDataValue('appType') === 'custom') {
             return [this.getDataValue('appdata')];
+          } else if (this.getDataValue('app') === 'Queue' && this.getDataValue('appType') !== 'custom') {
+            appdata = reverseMustache({
+              template: '{{queue}},{{options}},{{url}},{{announceoverride}},{{timeout}},{{agi}},{{macro}},{{gosub}},{{rule}},{{position}}',
+              content: this.getDataValue('appdata')
+            });
+            if (appdata) {
+              return [appdata.queue, appdata.options, appdata.url, appdata.announceoverride, appdata.timeout, appdata.agi, appdata.macro, appdata.gosub, appdata.rule, appdata.position];
+            } else {
+              appdata = reverseMustache({ // for retrocompatibility
+                template: '{{queue}},{{options}},{{url}},{{announceoverride}},{{timeout}}',
+                content: this.getDataValue('appdata')
+              });
+              if (appdata) {
+                return [appdata.queue, appdata.options, appdata.url, appdata.announceoverride, appdata.timeout, '', '', '', '', ''];
+              } else {
+                return ['', '', '', '', '', '', '', '', '', ''];
+              }
+            }
           } else {
             return this.getDataValue('appdata').split(',');
           }