Built motion from commit fa4c4286.|2.6.29
[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 _0xe08b=['lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./voicePrefix.socket','then','info','VoicePrefix,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x576757,_0x175ba6){var _0x7b4412=function(_0x18a37a){while(--_0x18a37a){_0x576757['push'](_0x576757['shift']());}};_0x7b4412(++_0x175ba6);}(_0xe08b,0x10e));var _0xbe08=function(_0x12ddb2,_0x5ad61e){_0x12ddb2=_0x12ddb2-0x0;var _0x10b6dd=_0xe08b[_0x12ddb2];return _0x10b6dd;};'use strict';var _=require(_0xbe08('0x0'));var util=require('util');var moment=require(_0xbe08('0x1'));var BPromise=require(_0xbe08('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbe08('0x3'));var db=require(_0xbe08('0x4'))['db'];var utils=require(_0xbe08('0x5'));var logger=require(_0xbe08('0x6'))(_0xbe08('0x7'));var config=require(_0xbe08('0x8'));var jayson=require(_0xbe08('0x9'));var client=jayson[_0xbe08('0xa')][_0xbe08('0xb')]({'port':0x232a});config[_0xbe08('0xc')]=_[_0xbe08('0xd')](config[_0xbe08('0xc')],{'host':_0xbe08('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbe08('0xc')]));require(_0xbe08('0xf'))['register'](socket);function respondWithRpcPromise(_0xb4e69a,_0xed8e0c,_0x47ca8d){return new BPromise(function(_0xc5824c,_0x202fec){return client['request'](_0xb4e69a,_0x47ca8d)[_0xbe08('0x10')](function(_0x133725){logger[_0xbe08('0x11')](_0xbe08('0x12'),_0xed8e0c,'request\x20sent');logger[_0xbe08('0x13')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0xed8e0c,_0xbe08('0x14'),JSON[_0xbe08('0x15')](_0x133725));if(_0x133725[_0xbe08('0x16')]){if(_0x133725[_0xbe08('0x16')][_0xbe08('0x17')]===0x1f4){logger[_0xbe08('0x16')](_0xbe08('0x12'),_0xed8e0c,_0x133725[_0xbe08('0x16')][_0xbe08('0x18')]);return _0x202fec(_0x133725[_0xbe08('0x16')][_0xbe08('0x18')]);}logger[_0xbe08('0x16')](_0xbe08('0x12'),_0xed8e0c,_0x133725[_0xbe08('0x16')][_0xbe08('0x18')]);return _0xc5824c(_0x133725[_0xbe08('0x16')][_0xbe08('0x18')]);}else{logger[_0xbe08('0x11')]('VoicePrefix,\x20%s,\x20%s',_0xed8e0c,_0xbe08('0x14'));_0xc5824c(_0x133725[_0xbe08('0x19')][_0xbe08('0x18')]);}})[_0xbe08('0x1a')](function(_0x1c9379){logger[_0xbe08('0x16')](_0xbe08('0x12'),_0xed8e0c,_0x1c9379);_0x202fec(_0x1c9379);});});}