Built motion from commit 1fa89557.|2.6.10
[motion2.git] / server / api / cmContact / cmContact.model.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 _0x9e11=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','fti_cm_contacts','lastName','mobile','fax','email','FULLTEXT','error','cmContact','afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','findOne','then','utcOffset','add','minutes','ret','cmContact,\x20afterCreate\x20','CmHopper','create','ListId','priority','callbackUniqueid','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','catch','Campaign','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','cmContact,\x20afterCreate,\x20','findAll','dialCheckDuplicateType','length','get','onlyIfOpen','BlackLists','message','CmList','Lists','always','CmHopperBlack','cmContact,\x20%s,\x20%s','List\x20not\x20found','models','isEmpty','VoiceQueueId','CampaignId','push','all','info','[CmContact][afterDestroy][Error]','lodash'];(function(_0x2e2681,_0x4089c1){var _0x368a64=function(_0x267262){while(--_0x267262){_0x2e2681['push'](_0x2e2681['shift']());}};_0x368a64(++_0x4089c1);}(_0x9e11,0x15d));var _0x19e1=function(_0x17303c,_0x274419){_0x17303c=_0x17303c-0x0;var _0x296266=_0x9e11[_0x17303c];return _0x296266;};'use strict';var _=require(_0x19e1('0x0'));var util=require('util');var logger=require(_0x19e1('0x1'))(_0x19e1('0x2'));var moment=require(_0x19e1('0x3'));var BPromise=require(_0x19e1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x19e1('0x5'));var rimraf=require(_0x19e1('0x6'));var config=require(_0x19e1('0x7'));var shared=require('../../config/environment/shared');var attributes=require(_0x19e1('0x8'));module[_0x19e1('0x9')]=function(_0x3d9996,_0x4aae03){return _0x3d9996[_0x19e1('0xa')](_0x19e1('0xb'),attributes,{'tableName':_0x19e1('0xc'),'paranoid':!![],'indexes':[{'name':_0x19e1('0xd'),'fields':[_0x19e1('0xd')]},{'name':_0x19e1('0xe'),'fields':['firstName',_0x19e1('0xf'),_0x19e1('0xd'),_0x19e1('0x10'),_0x19e1('0x11'),_0x19e1('0x12')],'type':_0x19e1('0x13')}],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci','hooks':{'afterCreate':function(_0x32c8fb,_0x3414a3,_0x2dd1d1){var _0x160e9f=_0x3d9996['models'];var _0x33bb7f=_0x32c8fb['get']({'plain':!![]});function _0x3749fc(){return function(_0x221de7){logger[_0x19e1('0x14')](_0x19e1('0x15'),_0x19e1('0x16'),util[_0x19e1('0x17')](_0x221de7,{'showHidden':![],'depth':null}));};}function _0x353da5(_0x2caaea,_0x2eb132){var _0x10b210=_0x2eb132[_0x19e1('0x18')]?_0x2eb132[_0x19e1('0x18')]:moment()[_0x19e1('0x19')](_0x19e1('0x1a'));return new BPromise(function(_0x53c2c9,_0x9f3a74){if(_[_0x19e1('0x1b')](_0x2eb132[_0x19e1('0x1c')])){_0x53c2c9({'ret':_0x10b210});}else{_0x160e9f[_0x19e1('0x1d')][_0x19e1('0x1e')]({'where':{'id':_0x2caaea['id']}})[_0x19e1('0x1f')](function(_0x4a83ca){if(!_[_0x19e1('0x1b')](_0x4a83ca)){var _0x2b17eb=_0x4a83ca[_0x19e1('0x1c')];if(!_['isNil'](_0x2b17eb)){var _0x18a5e1=shared['timezones'];var _0x23e754=_0x18a5e1[_0x2b17eb];var _0xa811e7=_0x18a5e1[_0x2eb132[_0x19e1('0x1c')]];if(!_[_0x19e1('0x1b')](_0x23e754)&&!_[_0x19e1('0x1b')](_0xa811e7)){var _0x2c8bf4=_0x23e754['utcOffset']-_0xa811e7[_0x19e1('0x20')];_0x10b210=_0x2eb132[_0x19e1('0x18')]?_0x2eb132[_0x19e1('0x18')]:moment();var _0x44b950=moment(_0x10b210)[_0x19e1('0x21')](_0x2c8bf4,_0x19e1('0x22'));_0x53c2c9({'ret':_0x44b950[_0x19e1('0x19')](_0x19e1('0x1a'))});}else _0x53c2c9({'ret':_0x10b210});}else _0x53c2c9({'ret':_0x10b210});}else{_0x53c2c9({'ret':_0x10b210});}});}});return 0xa;}var _0x3c00e9=function(_0x19d92f){return new BPromise(function(_0x318320,_0x1a3da4){_0x353da5(_0x19d92f,_0x33bb7f)[_0x19e1('0x1f')](function(_0x8fe95d){_0x33bb7f['scheduledat']=_0x8fe95d[_0x19e1('0x23')];_0x160e9f['CmHopper']['findOne']({'where':{'phone':_0x33bb7f[_0x19e1('0xd')],'VoiceQueueId':_0x19d92f['id']}})['then'](function(_0x3e23e2){if(!_[_0x19e1('0x1b')](_0x3e23e2)){throw new Error(_0x19e1('0x24')+_0x33bb7f['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x19d92f['id']);}return _0x160e9f[_0x19e1('0x25')][_0x19e1('0x26')]({'phone':_0x33bb7f['phone'],'ContactId':_0x33bb7f['id'],'ListId':_0x33bb7f[_0x19e1('0x27')],'priority':_0x33bb7f[_0x19e1('0x28')]?_0x33bb7f[_0x19e1('0x28')]:0x2,'scheduledat':_0x33bb7f[_0x19e1('0x18')]?_0x33bb7f[_0x19e1('0x18')]:moment()[_0x19e1('0x19')](_0x19e1('0x1a')),'callback':_0x33bb7f['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x33bb7f[_0x19e1('0x29')]?_0x33bb7f[_0x19e1('0x29')]:undefined,'callbackat':_0x33bb7f[_0x19e1('0x29')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x19d92f['id']});})['catch'](function(_0x2e6156){_0x1a3da4(_0x2e6156);});});});};var _0x311352=function(_0x2bb02e){return new BPromise(function(_0x5df06a,_0x557c4e){_0x353da5(_0x2bb02e,_0x33bb7f)['then'](function(_0x553e98){_0x33bb7f[_0x19e1('0x18')]=_0x553e98[_0x19e1('0x23')];_0x160e9f[_0x19e1('0x25')][_0x19e1('0x1e')]({'where':{'phone':_0x33bb7f[_0x19e1('0xd')],'VoiceQueueId':_0x2bb02e['id']}})[_0x19e1('0x1f')](function(_0x1b6194){if(!_[_0x19e1('0x1b')](_0x1b6194)){throw new Error(_0x19e1('0x24')+_0x33bb7f[_0x19e1('0xd')]+_0x19e1('0x2a')+_0x2bb02e['id']);}return _0x160e9f[_0x19e1('0x2b')]['findOne']({'where':{'calleridnum':_0x33bb7f[_0x19e1('0xd')],'VoiceQueueId':_0x2bb02e['id']}});})['then'](function(_0x15bf5e){if(!_[_0x19e1('0x1b')](_0x15bf5e)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x33bb7f[_0x19e1('0xd')]+_0x19e1('0x2c')+_0x2bb02e['id']);}return _0x160e9f[_0x19e1('0x25')][_0x19e1('0x26')]({'phone':_0x33bb7f[_0x19e1('0xd')],'ContactId':_0x33bb7f['id'],'ListId':_0x33bb7f['ListId'],'priority':_0x33bb7f[_0x19e1('0x28')]?_0x33bb7f[_0x19e1('0x28')]:0x2,'scheduledat':_0x33bb7f[_0x19e1('0x18')]?_0x33bb7f[_0x19e1('0x18')]:moment()['format'](_0x19e1('0x1a')),'callback':_0x33bb7f[_0x19e1('0x29')]?!![]:![],'callbackuniqueid':_0x33bb7f[_0x19e1('0x29')]?_0x33bb7f[_0x19e1('0x29')]:undefined,'callbackat':_0x33bb7f[_0x19e1('0x29')]?moment()[_0x19e1('0x19')](_0x19e1('0x1a')):undefined,'VoiceQueueId':_0x2bb02e['id']});})[_0x19e1('0x2d')](function(_0x8010db){_0x557c4e(_0x8010db);});});});};function _0x151810(){return function(_0x3bbbe9){logger[_0x19e1('0x14')](_0x19e1('0x15'),_0x19e1('0x16'),util[_0x19e1('0x17')](_0x3bbbe9,{'showHidden':![],'depth':null}));};}function _0x119d6a(_0x1483b0,_0x4d08a2){var _0x2d70e2=_0x4d08a2[_0x19e1('0x18')]?_0x4d08a2[_0x19e1('0x18')]:moment()[_0x19e1('0x19')](_0x19e1('0x1a'));return new BPromise(function(_0x7f6347,_0xdacb0){if(_[_0x19e1('0x1b')](_0x4d08a2[_0x19e1('0x1c')])){_0x7f6347({'ret':_0x2d70e2});}else{_0x160e9f[_0x19e1('0x2e')]['findOne']({'where':{'id':_0x1483b0['id']}})[_0x19e1('0x1f')](function(_0x42f396){if(!_[_0x19e1('0x1b')](_0x42f396)){var _0x3360b4=_0x42f396[_0x19e1('0x1c')];if(!_['isNil'](_0x3360b4)){var _0x22dcc7=shared['timezones'];var _0x4566b8=_0x22dcc7[_0x3360b4];var _0x40339d=_0x22dcc7[_0x4d08a2[_0x19e1('0x1c')]];if(!_['isNil'](_0x4566b8)&&!_[_0x19e1('0x1b')](_0x40339d)){var _0x47b7aa=_0x4566b8[_0x19e1('0x20')]-_0x40339d[_0x19e1('0x20')];_0x2d70e2=_0x4d08a2[_0x19e1('0x18')]?_0x4d08a2[_0x19e1('0x18')]:moment();var _0x5c32a2=moment(_0x2d70e2)[_0x19e1('0x21')](_0x47b7aa,_0x19e1('0x22'));_0x7f6347({'ret':_0x5c32a2[_0x19e1('0x19')](_0x19e1('0x1a'))});}else _0x7f6347({'ret':_0x2d70e2});}else _0x7f6347({'ret':_0x2d70e2});}else{_0x7f6347({'ret':_0x2d70e2});}});}});return 0xa;}var _0x1ae098=function(_0x391e1a){return new BPromise(function(_0x3c38c7,_0x352fbd){_0x119d6a(_0x391e1a,_0x33bb7f)[_0x19e1('0x1f')](function(_0x53b060){_0x33bb7f[_0x19e1('0x18')]=_0x53b060[_0x19e1('0x23')];_0x160e9f['CmHopper'][_0x19e1('0x1e')]({'where':{'phone':_0x33bb7f[_0x19e1('0xd')],'CampaignId':_0x391e1a['id']}})[_0x19e1('0x1f')](function(_0x43a75e){if(!_[_0x19e1('0x1b')](_0x43a75e)){throw new Error(_0x19e1('0x24')+_0x33bb7f[_0x19e1('0xd')]+_0x19e1('0x2f')+_0x391e1a['id']);}return _0x160e9f['CmHopper'][_0x19e1('0x26')]({'phone':_0x33bb7f[_0x19e1('0xd')],'ContactId':_0x33bb7f['id'],'ListId':_0x33bb7f[_0x19e1('0x27')],'priority':_0x33bb7f[_0x19e1('0x28')]?_0x33bb7f[_0x19e1('0x28')]:0x2,'scheduledat':_0x33bb7f[_0x19e1('0x18')]?_0x33bb7f[_0x19e1('0x18')]:moment()['format'](_0x19e1('0x1a')),'callback':_0x33bb7f[_0x19e1('0x29')]?!![]:![],'callbackuniqueid':_0x33bb7f[_0x19e1('0x29')]?_0x33bb7f[_0x19e1('0x29')]:undefined,'callbackat':_0x33bb7f[_0x19e1('0x29')]?moment()[_0x19e1('0x19')](_0x19e1('0x1a')):undefined,'CampaignId':_0x391e1a['id']});})[_0x19e1('0x2d')](function(_0x1267ff){_0x352fbd(_0x1267ff);});});});};var _0x318298=function(_0x528c4a){return new BPromise(function(_0x294474,_0x2389bd){_0x119d6a(_0x528c4a,_0x33bb7f)[_0x19e1('0x1f')](function(_0x111f35){_0x33bb7f['scheduledat']=_0x111f35[_0x19e1('0x23')];_0x160e9f['CmHopper'][_0x19e1('0x1e')]({'where':{'phone':_0x33bb7f[_0x19e1('0xd')],'CampaignId':_0x528c4a['id']}})[_0x19e1('0x1f')](function(_0xe35550){if(!_['isNil'](_0xe35550)){throw new Error(_0x19e1('0x24')+_0x33bb7f[_0x19e1('0xd')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x528c4a['id']);}return _0x160e9f[_0x19e1('0x2b')][_0x19e1('0x1e')]({'where':{'calleridnum':_0x33bb7f[_0x19e1('0xd')],'CampaignId':_0x528c4a['id']}});})['then'](function(_0x3b1ef1){if(!_[_0x19e1('0x1b')](_0x3b1ef1)){throw new Error(_0x19e1('0x30')+_0x33bb7f['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20'+_0x528c4a['id']);}return _0x160e9f[_0x19e1('0x25')][_0x19e1('0x26')]({'phone':_0x33bb7f[_0x19e1('0xd')],'ContactId':_0x33bb7f['id'],'ListId':_0x33bb7f[_0x19e1('0x27')],'priority':_0x33bb7f[_0x19e1('0x28')]?_0x33bb7f['priority']:0x2,'scheduledat':_0x33bb7f['scheduledat']?_0x33bb7f[_0x19e1('0x18')]:moment()[_0x19e1('0x19')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x33bb7f[_0x19e1('0x29')]?!![]:![],'callbackuniqueid':_0x33bb7f['callbackUniqueid']?_0x33bb7f[_0x19e1('0x29')]:undefined,'callbackat':_0x33bb7f['callbackUniqueid']?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x528c4a['id']});})[_0x19e1('0x2d')](function(_0x2ecd9e){_0x2389bd(_0x2ecd9e);});});});};if(_0x33bb7f[_0x19e1('0x27')]){_0x160e9f[_0x19e1('0x1d')][_0x19e1('0x31')]({'where':{'type':'outbound'},'attributes':['id',_0x19e1('0x32'),_0x19e1('0x1c')],'include':[{'model':_0x160e9f['CmList'],'as':'Lists','where':{'id':_0x33bb7f[_0x19e1('0x27')]}}]})['then'](function(_0x3d8dd3){if(_0x3d8dd3){var _0x58fe6c=[];for(var _0x50ea5c=0x0,_0x50793b;_0x50ea5c<_0x3d8dd3[_0x19e1('0x33')];_0x50ea5c+=0x1){_0x50793b=_0x3d8dd3[_0x50ea5c][_0x19e1('0x34')]({'plain':!![]});switch(_0x50793b['dialCheckDuplicateType']){case'always':_0x311352(_0x50793b)[_0x19e1('0x2d')](_0x3749fc());break;case _0x19e1('0x35'):_0x3c00e9(_0x50793b)[_0x19e1('0x2d')](_0x3749fc());break;default:_0x119d6a(_0x50793b,_0x33bb7f)[_0x19e1('0x1f')](function(_0x6eea2d){_0x33bb7f[_0x19e1('0x18')]=_0x6eea2d[_0x19e1('0x23')];_0x160e9f['CmHopper'][_0x19e1('0x26')]({'phone':_0x33bb7f['phone'],'ContactId':_0x33bb7f['id'],'ListId':_0x33bb7f[_0x19e1('0x27')],'scheduledat':_0x33bb7f[_0x19e1('0x18')]?_0x33bb7f[_0x19e1('0x18')]:moment()[_0x19e1('0x19')](_0x19e1('0x1a')),'priority':_0x33bb7f[_0x19e1('0x28')]?_0x33bb7f[_0x19e1('0x28')]:0x2,'callback':_0x33bb7f[_0x19e1('0x29')]?!![]:![],'callbackuniqueid':_0x33bb7f[_0x19e1('0x29')]?_0x33bb7f[_0x19e1('0x29')]:undefined,'callbackat':_0x33bb7f[_0x19e1('0x29')]?moment()[_0x19e1('0x19')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x50793b['id']})[_0x19e1('0x2d')](_0x3749fc());});}}}})[_0x19e1('0x1f')](function(){return _0x160e9f['VoiceQueue'][_0x19e1('0x31')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':_0x160e9f['CmList'],'as':_0x19e1('0x36'),'where':{'id':_0x33bb7f[_0x19e1('0x27')]}}]})['then'](function(_0x42844f){if(_0x42844f){var _0x18598d=[];for(var _0x3295d5=0x0,_0x401021;_0x3295d5<_0x42844f[_0x19e1('0x33')];_0x3295d5+=0x1){_0x401021=_0x42844f[_0x3295d5][_0x19e1('0x34')]({'plain':!![]});_0x160e9f['CmHopperBlack'][_0x19e1('0x26')]({'phone':_0x33bb7f[_0x19e1('0xd')],'ContactId':_0x33bb7f['id'],'ListId':_0x33bb7f[_0x19e1('0x27')],'VoiceQueueId':_0x401021['id']})[_0x19e1('0x2d')](function(_0x495c6f){logger[_0x19e1('0x14')]('cmContact,\x20%s,\x20%s',_0x19e1('0x16'),_0x495c6f[_0x19e1('0x37')]);});}}});})['then'](function(){return _0x160e9f[_0x19e1('0x2e')][_0x19e1('0x31')]({'attributes':['id','dialCheckDuplicateType',_0x19e1('0x1c')],'include':[{'model':_0x160e9f[_0x19e1('0x38')],'as':_0x19e1('0x39'),'where':{'id':_0x33bb7f[_0x19e1('0x27')]}}]})['then'](function(_0x3e9e6c){if(_0x3e9e6c){var _0x53706a=[];for(var _0x51d199=0x0,_0x547958;_0x51d199<_0x3e9e6c[_0x19e1('0x33')];_0x51d199+=0x1){_0x547958=_0x3e9e6c[_0x51d199]['get']({'plain':!![]});switch(_0x547958[_0x19e1('0x32')]){case _0x19e1('0x3a'):_0x318298(_0x547958)[_0x19e1('0x2d')](_0x151810());break;case _0x19e1('0x35'):_0x1ae098(_0x547958)[_0x19e1('0x2d')](_0x151810());break;default:_0x160e9f[_0x19e1('0x25')][_0x19e1('0x26')]({'phone':_0x33bb7f[_0x19e1('0xd')],'ContactId':_0x33bb7f['id'],'ListId':_0x33bb7f['ListId'],'scheduledat':_0x33bb7f[_0x19e1('0x18')]?_0x33bb7f[_0x19e1('0x18')]:moment()[_0x19e1('0x19')](_0x19e1('0x1a')),'priority':_0x33bb7f['priority']?_0x33bb7f[_0x19e1('0x28')]:0x2,'callback':_0x33bb7f[_0x19e1('0x29')]?!![]:![],'callbackuniqueid':_0x33bb7f['callbackUniqueid']?_0x33bb7f[_0x19e1('0x29')]:undefined,'callbackat':_0x33bb7f[_0x19e1('0x29')]?moment()[_0x19e1('0x19')](_0x19e1('0x1a')):undefined,'CampaignId':_0x547958['id']})[_0x19e1('0x2d')](_0x151810());}}}});})[_0x19e1('0x1f')](function(){return _0x160e9f[_0x19e1('0x2e')][_0x19e1('0x31')]({'attributes':['id'],'include':[{'model':_0x160e9f['CmList'],'as':_0x19e1('0x36'),'where':{'id':_0x33bb7f[_0x19e1('0x27')]}}]})[_0x19e1('0x1f')](function(_0x5a6eb9){if(_0x5a6eb9){var _0x2fe3c5=[];for(var _0x4dcabe=0x0,_0x23f05;_0x4dcabe<_0x5a6eb9[_0x19e1('0x33')];_0x4dcabe+=0x1){_0x23f05=_0x5a6eb9[_0x4dcabe][_0x19e1('0x34')]({'plain':!![]});_0x160e9f[_0x19e1('0x3b')][_0x19e1('0x26')]({'phone':_0x33bb7f[_0x19e1('0xd')],'ContactId':_0x33bb7f['id'],'ListId':_0x33bb7f[_0x19e1('0x27')],'CampaignId':_0x23f05['id']})['catch'](function(_0x100404){logger['error']('cmContact,\x20%s,\x20%s',_0x19e1('0x16'),_0x100404[_0x19e1('0x37')]);});}}});})[_0x19e1('0x1f')](function(){_0x2dd1d1();})[_0x19e1('0x2d')](function(_0x1e5418){logger[_0x19e1('0x14')](_0x19e1('0x3c'),'afterCreate',_0x1e5418[_0x19e1('0x37')]);_0x2dd1d1(_0x1e5418);});}else{_0x2dd1d1(new Error(_0x19e1('0x3d')));}},'afterDestroy':function(_0x553f2b,_0x15430c,_0x210852){var _0x5c2504=_0x3d9996[_0x19e1('0x3e')];var _0x255bae=_0x553f2b[_0x19e1('0x34')]({'plain':!![]});return _0x5c2504[_0x19e1('0x25')][_0x19e1('0x31')]({'raw':!![],'where':{'ListId':_0x255bae[_0x19e1('0x27')],'ContactId':_0x255bae['id']}})[_0x19e1('0x1f')](function(_0x2f9b35){if(!_[_0x19e1('0x3f')](_0x2f9b35)){var _0x2cca95=[];for(var _0x5265c8=0x0;_0x5265c8<_0x2f9b35[_0x19e1('0x33')];_0x5265c8+=0x1){var _0x1b9c3d=_0x5c2504[_0x19e1('0x25')]['destroy']({'where':{'ListId':_0x2f9b35[_0x5265c8]['ListId'],'ContactId':_0x2f9b35[_0x5265c8]['ContactId'],'VoiceQueueId':_0x2f9b35[_0x5265c8][_0x19e1('0x40')],'CampaignId':_0x2f9b35[_0x5265c8][_0x19e1('0x41')]}});_0x2cca95[_0x19e1('0x42')](_0x1b9c3d);}return BPromise[_0x19e1('0x43')](_0x2cca95);}})['then'](function(_0x199c7d){logger[_0x19e1('0x44')]('[CmContact][afterDestroy][Succesfull]',util['inspect'](_0x199c7d,{'showHidden':![],'depth':null}));_0x210852();})[_0x19e1('0x2d')](function(_0x45936e){logger['error'](_0x19e1('0x45'),util['inspect'](_0x45936e,{'showHidden':![],'depth':null}));_0x210852(_0x45936e);});}}});};