Built motion from commit (unavailable).|2.4.3
[motion2.git] / server / api / voiceMusicOnHold / voiceMusicOnHold.rpc.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 _0x59ec=['message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error'];(function(_0x1b665d,_0x2a4946){var _0x3e7e33=function(_0x5f4549){while(--_0x5f4549){_0x1b665d['push'](_0x1b665d['shift']());}};_0x3e7e33(++_0x2a4946);}(_0x59ec,0x192));var _0xc59e=function(_0x1ffa9d,_0x5824f9){_0x1ffa9d=_0x1ffa9d-0x0;var _0x5e704b=_0x59ec[_0x1ffa9d];return _0x5e704b;};'use strict';var _=require(_0xc59e('0x0'));var util=require('util');var moment=require(_0xc59e('0x1'));var BPromise=require(_0xc59e('0x2'));var rs=require(_0xc59e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc59e('0x4'))['db'];var utils=require(_0xc59e('0x5'));var logger=require(_0xc59e('0x6'))('rpc');var config=require(_0xc59e('0x7'));var jayson=require(_0xc59e('0x8'));var client=jayson[_0xc59e('0x9')][_0xc59e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x32d323,_0x5ad71a,_0x10e758){return new BPromise(function(_0x50580d,_0x394068){return client['request'](_0x32d323,_0x10e758)['then'](function(_0x58c8e1){logger[_0xc59e('0xb')](_0xc59e('0xc'),_0x5ad71a,_0xc59e('0xd'));logger[_0xc59e('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x5ad71a,'request\x20sent',JSON[_0xc59e('0xf')](_0x58c8e1));if(_0x58c8e1['error']){if(_0x58c8e1['error'][_0xc59e('0x10')]===0x1f4){logger[_0xc59e('0x11')](_0xc59e('0xc'),_0x5ad71a,_0x58c8e1[_0xc59e('0x11')][_0xc59e('0x12')]);return _0x394068(_0x58c8e1[_0xc59e('0x11')][_0xc59e('0x12')]);}logger['error'](_0xc59e('0xc'),_0x5ad71a,_0x58c8e1[_0xc59e('0x11')][_0xc59e('0x12')]);return _0x50580d(_0x58c8e1[_0xc59e('0x11')][_0xc59e('0x12')]);}else{logger[_0xc59e('0xb')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5ad71a,_0xc59e('0xd'));_0x50580d(_0x58c8e1[_0xc59e('0x13')][_0xc59e('0x12')]);}})[_0xc59e('0x14')](function(_0x49f122){logger[_0xc59e('0x11')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5ad71a,_0x49f122);_0x394068(_0x49f122);});});}