Built motion from commit (unavailable).|2.5.16
[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 _0xfe6a=['defaults','redis','localhost','socket.io-emitter','request','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoicePrefix,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x45292d,_0x3bc5c9){var _0x36a66d=function(_0x179af9){while(--_0x179af9){_0x45292d['push'](_0x45292d['shift']());}};_0x36a66d(++_0x3bc5c9);}(_0xfe6a,0xe8));var _0xafe6=function(_0x1721b7,_0x2eba9b){_0x1721b7=_0x1721b7-0x0;var _0x5ed8d1=_0xfe6a[_0x1721b7];return _0x5ed8d1;};'use strict';var _=require(_0xafe6('0x0'));var util=require(_0xafe6('0x1'));var moment=require(_0xafe6('0x2'));var BPromise=require(_0xafe6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xafe6('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xafe6('0x5'))(_0xafe6('0x6'));var config=require(_0xafe6('0x7'));var jayson=require(_0xafe6('0x8'));var client=jayson[_0xafe6('0x9')][_0xafe6('0xa')]({'port':0x232a});config['redis']=_[_0xafe6('0xb')](config[_0xafe6('0xc')],{'host':_0xafe6('0xd'),'port':0x18eb});var socket=require(_0xafe6('0xe'))(new Redis(config[_0xafe6('0xc')]));require('./voicePrefix.socket')['register'](socket);function respondWithRpcPromise(_0x46e486,_0x45844f,_0x5a06f2){return new BPromise(function(_0x340c65,_0x3cf21a){return client[_0xafe6('0xf')](_0x46e486,_0x5a06f2)['then'](function(_0x5399f9){logger['info']('VoicePrefix,\x20%s,\x20%s',_0x45844f,'request\x20sent');logger[_0xafe6('0x10')](_0xafe6('0x11'),_0x45844f,_0xafe6('0x12'),JSON[_0xafe6('0x13')](_0x5399f9));if(_0x5399f9[_0xafe6('0x14')]){if(_0x5399f9[_0xafe6('0x14')][_0xafe6('0x15')]===0x1f4){logger[_0xafe6('0x14')](_0xafe6('0x16'),_0x45844f,_0x5399f9[_0xafe6('0x14')]['message']);return _0x3cf21a(_0x5399f9[_0xafe6('0x14')][_0xafe6('0x17')]);}logger[_0xafe6('0x14')](_0xafe6('0x16'),_0x45844f,_0x5399f9[_0xafe6('0x14')][_0xafe6('0x17')]);return _0x340c65(_0x5399f9[_0xafe6('0x14')][_0xafe6('0x17')]);}else{logger[_0xafe6('0x18')](_0xafe6('0x16'),_0x45844f,_0xafe6('0x12'));_0x340c65(_0x5399f9[_0xafe6('0x19')][_0xafe6('0x17')]);}})[_0xafe6('0x1a')](function(_0x3283b9){logger['error']('VoicePrefix,\x20%s,\x20%s',_0x45844f,_0x3283b9);_0x3cf21a(_0x3283b9);});});}