Built motion from commit (unavailable).|2.5.23
[motion2.git] / server / api / cannedAnswer / cannedAnswer.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 _0x32de=['CannedAnswer,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3b7574,_0x3cd77c){var _0x1dfc86=function(_0x6b000f){while(--_0x6b000f){_0x3b7574['push'](_0x3b7574['shift']());}};_0x1dfc86(++_0x3cd77c);}(_0x32de,0x13f));var _0xe32d=function(_0x44176c,_0x150427){_0x44176c=_0x44176c-0x0;var _0x15f4bb=_0x32de[_0x44176c];return _0x15f4bb;};'use strict';var _=require(_0xe32d('0x0'));var util=require(_0xe32d('0x1'));var moment=require(_0xe32d('0x2'));var BPromise=require(_0xe32d('0x3'));var rs=require(_0xe32d('0x4'));var fs=require('fs');var Redis=require(_0xe32d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe32d('0x6'));var logger=require(_0xe32d('0x7'))(_0xe32d('0x8'));var config=require(_0xe32d('0x9'));var jayson=require(_0xe32d('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x351643,_0x5f0b66,_0x559d46){return new BPromise(function(_0x3180d9,_0x48140d){return client[_0xe32d('0xb')](_0x351643,_0x559d46)[_0xe32d('0xc')](function(_0x50d688){logger[_0xe32d('0xd')](_0xe32d('0xe'),_0x5f0b66,_0xe32d('0xf'));logger[_0xe32d('0x10')](_0xe32d('0x11'),_0x5f0b66,_0xe32d('0xf'),JSON[_0xe32d('0x12')](_0x50d688));if(_0x50d688[_0xe32d('0x13')]){if(_0x50d688[_0xe32d('0x13')][_0xe32d('0x14')]===0x1f4){logger[_0xe32d('0x13')](_0xe32d('0xe'),_0x5f0b66,_0x50d688[_0xe32d('0x13')][_0xe32d('0x15')]);return _0x48140d(_0x50d688[_0xe32d('0x13')][_0xe32d('0x15')]);}logger[_0xe32d('0x13')]('CannedAnswer,\x20%s,\x20%s',_0x5f0b66,_0x50d688[_0xe32d('0x13')][_0xe32d('0x15')]);return _0x3180d9(_0x50d688['error'][_0xe32d('0x15')]);}else{logger[_0xe32d('0xd')](_0xe32d('0xe'),_0x5f0b66,_0xe32d('0xf'));_0x3180d9(_0x50d688[_0xe32d('0x16')]['message']);}})[_0xe32d('0x17')](function(_0x136469){logger[_0xe32d('0x13')](_0xe32d('0xe'),_0x5f0b66,_0x136469);_0x48140d(_0x136469);});});}