Built motion from commit (unavailable).|2.5.20
[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 _0x4c3b=['stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3cb6d8,_0x19ff85){var _0x5c7088=function(_0x731044){while(--_0x731044){_0x3cb6d8['push'](_0x3cb6d8['shift']());}};_0x5c7088(++_0x19ff85);}(_0x4c3b,0xa1));var _0xb4c3=function(_0x4dcd01,_0x3334d4){_0x4dcd01=_0x4dcd01-0x0;var _0x4ce410=_0x4c3b[_0x4dcd01];return _0x4ce410;};'use strict';var _=require('lodash');var util=require(_0xb4c3('0x0'));var moment=require(_0xb4c3('0x1'));var BPromise=require(_0xb4c3('0x2'));var rs=require(_0xb4c3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb4c3('0x4'));var logger=require(_0xb4c3('0x5'))(_0xb4c3('0x6'));var config=require(_0xb4c3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb4c3('0x8')][_0xb4c3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x42ad78,_0xe1582f,_0x1edd46){return new BPromise(function(_0x279f5e,_0x5e8f19){return client[_0xb4c3('0xa')](_0x42ad78,_0x1edd46)[_0xb4c3('0xb')](function(_0x4cd621){logger['info'](_0xb4c3('0xc'),_0xe1582f,_0xb4c3('0xd'));logger[_0xb4c3('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0xe1582f,_0xb4c3('0xd'),JSON[_0xb4c3('0xf')](_0x4cd621));if(_0x4cd621[_0xb4c3('0x10')]){if(_0x4cd621[_0xb4c3('0x10')][_0xb4c3('0x11')]===0x1f4){logger[_0xb4c3('0x10')](_0xb4c3('0xc'),_0xe1582f,_0x4cd621[_0xb4c3('0x10')][_0xb4c3('0x12')]);return _0x5e8f19(_0x4cd621[_0xb4c3('0x10')][_0xb4c3('0x12')]);}logger[_0xb4c3('0x10')](_0xb4c3('0xc'),_0xe1582f,_0x4cd621[_0xb4c3('0x10')]['message']);return _0x279f5e(_0x4cd621['error'][_0xb4c3('0x12')]);}else{logger[_0xb4c3('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0xe1582f,_0xb4c3('0xd'));_0x279f5e(_0x4cd621[_0xb4c3('0x14')][_0xb4c3('0x12')]);}})[_0xb4c3('0x15')](function(_0x4f9346){logger[_0xb4c3('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0xe1582f,_0x4f9346);_0x5e8f19(_0x4f9346);});});}