Built motion from commit (unavailable).|2.5.14
[motion2.git] / server / api / smsMessage / smsMessage.controller.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 _0x45cf=['MessageUUID','indexOf','sent','delivered','Status','infobip','results','groupName','html-pdf','eml-format','zip-dir','moment','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','request','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','save','then','destroy','stack','name','send','index','map','SmsMessage','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','pick','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','find','create','update','body','describe','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','CmContact','get','SmsInteraction','isNil','interaction','user','role','null','AcceptMessage','acceptMessage','SIP/%s','channel','event','EventManager','acceptmessage','sms-interactions','sms','agent','SmsInteractionId','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','interface','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo'];(function(_0xfcecfe,_0x1027e8){var _0x5b926b=function(_0x5e7396){while(--_0x5e7396){_0xfcecfe['push'](_0xfcecfe['shift']());}};_0x5b926b(++_0x1027e8);}(_0x45cf,0x90));var _0xf45c=function(_0x41f663,_0x5996bd){_0x41f663=_0x41f663-0x0;var _0x1cd296=_0x45cf[_0x41f663];return _0x1cd296;};'use strict';var pdf=require(_0xf45c('0x0'));var emlformat=require(_0xf45c('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xf45c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf45c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf45c('0x4'));var util=require(_0xf45c('0x5'));var path=require(_0xf45c('0x6'));var sox=require(_0xf45c('0x7'));var csv=require('to-csv');var ejs=require(_0xf45c('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf45c('0x9'));var crypto=require(_0xf45c('0xa'));var jsforce=require(_0xf45c('0xb'));var deskjs=require(_0xf45c('0xc'));var toCsv=require(_0xf45c('0xd'));var querystring=require('querystring');var Papa=require(_0xf45c('0xe'));var Redis=require('ioredis');var authService=require(_0xf45c('0xf'));var qs=require(_0xf45c('0x10'));var as=require(_0xf45c('0x11'));var hardwareService=require(_0xf45c('0x12'));var logger=require(_0xf45c('0x13'))(_0xf45c('0x14'));var utils=require(_0xf45c('0x15'));var config=require(_0xf45c('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xf45c('0x17'))['db'];config['redis']=_[_0xf45c('0x18')](config[_0xf45c('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xf45c('0x1a'))(new Redis(config[_0xf45c('0x19')]));require(_0xf45c('0x1b'))[_0xf45c('0x1c')](socket);var jayson=require(_0xf45c('0x1d'));var client=jayson[_0xf45c('0x1e')][_0xf45c('0x1f')]({'port':0x232c});var client9002=jayson[_0xf45c('0x1e')][_0xf45c('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x1a0366,_0x2824f7,_0x3b871a,_0x203f7b){return new BPromise(function(_0x293ae8,_0x53d9d0){var _0x252bea=_0x203f7b||client;return _0x252bea[_0xf45c('0x20')](_0x1a0366,_0x3b871a)['then'](function(_0x569841){logger['info'](_0xf45c('0x21'),_0x2824f7,_0xf45c('0x22'));logger[_0xf45c('0x23')](_0xf45c('0x24'),_0x2824f7,_0xf45c('0x22'),JSON[_0xf45c('0x25')](_0x569841));if(_0x569841[_0xf45c('0x26')]){if(_0x569841[_0xf45c('0x26')][_0xf45c('0x27')]===0x1f4){logger[_0xf45c('0x26')](_0xf45c('0x21'),_0x2824f7,_0x569841[_0xf45c('0x26')]['message']);return _0x53d9d0(_0x569841[_0xf45c('0x26')][_0xf45c('0x28')]);}logger[_0xf45c('0x26')](_0xf45c('0x21'),_0x2824f7,_0x569841[_0xf45c('0x26')][_0xf45c('0x28')]);return _0x293ae8(_0x569841['error'][_0xf45c('0x28')]);}else{logger[_0xf45c('0x29')]('SmsMessage,\x20%s,\x20%s',_0x2824f7,_0xf45c('0x22'));_0x293ae8(_0x569841['result'][_0xf45c('0x28')]);}})[_0xf45c('0x2a')](function(_0x6ce00f){logger['error'](_0xf45c('0x21'),_0x2824f7,_0x6ce00f);_0x53d9d0(_0x6ce00f);});});}function respondWithStatusCode(_0x5af535,_0x124d11){_0x124d11=_0x124d11||0xcc;return function(_0x28c1a6){if(_0x28c1a6){return _0x5af535[_0xf45c('0x2b')](_0x124d11);}return _0x5af535[_0xf45c('0x2c')](_0x124d11)[_0xf45c('0x2d')]();};}function respondWithResult(_0x5ede5d,_0xeaa192){_0xeaa192=_0xeaa192||0xc8;return function(_0x528083){if(_0x528083){return _0x5ede5d[_0xf45c('0x2c')](_0xeaa192)[_0xf45c('0x2e')](_0x528083);}};}function respondWithFilteredResult(_0x443006,_0x59d133){return function(_0x47e053){if(_0x47e053){var _0x3f1325=_0x47e053[_0xf45c('0x2f')],_0x3dd818=_0x59d133[_0xf45c('0x30')],_0x4d1f3d=_0x59d133[_0xf45c('0x30')]+_0x59d133[_0xf45c('0x31')],_0x187118;if(_0x4d1f3d>=_0x3f1325){_0x4d1f3d=_0x3f1325;_0x187118=0xc8;}else{_0x187118=0xce;}_0x443006[_0xf45c('0x2c')](_0x187118);return _0x443006['set'](_0xf45c('0x32'),_0x3dd818+'-'+_0x4d1f3d+'/'+_0x3f1325)[_0xf45c('0x2e')](_0x47e053);}return null;};}function patchUpdates(_0x1fecca){return function(_0x3dfab6){try{jsonpatch['apply'](_0x3dfab6,_0x1fecca,!![]);}catch(_0x28270d){return BPromise[_0xf45c('0x33')](_0x28270d);}return _0x3dfab6[_0xf45c('0x34')]();};}function saveUpdates(_0x62d232,_0x2460e7){return function(_0xc51571){if(_0xc51571){return _0xc51571['update'](_0x62d232)[_0xf45c('0x35')](function(_0x13a25f){return _0x13a25f;});}return null;};}function removeEntity(_0x1cd55e,_0xe4c74f){return function(_0x5465e7){if(_0x5465e7){return _0x5465e7[_0xf45c('0x36')]()[_0xf45c('0x35')](function(){_0x1cd55e[_0xf45c('0x2c')](0xcc)[_0xf45c('0x2d')]();});}};}function handleEntityNotFound(_0x165144,_0x7042b4){return function(_0x11c4d1){if(!_0x11c4d1){_0x165144[_0xf45c('0x2b')](0x194);}return _0x11c4d1;};}function handleError(_0x3c4d67,_0x599577){_0x599577=_0x599577||0x1f4;return function(_0x108ea5){logger[_0xf45c('0x26')](_0x108ea5[_0xf45c('0x37')]);if(_0x108ea5[_0xf45c('0x38')]){delete _0x108ea5[_0xf45c('0x38')];}_0x3c4d67[_0xf45c('0x2c')](_0x599577)[_0xf45c('0x39')](_0x108ea5);};}exports[_0xf45c('0x3a')]=function(_0x599776,_0xacfb15){var _0x2842b6={},_0x4971a6={},_0x4ed49a={'count':0x0,'rows':[]};var _0xec49ec=_[_0xf45c('0x3b')](db[_0xf45c('0x3c')][_0xf45c('0x3d')],function(_0x23aa6a){return{'name':_0x23aa6a[_0xf45c('0x3e')],'type':_0x23aa6a[_0xf45c('0x3f')]['key']};});_0x4971a6[_0xf45c('0x40')]=_['map'](_0xec49ec,_0xf45c('0x38'));_0x4971a6[_0xf45c('0x41')]=_[_0xf45c('0x42')](_0x599776['query']);_0x4971a6[_0xf45c('0x43')]=_[_0xf45c('0x44')](_0x4971a6[_0xf45c('0x40')],_0x4971a6['query']);_0x2842b6['attributes']=_['intersection'](_0x4971a6['model'],qs[_0xf45c('0x45')](_0x599776[_0xf45c('0x41')][_0xf45c('0x45')]));_0x2842b6[_0xf45c('0x46')]=_0x2842b6[_0xf45c('0x46')]['length']?_0x2842b6[_0xf45c('0x46')]:_0x4971a6['model'];if(!_0x599776[_0xf45c('0x41')][_0xf45c('0x47')](_0xf45c('0x48'))){_0x2842b6[_0xf45c('0x31')]=qs[_0xf45c('0x31')](_0x599776['query']['limit']);_0x2842b6[_0xf45c('0x30')]=qs[_0xf45c('0x30')](_0x599776['query'][_0xf45c('0x30')]);}_0x2842b6['order']=qs[_0xf45c('0x49')](_0x599776[_0xf45c('0x41')][_0xf45c('0x49')]);_0x2842b6['where']=qs['filters'](_[_0xf45c('0x4a')](_0x599776[_0xf45c('0x41')],_0x4971a6[_0xf45c('0x43')]),_0xec49ec);if(_0x599776[_0xf45c('0x41')]['filter']){_0x2842b6[_0xf45c('0x4b')]=_[_0xf45c('0x4c')](_0x2842b6['where'],{'$or':_[_0xf45c('0x3b')](_0xec49ec,function(_0x32eba0){if(_0x32eba0[_0xf45c('0x3f')]!==_0xf45c('0x4d')){var _0x34a969={};_0x34a969[_0x32eba0[_0xf45c('0x38')]]={'$like':'%'+_0x599776[_0xf45c('0x41')]['filter']+'%'};return _0x34a969;}})});}_0x2842b6=_[_0xf45c('0x4c')]({},_0x2842b6,_0x599776[_0xf45c('0x4e')]);var _0x2745c6={'where':_0x2842b6[_0xf45c('0x4b')]};return db['SmsMessage']['count'](_0x2745c6)[_0xf45c('0x35')](function(_0x4d42b7){_0x4ed49a['count']=_0x4d42b7;if(_0x599776[_0xf45c('0x41')][_0xf45c('0x4f')]){_0x2842b6[_0xf45c('0x50')]=[{'all':!![]}];}return db[_0xf45c('0x3c')][_0xf45c('0x51')](_0x2842b6);})['then'](function(_0x5904f5){_0x4ed49a[_0xf45c('0x52')]=_0x5904f5;return _0x4ed49a;})[_0xf45c('0x35')](respondWithFilteredResult(_0xacfb15,_0x2842b6))[_0xf45c('0x2a')](handleError(_0xacfb15,null));};exports[_0xf45c('0x53')]=function(_0xf9d529,_0x4b5ae7){var _0x1a387d={'raw':!![],'where':{'id':_0xf9d529[_0xf45c('0x54')]['id']}},_0x5abf56={};_0x5abf56[_0xf45c('0x40')]=_[_0xf45c('0x42')](db[_0xf45c('0x3c')][_0xf45c('0x3d')]);_0x5abf56['query']=_[_0xf45c('0x42')](_0xf9d529['query']);_0x5abf56['filters']=_[_0xf45c('0x44')](_0x5abf56[_0xf45c('0x40')],_0x5abf56[_0xf45c('0x41')]);_0x1a387d['attributes']=_[_0xf45c('0x44')](_0x5abf56[_0xf45c('0x40')],qs[_0xf45c('0x45')](_0xf9d529[_0xf45c('0x41')]['fields']));_0x1a387d['attributes']=_0x1a387d['attributes'][_0xf45c('0x55')]?_0x1a387d[_0xf45c('0x46')]:_0x5abf56[_0xf45c('0x40')];if(_0xf9d529[_0xf45c('0x41')][_0xf45c('0x4f')]){_0x1a387d['include']=[{'all':!![]}];}_0x1a387d=_['merge']({},_0x1a387d,_0xf9d529[_0xf45c('0x4e')]);return db[_0xf45c('0x3c')][_0xf45c('0x56')](_0x1a387d)[_0xf45c('0x35')](handleEntityNotFound(_0x4b5ae7,null))[_0xf45c('0x35')](respondWithResult(_0x4b5ae7,null))[_0xf45c('0x2a')](handleError(_0x4b5ae7,null));};exports[_0xf45c('0x57')]=function(_0x58227c,_0x50625f){return db[_0xf45c('0x3c')][_0xf45c('0x57')](_0x58227c['body'],{})[_0xf45c('0x35')](respondWithResult(_0x50625f,0xc9))[_0xf45c('0x2a')](handleError(_0x50625f,null));};exports[_0xf45c('0x58')]=function(_0x3d24ed,_0x48562b){if(_0x3d24ed['body']['id']){delete _0x3d24ed[_0xf45c('0x59')]['id'];}return db['SmsMessage'][_0xf45c('0x56')]({'where':{'id':_0x3d24ed[_0xf45c('0x54')]['id']}})['then'](handleEntityNotFound(_0x48562b,null))[_0xf45c('0x35')](saveUpdates(_0x3d24ed[_0xf45c('0x59')],null))['then'](respondWithResult(_0x48562b,null))[_0xf45c('0x2a')](handleError(_0x48562b,null));};exports[_0xf45c('0x36')]=function(_0x45c9e4,_0x656ebe){return db[_0xf45c('0x3c')]['find']({'where':{'id':_0x45c9e4[_0xf45c('0x54')]['id']}})[_0xf45c('0x35')](handleEntityNotFound(_0x656ebe,null))[_0xf45c('0x35')](removeEntity(_0x656ebe,null))['catch'](handleError(_0x656ebe,null));};exports[_0xf45c('0x5a')]=function(_0x30a3df,_0x5e3397){return db[_0xf45c('0x3c')][_0xf45c('0x5a')]()['then'](respondWithResult(_0x5e3397,null))[_0xf45c('0x2a')](handleError(_0x5e3397,null));};var interaction_log=require(_0xf45c('0x13'))('sms-interactions');exports[_0xf45c('0x5b')]=function(_0x34756a,_0x52f4cb,_0x1be143){var _0x3d0e4d={'channel':'sms'};if(_0x34756a[_0xf45c('0x59')]['id']){delete _0x34756a['body']['id'];}_0x34756a[_0xf45c('0x59')][_0xf45c('0x5c')]=!![];_0x34756a[_0xf45c('0x59')][_0xf45c('0x5d')]=moment()[_0xf45c('0x5e')](_0xf45c('0x5f'));_0x34756a[_0xf45c('0x59')][_0xf45c('0x60')]=_0x34756a[_0xf45c('0x59')][_0xf45c('0x60')]||_0x34756a['user']['id'];return db[_0xf45c('0x3c')][_0xf45c('0x56')]({'where':{'id':_0x34756a[_0xf45c('0x54')]['id'],'UserId':null},'include':[{'model':db[_0xf45c('0x61')],'as':'Contact'}]})[_0xf45c('0x35')](handleEntityNotFound(_0x52f4cb,null))['then'](saveUpdates(_0x34756a[_0xf45c('0x59')],null))[_0xf45c('0x35')](function(_0x39122e){if(_0x39122e){_0x3d0e4d['message']=_0x39122e[_0xf45c('0x62')]({'plain':!![]});return db[_0xf45c('0x63')][_0xf45c('0x56')]({'where':{'id':_0x39122e['SmsInteractionId']}});}return null;})[_0xf45c('0x35')](handleEntityNotFound(_0x52f4cb,null))[_0xf45c('0x35')](function(_0x32cab7){if(_0x32cab7){return _0x32cab7['update']({'UserId':_0x34756a[_0xf45c('0x59')][_0xf45c('0x60')],'read1stAt':_[_0xf45c('0x64')](_0x32cab7['read1stAt'])?moment()[_0xf45c('0x5e')](_0xf45c('0x5f')):undefined});}return null;})[_0xf45c('0x35')](function(_0x3c7820){if(_0x3c7820){_0x3d0e4d[_0xf45c('0x65')]=_0x3c7820[_0xf45c('0x62')]({'plain':!![]});interaction_log[_0xf45c('0x29')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x34756a[_0xf45c('0x66')]['id'],_0x34756a['user'][_0xf45c('0x38')],_0x34756a[_0xf45c('0x66')][_0xf45c('0x67')],_0x3d0e4d[_0xf45c('0x65')]['id'],_0x34756a[_0xf45c('0x59')]?JSON[_0xf45c('0x25')](_0x34756a[_0xf45c('0x59')]):_0xf45c('0x68'));return respondWithRpcPromise(_0xf45c('0x69'),_0xf45c('0x6a'),_0x3d0e4d);}return null;})[_0xf45c('0x35')](function(_0xffb35c){if(_0xffb35c){if(_0x34756a[_0xf45c('0x59')]['manual']){_0x3d0e4d['message']['interface']=util[_0xf45c('0x5e')](_0xf45c('0x6b'),_0x34756a[_0xf45c('0x66')][_0xf45c('0x38')]);_0x3d0e4d[_0xf45c('0x28')]['channel']=_0x3d0e4d[_0xf45c('0x6c')];_0x3d0e4d[_0xf45c('0x28')][_0xf45c('0x6d')]='accept';return respondWithRpcPromise('EventManager',_0xf45c('0x6e'),{'event':_0xf45c('0x6f'),'message':_0x3d0e4d[_0xf45c('0x28')]},client9002)[_0xf45c('0x35')](function(){return _0x3d0e4d;});}return _0x3d0e4d;}return null;})[_0xf45c('0x35')](respondWithResult(_0x52f4cb,null))['catch'](handleError(_0x52f4cb,null));};var interaction_log=require('../../config/logger')(_0xf45c('0x70'));exports[_0xf45c('0x33')]=function(_0xb643af,_0xca8bf8,_0x1998eb){var _0x21ce5b={'agent':{},'channel':_0xf45c('0x71')};if(_0xb643af['body']['id']){delete _0xb643af[_0xf45c('0x59')]['id'];}_0xb643af[_0xf45c('0x59')][_0xf45c('0x60')]=_0xb643af['body'][_0xf45c('0x60')]||_0xb643af['user']['id'];_0x21ce5b[_0xf45c('0x72')]['id']=_0xb643af[_0xf45c('0x59')][_0xf45c('0x60')];return db[_0xf45c('0x3c')][_0xf45c('0x56')]({'where':{'id':_0xb643af[_0xf45c('0x54')]['id'],'UserId':null}})[_0xf45c('0x35')](handleEntityNotFound(_0xca8bf8,null))[_0xf45c('0x35')](function(_0x3c9dd3){if(_0x3c9dd3){_0x21ce5b[_0xf45c('0x28')]=_0x3c9dd3['get']({'plain':!![]});return db[_0xf45c('0x63')]['find']({'where':{'id':_0x3c9dd3[_0xf45c('0x73')]}});}return null;})[_0xf45c('0x35')](handleEntityNotFound(_0xca8bf8,null))[_0xf45c('0x35')](function(_0x26e4dd){if(_0x26e4dd){_0x21ce5b['interaction']=_0x26e4dd[_0xf45c('0x62')]({'plain':!![]});interaction_log[_0xf45c('0x29')](_0xf45c('0x74'),_0xb643af[_0xf45c('0x66')]['id'],_0xb643af[_0xf45c('0x66')][_0xf45c('0x38')],_0xb643af[_0xf45c('0x66')][_0xf45c('0x67')],_0x21ce5b[_0xf45c('0x65')]['id'],_0xb643af[_0xf45c('0x59')]?JSON[_0xf45c('0x25')](_0xb643af['body']):_0xf45c('0x68'));return respondWithRpcPromise(_0xf45c('0x75'),'rejectMessage',_0x21ce5b);}return null;})[_0xf45c('0x35')](function(_0x54514c){if(_0x54514c){_0x54514c[_0xf45c('0x28')][_0xf45c('0x76')]=util[_0xf45c('0x5e')](_0xf45c('0x6b'),_0xb643af[_0xf45c('0x66')][_0xf45c('0x38')]);_0x54514c[_0xf45c('0x28')][_0xf45c('0x6c')]=_0x21ce5b['channel'];_0x54514c[_0xf45c('0x28')]['event']='reject';respondWithRpcPromise('EventManager',_0xf45c('0x6e'),{'event':'rejectmessage','message':_0x54514c['message']},client9002);return _0x21ce5b;}return null;})[_0xf45c('0x35')](respondWithResult(_0xca8bf8,null))['catch'](handleError(_0xca8bf8,null));};exports[_0xf45c('0x2c')]=function(_0x2ad8d1,_0x390a3e,_0x2e9833){if(_0x2ad8d1[_0xf45c('0x59')]['id']){delete _0x2ad8d1[_0xf45c('0x59')]['id'];}var _0x376ab0;return db[_0xf45c('0x3c')]['find']({'where':{'id':_0x2ad8d1[_0xf45c('0x54')]['id']}})[_0xf45c('0x35')](handleEntityNotFound(_0x390a3e,null))[_0xf45c('0x35')](function(_0x3bbdae){if(_0x3bbdae){_0x376ab0=_0x3bbdae;return db[_0xf45c('0x77')][_0xf45c('0x56')]({'where':{'id':_0x3bbdae[_0xf45c('0x78')]}});}})[_0xf45c('0x35')](handleEntityNotFound(_0x390a3e,null))[_0xf45c('0x35')](function(_0x4dfbf7){if(_0x4dfbf7){logger[_0xf45c('0x23')](_0xf45c('0x24'),_0xf45c('0x2c'),_0xf45c('0x79'),_0x4dfbf7['type'],util[_0xf45c('0x7a')](_0x2ad8d1[_0xf45c('0x59')],{'showHidden':![],'depth':null}));switch(_0x4dfbf7['type']){case _0xf45c('0x7b'):if(_0x2ad8d1['body']['MessageSid']&&_0x2ad8d1[_0xf45c('0x59')][_0xf45c('0x7c')]===_0x376ab0[_0xf45c('0x7d')]){return _0x376ab0[_0xf45c('0x58')]({'read':!![]});}else{logger[_0xf45c('0x26')](_0xf45c('0x7e'),'status',_0xf45c('0x7b'),util['inspect'](_0x2ad8d1[_0xf45c('0x59')],{'showHidden':![],'depth':null}));}break;case _0xf45c('0x7f'):if(_0x2ad8d1[_0xf45c('0x59')][_0xf45c('0x80')]&&_0x2ad8d1[_0xf45c('0x59')][_0xf45c('0x80')]===_0x376ab0[_0xf45c('0x7d')]&&_[_0xf45c('0x81')]([_0xf45c('0x82'),_0xf45c('0x83')],_0x2ad8d1[_0xf45c('0x59')][_0xf45c('0x84')])>=0x0){return _0x376ab0[_0xf45c('0x58')]({'read':!![]});}else{logger[_0xf45c('0x26')](_0xf45c('0x7e'),_0xf45c('0x2c'),'plivio',util[_0xf45c('0x7a')](_0x2ad8d1[_0xf45c('0x59')],{'showHidden':![],'depth':null}));}break;case _0xf45c('0x85'):var _0xc86198=_0x2ad8d1[_0xf45c('0x59')][_0xf45c('0x86')][0x0];if(_0xc86198['status'][_0xf45c('0x87')]==='DELIVERED'){return _0x376ab0[_0xf45c('0x58')]({'read':!![]});}else{logger[_0xf45c('0x26')](_0xf45c('0x7e'),_0xf45c('0x2c'),'infobip',util[_0xf45c('0x7a')](_0x2ad8d1[_0xf45c('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x376ab0;}})['then'](respondWithResult(_0x390a3e,null))['catch'](handleError(_0x390a3e,null));};