Built motion from commit (unavailable).|2.0.78
[motion2.git] / server / services / ami / trigger / cmContact / index.js
index 67c9878..e6e94e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x78ee=['../../../../config/logger','trigger','../../rpc/cmContact','localhost','stringify','emit','autoCreate','data2','data1','calleridnum','routeId','calleridname','<unknown>','uniqueid','destcalleridname','phone','then','omit','format','user:%s','name','action','toLowerCase','merge','resolve','createContact','Error\x20creating\x20contact','trigger:%s','bluebird','util','lodash'];(function(_0x39ca80,_0x19b047){var _0x3e588d=function(_0x26dd0b){while(--_0x26dd0b){_0x39ca80['push'](_0x39ca80['shift']());}};_0x3e588d(++_0x19b047);}(_0x78ee,0xf5));var _0xe78e=function(_0x2bb903,_0xd211ea){_0x2bb903=_0x2bb903-0x0;var _0x418c03=_0x78ee[_0x2bb903];return _0x418c03;};'use strict';var BPromise=require(_0xe78e('0x0'));var util=require(_0xe78e('0x1'));var _=require(_0xe78e('0x2'));var logger=require(_0xe78e('0x3'))(_0xe78e('0x4'));var cmContactRpc=require(_0xe78e('0x5'));var io=require('socket.io-emitter')({'host':_0xe78e('0x6'),'port':0x18eb});function emit(_0x744f13,_0x2d6396,_0x2746fa){logger['info'](_0x744f13,_0x2d6396,JSON[_0xe78e('0x7')](_0x2746fa));io['to'](_0x744f13)[_0xe78e('0x8')](_0x2d6396,_0x2746fa);}exports['exec']=function(_0x524718,_0x28e651,_0x43a6ef){_0x43a6ef[_0xe78e('0x9')]=0x0;if(_0x28e651[_0xe78e('0xa')]&&parseInt(_0x28e651[_0xe78e('0xa')],0xa)){var _0x14eaf9={'ListId':parseInt(_0x28e651[_0xe78e('0xb')],0xa),'phone':_0x43a6ef[_0xe78e('0xc')]};if(_['isNil'](_0x43a6ef[_0xe78e('0xd')])){_0x14eaf9['firstName']=_0x43a6ef[_0xe78e('0xe')]&&_0x43a6ef[_0xe78e('0xe')]!==_0xe78e('0xf')?_0x43a6ef[_0xe78e('0xe')]:_0x43a6ef[_0xe78e('0xc')]||_0x43a6ef[_0xe78e('0x10')];}else{_0x14eaf9['firstName']=_0x43a6ef['destcalleridname']&&_0x43a6ef[_0xe78e('0x11')]!==_0xe78e('0xf')?_0x43a6ef['destcalleridname']:_0x43a6ef['destcalleridnum']||_0x43a6ef[_0xe78e('0x10')];_0x14eaf9[_0xe78e('0x12')]=_0x43a6ef[_0xe78e('0x11')]&&_0x43a6ef['destcalleridname']!==_0xe78e('0xf')?_0x43a6ef['destcalleridname']:_0x43a6ef['destcalleridnum']||_0x43a6ef[_0xe78e('0x10')];}BPromise['resolve']()[_0xe78e('0x13')](cmContactRpc['showContact']({'where':_[_0xe78e('0x14')](_0x14eaf9,['firstName'])}))['then'](function(_0x499cfd){if(_0x499cfd){_0x43a6ef['xmd-contactid2']=_0x499cfd['id'];emit(util[_0xe78e('0x15')](_0xe78e('0x16'),_0x524718[_0xe78e('0x17')]),util[_0xe78e('0x15')]('trigger:%s',_0x28e651[_0xe78e('0x18')][_0xe78e('0x19')]()),_[_0xe78e('0x1a')](_0x43a6ef,{'ListId':parseInt(_0x28e651[_0xe78e('0xb')],0xa)}));return;}else{return BPromise[_0xe78e('0x1b')]()['then'](cmContactRpc[_0xe78e('0x1c')](_0x14eaf9));}})[_0xe78e('0x13')](function(_0xcc659b){if(_0xcc659b){_0x43a6ef['xmd-contactid2']=_0xcc659b['id'];emit(util['format'](_0xe78e('0x16'),_0x524718[_0xe78e('0x17')]),util[_0xe78e('0x15')]('trigger:%s',_0x28e651['action'][_0xe78e('0x19')]()),_[_0xe78e('0x1a')](_0x43a6ef,{'ListId':parseInt(_0x28e651[_0xe78e('0xb')],0xa)}));}})['catch'](function(_0x5e3ce7){logger['error'](_0xe78e('0x1d'),JSON[_0xe78e('0x7')](_0x5e3ce7));});}else{if(_0x524718){emit(util['format']('user:%s',_0x524718[_0xe78e('0x17')]),util['format'](_0xe78e('0x1e'),_0x28e651[_0xe78e('0x18')][_0xe78e('0x19')]()),_[_0xe78e('0x1a')]({'ListId':parseInt(_0x28e651[_0xe78e('0xb')],0xa)},_0x43a6ef));}}};
\ No newline at end of file
+var _0x75e4=['then','user:%s','name','format','trigger:%s','merge','createContact','action','toLowerCase','Error\x20creating\x20contact','stringify','util','lodash','../../../../config/logger','../../rpc/cmContact','socket.io-emitter','localhost','exec','autoCreate','data2','data1','calleridnum','isNil','routeId','firstName','calleridname','<unknown>','destcalleridname','destcalleridnum','uniqueid','phone','resolve','showContact'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x75e4,0x113));var _0x475e=function(_0xfbdff6,_0x2af690){_0xfbdff6=_0xfbdff6-0x0;var _0x4cb9be=_0x75e4[_0xfbdff6];return _0x4cb9be;};'use strict';var BPromise=require('bluebird');var util=require(_0x475e('0x0'));var _=require(_0x475e('0x1'));var logger=require(_0x475e('0x2'))('trigger');var cmContactRpc=require(_0x475e('0x3'));var io=require(_0x475e('0x4'))({'host':_0x475e('0x5'),'port':0x18eb});function emit(_0x5f4fad,_0x4a65c5,_0x43a2b3){logger['info'](_0x5f4fad,_0x4a65c5,JSON['stringify'](_0x43a2b3));io['to'](_0x5f4fad)['emit'](_0x4a65c5,_0x43a2b3);}exports[_0x475e('0x6')]=function(_0x515e46,_0x54a177,_0x4702e7){_0x4702e7[_0x475e('0x7')]=0x0;if(_0x54a177[_0x475e('0x8')]&&parseInt(_0x54a177[_0x475e('0x8')],0xa)){var _0x33592d={'ListId':parseInt(_0x54a177[_0x475e('0x9')],0xa),'phone':_0x4702e7[_0x475e('0xa')]};if(_[_0x475e('0xb')](_0x4702e7[_0x475e('0xc')])){_0x33592d[_0x475e('0xd')]=_0x4702e7['calleridname']&&_0x4702e7[_0x475e('0xe')]!==_0x475e('0xf')?_0x4702e7[_0x475e('0xe')]:_0x4702e7['calleridnum']||_0x4702e7['uniqueid'];}else{_0x33592d['firstName']=_0x4702e7[_0x475e('0x10')]&&_0x4702e7['destcalleridname']!==_0x475e('0xf')?_0x4702e7[_0x475e('0x10')]:_0x4702e7[_0x475e('0x11')]||_0x4702e7[_0x475e('0x12')];_0x33592d[_0x475e('0x13')]=_0x4702e7['destcalleridname']&&_0x4702e7[_0x475e('0x10')]!==_0x475e('0xf')?_0x4702e7[_0x475e('0x10')]:_0x4702e7['destcalleridnum']||_0x4702e7['uniqueid'];}BPromise[_0x475e('0x14')]()['then'](cmContactRpc[_0x475e('0x15')]({'where':_['omit'](_0x33592d,['firstName'])}))[_0x475e('0x16')](function(_0x3b8fc0){if(_0x3b8fc0){_0x4702e7['xmd-contactid2']=_0x3b8fc0['id'];emit(util['format'](_0x475e('0x17'),_0x515e46[_0x475e('0x18')]),util[_0x475e('0x19')](_0x475e('0x1a'),_0x54a177['action']['toLowerCase']()),_[_0x475e('0x1b')](_0x4702e7,{'ListId':parseInt(_0x54a177['data1'],0xa)}));return;}else{return BPromise[_0x475e('0x14')]()[_0x475e('0x16')](cmContactRpc[_0x475e('0x1c')](_0x33592d));}})[_0x475e('0x16')](function(_0xdff45c){if(_0xdff45c){_0x4702e7['xmd-contactid2']=_0xdff45c['id'];emit(util[_0x475e('0x19')]('user:%s',_0x515e46['name']),util['format']('trigger:%s',_0x54a177[_0x475e('0x1d')][_0x475e('0x1e')]()),_['merge'](_0x4702e7,{'ListId':parseInt(_0x54a177[_0x475e('0x9')],0xa)}));}})['catch'](function(_0x5ca267){logger['error'](_0x475e('0x1f'),JSON[_0x475e('0x20')](_0x5ca267));});}else{if(_0x515e46){emit(util['format'](_0x475e('0x17'),_0x515e46[_0x475e('0x18')]),util['format']('trigger:%s',_0x54a177[_0x475e('0x1d')]['toLowerCase']()),_[_0x475e('0x1b')]({'ListId':parseInt(_0x54a177[_0x475e('0x9')],0xa)},_0x4702e7));}}};
\ No newline at end of file