20836577d9b04810c6b604a71b8585194baf0efc
[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 _0xf342=['info','VoiceMusicOnHold,\x20%s,\x20%s','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then'];(function(_0x3dc73c,_0x2a4784){var _0x40e5fc=function(_0x643425){while(--_0x643425){_0x3dc73c['push'](_0x3dc73c['shift']());}};_0x40e5fc(++_0x2a4784);}(_0xf342,0xf0));var _0x2f34=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf342[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2f34('0x0'));var util=require(_0x2f34('0x1'));var moment=require(_0x2f34('0x2'));var BPromise=require(_0x2f34('0x3'));var rs=require(_0x2f34('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2f34('0x5'))['db'];var utils=require(_0x2f34('0x6'));var logger=require(_0x2f34('0x7'))(_0x2f34('0x8'));var config=require(_0x2f34('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2f34('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28dd8a,_0x52af96,_0x1ea265){return new BPromise(function(_0x234e7b,_0x1569cc){return client[_0x2f34('0xb')](_0x28dd8a,_0x1ea265)[_0x2f34('0xc')](function(_0x440a4a){logger[_0x2f34('0xd')](_0x2f34('0xe'),_0x52af96,'request\x20sent');logger[_0x2f34('0xf')](_0x2f34('0x10'),_0x52af96,'request\x20sent',JSON['stringify'](_0x440a4a));if(_0x440a4a[_0x2f34('0x11')]){if(_0x440a4a[_0x2f34('0x11')][_0x2f34('0x12')]===0x1f4){logger['error'](_0x2f34('0xe'),_0x52af96,_0x440a4a[_0x2f34('0x11')][_0x2f34('0x13')]);return _0x1569cc(_0x440a4a[_0x2f34('0x11')][_0x2f34('0x13')]);}logger['error'](_0x2f34('0xe'),_0x52af96,_0x440a4a[_0x2f34('0x11')][_0x2f34('0x13')]);return _0x234e7b(_0x440a4a[_0x2f34('0x11')][_0x2f34('0x13')]);}else{logger[_0x2f34('0xd')](_0x2f34('0xe'),_0x52af96,_0x2f34('0x14'));_0x234e7b(_0x440a4a[_0x2f34('0x15')][_0x2f34('0x13')]);}})[_0x2f34('0x16')](function(_0x153906){logger[_0x2f34('0x11')](_0x2f34('0xe'),_0x52af96,_0x153906);_0x1569cc(_0x153906);});});}