Built motion from commit 52c8a02d.|2.6.29
[motion2.git] / server / services / ami / trigger / integration / sugarcrm.js
index e359157..72c9bf3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa8c4=['parent_type','Contacts','direction','length','variableName','idField','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','find','entry_list','value','Agent\x20found!','resolve','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','user_name','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry','first_name','<unknown>','debug','[HTTP]','merge','map','forEach','type','string','nameField','customField','toLowerCase','content','variable','custom_fields','Variable','push','login','password','PLAIN','xCALLY\x20Motion\x20integration','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','outbound','%s/service/v4_1/rest.php','recordingFormat','destcalleridname','version','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','[OUTBOUND]','error','unmanaged','uri','lastevent','lodash','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','POST','info','Creating\x20new\x20ticket...','name','getString','assigned_user_id','created_by','description','Descriptions','toISOString','replace','duration_hours','parent_id'];(function(_0xea343d,_0x311197){var _0x2c6e9c=function(_0x454bd6){while(--_0x454bd6){_0xea343d['push'](_0xea343d['shift']());}};_0x2c6e9c(++_0x311197);}(_0xa8c4,0x1bf));var _0x4a8c=function(_0x463f44,_0xc071ff){_0x463f44=_0x463f44-0x0;var _0x304163=_0xa8c4[_0x463f44];return _0x304163;};'use strict';var _=require(_0x4a8c('0x0'));var rp=require('request-promise');var BPromise=require(_0x4a8c('0x1'));var md5=require(_0x4a8c('0x2'));var util=require(_0x4a8c('0x3'));var Redis=require(_0x4a8c('0x4'));var intUtil=require(_0x4a8c('0x5'));var config=require(_0x4a8c('0x6'));var logger=require(_0x4a8c('0x7'))(_0x4a8c('0x8'));config[_0x4a8c('0x9')]=_[_0x4a8c('0xa')](config['redis'],{'host':_0x4a8c('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4a8c('0x9')]));var def={'method':_0x4a8c('0xc'),'json':!![]};function emit(_0xd0d6e,_0x3c021c,_0x57db18){io['to'](_0xd0d6e)['emit'](_0x3c021c,_0x57db18);}function getTicket(_0x17046b,_0x1aaee4,_0x1205d9,_0x5f3131,_0x2a9389,_0x5ee0e1,_0x31e1d2,_0x4e7ecd){logger[_0x4a8c('0xd')](_0x4a8c('0xe'));var _0x2b9788=new Date();var _0x44ef6a=[{'name':_0x4a8c('0xf'),'value':intUtil[_0x4a8c('0x10')](_0x5f3131['Subjects'],_0x2a9389,'\x20')},{'name':_0x4a8c('0x11'),'value':_0x1aaee4['id']},{'name':_0x4a8c('0x12'),'value':_0x1aaee4['id']},{'name':_0x4a8c('0x13'),'value':intUtil[_0x4a8c('0x10')](_0x5f3131[_0x4a8c('0x14')],_0x2a9389,'\x0a')},{'name':'date_start','value':_0x2b9788[_0x4a8c('0x15')]()['slice'](0x0,0x13)[_0x4a8c('0x16')]('T','\x20')},{'name':_0x4a8c('0x17'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0x4a8c('0x18'),'value':_0x1205d9['id']},{'name':_0x4a8c('0x19'),'value':_0x4a8c('0x1a')},{'name':'parent_name','value':_0x1205d9['name']},{'name':_0x4a8c('0x1b'),'value':_0x4e7ecd}];if(_0x5ee0e1[_0x4a8c('0x1c')]){_['forEach'](_0x5ee0e1,function(_0x5c59c4){if(_0x2a9389[_0x5c59c4[_0x4a8c('0x1d')]]){_0x44ef6a['push']({'name':_0x5c59c4[_0x4a8c('0x1e')],'value':_0x2a9389[_0x5c59c4[_0x4a8c('0x1d')]]});}});}return request({'form':{'method':'set_entry','input_type':'JSON','response_type':_0x4a8c('0x1f'),'rest_data':JSON[_0x4a8c('0x20')]({'session':_0x31e1d2['id'],'module_name':_0x4a8c('0x21'),'name_value_list':_0x44ef6a})}});}function getAuth(_0x10b079){return util[_0x4a8c('0x22')](_0x4a8c('0x23'),new Buffer(_0x10b079[_0x4a8c('0x24')]+':X')[_0x4a8c('0x25')]('base64'));}function getServerInfo(_0x59f1d8){return request({'form':{'method':_0x4a8c('0x26'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x4a8c('0x20')]({'session':_0x59f1d8['id']})}});}function getUser(_0x525414,_0xef59e9,_0x50ac75){if(!_[_0x4a8c('0x27')](_0xef59e9)){logger[_0x4a8c('0xd')](_0x4a8c('0x28'),_0xef59e9);return request({'form':{'method':_0x4a8c('0x29'),'input_type':_0x4a8c('0x1f'),'response_type':'JSON','rest_data':JSON[_0x4a8c('0x20')]({'session':_0x50ac75['id'],'module_name':'Employees','query':util[_0x4a8c('0x22')](_0x4a8c('0x2a'),_0xef59e9),'order_by':'','offset':'0','select_fields':['id',_0x4a8c('0xf'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x4a8c('0x2b')](function(_0x3fe11e){if(_0x3fe11e['entry_list'][_0x4a8c('0x1c')]){var _0x236a69=_[_0x4a8c('0x2c')](_0x3fe11e[_0x4a8c('0x2d')],function(_0x272384){return _0x272384['name_value_list']['user_name'][_0x4a8c('0x2e')]===_0xef59e9;});if(_0x236a69){logger[_0x4a8c('0xd')](_0x4a8c('0x2f'));return BPromise[_0x4a8c('0x30')]({'id':_0x236a69[_0x4a8c('0x31')]['id'][_0x4a8c('0x2e')],'name':_0x236a69['name_value_list'][_0x4a8c('0xf')][_0x4a8c('0x2e')]});}}logger[_0x4a8c('0xd')](_0x4a8c('0x32'));return BPromise[_0x4a8c('0x30')]({'id':_0x50ac75[_0x4a8c('0x31')][_0x4a8c('0x33')][_0x4a8c('0x2e')],'name':_0x50ac75[_0x4a8c('0x31')]['user_name'][_0x4a8c('0x2e')]});});}else{logger[_0x4a8c('0xd')](_0x4a8c('0x34'));return BPromise[_0x4a8c('0x30')]({'id':_0x50ac75[_0x4a8c('0x31')][_0x4a8c('0x33')][_0x4a8c('0x2e')],'name':_0x50ac75[_0x4a8c('0x31')][_0x4a8c('0x35')][_0x4a8c('0x2e')]});}}function getEndUser(_0x460a2f,_0x3dc8a3,_0x1d159b,_0x53b475){logger[_0x4a8c('0xd')](_0x4a8c('0x36'),_0x1d159b);return request({'form':{'method':'get_entry_list','input_type':_0x4a8c('0x1f'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x53b475['id'],'module_name':_0x4a8c('0x1a'),'query':util[_0x4a8c('0x22')](_0x4a8c('0x37'),_0x1d159b),'order_by':'','offset':'0','select_fields':['id',_0x4a8c('0xf'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x5ba724){if(_0x5ba724[_0x4a8c('0x2d')][_0x4a8c('0x1c')]){var _0x3a35aa=_[_0x4a8c('0x2c')](_0x5ba724[_0x4a8c('0x2d')],function(_0x513747){return _0x513747[_0x4a8c('0x31')][_0x4a8c('0x38')][_0x4a8c('0x2e')]===_0x1d159b;});if(_0x3a35aa){logger[_0x4a8c('0xd')](_0x4a8c('0x39'));return BPromise[_0x4a8c('0x30')]({'id':_0x3a35aa[_0x4a8c('0x31')]['id'][_0x4a8c('0x2e')],'name':_0x3a35aa[_0x4a8c('0x31')][_0x4a8c('0xf')][_0x4a8c('0x2e')],'phone':_0x3a35aa[_0x4a8c('0x31')][_0x4a8c('0x38')][_0x4a8c('0x2e')]});}}else{logger[_0x4a8c('0xd')](_0x4a8c('0x3a'));return request({'form':{'method':_0x4a8c('0x3b'),'input_type':_0x4a8c('0x1f'),'response_type':_0x4a8c('0x1f'),'rest_data':JSON['stringify']({'session':_0x53b475['id'],'module_name':_0x4a8c('0x1a'),'name_value_list':[{'name':_0x4a8c('0x3c'),'value':_0x3dc8a3!==_0x4a8c('0x3d')?_0x3dc8a3:util['format']('Caller\x20-\x20%s',_0x1d159b)},{'name':'phone_home','value':_0x1d159b}]})}})['then'](function(_0x585c14){logger[_0x4a8c('0xd')]('Enduser\x20created.');return BPromise[_0x4a8c('0x30')]({'id':_0x585c14['id'],'name':_0x585c14['entry_list'][_0x4a8c('0x3c')][_0x4a8c('0x2e')],'phone':_0x585c14[_0x4a8c('0x2d')][_0x4a8c('0x38')][_0x4a8c('0x2e')]});});}});}function request(_0x43cf6e){logger[_0x4a8c('0x3e')](_0x4a8c('0x3f'),JSON[_0x4a8c('0x20')](_0x43cf6e));return rp(_[_0x4a8c('0x40')](def,_0x43cf6e));}function getTags(_0x34064c,_0x2ddc9f){var _0x11a38c=[];if(_0x34064c&&_0x34064c[_0x4a8c('0x1c')]>0x0){_0x11a38c=_[_0x4a8c('0x41')](_0x34064c,_0x2ddc9f);}return _0x11a38c;}function getCustomFields(_0x22ead4,_0x3c7838){var _0x244aab=[];var _0x205a60={'custom_fields':[]};if(_0x22ead4['length']>0x0){_[_0x4a8c('0x42')](_0x22ead4,function(_0x51acf9){if(_0x51acf9[_0x4a8c('0x43')]===_0x4a8c('0x44')&&_0x51acf9[_0x4a8c('0x45')]&&!_0x51acf9[_0x4a8c('0x46')]){_0x205a60[_0x51acf9[_0x4a8c('0x45')][_0x4a8c('0x47')]()]=_0x51acf9[_0x4a8c('0x48')][_0x4a8c('0x25')]();}else if(_0x51acf9[_0x4a8c('0x43')]===_0x4a8c('0x44')&&_0x51acf9[_0x4a8c('0x1e')]&&_0x51acf9['customField']){_0x205a60['custom_fields']['push']({'id':_0x51acf9[_0x4a8c('0x1e')],'value':_0x51acf9[_0x4a8c('0x48')][_0x4a8c('0x25')]()});}else if(_0x51acf9[_0x4a8c('0x43')]===_0x4a8c('0x49')&&_0x51acf9[_0x4a8c('0x1d')]&&_0x51acf9['idField']&&_0x51acf9[_0x4a8c('0x46')]){_0x3c7838[_0x51acf9[_0x4a8c('0x1d')]]&&_0x205a60[_0x4a8c('0x4a')]['push']({'id':_0x51acf9[_0x4a8c('0x1e')],'value':_0x3c7838[_0x51acf9[_0x4a8c('0x1d')]][_0x4a8c('0x25')]()});}else if(_0x51acf9['type']==='customVariable'&&_0x51acf9[_0x4a8c('0x4b')]&&_0x51acf9[_0x4a8c('0x4b')][_0x4a8c('0xf')]&&_0x51acf9['idField']&&_0x51acf9['customField']){_0x3c7838[_0x51acf9['Variable'][_0x4a8c('0xf')]['toLowerCase']()]&&_0x205a60[_0x4a8c('0x4a')][_0x4a8c('0x4c')]({'id':_0x51acf9['idField'],'value':_0x3c7838[_0x51acf9[_0x4a8c('0x4b')]['name'][_0x4a8c('0x47')]()][_0x4a8c('0x25')]()});}});}return _0x205a60;}function getConnection(_0x2712c9){return request({'method':_0x4a8c('0xc'),'form':{'method':_0x4a8c('0x4d'),'input_type':_0x4a8c('0x1f'),'response_type':_0x4a8c('0x1f'),'rest_data':JSON[_0x4a8c('0x20')]({'user_auth':{'user_name':_0x2712c9['username'],'password':_0x2712c9[_0x4a8c('0x4e')],'encryption':_0x4a8c('0x4f')},'application':_0x4a8c('0x50')})}})[_0x4a8c('0x2b')](function(_0x5e2a89){var _0x5c99ff=_0x5e2a89;if(_0x5c99ff['id']){def['sessionID']=_0x5c99ff['id'];return BPromise[_0x4a8c('0x30')](_0x5c99ff);}else{throw new Error(util[_0x4a8c('0x22')](_0x4a8c('0x51'),_0x2712c9['id']));}});}function setRelationship(_0x1c3009,_0x15903a,_0x38818b,_0x1ab0a4){return request({'form':{'method':_0x4a8c('0x52'),'input_type':_0x4a8c('0x1f'),'response_type':_0x4a8c('0x1f'),'rest_data':JSON[_0x4a8c('0x20')]({'session':_0x1c3009['id'],'module_name':_0x4a8c('0x21'),'module_id':_0x38818b['id'],'link_field_name':_0x1ab0a4,'related_ids':[_0x15903a['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x4a8c('0x53')]=function(_0x38ba76,_0x6ff56e,_0x5aae40,_0x475fde,_0x1c412c,_0x1aa56e){var _0x20af0e,_0x21092f,_0x517a25,_0x37dbe3;_0x1aa56e[_0x4a8c('0x54')]=intUtil[_0x4a8c('0x55')](_0x1aa56e['remoteUri']);_0x1aa56e[_0x4a8c('0x56')]=intUtil[_0x4a8c('0x55')](_0x1aa56e[_0x4a8c('0x56')]);def['uri']=util[_0x4a8c('0x22')]('%s/service/v4_1/rest.php',_0x1aa56e[_0x4a8c('0x54')]);if(_0x1c412c&&_0x1c412c[_0x4a8c('0x57')]){logger[_0x4a8c('0xd')](_0x4a8c('0x58'),_0x4a8c('0x59'));_0x6ff56e[_0x4a8c('0x5a')]=util[_0x4a8c('0x22')](_0x4a8c('0x5b'),_0x1aa56e['serverUrl'],_0x6ff56e['uniqueid'],md5(_0x6ff56e[_0x4a8c('0x5c')]));}else{_0x6ff56e[_0x4a8c('0x5a')]='';}return getConnection(_0x1aa56e)[_0x4a8c('0x2b')](function(_0x5ccc02){_0x37dbe3=_0x5ccc02;return getUser(_0x1aa56e,_0x475fde['name'],_0x37dbe3);})[_0x4a8c('0x2b')](function(_0x597789){_0x20af0e=_0x597789;logger[_0x4a8c('0xd')](_0x4a8c('0x5d'),_0x20af0e['id']);return getEndUser(_0x1aa56e,_0x6ff56e[_0x4a8c('0x5e')],_0x6ff56e['calleridnum'],_0x37dbe3);})['then'](function(_0x2cb489){_0x21092f=_0x2cb489;logger['info'](_0x4a8c('0x5f'),_0x21092f['id']);return getTicket(_0x1aa56e,_0x20af0e,_0x21092f,_0x5aae40,_0x6ff56e,_0x5aae40[_0x4a8c('0x60')],_0x37dbe3,_0x4a8c('0x61'));})[_0x4a8c('0x2b')](function(_0x3341b3){_0x517a25=_0x3341b3;logger[_0x4a8c('0xd')](_0x4a8c('0x62'));logger['info'](_0x4a8c('0x63'),_0x517a25['id']);return setRelationship(_0x37dbe3,_0x20af0e,_0x517a25,_0x4a8c('0x64'));})[_0x4a8c('0x2b')](function(){return setRelationship(_0x37dbe3,_0x21092f,_0x517a25,_0x4a8c('0x65'));})[_0x4a8c('0x2b')](function(){return getServerInfo(_0x37dbe3);})[_0x4a8c('0x2b')](function(_0x3d7017){var _0x2181ef=parseInt(_0x3d7017['version']['charAt'](0x0));var _0x3eca37=util[_0x4a8c('0x22')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x1aa56e[_0x4a8c('0x54')],_0x517a25['id']);if(_0x2181ef>0x6){_0x3eca37=util[_0x4a8c('0x22')](_0x4a8c('0x66'),_0x1aa56e[_0x4a8c('0x54')],_0x517a25['id']);}logger[_0x4a8c('0xd')]('[QUEUE]',_0x4a8c('0x67'));emit(util[_0x4a8c('0x22')](_0x4a8c('0x68'),_0x475fde['name']),_0x4a8c('0x69'),{'uri':_0x3eca37});})[_0x4a8c('0x6a')](function(_0x3d908e){logger['error'](_0x4a8c('0x58'),JSON['stringify'](_0x3d908e));});};exports[_0x4a8c('0x6b')]=function(_0x336785,_0x5ac4be,_0x479be3,_0xf9f462,_0x2c01be,_0x2a3c5c,_0x3b6c68){var _0x46a988,_0x1e5d6a,_0x5ab2b5,_0x3c4533;_0x2a3c5c[_0x4a8c('0x54')]=intUtil[_0x4a8c('0x55')](_0x2a3c5c[_0x4a8c('0x54')]);_0x2a3c5c[_0x4a8c('0x56')]=intUtil['stripTrailingSlash'](_0x2a3c5c[_0x4a8c('0x56')]);def['uri']=util[_0x4a8c('0x22')](_0x4a8c('0x6c'),_0x2a3c5c[_0x4a8c('0x54')]);if(_0x3b6c68&&_0x3b6c68['recordingFormat']&&_0x3b6c68[_0x4a8c('0x6d')]!=='none'){logger[_0x4a8c('0xd')]('[OUTBOUND]',_0x4a8c('0x59'));_0x5ac4be[_0x4a8c('0x5a')]=util['format'](_0x4a8c('0x5b'),_0x2a3c5c[_0x4a8c('0x56')],_0x5ac4be[_0x4a8c('0x5c')],md5(_0x5ac4be[_0x4a8c('0x5c')]));}return getConnection(_0x2a3c5c)['then'](function(_0x557e7a){_0x3c4533=_0x557e7a;return getUser(_0x2a3c5c,_0xf9f462[_0x4a8c('0xf')],_0x3c4533);})['then'](function(_0x84ac4d){_0x46a988=_0x84ac4d;logger['info'](_0x4a8c('0x5d'),_0x46a988['id']);return getEndUser(_0x2a3c5c,_0x5ac4be[_0x4a8c('0x6e')],_0x5ac4be['destcalleridnum'],_0x3c4533);})[_0x4a8c('0x2b')](function(_0x51c521){_0x1e5d6a=_0x51c521;logger[_0x4a8c('0xd')]('The\x20Enduser\x20ID\x20is:',_0x1e5d6a['id']);return getTicket(_0x2a3c5c,_0x46a988,_0x1e5d6a,_0x479be3,_0x5ac4be,_0x479be3['Fields'],_0x3c4533,'Outbound');})['then'](function(_0x511a78){_0x5ab2b5=_0x511a78;logger[_0x4a8c('0xd')](_0x4a8c('0x62'));logger[_0x4a8c('0xd')](_0x4a8c('0x63'),_0x5ab2b5['id']);return setRelationship(_0x3c4533,_0x46a988,_0x5ab2b5,_0x4a8c('0x64'));})[_0x4a8c('0x2b')](function(){return setRelationship(_0x3c4533,_0x1e5d6a,_0x5ab2b5,_0x4a8c('0x65'));})['then'](function(){return getServerInfo(_0x3c4533);})[_0x4a8c('0x2b')](function(_0x3bffc9){var _0x3b2f31=parseInt(_0x3bffc9[_0x4a8c('0x6f')]['charAt'](0x0));var _0x52b32f=util[_0x4a8c('0x22')](_0x4a8c('0x70'),_0x2a3c5c[_0x4a8c('0x54')],_0x5ab2b5['id']);if(_0x3b2f31>0x6){_0x52b32f=util[_0x4a8c('0x22')](_0x4a8c('0x66'),_0x2a3c5c[_0x4a8c('0x54')],_0x5ab2b5['id']);}logger[_0x4a8c('0xd')](_0x4a8c('0x71'),_0x4a8c('0x67'));emit(util[_0x4a8c('0x22')](_0x4a8c('0x68'),_0xf9f462[_0x4a8c('0xf')]),'trigger:browser:url',{'uri':_0x52b32f});})[_0x4a8c('0x6a')](function(_0x475386){logger[_0x4a8c('0x72')](_0x4a8c('0x71'),JSON[_0x4a8c('0x20')](_0x475386));});};exports[_0x4a8c('0x73')]=function(_0x54dea1,_0x832344,_0x1873a4,_0x168dba,_0x203695,_0x273767){var _0x323305,_0x40fd71,_0x4343bb,_0x3c238e;_0x273767[_0x4a8c('0x54')]=intUtil['stripTrailingSlash'](_0x273767[_0x4a8c('0x54')]);_0x273767[_0x4a8c('0x56')]=intUtil[_0x4a8c('0x55')](_0x273767['serverUrl']);def[_0x4a8c('0x74')]=util[_0x4a8c('0x22')](_0x4a8c('0x6c'),_0x273767[_0x4a8c('0x54')]);if(_0x203695&&_0x203695['monitor_format']){logger[_0x4a8c('0xd')]('['+_0x832344['lastevent']['toUpperCase']()+']',_0x4a8c('0x59'));_0x832344[_0x4a8c('0x5a')]=util['format'](_0x4a8c('0x5b'),_0x273767[_0x4a8c('0x56')],_0x832344['uniqueid'],md5(_0x832344[_0x4a8c('0x5c')]));}else{_0x832344[_0x4a8c('0x5a')]='';}return getConnection(_0x273767)['then'](function(_0x5cf3f1){_0x3c238e=_0x5cf3f1;if(!_['isNil'](_0x168dba)){return getUser(_0x273767,_0x168dba[_0x4a8c('0xf')],_0x3c238e);}else{return getUser(_0x273767,null,_0x3c238e);}})[_0x4a8c('0x2b')](function(_0x190d48){_0x323305=_0x190d48;logger[_0x4a8c('0xd')](_0x4a8c('0x5d'),_0x323305['id']);return getEndUser(_0x273767,_0x832344[_0x4a8c('0x5e')],_0x832344['calleridnum'],_0x3c238e);})['then'](function(_0x111f25){_0x40fd71=_0x111f25;logger[_0x4a8c('0xd')](_0x4a8c('0x5f'),_0x40fd71['id']);return getTicket(_0x273767,_0x323305,_0x40fd71,_0x1873a4,_0x832344,_0x1873a4[_0x4a8c('0x60')],_0x3c238e,'Inbound');})[_0x4a8c('0x2b')](function(_0x351329){_0x4343bb=_0x351329;logger[_0x4a8c('0xd')]('Ticket\x20created!');logger['info'](_0x4a8c('0x63'),_0x4343bb['id']);return setRelationship(_0x3c238e,_0x323305,_0x4343bb,_0x4a8c('0x64'));})[_0x4a8c('0x2b')](function(){return setRelationship(_0x3c238e,_0x40fd71,_0x4343bb,'contacts');})[_0x4a8c('0x2b')](function(){return getServerInfo(_0x3c238e);})[_0x4a8c('0x6a')](function(_0x98d5c9){logger['error']('['+_0x832344[_0x4a8c('0x75')]['toUpperCase']()+']',JSON[_0x4a8c('0x20')](_0x98d5c9));});};
\ No newline at end of file
+var _0x725f=['uri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','users','version','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','%s/service/v4_1/rest.php','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','charAt','error','The\x20Ticket\x20ID\x20is:','contacts','lastevent','toUpperCase','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','sugarcrm','redis','socket.io-emitter','POST','Creating\x20new\x20ticket...','name','getString','Subjects','created_by','description','Descriptions','date_start','slice','replace','duration_hours','parent_id','parent_type','Contacts','parent_name','direction','length','forEach','variableName','push','idField','set_entry','JSON','Calls','Basic\x20%s','apiKey','toString','base64','get_server_info','stringify','isNil','info','Getting\x20agent\x20with\x20name','get_entry_list','Employees','then','entry_list','find','name_value_list','user_name','value','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','format','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','<unknown>','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','map','nameField','customField','content','type','string','custom_fields','variable','customVariable','Variable','toLowerCase','login','username','PLAIN','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl'];(function(_0xce0591,_0x20c9ae){var _0xf6499e=function(_0x40d94d){while(--_0x40d94d){_0xce0591['push'](_0xce0591['shift']());}};_0xf6499e(++_0x20c9ae);}(_0x725f,0x191));var _0xf725=function(_0x5a36e,_0x56603c){_0x5a36e=_0x5a36e-0x0;var _0x1ddcda=_0x725f[_0x5a36e];return _0x1ddcda;};'use strict';var _=require(_0xf725('0x0'));var rp=require(_0xf725('0x1'));var BPromise=require(_0xf725('0x2'));var md5=require('md5');var util=require(_0xf725('0x3'));var Redis=require(_0xf725('0x4'));var intUtil=require(_0xf725('0x5'));var config=require(_0xf725('0x6'));var logger=require('../../../../config/logger')(_0xf725('0x7'));config[_0xf725('0x8')]=_['defaults'](config[_0xf725('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xf725('0x9'))(new Redis(config[_0xf725('0x8')]));var def={'method':_0xf725('0xa'),'json':!![]};function emit(_0x5d3d4d,_0x837de0,_0x3c8a52){io['to'](_0x5d3d4d)['emit'](_0x837de0,_0x3c8a52);}function getTicket(_0x30699a,_0x5c2112,_0x4468bb,_0x261a15,_0x396487,_0x4e9001,_0x5f13bf,_0x144003){logger['info'](_0xf725('0xb'));var _0x29f176=new Date();var _0x47fedf=[{'name':_0xf725('0xc'),'value':intUtil[_0xf725('0xd')](_0x261a15[_0xf725('0xe')],_0x396487,'\x20')},{'name':'assigned_user_id','value':_0x5c2112['id']},{'name':_0xf725('0xf'),'value':_0x5c2112['id']},{'name':_0xf725('0x10'),'value':intUtil['getString'](_0x261a15[_0xf725('0x11')],_0x396487,'\x0a')},{'name':_0xf725('0x12'),'value':_0x29f176['toISOString']()[_0xf725('0x13')](0x0,0x13)[_0xf725('0x14')]('T','\x20')},{'name':_0xf725('0x15'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0xf725('0x16'),'value':_0x4468bb['id']},{'name':_0xf725('0x17'),'value':_0xf725('0x18')},{'name':_0xf725('0x19'),'value':_0x4468bb[_0xf725('0xc')]},{'name':_0xf725('0x1a'),'value':_0x144003}];if(_0x4e9001[_0xf725('0x1b')]){_[_0xf725('0x1c')](_0x4e9001,function(_0x737555){if(_0x396487[_0x737555[_0xf725('0x1d')]]){_0x47fedf[_0xf725('0x1e')]({'name':_0x737555[_0xf725('0x1f')],'value':_0x396487[_0x737555[_0xf725('0x1d')]]});}});}return request({'form':{'method':_0xf725('0x20'),'input_type':_0xf725('0x21'),'response_type':_0xf725('0x21'),'rest_data':JSON['stringify']({'session':_0x5f13bf['id'],'module_name':_0xf725('0x22'),'name_value_list':_0x47fedf})}});}function getAuth(_0x5868b1){return util['format'](_0xf725('0x23'),new Buffer(_0x5868b1[_0xf725('0x24')]+':X')[_0xf725('0x25')](_0xf725('0x26')));}function getServerInfo(_0x207519){return request({'form':{'method':_0xf725('0x27'),'input_type':_0xf725('0x21'),'response_type':_0xf725('0x21'),'rest_data':JSON[_0xf725('0x28')]({'session':_0x207519['id']})}});}function getUser(_0x5dfb73,_0x1d4d69,_0x5546cc){if(!_[_0xf725('0x29')](_0x1d4d69)){logger[_0xf725('0x2a')](_0xf725('0x2b'),_0x1d4d69);return request({'form':{'method':_0xf725('0x2c'),'input_type':_0xf725('0x21'),'response_type':'JSON','rest_data':JSON[_0xf725('0x28')]({'session':_0x5546cc['id'],'module_name':_0xf725('0x2d'),'query':util['format']('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x1d4d69),'order_by':'','offset':'0','select_fields':['id',_0xf725('0xc'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xf725('0x2e')](function(_0x335dc4){if(_0x335dc4[_0xf725('0x2f')]['length']){var _0x6a5293=_[_0xf725('0x30')](_0x335dc4[_0xf725('0x2f')],function(_0x1517af){return _0x1517af[_0xf725('0x31')][_0xf725('0x32')]['value']===_0x1d4d69;});if(_0x6a5293){logger[_0xf725('0x2a')]('Agent\x20found!');return BPromise['resolve']({'id':_0x6a5293[_0xf725('0x31')]['id'][_0xf725('0x33')],'name':_0x6a5293[_0xf725('0x31')][_0xf725('0xc')][_0xf725('0x33')]});}}logger[_0xf725('0x2a')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0xf725('0x34')]({'id':_0x5546cc['name_value_list'][_0xf725('0x35')][_0xf725('0x33')],'name':_0x5546cc[_0xf725('0x31')][_0xf725('0x32')]['value']});});}else{logger[_0xf725('0x2a')](_0xf725('0x36'));return BPromise['resolve']({'id':_0x5546cc[_0xf725('0x31')][_0xf725('0x35')][_0xf725('0x33')],'name':_0x5546cc[_0xf725('0x31')][_0xf725('0x32')]['value']});}}function getEndUser(_0x284372,_0x5a977c,_0x5032e5,_0xd43171){logger['info'](_0xf725('0x37'),_0x5032e5);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':_0xf725('0x21'),'rest_data':JSON[_0xf725('0x28')]({'session':_0xd43171['id'],'module_name':_0xf725('0x18'),'query':util[_0xf725('0x38')](_0xf725('0x39'),_0x5032e5),'order_by':'','offset':'0','select_fields':['id',_0xf725('0xc'),_0xf725('0x3a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xf725('0x2e')](function(_0x44966a){if(_0x44966a[_0xf725('0x2f')][_0xf725('0x1b')]){var _0x30bb73=_[_0xf725('0x30')](_0x44966a[_0xf725('0x2f')],function(_0x4687b5){return _0x4687b5[_0xf725('0x31')]['phone_home'][_0xf725('0x33')]===_0x5032e5;});if(_0x30bb73){logger[_0xf725('0x2a')]('Enduser\x20found!');return BPromise[_0xf725('0x34')]({'id':_0x30bb73[_0xf725('0x31')]['id'][_0xf725('0x33')],'name':_0x30bb73[_0xf725('0x31')][_0xf725('0xc')][_0xf725('0x33')],'phone':_0x30bb73[_0xf725('0x31')]['phone_home'][_0xf725('0x33')]});}}else{logger[_0xf725('0x2a')](_0xf725('0x3b'));return request({'form':{'method':_0xf725('0x20'),'input_type':_0xf725('0x21'),'response_type':_0xf725('0x21'),'rest_data':JSON[_0xf725('0x28')]({'session':_0xd43171['id'],'module_name':_0xf725('0x18'),'name_value_list':[{'name':_0xf725('0x3c'),'value':_0x5a977c!==_0xf725('0x3d')?_0x5a977c:util['format'](_0xf725('0x3e'),_0x5032e5)},{'name':_0xf725('0x3a'),'value':_0x5032e5}]})}})['then'](function(_0x4e9b38){logger[_0xf725('0x2a')](_0xf725('0x3f'));return BPromise[_0xf725('0x34')]({'id':_0x4e9b38['id'],'name':_0x4e9b38[_0xf725('0x2f')][_0xf725('0x3c')]['value'],'phone':_0x4e9b38[_0xf725('0x2f')][_0xf725('0x3a')]['value']});});}});}function request(_0x48310d){logger[_0xf725('0x40')](_0xf725('0x41'),JSON['stringify'](_0x48310d));return rp(_['merge'](def,_0x48310d));}function getTags(_0x544ecc,_0x25ef33){var _0x31c3bb=[];if(_0x544ecc&&_0x544ecc[_0xf725('0x1b')]>0x0){_0x31c3bb=_[_0xf725('0x42')](_0x544ecc,_0x25ef33);}return _0x31c3bb;}function getCustomFields(_0x1534e6,_0x1802f0){var _0x4b69d0=[];var _0x4cc381={'custom_fields':[]};if(_0x1534e6[_0xf725('0x1b')]>0x0){_[_0xf725('0x1c')](_0x1534e6,function(_0x24a9b4){if(_0x24a9b4['type']==='string'&&_0x24a9b4[_0xf725('0x43')]&&!_0x24a9b4[_0xf725('0x44')]){_0x4cc381[_0x24a9b4[_0xf725('0x43')]['toLowerCase']()]=_0x24a9b4[_0xf725('0x45')][_0xf725('0x25')]();}else if(_0x24a9b4[_0xf725('0x46')]===_0xf725('0x47')&&_0x24a9b4['idField']&&_0x24a9b4['customField']){_0x4cc381[_0xf725('0x48')]['push']({'id':_0x24a9b4[_0xf725('0x1f')],'value':_0x24a9b4['content'][_0xf725('0x25')]()});}else if(_0x24a9b4[_0xf725('0x46')]===_0xf725('0x49')&&_0x24a9b4[_0xf725('0x1d')]&&_0x24a9b4['idField']&&_0x24a9b4[_0xf725('0x44')]){_0x1802f0[_0x24a9b4[_0xf725('0x1d')]]&&_0x4cc381[_0xf725('0x48')]['push']({'id':_0x24a9b4['idField'],'value':_0x1802f0[_0x24a9b4[_0xf725('0x1d')]]['toString']()});}else if(_0x24a9b4[_0xf725('0x46')]===_0xf725('0x4a')&&_0x24a9b4[_0xf725('0x4b')]&&_0x24a9b4[_0xf725('0x4b')][_0xf725('0xc')]&&_0x24a9b4['idField']&&_0x24a9b4[_0xf725('0x44')]){_0x1802f0[_0x24a9b4[_0xf725('0x4b')][_0xf725('0xc')][_0xf725('0x4c')]()]&&_0x4cc381['custom_fields'][_0xf725('0x1e')]({'id':_0x24a9b4[_0xf725('0x1f')],'value':_0x1802f0[_0x24a9b4[_0xf725('0x4b')]['name']['toLowerCase']()][_0xf725('0x25')]()});}});}return _0x4cc381;}function getConnection(_0x261d6d){return request({'method':_0xf725('0xa'),'form':{'method':_0xf725('0x4d'),'input_type':'JSON','response_type':_0xf725('0x21'),'rest_data':JSON[_0xf725('0x28')]({'user_auth':{'user_name':_0x261d6d[_0xf725('0x4e')],'password':_0x261d6d['password'],'encryption':_0xf725('0x4f')},'application':'xCALLY\x20Motion\x20integration'})}})[_0xf725('0x2e')](function(_0x209075){var _0x3d77ad=_0x209075;if(_0x3d77ad['id']){def[_0xf725('0x50')]=_0x3d77ad['id'];return BPromise[_0xf725('0x34')](_0x3d77ad);}else{throw new Error(util[_0xf725('0x38')](_0xf725('0x51'),_0x261d6d['id']));}});}function setRelationship(_0x242d6b,_0x3877dd,_0x33a4f2,_0x42ed79){return request({'form':{'method':_0xf725('0x52'),'input_type':'JSON','response_type':_0xf725('0x21'),'rest_data':JSON[_0xf725('0x28')]({'session':_0x242d6b['id'],'module_name':'Calls','module_id':_0x33a4f2['id'],'link_field_name':_0x42ed79,'related_ids':[_0x3877dd['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xf725('0x53')]=function(_0x458016,_0x3c8e6b,_0x55df29,_0x46b75f,_0x3ba9a6,_0x458914){var _0x32a86e,_0x3d0c3a,_0x20e89b,_0x458dff;_0x458914[_0xf725('0x54')]=intUtil[_0xf725('0x55')](_0x458914[_0xf725('0x54')]);_0x458914[_0xf725('0x56')]=intUtil[_0xf725('0x55')](_0x458914[_0xf725('0x56')]);def[_0xf725('0x57')]=util[_0xf725('0x38')]('%s/service/v4_1/rest.php',_0x458914[_0xf725('0x54')]);if(_0x3ba9a6&&_0x3ba9a6[_0xf725('0x58')]){logger[_0xf725('0x2a')](_0xf725('0x59'),_0xf725('0x5a'));_0x3c8e6b[_0xf725('0x5b')]=util['format'](_0xf725('0x5c'),_0x458914[_0xf725('0x56')],_0x3c8e6b[_0xf725('0x5d')],md5(_0x3c8e6b[_0xf725('0x5d')]));}else{_0x3c8e6b[_0xf725('0x5b')]='';}return getConnection(_0x458914)['then'](function(_0x42a74f){_0x458dff=_0x42a74f;return getUser(_0x458914,_0x46b75f[_0xf725('0xc')],_0x458dff);})[_0xf725('0x2e')](function(_0x19c408){_0x32a86e=_0x19c408;logger[_0xf725('0x2a')]('The\x20User\x20ID\x20is:',_0x32a86e['id']);return getEndUser(_0x458914,_0x3c8e6b[_0xf725('0x5e')],_0x3c8e6b[_0xf725('0x5f')],_0x458dff);})[_0xf725('0x2e')](function(_0x17ddef){_0x3d0c3a=_0x17ddef;logger[_0xf725('0x2a')](_0xf725('0x60'),_0x3d0c3a['id']);return getTicket(_0x458914,_0x32a86e,_0x3d0c3a,_0x55df29,_0x3c8e6b,_0x55df29[_0xf725('0x61')],_0x458dff,_0xf725('0x62'));})[_0xf725('0x2e')](function(_0x36f002){_0x20e89b=_0x36f002;logger['info'](_0xf725('0x63'));logger[_0xf725('0x2a')]('The\x20Ticket\x20ID\x20is:',_0x20e89b['id']);return setRelationship(_0x458dff,_0x32a86e,_0x20e89b,_0xf725('0x64'));})[_0xf725('0x2e')](function(){return setRelationship(_0x458dff,_0x3d0c3a,_0x20e89b,'contacts');})[_0xf725('0x2e')](function(){return getServerInfo(_0x458dff);})['then'](function(_0x425e53){var _0x5ee877=parseInt(_0x425e53[_0xf725('0x65')]['charAt'](0x0));var _0x298cd4=util[_0xf725('0x38')](_0xf725('0x66'),_0x458914[_0xf725('0x54')],_0x20e89b['id']);if(_0x5ee877>0x6){_0x298cd4=util[_0xf725('0x38')](_0xf725('0x67'),_0x458914[_0xf725('0x54')],_0x20e89b['id']);}logger[_0xf725('0x2a')]('[QUEUE]',_0xf725('0x68'));emit(util[_0xf725('0x38')](_0xf725('0x69'),_0x46b75f[_0xf725('0xc')]),_0xf725('0x6a'),{'uri':_0x298cd4});})[_0xf725('0x6b')](function(_0x28c32a){logger['error'](_0xf725('0x59'),JSON[_0xf725('0x28')](_0x28c32a));});};exports['outbound']=function(_0x20597b,_0x5301b1,_0x36972a,_0x1a9617,_0x6e5689,_0x5763be,_0x38bc51){var _0x3a95ea,_0x3025f4,_0x4b1517,_0x275e6e;_0x5763be[_0xf725('0x54')]=intUtil[_0xf725('0x55')](_0x5763be['remoteUri']);_0x5763be[_0xf725('0x56')]=intUtil[_0xf725('0x55')](_0x5763be[_0xf725('0x56')]);def[_0xf725('0x57')]=util[_0xf725('0x38')](_0xf725('0x6c'),_0x5763be['remoteUri']);if(_0x38bc51&&_0x38bc51[_0xf725('0x6d')]&&_0x38bc51[_0xf725('0x6d')]!==_0xf725('0x6e')){logger[_0xf725('0x2a')](_0xf725('0x6f'),_0xf725('0x5a'));_0x5301b1['recordingURL']=util['format'](_0xf725('0x5c'),_0x5763be['serverUrl'],_0x5301b1['uniqueid'],md5(_0x5301b1['uniqueid']));}return getConnection(_0x5763be)[_0xf725('0x2e')](function(_0x7c15c4){_0x275e6e=_0x7c15c4;return getUser(_0x5763be,_0x1a9617[_0xf725('0xc')],_0x275e6e);})[_0xf725('0x2e')](function(_0x3f4b71){_0x3a95ea=_0x3f4b71;logger[_0xf725('0x2a')](_0xf725('0x70'),_0x3a95ea['id']);return getEndUser(_0x5763be,_0x5301b1[_0xf725('0x71')],_0x5301b1[_0xf725('0x72')],_0x275e6e);})[_0xf725('0x2e')](function(_0x2aa18b){_0x3025f4=_0x2aa18b;logger[_0xf725('0x2a')](_0xf725('0x60'),_0x3025f4['id']);return getTicket(_0x5763be,_0x3a95ea,_0x3025f4,_0x36972a,_0x5301b1,_0x36972a['Fields'],_0x275e6e,_0xf725('0x73'));})['then'](function(_0x552b63){_0x4b1517=_0x552b63;logger[_0xf725('0x2a')](_0xf725('0x63'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x4b1517['id']);return setRelationship(_0x275e6e,_0x3a95ea,_0x4b1517,_0xf725('0x64'));})['then'](function(){return setRelationship(_0x275e6e,_0x3025f4,_0x4b1517,'contacts');})['then'](function(){return getServerInfo(_0x275e6e);})[_0xf725('0x2e')](function(_0x4fa38f){var _0x11362c=parseInt(_0x4fa38f['version'][_0xf725('0x74')](0x0));var _0xa9ea1e=util['format'](_0xf725('0x66'),_0x5763be[_0xf725('0x54')],_0x4b1517['id']);if(_0x11362c>0x6){_0xa9ea1e=util[_0xf725('0x38')](_0xf725('0x67'),_0x5763be[_0xf725('0x54')],_0x4b1517['id']);}logger[_0xf725('0x2a')](_0xf725('0x6f'),_0xf725('0x68'));emit(util['format'](_0xf725('0x69'),_0x1a9617['name']),'trigger:browser:url',{'uri':_0xa9ea1e});})[_0xf725('0x6b')](function(_0x5223da){logger[_0xf725('0x75')](_0xf725('0x6f'),JSON[_0xf725('0x28')](_0x5223da));});};exports['unmanaged']=function(_0x70f605,_0x20091e,_0x1f1624,_0x17400c,_0x4888ae,_0x4b5abb){var _0xdf577a,_0x3a2c8d,_0x3716e3,_0x29eb42;_0x4b5abb['remoteUri']=intUtil[_0xf725('0x55')](_0x4b5abb[_0xf725('0x54')]);_0x4b5abb[_0xf725('0x56')]=intUtil[_0xf725('0x55')](_0x4b5abb[_0xf725('0x56')]);def[_0xf725('0x57')]=util[_0xf725('0x38')](_0xf725('0x6c'),_0x4b5abb['remoteUri']);if(_0x4888ae&&_0x4888ae['monitor_format']){logger[_0xf725('0x2a')]('['+_0x20091e['lastevent']['toUpperCase']()+']',_0xf725('0x5a'));_0x20091e[_0xf725('0x5b')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4b5abb[_0xf725('0x56')],_0x20091e[_0xf725('0x5d')],md5(_0x20091e[_0xf725('0x5d')]));}else{_0x20091e[_0xf725('0x5b')]='';}return getConnection(_0x4b5abb)['then'](function(_0x36c873){_0x29eb42=_0x36c873;if(!_[_0xf725('0x29')](_0x17400c)){return getUser(_0x4b5abb,_0x17400c[_0xf725('0xc')],_0x29eb42);}else{return getUser(_0x4b5abb,null,_0x29eb42);}})[_0xf725('0x2e')](function(_0x322600){_0xdf577a=_0x322600;logger[_0xf725('0x2a')](_0xf725('0x70'),_0xdf577a['id']);return getEndUser(_0x4b5abb,_0x20091e[_0xf725('0x5e')],_0x20091e[_0xf725('0x5f')],_0x29eb42);})['then'](function(_0x231ed6){_0x3a2c8d=_0x231ed6;logger[_0xf725('0x2a')](_0xf725('0x60'),_0x3a2c8d['id']);return getTicket(_0x4b5abb,_0xdf577a,_0x3a2c8d,_0x1f1624,_0x20091e,_0x1f1624[_0xf725('0x61')],_0x29eb42,_0xf725('0x62'));})[_0xf725('0x2e')](function(_0x3d9e3e){_0x3716e3=_0x3d9e3e;logger[_0xf725('0x2a')](_0xf725('0x63'));logger[_0xf725('0x2a')](_0xf725('0x76'),_0x3716e3['id']);return setRelationship(_0x29eb42,_0xdf577a,_0x3716e3,_0xf725('0x64'));})[_0xf725('0x2e')](function(){return setRelationship(_0x29eb42,_0x3a2c8d,_0x3716e3,_0xf725('0x77'));})['then'](function(){return getServerInfo(_0x29eb42);})[_0xf725('0x6b')](function(_0x4b47a6){logger[_0xf725('0x75')]('['+_0x20091e[_0xf725('0x78')][_0xf725('0x79')]()+']',JSON['stringify'](_0x4b47a6));});};
\ No newline at end of file