Built motion from commit 67e5df37.|2.0.66
[motion2.git] / server / api / smsDisposition / smsDisposition.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 _0x15b8=['bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsDisposition,\x20%s,\x20%s','request\x20sent','debug','SmsDisposition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment'];(function(_0x212a37,_0xf35b2e){var _0x5d0bf9=function(_0x51850f){while(--_0x51850f){_0x212a37['push'](_0x212a37['shift']());}};_0x5d0bf9(++_0xf35b2e);}(_0x15b8,0xcd));var _0x815b=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x15b8[_0x4fde08];return _0x12e725;};'use strict';var _=require('lodash');var util=require(_0x815b('0x0'));var moment=require(_0x815b('0x1'));var BPromise=require(_0x815b('0x2'));var rs=require(_0x815b('0x3'));var fs=require('fs');var db=require(_0x815b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x815b('0x5'))(_0x815b('0x6'));var config=require(_0x815b('0x7'));var jayson=require(_0x815b('0x8'));var client=jayson[_0x815b('0x9')][_0x815b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x581869,_0x1e9fc0,_0xdfdf6){return new BPromise(function(_0x26119a,_0x175053){return client[_0x815b('0xb')](_0x581869,_0xdfdf6)[_0x815b('0xc')](function(_0x474f37){logger[_0x815b('0xd')](_0x815b('0xe'),_0x1e9fc0,_0x815b('0xf'));logger[_0x815b('0x10')](_0x815b('0x11'),_0x1e9fc0,_0x815b('0xf'),JSON[_0x815b('0x12')](_0x474f37));if(_0x474f37[_0x815b('0x13')]){if(_0x474f37[_0x815b('0x13')][_0x815b('0x14')]===0x1f4){logger[_0x815b('0x13')]('SmsDisposition,\x20%s,\x20%s',_0x1e9fc0,_0x474f37['error'][_0x815b('0x15')]);return _0x175053(_0x474f37[_0x815b('0x13')]['message']);}logger['error']('SmsDisposition,\x20%s,\x20%s',_0x1e9fc0,_0x474f37[_0x815b('0x13')]['message']);return _0x26119a(_0x474f37['error'][_0x815b('0x15')]);}else{logger[_0x815b('0xd')](_0x815b('0xe'),_0x1e9fc0,'request\x20sent');_0x26119a(_0x474f37['result'][_0x815b('0x15')]);}})[_0x815b('0x16')](function(_0x3c2a38){logger[_0x815b('0x13')](_0x815b('0xe'),_0x1e9fc0,_0x3c2a38);_0x175053(_0x3c2a38);});});}