Built motion from commit (unavailable).|2.5.22
[motion2.git] / server / api / teamVoiceQueue / teamVoiceQueue.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 _0x6a0d=['client','http','request','then','TeamVoiceQueue,\x20%s,\x20%s','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x490eba,_0x518ea9){var _0x37ac7b=function(_0xb0e9ab){while(--_0xb0e9ab){_0x490eba['push'](_0x490eba['shift']());}};_0x37ac7b(++_0x518ea9);}(_0x6a0d,0x6d));var _0xd6a0=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x6a0d[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var util=require(_0xd6a0('0x0'));var moment=require(_0xd6a0('0x1'));var BPromise=require(_0xd6a0('0x2'));var rs=require(_0xd6a0('0x3'));var fs=require('fs');var Redis=require(_0xd6a0('0x4'));var db=require(_0xd6a0('0x5'))['db'];var utils=require(_0xd6a0('0x6'));var logger=require(_0xd6a0('0x7'))(_0xd6a0('0x8'));var config=require(_0xd6a0('0x9'));var jayson=require(_0xd6a0('0xa'));var client=jayson[_0xd6a0('0xb')][_0xd6a0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x83a9c9,_0x1b0c77,_0x98235){return new BPromise(function(_0x3f5908,_0xaea262){return client[_0xd6a0('0xd')](_0x83a9c9,_0x98235)[_0xd6a0('0xe')](function(_0xf73572){logger['info'](_0xd6a0('0xf'),_0x1b0c77,'request\x20sent');logger[_0xd6a0('0x10')](_0xd6a0('0x11'),_0x1b0c77,'request\x20sent',JSON[_0xd6a0('0x12')](_0xf73572));if(_0xf73572[_0xd6a0('0x13')]){if(_0xf73572[_0xd6a0('0x13')][_0xd6a0('0x14')]===0x1f4){logger[_0xd6a0('0x13')]('TeamVoiceQueue,\x20%s,\x20%s',_0x1b0c77,_0xf73572[_0xd6a0('0x13')]['message']);return _0xaea262(_0xf73572['error'][_0xd6a0('0x15')]);}logger[_0xd6a0('0x13')](_0xd6a0('0xf'),_0x1b0c77,_0xf73572['error'][_0xd6a0('0x15')]);return _0x3f5908(_0xf73572[_0xd6a0('0x13')]['message']);}else{logger[_0xd6a0('0x16')](_0xd6a0('0xf'),_0x1b0c77,_0xd6a0('0x17'));_0x3f5908(_0xf73572['result'][_0xd6a0('0x15')]);}})['catch'](function(_0x49022a){logger[_0xd6a0('0x13')](_0xd6a0('0xf'),_0x1b0c77,_0x49022a);_0xaea262(_0x49022a);});});}