X-Git-Url: http://repos.xcallymotion.com/?a=blobdiff_plain;f=server%2Fmodels%2Fvoice_extension.js;h=a3fe96061f6ad1e4873bea9c352b0ea011910fd8;hb=4a2787f50c315de798d62cc0d6ceee6712bc35f6;hp=441a5ad36cb94710c826b6e009140fc45006b41b;hpb=8185dd6add91869b87ce140246bbb27d61474401;p=motion.git diff --git a/server/models/voice_extension.js b/server/models/voice_extension.js index 441a5ad..a3fe960 100644 --- a/server/models/voice_extension.js +++ b/server/models/voice_extension.js @@ -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(','); }