Built motion from commit (unavailable).|2.5.4
[motion2.git] / server / api / cmContactHasPhone / cmContactHasPhone.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 _0x95f7=['moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','http','request','then','info','CmContactHasPhone,\x20%s,\x20%s','CmContactHasPhone,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch'];(function(_0x27fa6b,_0x42da89){var _0x2197ce=function(_0x172d25){while(--_0x172d25){_0x27fa6b['push'](_0x27fa6b['shift']());}};_0x2197ce(++_0x42da89);}(_0x95f7,0x143));var _0x795f=function(_0x495207,_0x58f561){_0x495207=_0x495207-0x0;var _0x41cbf9=_0x95f7[_0x495207];return _0x41cbf9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x795f('0x0'));var BPromise=require(_0x795f('0x1'));var rs=require(_0x795f('0x2'));var fs=require('fs');var Redis=require(_0x795f('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x795f('0x4'))(_0x795f('0x5'));var config=require('../../config/environment');var jayson=require(_0x795f('0x6'));var client=jayson['client'][_0x795f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xd693b6,_0x27bfd2,_0x6e5860){return new BPromise(function(_0x35539c,_0xeda01){return client[_0x795f('0x8')](_0xd693b6,_0x6e5860)[_0x795f('0x9')](function(_0x55fbe5){logger[_0x795f('0xa')](_0x795f('0xb'),_0x27bfd2,'request\x20sent');logger['debug'](_0x795f('0xc'),_0x27bfd2,_0x795f('0xd'),JSON[_0x795f('0xe')](_0x55fbe5));if(_0x55fbe5[_0x795f('0xf')]){if(_0x55fbe5['error'][_0x795f('0x10')]===0x1f4){logger['error']('CmContactHasPhone,\x20%s,\x20%s',_0x27bfd2,_0x55fbe5[_0x795f('0xf')][_0x795f('0x11')]);return _0xeda01(_0x55fbe5[_0x795f('0xf')][_0x795f('0x11')]);}logger[_0x795f('0xf')]('CmContactHasPhone,\x20%s,\x20%s',_0x27bfd2,_0x55fbe5[_0x795f('0xf')]['message']);return _0x35539c(_0x55fbe5['error']['message']);}else{logger[_0x795f('0xa')](_0x795f('0xb'),_0x27bfd2,_0x795f('0xd'));_0x35539c(_0x55fbe5['result'][_0x795f('0x11')]);}})[_0x795f('0x12')](function(_0x3d96d2){logger[_0x795f('0xf')]('CmContactHasPhone,\x20%s,\x20%s',_0x27bfd2,_0x3d96d2);_0xeda01(_0x3d96d2);});});}