Built motion from commit (unavailable).|2.5.21
[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 _0x3b40=['../../config/environment','client','http','request','then','debug','request\x20sent','stringify','error','code','VoiceMusicOnHold,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0x3b40,0x6b));var _0x03b4=function(_0x22e2f3,_0x3b2528){_0x22e2f3=_0x22e2f3-0x0;var _0x476438=_0x3b40[_0x22e2f3];return _0x476438;};'use strict';var _=require(_0x03b4('0x0'));var util=require(_0x03b4('0x1'));var moment=require(_0x03b4('0x2'));var BPromise=require(_0x03b4('0x3'));var rs=require(_0x03b4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x03b4('0x5'))['db'];var utils=require(_0x03b4('0x6'));var logger=require('../../config/logger')(_0x03b4('0x7'));var config=require(_0x03b4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x03b4('0x9')][_0x03b4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a34ec,_0x572723,_0x3a6d73){return new BPromise(function(_0x1323f2,_0x5938be){return client[_0x03b4('0xb')](_0x1a34ec,_0x3a6d73)[_0x03b4('0xc')](function(_0x2bb591){logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x572723,'request\x20sent');logger[_0x03b4('0xd')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x572723,_0x03b4('0xe'),JSON[_0x03b4('0xf')](_0x2bb591));if(_0x2bb591['error']){if(_0x2bb591[_0x03b4('0x10')][_0x03b4('0x11')]===0x1f4){logger[_0x03b4('0x10')](_0x03b4('0x12'),_0x572723,_0x2bb591['error']['message']);return _0x5938be(_0x2bb591[_0x03b4('0x10')][_0x03b4('0x13')]);}logger[_0x03b4('0x10')](_0x03b4('0x12'),_0x572723,_0x2bb591['error'][_0x03b4('0x13')]);return _0x1323f2(_0x2bb591['error'][_0x03b4('0x13')]);}else{logger[_0x03b4('0x14')](_0x03b4('0x12'),_0x572723,_0x03b4('0xe'));_0x1323f2(_0x2bb591[_0x03b4('0x15')][_0x03b4('0x13')]);}})[_0x03b4('0x16')](function(_0xd26d5f){logger[_0x03b4('0x10')](_0x03b4('0x12'),_0x572723,_0xd26d5f);_0x5938be(_0xd26d5f);});});}