Built motion from commit fade34fd.|2.5.41
[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 _0xff0d=['info','util','mustache','../../../../config/logger','trigger','data2','Script','data3','render','exec','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s'];(function(_0x2fff83,_0x29d5fe){var _0xa2a722=function(_0x18b6b0){while(--_0x18b6b0){_0x2fff83['push'](_0x2fff83['shift']());}};_0xa2a722(++_0x29d5fe);}(_0xff0d,0xa9));var _0xdff0=function(_0x1ccbcc,_0x5c948b){_0x1ccbcc=_0x1ccbcc-0x0;var _0x1e873f=_0xff0d[_0x1ccbcc];return _0x1e873f;};'use strict';var util=require(_0xdff0('0x0'));var sh=require('shelljs');var Mustache=require(_0xdff0('0x1'));var logger=require(_0xdff0('0x2'))(_0xdff0('0x3'));exports['exec']=function(_0x3fd3c5,_0x419862){var _0x4057f4=_0x3fd3c5[_0xdff0('0x4')]?_0x3fd3c5[_0xdff0('0x4')]:_0xdff0('0x5');var _0x324888=_0x3fd3c5[_0xdff0('0x6')]?Mustache[_0xdff0('0x7')](_0x3fd3c5['data3'],_0x419862):_0x419862;sh[_0xdff0('0x8')](_0x324888,function(_0x495958,_0x32cbe3,_0x2d637f){if(_0x495958!==0x0){logger['error'](util[_0xdff0('0x9')](_0xdff0('0xa'),_0x4057f4,_0x324888,_0x495958,_0x2d637f));}else{logger[_0xdff0('0xb')](util[_0xdff0('0x9')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x4057f4,_0x324888,_0x32cbe3));}});};