Built motion from commit (unavailable).|2.4.19
[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 _0x1a70=['debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceMusicOnHold,\x20%s,\x20%s','message','info','lodash','bluebird','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent'];(function(_0xd3bcf8,_0x994fdb){var _0x296170=function(_0x2f5519){while(--_0x2f5519){_0xd3bcf8['push'](_0xd3bcf8['shift']());}};_0x296170(++_0x994fdb);}(_0x1a70,0x197));var _0x01a7=function(_0x16fe3d,_0x49dc87){_0x16fe3d=_0x16fe3d-0x0;var _0x1e354f=_0x1a70[_0x16fe3d];return _0x1e354f;};'use strict';var _=require(_0x01a7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x01a7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x01a7('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x01a7('0x3'));var config=require(_0x01a7('0x4'));var jayson=require(_0x01a7('0x5'));var client=jayson[_0x01a7('0x6')][_0x01a7('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x56e868,_0x52c45e,_0x252f11){return new BPromise(function(_0x341685,_0x3f9ffd){return client[_0x01a7('0x8')](_0x56e868,_0x252f11)[_0x01a7('0x9')](function(_0x48306c){logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x52c45e,_0x01a7('0xa'));logger[_0x01a7('0xb')](_0x01a7('0xc'),_0x52c45e,'request\x20sent',JSON[_0x01a7('0xd')](_0x48306c));if(_0x48306c[_0x01a7('0xe')]){if(_0x48306c[_0x01a7('0xe')][_0x01a7('0xf')]===0x1f4){logger[_0x01a7('0xe')](_0x01a7('0x10'),_0x52c45e,_0x48306c['error']['message']);return _0x3f9ffd(_0x48306c[_0x01a7('0xe')][_0x01a7('0x11')]);}logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x52c45e,_0x48306c[_0x01a7('0xe')][_0x01a7('0x11')]);return _0x341685(_0x48306c['error'][_0x01a7('0x11')]);}else{logger[_0x01a7('0x12')](_0x01a7('0x10'),_0x52c45e,_0x01a7('0xa'));_0x341685(_0x48306c['result'][_0x01a7('0x11')]);}})['catch'](function(_0x35268c){logger[_0x01a7('0xe')](_0x01a7('0x10'),_0x52c45e,_0x35268c);_0x3f9ffd(_0x35268c);});});}