Built motion from commit (unavailable).|2.4.15
[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 _0x25f2=['null','RejectMessage','rejectMessage','SIP/%s','SmsAccount','SmsAccountId','inspect','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','MessageUUID','messageId','sent','delivered','infobip','results','groupName','DELIVERED','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','./smsMessage.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','SmsMessage','includeAll','include','findAll','rows','show','params','find','create','body','describe','accept','sms','read','format','UserId','user','CmContact','Contact','get','SmsInteraction','SmsInteractionId','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','manual','interface','channel','event','EventManager','acceptmessage','sms-interactions','agent','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0x342755,_0x5c6ecd){var _0x5256ff=function(_0xea2d68){while(--_0xea2d68){_0x342755['push'](_0x342755['shift']());}};_0x5256ff(++_0x5c6ecd);}(_0x25f2,0x1c5));var _0x225f=function(_0x5530ff,_0x1532a9){_0x5530ff=_0x5530ff-0x0;var _0x55e999=_0x25f2[_0x5530ff];return _0x55e999;};'use strict';var pdf=require(_0x225f('0x0'));var emlformat=require(_0x225f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x225f('0x2'));var jsonpatch=require(_0x225f('0x3'));var rp=require('request-promise');var moment=require(_0x225f('0x4'));var BPromise=require(_0x225f('0x5'));var Mustache=require(_0x225f('0x6'));var util=require('util');var path=require(_0x225f('0x7'));var sox=require(_0x225f('0x8'));var csv=require(_0x225f('0x9'));var ejs=require(_0x225f('0xa'));var fs=require('fs');var _=require(_0x225f('0xb'));var squel=require(_0x225f('0xc'));var crypto=require(_0x225f('0xd'));var jsforce=require(_0x225f('0xe'));var deskjs=require(_0x225f('0xf'));var toCsv=require(_0x225f('0x9'));var querystring=require('querystring');var Papa=require(_0x225f('0x10'));var Redis=require(_0x225f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x225f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x225f('0x13'));var logger=require(_0x225f('0x14'))(_0x225f('0x15'));var utils=require(_0x225f('0x16'));var config=require(_0x225f('0x17'));var db=require('../../mysqldb')['db'];config[_0x225f('0x18')]=_[_0x225f('0x19')](config[_0x225f('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x225f('0x1a'))[_0x225f('0x1b')](socket);var jayson=require(_0x225f('0x1c'));var client=jayson[_0x225f('0x1d')][_0x225f('0x1e')]({'port':0x232c});var client9002=jayson[_0x225f('0x1d')]['http']({'port':0x232a});function checkPasswordPattern(_0x240776,_0x4ed1c6,_0x521e58){if(_0x521e58){var _0x1d1030=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1d1030[_0x225f('0x1f')](_0x4ed1c6)){return _0x240776;}else{throw new db[(_0x225f('0x20'))][(_0x225f('0x21'))](_0x225f('0x22'));}}else{return _0x240776;}}function respondWithRpcPromise(_0x2c29fe,_0x400c96,_0x4a9e64,_0x51b7c9){return new BPromise(function(_0x1f128c,_0x17496c){var _0x29e35b=_0x51b7c9||client;return _0x29e35b[_0x225f('0x23')](_0x2c29fe,_0x4a9e64)[_0x225f('0x24')](function(_0x2f229c){logger[_0x225f('0x25')]('SmsMessage,\x20%s,\x20%s',_0x400c96,_0x225f('0x26'));logger[_0x225f('0x27')](_0x225f('0x28'),_0x400c96,_0x225f('0x26'),JSON[_0x225f('0x29')](_0x2f229c));if(_0x2f229c[_0x225f('0x2a')]){if(_0x2f229c[_0x225f('0x2a')][_0x225f('0x2b')]===0x1f4){logger['error'](_0x225f('0x2c'),_0x400c96,_0x2f229c[_0x225f('0x2a')][_0x225f('0x2d')]);return _0x17496c(_0x2f229c[_0x225f('0x2a')][_0x225f('0x2d')]);}logger[_0x225f('0x2a')](_0x225f('0x2c'),_0x400c96,_0x2f229c[_0x225f('0x2a')][_0x225f('0x2d')]);return _0x1f128c(_0x2f229c[_0x225f('0x2a')][_0x225f('0x2d')]);}else{logger[_0x225f('0x25')](_0x225f('0x2c'),_0x400c96,_0x225f('0x26'));_0x1f128c(_0x2f229c[_0x225f('0x2e')]['message']);}})[_0x225f('0x2f')](function(_0x144215){logger[_0x225f('0x2a')](_0x225f('0x2c'),_0x400c96,_0x144215);_0x17496c(_0x144215);});});}function respondWithStatusCode(_0x159024,_0x400c0f){_0x400c0f=_0x400c0f||0xcc;return function(_0x305d5d){if(_0x305d5d){return _0x159024[_0x225f('0x30')](_0x400c0f);}return _0x159024[_0x225f('0x31')](_0x400c0f)[_0x225f('0x32')]();};}function respondWithResult(_0x5d115d,_0x31ad58){_0x31ad58=_0x31ad58||0xc8;return function(_0x2a5303){if(_0x2a5303){return _0x5d115d['status'](_0x31ad58)[_0x225f('0x33')](_0x2a5303);}};}function respondWithFilteredResult(_0x1a15a3,_0x495fbe){return function(_0x124032){if(_0x124032){var _0x563c59=_0x124032[_0x225f('0x34')],_0x52ecb9=_0x495fbe['offset'],_0x538f34=_0x495fbe['offset']+_0x495fbe['limit'],_0x14cca4;if(_0x538f34>=_0x563c59){_0x538f34=_0x563c59;_0x14cca4=0xc8;}else{_0x14cca4=0xce;}_0x1a15a3[_0x225f('0x31')](_0x14cca4);return _0x1a15a3[_0x225f('0x35')](_0x225f('0x36'),_0x52ecb9+'-'+_0x538f34+'/'+_0x563c59)[_0x225f('0x33')](_0x124032);}return null;};}function patchUpdates(_0xb4842a){return function(_0x3b1dfb){try{jsonpatch[_0x225f('0x37')](_0x3b1dfb,_0xb4842a,!![]);}catch(_0x5aecd4){return BPromise[_0x225f('0x38')](_0x5aecd4);}return _0x3b1dfb[_0x225f('0x39')]();};}function saveUpdates(_0x2941a0,_0x334e86){return function(_0x428271){if(_0x428271){return _0x428271[_0x225f('0x3a')](_0x2941a0)[_0x225f('0x24')](function(_0x15fb3c){return _0x15fb3c;});}return null;};}function removeEntity(_0x447e41,_0xaacf8f){return function(_0x5402f3){if(_0x5402f3){return _0x5402f3[_0x225f('0x3b')]()['then'](function(){_0x447e41[_0x225f('0x31')](0xcc)[_0x225f('0x32')]();});}};}function handleEntityNotFound(_0x366948,_0x48831a){return function(_0x223553){if(!_0x223553){_0x366948['sendStatus'](0x194);}return _0x223553;};}function handleError(_0x39ede2,_0x2d1da3){_0x2d1da3=_0x2d1da3||0x1f4;return function(_0x40e27d){logger['error'](_0x40e27d[_0x225f('0x3c')]);if(_0x40e27d[_0x225f('0x3d')]){delete _0x40e27d[_0x225f('0x3d')];}_0x39ede2['status'](_0x2d1da3)[_0x225f('0x3e')](_0x40e27d);};}exports[_0x225f('0x3f')]=function(_0x277e44,_0x5e9348){var _0x1f260d={},_0x259bea={},_0x2e6196={'count':0x0,'rows':[]};var _0x54990c=_[_0x225f('0x40')](db['SmsMessage'][_0x225f('0x41')],function(_0x6b902b){return{'name':_0x6b902b[_0x225f('0x42')],'type':_0x6b902b[_0x225f('0x43')][_0x225f('0x44')]};});_0x259bea[_0x225f('0x45')]=_['map'](_0x54990c,_0x225f('0x3d'));_0x259bea[_0x225f('0x46')]=_[_0x225f('0x47')](_0x277e44[_0x225f('0x46')]);_0x259bea['filters']=_[_0x225f('0x48')](_0x259bea[_0x225f('0x45')],_0x259bea[_0x225f('0x46')]);_0x1f260d[_0x225f('0x49')]=_[_0x225f('0x48')](_0x259bea[_0x225f('0x45')],qs[_0x225f('0x4a')](_0x277e44[_0x225f('0x46')]['fields']));_0x1f260d['attributes']=_0x1f260d[_0x225f('0x49')][_0x225f('0x4b')]?_0x1f260d[_0x225f('0x49')]:_0x259bea[_0x225f('0x45')];if(!_0x277e44['query'][_0x225f('0x4c')](_0x225f('0x4d'))){_0x1f260d[_0x225f('0x4e')]=qs[_0x225f('0x4e')](_0x277e44[_0x225f('0x46')][_0x225f('0x4e')]);_0x1f260d[_0x225f('0x4f')]=qs[_0x225f('0x4f')](_0x277e44[_0x225f('0x46')][_0x225f('0x4f')]);}_0x1f260d[_0x225f('0x50')]=qs[_0x225f('0x51')](_0x277e44['query'][_0x225f('0x51')]);_0x1f260d[_0x225f('0x52')]=qs[_0x225f('0x53')](_[_0x225f('0x54')](_0x277e44['query'],_0x259bea[_0x225f('0x53')]));if(_0x277e44[_0x225f('0x46')][_0x225f('0x55')]){_0x1f260d[_0x225f('0x52')]=_['merge'](_0x1f260d[_0x225f('0x52')],{'$or':_[_0x225f('0x40')](_0x54990c,function(_0x5cd3b1){if(_0x5cd3b1[_0x225f('0x43')]!==_0x225f('0x56')){var _0xe1241d={};_0xe1241d[_0x5cd3b1['name']]={'$like':'%'+_0x277e44[_0x225f('0x46')][_0x225f('0x55')]+'%'};return _0xe1241d;}})});}_0x1f260d=_[_0x225f('0x57')]({},_0x1f260d,_0x277e44[_0x225f('0x58')]);var _0x30ccef={'where':_0x1f260d[_0x225f('0x52')]};return db[_0x225f('0x59')][_0x225f('0x34')](_0x30ccef)[_0x225f('0x24')](function(_0x30d21f){_0x2e6196[_0x225f('0x34')]=_0x30d21f;if(_0x277e44[_0x225f('0x46')][_0x225f('0x5a')]){_0x1f260d[_0x225f('0x5b')]=[{'all':!![]}];}return db[_0x225f('0x59')][_0x225f('0x5c')](_0x1f260d);})[_0x225f('0x24')](function(_0x105264){_0x2e6196[_0x225f('0x5d')]=_0x105264;return _0x2e6196;})['then'](respondWithFilteredResult(_0x5e9348,_0x1f260d))[_0x225f('0x2f')](handleError(_0x5e9348,null));};exports[_0x225f('0x5e')]=function(_0x577d58,_0x40ab99){var _0xbbaedd={'raw':!![],'where':{'id':_0x577d58[_0x225f('0x5f')]['id']}},_0x355597={};_0x355597[_0x225f('0x45')]=_[_0x225f('0x47')](db[_0x225f('0x59')]['rawAttributes']);_0x355597[_0x225f('0x46')]=_[_0x225f('0x47')](_0x577d58[_0x225f('0x46')]);_0x355597[_0x225f('0x53')]=_['intersection'](_0x355597[_0x225f('0x45')],_0x355597['query']);_0xbbaedd['attributes']=_[_0x225f('0x48')](_0x355597['model'],qs[_0x225f('0x4a')](_0x577d58[_0x225f('0x46')][_0x225f('0x4a')]));_0xbbaedd[_0x225f('0x49')]=_0xbbaedd[_0x225f('0x49')][_0x225f('0x4b')]?_0xbbaedd[_0x225f('0x49')]:_0x355597[_0x225f('0x45')];if(_0x577d58[_0x225f('0x46')]['includeAll']){_0xbbaedd['include']=[{'all':!![]}];}_0xbbaedd=_[_0x225f('0x57')]({},_0xbbaedd,_0x577d58[_0x225f('0x58')]);return db[_0x225f('0x59')][_0x225f('0x60')](_0xbbaedd)[_0x225f('0x24')](handleEntityNotFound(_0x40ab99,null))[_0x225f('0x24')](respondWithResult(_0x40ab99,null))[_0x225f('0x2f')](handleError(_0x40ab99,null));};exports[_0x225f('0x61')]=function(_0x4d2554,_0x2a53c3){return db[_0x225f('0x59')][_0x225f('0x61')](_0x4d2554[_0x225f('0x62')],{})[_0x225f('0x24')](respondWithResult(_0x2a53c3,0xc9))['catch'](handleError(_0x2a53c3,null));};exports[_0x225f('0x3a')]=function(_0x58cf30,_0x33c226){if(_0x58cf30[_0x225f('0x62')]['id']){delete _0x58cf30[_0x225f('0x62')]['id'];}return db[_0x225f('0x59')]['find']({'where':{'id':_0x58cf30[_0x225f('0x5f')]['id']}})[_0x225f('0x24')](handleEntityNotFound(_0x33c226,null))[_0x225f('0x24')](saveUpdates(_0x58cf30[_0x225f('0x62')],null))['then'](respondWithResult(_0x33c226,null))[_0x225f('0x2f')](handleError(_0x33c226,null));};exports[_0x225f('0x3b')]=function(_0x23b784,_0x555f63){return db[_0x225f('0x59')]['find']({'where':{'id':_0x23b784[_0x225f('0x5f')]['id']}})[_0x225f('0x24')](handleEntityNotFound(_0x555f63,null))[_0x225f('0x24')](removeEntity(_0x555f63,null))[_0x225f('0x2f')](handleError(_0x555f63,null));};exports[_0x225f('0x63')]=function(_0x234aa3,_0x1df70d){return db[_0x225f('0x59')]['describe']()[_0x225f('0x24')](respondWithResult(_0x1df70d,null))[_0x225f('0x2f')](handleError(_0x1df70d,null));};var interaction_log=require(_0x225f('0x14'))('sms-interactions');exports[_0x225f('0x64')]=function(_0xd33b85,_0x514638,_0x30a3f7){var _0x4ba376={'channel':_0x225f('0x65')};if(_0xd33b85[_0x225f('0x62')]['id']){delete _0xd33b85['body']['id'];}_0xd33b85['body'][_0x225f('0x66')]=!![];_0xd33b85[_0x225f('0x62')]['readAt']=moment()[_0x225f('0x67')]('YYYY-MM-DD\x20HH:mm:ss');_0xd33b85[_0x225f('0x62')][_0x225f('0x68')]=_0xd33b85['body'][_0x225f('0x68')]||_0xd33b85[_0x225f('0x69')]['id'];return db[_0x225f('0x59')][_0x225f('0x60')]({'where':{'id':_0xd33b85[_0x225f('0x5f')]['id'],'UserId':null},'include':[{'model':db[_0x225f('0x6a')],'as':_0x225f('0x6b')}]})[_0x225f('0x24')](handleEntityNotFound(_0x514638,null))[_0x225f('0x24')](saveUpdates(_0xd33b85[_0x225f('0x62')],null))[_0x225f('0x24')](function(_0x540134){if(_0x540134){_0x4ba376[_0x225f('0x2d')]=_0x540134[_0x225f('0x6c')]({'plain':!![]});return db[_0x225f('0x6d')][_0x225f('0x60')]({'where':{'id':_0x540134[_0x225f('0x6e')]}});}return null;})[_0x225f('0x24')](handleEntityNotFound(_0x514638,null))[_0x225f('0x24')](function(_0x57f111){if(_0x57f111){return _0x57f111[_0x225f('0x3a')]({'UserId':_0xd33b85[_0x225f('0x62')][_0x225f('0x68')],'read1stAt':_['isNil'](_0x57f111[_0x225f('0x6f')])?moment()[_0x225f('0x67')](_0x225f('0x70')):undefined});}return null;})[_0x225f('0x24')](function(_0x4fa9d5){if(_0x4fa9d5){_0x4ba376[_0x225f('0x71')]=_0x4fa9d5[_0x225f('0x6c')]({'plain':!![]});interaction_log[_0x225f('0x25')](_0x225f('0x72'),_0xd33b85['user']['id'],_0xd33b85[_0x225f('0x69')][_0x225f('0x3d')],_0xd33b85[_0x225f('0x69')][_0x225f('0x73')],_0x4ba376['interaction']['id'],_0xd33b85[_0x225f('0x62')]?JSON[_0x225f('0x29')](_0xd33b85[_0x225f('0x62')]):'null');return respondWithRpcPromise(_0x225f('0x74'),_0x225f('0x75'),_0x4ba376);}return null;})[_0x225f('0x24')](function(_0x55c2cd){if(_0x55c2cd){if(_0xd33b85[_0x225f('0x62')][_0x225f('0x76')]){_0x4ba376[_0x225f('0x2d')][_0x225f('0x77')]=util[_0x225f('0x67')]('SIP/%s',_0xd33b85[_0x225f('0x69')][_0x225f('0x3d')]);_0x4ba376[_0x225f('0x2d')][_0x225f('0x78')]=_0x4ba376[_0x225f('0x78')];_0x4ba376[_0x225f('0x2d')][_0x225f('0x79')]='accept';return respondWithRpcPromise(_0x225f('0x7a'),_0x225f('0x7a'),{'event':_0x225f('0x7b'),'message':_0x4ba376[_0x225f('0x2d')]},client9002)[_0x225f('0x24')](function(){return _0x4ba376;});}return _0x4ba376;}return null;})[_0x225f('0x24')](respondWithResult(_0x514638,null))[_0x225f('0x2f')](handleError(_0x514638,null));};var interaction_log=require(_0x225f('0x14'))(_0x225f('0x7c'));exports[_0x225f('0x38')]=function(_0x34b537,_0x215b8d,_0x198fd4){var _0x58676a={'agent':{},'channel':'sms'};if(_0x34b537[_0x225f('0x62')]['id']){delete _0x34b537[_0x225f('0x62')]['id'];}_0x34b537[_0x225f('0x62')]['UserId']=_0x34b537[_0x225f('0x62')][_0x225f('0x68')]||_0x34b537[_0x225f('0x69')]['id'];_0x58676a[_0x225f('0x7d')]['id']=_0x34b537[_0x225f('0x62')][_0x225f('0x68')];return db[_0x225f('0x59')][_0x225f('0x60')]({'where':{'id':_0x34b537['params']['id'],'UserId':null}})[_0x225f('0x24')](handleEntityNotFound(_0x215b8d,null))[_0x225f('0x24')](function(_0xcd881e){if(_0xcd881e){_0x58676a[_0x225f('0x2d')]=_0xcd881e[_0x225f('0x6c')]({'plain':!![]});return db[_0x225f('0x6d')]['find']({'where':{'id':_0xcd881e[_0x225f('0x6e')]}});}return null;})[_0x225f('0x24')](handleEntityNotFound(_0x215b8d,null))['then'](function(_0x2d903d){if(_0x2d903d){_0x58676a[_0x225f('0x71')]=_0x2d903d['get']({'plain':!![]});interaction_log['info'](_0x225f('0x7e'),_0x34b537[_0x225f('0x69')]['id'],_0x34b537['user'][_0x225f('0x3d')],_0x34b537['user']['role'],_0x58676a[_0x225f('0x71')]['id'],_0x34b537[_0x225f('0x62')]?JSON['stringify'](_0x34b537[_0x225f('0x62')]):_0x225f('0x7f'));return respondWithRpcPromise(_0x225f('0x80'),_0x225f('0x81'),_0x58676a);}return null;})[_0x225f('0x24')](function(_0xbfcd66){if(_0xbfcd66){_0xbfcd66[_0x225f('0x2d')][_0x225f('0x77')]=util[_0x225f('0x67')](_0x225f('0x82'),_0x34b537[_0x225f('0x69')][_0x225f('0x3d')]);_0xbfcd66['message'][_0x225f('0x78')]=_0x58676a[_0x225f('0x78')];_0xbfcd66[_0x225f('0x2d')]['event']=_0x225f('0x38');respondWithRpcPromise(_0x225f('0x7a'),_0x225f('0x7a'),{'event':'rejectmessage','message':_0xbfcd66['message']},client9002);return _0x58676a;}return null;})[_0x225f('0x24')](respondWithResult(_0x215b8d,null))[_0x225f('0x2f')](handleError(_0x215b8d,null));};exports[_0x225f('0x31')]=function(_0x7944f1,_0x555efb,_0x27b7b7){if(_0x7944f1[_0x225f('0x62')]['id']){delete _0x7944f1['body']['id'];}var _0x24b6f2;return db[_0x225f('0x59')][_0x225f('0x60')]({'where':{'id':_0x7944f1['params']['id']}})[_0x225f('0x24')](handleEntityNotFound(_0x555efb,null))[_0x225f('0x24')](function(_0x5a14a7){if(_0x5a14a7){_0x24b6f2=_0x5a14a7;return db[_0x225f('0x83')][_0x225f('0x60')]({'where':{'id':_0x5a14a7[_0x225f('0x84')]}});}})[_0x225f('0x24')](handleEntityNotFound(_0x555efb,null))['then'](function(_0x4b27f5){if(_0x4b27f5){logger[_0x225f('0x27')](_0x225f('0x28'),_0x225f('0x31'),'received\x20delivery\x20report\x20from',_0x4b27f5[_0x225f('0x43')],util[_0x225f('0x85')](_0x7944f1['body'],{'showHidden':![],'depth':null}));switch(_0x4b27f5[_0x225f('0x43')]){case'twilio':if(_0x7944f1[_0x225f('0x62')][_0x225f('0x86')]&&_0x7944f1[_0x225f('0x62')][_0x225f('0x86')]===_0x24b6f2['messageId']){return _0x24b6f2['update']({'read':!![]});}else{logger[_0x225f('0x2a')](_0x225f('0x87'),'status',_0x225f('0x88'),util[_0x225f('0x85')](_0x7944f1['body'],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x7944f1[_0x225f('0x62')][_0x225f('0x89')]&&_0x7944f1[_0x225f('0x62')][_0x225f('0x89')]===_0x24b6f2[_0x225f('0x8a')]&&_['indexOf']([_0x225f('0x8b'),_0x225f('0x8c')],_0x7944f1[_0x225f('0x62')]['Status'])>=0x0){return _0x24b6f2[_0x225f('0x3a')]({'read':!![]});}else{logger[_0x225f('0x2a')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x225f('0x31'),'plivio',util[_0x225f('0x85')](_0x7944f1[_0x225f('0x62')],{'showHidden':![],'depth':null}));}break;case _0x225f('0x8d'):var _0x4d82cf=_0x7944f1['body'][_0x225f('0x8e')][0x0];if(_0x4d82cf[_0x225f('0x31')][_0x225f('0x8f')]===_0x225f('0x90')){return _0x24b6f2[_0x225f('0x3a')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x225f('0x31'),_0x225f('0x8d'),util['inspect'](_0x7944f1[_0x225f('0x62')],{'showHidden':![],'depth':null}));}break;}return _0x24b6f2;}})[_0x225f('0x24')](respondWithResult(_0x555efb,null))[_0x225f('0x2f')](handleError(_0x555efb,null));};