Built motion from commit d5e4af8c.|2.6.23
[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 _0x6bd0=['error','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','mustache','trigger','exec','data2','Script','render','data3'];(function(_0x153da6,_0xc9bfde){var _0xf01a0d=function(_0x409ed5){while(--_0x409ed5){_0x153da6['push'](_0x153da6['shift']());}};_0xf01a0d(++_0xc9bfde);}(_0x6bd0,0x161));var _0x06bd=function(_0x548924,_0x18acc1){_0x548924=_0x548924-0x0;var _0x36bbdc=_0x6bd0[_0x548924];return _0x36bbdc;};'use strict';var util=require('util');var sh=require('shelljs');var Mustache=require(_0x06bd('0x0'));var logger=require('../../../../config/logger')(_0x06bd('0x1'));exports[_0x06bd('0x2')]=function(_0x25d35b,_0x121763){var _0x47a4d5=_0x25d35b[_0x06bd('0x3')]?_0x25d35b['data2']:_0x06bd('0x4');var _0x367489=_0x25d35b['data3']?Mustache[_0x06bd('0x5')](_0x25d35b[_0x06bd('0x6')],_0x121763):_0x121763;sh['exec'](_0x367489,function(_0x1cfbd2,_0x4c5cc0,_0x678e85){if(_0x1cfbd2!==0x0){logger[_0x06bd('0x7')](util[_0x06bd('0x8')]('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x47a4d5,_0x367489,_0x1cfbd2,_0x678e85));}else{logger['info'](util[_0x06bd('0x8')](_0x06bd('0x9'),_0x47a4d5,_0x367489,_0x4c5cc0));}});};