Built motion from commit 7158bc59.|2.5.42
[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 _0x26f4=['trigger','exec','data2','Script','data3','render','error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','format','shelljs','mustache','../../../../config/logger'];(function(_0x19ecb5,_0x8fc0b9){var _0x4f2ae3=function(_0x2d358a){while(--_0x2d358a){_0x19ecb5['push'](_0x19ecb5['shift']());}};_0x4f2ae3(++_0x8fc0b9);}(_0x26f4,0x1aa));var _0x426f=function(_0x9f4475,_0x1d734e){_0x9f4475=_0x9f4475-0x0;var _0x495cb1=_0x26f4[_0x9f4475];return _0x495cb1;};'use strict';var util=require('util');var sh=require(_0x426f('0x0'));var Mustache=require(_0x426f('0x1'));var logger=require(_0x426f('0x2'))(_0x426f('0x3'));exports[_0x426f('0x4')]=function(_0x4fcea6,_0x204e4a){var _0x1e9cc6=_0x4fcea6[_0x426f('0x5')]?_0x4fcea6[_0x426f('0x5')]:_0x426f('0x6');var _0x468ef5=_0x4fcea6[_0x426f('0x7')]?Mustache[_0x426f('0x8')](_0x4fcea6['data3'],_0x204e4a):_0x204e4a;sh['exec'](_0x468ef5,function(_0x4d1a15,_0x19ac8f,_0x2b17cc){if(_0x4d1a15!==0x0){logger[_0x426f('0x9')](util['format'](_0x426f('0xa'),_0x1e9cc6,_0x468ef5,_0x4d1a15,_0x2b17cc));}else{logger[_0x426f('0xb')](util[_0x426f('0xc')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x1e9cc6,_0x468ef5,_0x19ac8f));}});};