X-Git-Url: http://repos.xcallymotion.com/?a=blobdiff_plain;f=server%2Fservices%2Fami%2Ftrigger%2Findex.js;h=e32efc84cc2a1d34cfdd5578f139d042da329de3;hb=616b05b12f37a2d91c8e3c0e9817684f8aa283c7;hp=efeefd5c1d8433cdd102425ad52080455306ea71;hpb=884fcf970b507196a3b60584a74b23a84d7eaf24;p=motion2.git diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index efeefd5..e32efc8 100644 --- a/server/services/ami/trigger/index.js +++ b/server/services/ami/trigger/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf257=['some','channel','chat','ChatWebsiteId','operator','AccountId','value','upperFirst','interaction','event','agent','membername','lastevent','exports','url','mustache','ioredis','./urlforward','./cmContact','./script','../../../config/environment','../../../config/logger','trigger','../ami','redis','defaults','localhost','socket.io-emitter','popup','triggers','agents','voiceQueues','templates','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','info','stringify','clone','interface','checkTriggers','status','checkTrigger','merge','Actions','length','action','toLowerCase','contactmanager','motionbar','browser','data1','html','data2','render','template\x20not\x20found','uri','buildUri','isNil','data4','uriLocation','windowWidth','data5','800','windowHeight','600','data6','winapp','winApplication','data3','format','user:%s','name','trigger:%s:%s','jscripty','trigger:%s','integration','exec','queue','routeId','parse','replace','AllConditions','every','checkConditions','AnyConditions'];(function(_0x24f75b,_0x8b108c){var _0x1eb17a=function(_0x131645){while(--_0x131645){_0x24f75b['push'](_0x24f75b['shift']());}};_0x1eb17a(++_0x8b108c);}(_0xf257,0x82));var _0x7f25=function(_0x2af655,_0x43eac3){_0x2af655=_0x2af655-0x0;var _0x54380a=_0xf257[_0x2af655];return _0x54380a;};'use strict';var util=require('util');var _=require('lodash');var url=require(_0x7f25('0x0'));var Mustache=require(_0x7f25('0x1'));var Redis=require(_0x7f25('0x2'));var urlforward=require(_0x7f25('0x3'));var integration=require('./integration');var cmContact=require(_0x7f25('0x4'));var script=require(_0x7f25('0x5'));var config=require(_0x7f25('0x6'));var logger=require(_0x7f25('0x7'))(_0x7f25('0x8'));var ami=require(_0x7f25('0x9'));config[_0x7f25('0xa')]=_[_0x7f25('0xb')](config[_0x7f25('0xa')],{'host':_0x7f25('0xc'),'port':0x18eb});var io=require(_0x7f25('0xd'))(new Redis(config[_0x7f25('0xa')]));var operators={'equals':function(_0x245602,_0xd7da73){return _0x245602==_0xd7da73;},'not_equals':function(_0x57ba17,_0x1b9268){return _0x57ba17!=_0x1b9268;}};var barAndWebActions=[_0x7f25('0xe'),'url','winapp'];function Trigger(_0x26a033){this['triggers']=_0x26a033[_0x7f25('0xf')];this[_0x7f25('0x10')]=_0x26a033[_0x7f25('0x10')];this[_0x7f25('0x11')]=_0x26a033[_0x7f25('0x11')];this[_0x7f25('0x12')]=_0x26a033[_0x7f25('0x12')];this['voiceExtensions']=_0x26a033['voiceExtensions'];this[_0x7f25('0x13')]=_0x26a033['zendeskAccounts'];this[_0x7f25('0x14')]=_0x26a033[_0x7f25('0x14')];this[_0x7f25('0x15')]=_0x26a033[_0x7f25('0x15')];this[_0x7f25('0x16')]=_0x26a033['sugarcrmAccounts'];this['zohoAccounts']=_0x26a033['zohoAccounts'];this[_0x7f25('0x17')]=_0x26a033[_0x7f25('0x17')];this[_0x7f25('0x18')]=_0x26a033[_0x7f25('0x18')];this[_0x7f25('0x19')]=_0x26a033[_0x7f25('0x19')];this[_0x7f25('0x1a')]=_0x26a033[_0x7f25('0x1a')];this['freshsalesAccounts']=_0x26a033[_0x7f25('0x1b')];this[_0x7f25('0x1c')]={'zendesk':this[_0x7f25('0x13')],'salesforce':this[_0x7f25('0x15')],'freshdesk':this[_0x7f25('0x14')],'sugarcrm':this[_0x7f25('0x16')],'zoho':this['zohoAccounts'],'desk':this['deskAccounts'],'vtiger':this[_0x7f25('0x18')],'dynamics365':this[_0x7f25('0x1a')],'freshsales':this[_0x7f25('0x1b')],'servicenow':this[_0x7f25('0x19')]};ami['on'](_0x7f25('0x1d'),this[_0x7f25('0x1e')][_0x7f25('0x1f')](this));ami['on'](_0x7f25('0x20'),this[_0x7f25('0x1e')]['bind'](this));ami['on'](_0x7f25('0x21'),this[_0x7f25('0x1e')][_0x7f25('0x1f')](this));ami['on'](_0x7f25('0x22'),this[_0x7f25('0x1e')]['bind'](this));ami['on'](_0x7f25('0x23'),this[_0x7f25('0x1e')][_0x7f25('0x1f')](this));ami['on']('custom:agentnoanswer',this[_0x7f25('0x1e')]['bind'](this));ami['on'](_0x7f25('0x24'),this[_0x7f25('0x1e')][_0x7f25('0x1f')](this));ami['on'](_0x7f25('0x25'),this[_0x7f25('0x1e')][_0x7f25('0x1f')](this));ami['on'](_0x7f25('0x26'),this[_0x7f25('0x1e')][_0x7f25('0x1f')](this));ami['on'](_0x7f25('0x27'),this['syncCustomEvent']['bind'](this));ami['on'](_0x7f25('0x28'),this[_0x7f25('0x1e')]['bind'](this));ami['on'](_0x7f25('0x29'),this[_0x7f25('0x2a')][_0x7f25('0x1f')](this));ami['on'](_0x7f25('0x2b'),this[_0x7f25('0x2a')][_0x7f25('0x1f')](this));ami['on']('custom:dialend',this[_0x7f25('0x2a')]['bind'](this));ami['on'](_0x7f25('0x2c'),this['syncCustomEvent'][_0x7f25('0x1f')](this));ami['on'](_0x7f25('0x2d'),this[_0x7f25('0x1e')]['bind'](this));ami['on'](_0x7f25('0x2e'),this[_0x7f25('0x1e')][_0x7f25('0x1f')](this));ami['on'](_0x7f25('0x2f'),this[_0x7f25('0x1e')][_0x7f25('0x1f')](this));ami['on'](_0x7f25('0x30'),this[_0x7f25('0x1e')]['bind'](this));ami['on'](_0x7f25('0x31'),this[_0x7f25('0x1e')][_0x7f25('0x1f')](this));}Trigger[_0x7f25('0x32')][_0x7f25('0x33')]=function(_0x560d88,_0x4cc461,_0x56ac18){logger[_0x7f25('0x34')](_0x560d88,_0x4cc461,JSON[_0x7f25('0x35')](_0x56ac18));io['to'](_0x560d88)[_0x7f25('0x33')](_0x4cc461,_0x56ac18);};Trigger['prototype'][_0x7f25('0x1e')]=function(_0x152e4b){var _0x4ed4e3=_[_0x7f25('0x36')](_0x152e4b);this['checkTriggers'](_0x4ed4e3);};Trigger[_0x7f25('0x32')][_0x7f25('0x2a')]=function(_0x4b4478){if(this[_0x7f25('0x10')][_0x4b4478[_0x7f25('0x37')]]){this[_0x7f25('0x1e')](_0x4b4478);}};Trigger[_0x7f25('0x32')][_0x7f25('0x38')]=function(_0x217b73){var _0x4b4a23;for(var _0x1a4118 in this[_0x7f25('0xf')]){if(this[_0x7f25('0xf')]['hasOwnProperty'](_0x1a4118)){if(this[_0x7f25('0xf')][_0x1a4118][_0x7f25('0x39')]){_0x4b4a23=this[_0x7f25('0x3a')](this[_0x7f25('0xf')][_0x1a4118],_0x217b73);if(_0x4b4a23){_[_0x7f25('0x3b')](_0x217b73,_0x217b73['variables']);for(var _0x4429b2=0x0,_0x1d2a06,_0x8a1083,_0x26031b;_0x4429b2