Built motion from commit (unavailable).|2.3.97
[motion2.git] / server / api / voicePrefix / voicePrefix.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 _0xa310=['request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./voicePrefix.socket','register','request','info','VoicePrefix,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa310,0xe0));var _0x0a31=function(_0x1eb6c3,_0x4e58a4){_0x1eb6c3=_0x1eb6c3-0x0;var _0x4b5961=_0xa310[_0x1eb6c3];return _0x4b5961;};'use strict';var _=require(_0x0a31('0x0'));var util=require(_0x0a31('0x1'));var moment=require(_0x0a31('0x2'));var BPromise=require('bluebird');var rs=require(_0x0a31('0x3'));var fs=require('fs');var Redis=require(_0x0a31('0x4'));var db=require(_0x0a31('0x5'))['db'];var utils=require(_0x0a31('0x6'));var logger=require('../../config/logger')(_0x0a31('0x7'));var config=require(_0x0a31('0x8'));var jayson=require(_0x0a31('0x9'));var client=jayson[_0x0a31('0xa')][_0x0a31('0xb')]({'port':0x232a});config[_0x0a31('0xc')]=_['defaults'](config[_0x0a31('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x0a31('0xd'))(new Redis(config[_0x0a31('0xc')]));require(_0x0a31('0xe'))[_0x0a31('0xf')](socket);function respondWithRpcPromise(_0x4001ad,_0x58a0a9,_0x92bd10){return new BPromise(function(_0x8d4c1b,_0x32a70e){return client[_0x0a31('0x10')](_0x4001ad,_0x92bd10)['then'](function(_0x277707){logger[_0x0a31('0x11')](_0x0a31('0x12'),_0x58a0a9,_0x0a31('0x13'));logger['debug'](_0x0a31('0x14'),_0x58a0a9,_0x0a31('0x13'),JSON[_0x0a31('0x15')](_0x277707));if(_0x277707['error']){if(_0x277707['error'][_0x0a31('0x16')]===0x1f4){logger[_0x0a31('0x17')](_0x0a31('0x12'),_0x58a0a9,_0x277707['error'][_0x0a31('0x18')]);return _0x32a70e(_0x277707['error'][_0x0a31('0x18')]);}logger[_0x0a31('0x17')](_0x0a31('0x12'),_0x58a0a9,_0x277707[_0x0a31('0x17')][_0x0a31('0x18')]);return _0x8d4c1b(_0x277707[_0x0a31('0x17')][_0x0a31('0x18')]);}else{logger[_0x0a31('0x11')](_0x0a31('0x12'),_0x58a0a9,'request\x20sent');_0x8d4c1b(_0x277707[_0x0a31('0x19')][_0x0a31('0x18')]);}})[_0x0a31('0x1a')](function(_0x15cf6a){logger[_0x0a31('0x17')]('VoicePrefix,\x20%s,\x20%s',_0x58a0a9,_0x15cf6a);_0x32a70e(_0x15cf6a);});});}