Built motion from commit 9d0783e6.|2.6.13
[motion2.git] / server / services / ami / trigger / script / index.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0xc0df=['exec','data2','Script','data3','error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','shelljs','mustache','../../../../config/logger'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xc0df,0x1a1));var _0xfc0d=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xc0df[_0x4b369d];return _0x571a98;};'use strict';var util=require('util');var sh=require(_0xfc0d('0x0'));var Mustache=require(_0xfc0d('0x1'));var logger=require(_0xfc0d('0x2'))('trigger');exports[_0xfc0d('0x3')]=function(_0x5ecd22,_0x23eaa4){var _0x252844=_0x5ecd22['data2']?_0x5ecd22[_0xfc0d('0x4')]:_0xfc0d('0x5');var _0x94c576=_0x5ecd22[_0xfc0d('0x6')]?Mustache['render'](_0x5ecd22[_0xfc0d('0x6')],_0x23eaa4):_0x23eaa4;sh['exec'](_0x94c576,function(_0x4204d2,_0x1bddf5,_0x5b7248){if(_0x4204d2!==0x0){logger[_0xfc0d('0x7')](util['format'](_0xfc0d('0x8'),_0x252844,_0x94c576,_0x4204d2,_0x5b7248));}else{logger[_0xfc0d('0x9')](util[_0xfc0d('0xa')](_0xfc0d('0xb'),_0x252844,_0x94c576,_0x1bddf5));}});};