Built motion from commit 9d0783e6.|2.6.13
[motion2.git] / server / services / agi / project.js
index 53b9dc2..e247abe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3fff=['agi','./rpc','./vertices','getSquareProjects','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','hasOwnProperty','maxRetry','retry','addVertex','omit','isArray','length','source','addEdge','target','toJson','mxGraphModel','root','inspect','production','start','debug','stringify','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','mxCell','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','traverseBFS','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','agicommand','response','code','result','isUndefined','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','continueAt','close','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','exports','lodash','moment','xml2json','util','../../config/logger'];(function(_0x4e8836,_0x31c212){var _0x236266=function(_0x2e03ff){while(--_0x2e03ff){_0x4e8836['push'](_0x4e8836['shift']());}};_0x236266(++_0x31c212);}(_0x3fff,0x7b));var _0xf3ff=function(_0x43450f,_0x109af9){_0x43450f=_0x43450f-0x0;var _0x496603=_0x3fff[_0x43450f];return _0x496603;};'use strict';var _=require(_0xf3ff('0x0'));var moment=require(_0xf3ff('0x1'));var parser=require(_0xf3ff('0x2'));var util=require(_0xf3ff('0x3'));var logger=require(_0xf3ff('0x4'))(_0xf3ff('0x5'));var rpc=require(_0xf3ff('0x6'));var mailRpc=require('./mailRpc');var Graph=require('./graph');var Vertices=require(_0xf3ff('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0xf3ff('0x8')]()[_0xf3ff('0x9')](function(_0x1c6136){logger[_0xf3ff('0xa')](_0xf3ff('0xb'),_0x1c6136['stack']);return[];});}function addVertex(_0x54e9d5,_0x528635,_0x60c8f3){_0x528635['agicommand']=_0x60c8f3;if(_0x528635[_0xf3ff('0xc')]('retry')){_0x528635[_0xf3ff('0xd')]=parseInt(_0x528635[_0xf3ff('0xe')],0xa);}_0x54e9d5[_0xf3ff('0xf')](_[_0xf3ff('0x10')](_0x528635,'mxCell'));}function initGraph(_0x5dfa8a,_0x4b94b2){var _0x179217=new Graph();for(var _0x59960d in _0x5dfa8a){if(_0x5dfa8a[_0xf3ff('0xc')](_0x59960d)){if(_[_0xf3ff('0x11')](_0x5dfa8a[_0x59960d])){for(var _0x449937=0x0;_0x449937<_0x5dfa8a[_0x59960d]['length'];_0x449937+=0x1){addVertex(_0x179217,_0x5dfa8a[_0x59960d][_0x449937],_0x59960d);}}else{addVertex(_0x179217,_0x5dfa8a[_0x59960d],_0x59960d);}}}for(var _0x52d483=0x0;_0x52d483<_0x4b94b2[_0xf3ff('0x12')];_0x52d483+=0x1){if(_0x4b94b2[_0x52d483][_0xf3ff('0x13')]&&_0x4b94b2[_0x52d483]['target']){_0x179217[_0xf3ff('0x14')](_0x4b94b2[_0x52d483]['source'],_0x4b94b2[_0x52d483][_0xf3ff('0x15')],_0x4b94b2[_0x52d483]['value']);}}return _0x179217;}function getRoot(_0x4f1193){return parser[_0xf3ff('0x16')](_0x4f1193,{'object':!![]})[_0xf3ff('0x17')][_0xf3ff('0x18')];}function inspect(_0x3189f1){return util[_0xf3ff('0x19')](_0x3189f1,{'showHidden':![],'depth':null});}function initialize(_0x3dbc49,_0x342882){var _0x55464c=getRoot(_0x3dbc49[_0xf3ff('0x1a')]);if(!_0x55464c||!_0x55464c[_0xf3ff('0x1b')])return;var _0x192af8,_0x1260d4,_0x2e48e9;logger[_0xf3ff('0x1c')](_0xf3ff('0x18'),JSON[_0xf3ff('0x1d')](_0x55464c,null,0x2));_0x342882[_0xf3ff('0x1e')]=moment()[_0xf3ff('0x1f')](_0xf3ff('0x20'));_0x192af8=initGraph(_[_0xf3ff('0x10')](_0x55464c,_0xf3ff('0x21')),_0x55464c[_0xf3ff('0x21')]);_0x1260d4=new Vertices(_0x342882,rpc,mailRpc);logger[_0xf3ff('0x22')](util[_0xf3ff('0x1f')](_0xf3ff('0x23'),_0x342882[_0xf3ff('0x24')],_0x342882[_0xf3ff('0x25')],_0x342882[_0xf3ff('0x26')],_0x342882[_0xf3ff('0x27')],_0x342882[_0xf3ff('0x28')]));_0x192af8[_0xf3ff('0x29')](_0x55464c[_0xf3ff('0x1b')]['id'],function(_0x55a5f0){try{_0x55a5f0=_0x1260d4[_0xf3ff('0x2a')](_0x55a5f0);logger['debug'](_0xf3ff('0x2b'),JSON[_0xf3ff('0x1d')](_0x55a5f0,null,0x2));if(_0x55a5f0['agicommand']===_0xf3ff('0x2c')){logger[_0xf3ff('0x22')](_0xf3ff('0x2d'));_0x342882[_0xf3ff('0x2e')]=_0x55a5f0[_0xf3ff('0x2e')]||_0x342882[_0xf3ff('0x2e')];_0x342882[_0xf3ff('0x2f')]=_0x55a5f0[_0xf3ff('0x2f')];_0x342882[_0xf3ff('0x30')]=_0x55a5f0[_0xf3ff('0x30')]?_0x55a5f0[_0xf3ff('0x30')]-0x1:0x1;return null;}else if(_0x55a5f0&&_0x1260d4[_0x55a5f0[_0xf3ff('0x31')]]){_0x2e48e9=_0x1260d4[_0x55a5f0[_0xf3ff('0x31')]](_0x55a5f0);logger['info'](_0xf3ff('0x32'),JSON[_0xf3ff('0x1d')](_0x2e48e9,null,0x2));if(_0x2e48e9&&_0x2e48e9[_0xf3ff('0x33')]===AGI_CODE_SUCCESS&&_0x2e48e9[_0xf3ff('0x34')]!==AGI_RESULT_ERROR&&!_0x342882['evtHangup']){logger[_0xf3ff('0x1c')](_0xf3ff('0x32'),inspect(_0x2e48e9));return _[_0xf3ff('0x35')](_0x2e48e9[_0xf3ff('0x34')])?null:_0x2e48e9['result'][_0xf3ff('0x36')]();}else{logger['error'](_0xf3ff('0x32'),inspect(_0x2e48e9));return null;}}else{logger[_0xf3ff('0xa')](_0xf3ff('0x37'));return null;}}catch(_0x1ef238){logger[_0xf3ff('0xa')](_0x1ef238['stack']);return null;}});if(_0x55464c[_0xf3ff('0x38')]){logger[_0xf3ff('0x22')](util['format'](_0xf3ff('0x39'),_0x342882['arg_1'],_0x342882[_0xf3ff('0x25')],_0x342882[_0xf3ff('0x26')],_0x342882['dnid'],_0x342882[_0xf3ff('0x28')]));_0x192af8[_0xf3ff('0x29')](_0x55464c[_0xf3ff('0x38')]['id'],function(_0x392596){try{_0x392596=_0x1260d4[_0xf3ff('0x2a')](_0x392596);logger[_0xf3ff('0x1c')](_0xf3ff('0x2b'),JSON[_0xf3ff('0x1d')](_0x392596,null,0x2));if(_0x392596&&_0x1260d4[_0x392596['agicommand']]){_0x2e48e9=_0x1260d4[_0x392596[_0xf3ff('0x31')]](_0x392596);if(_0x2e48e9){logger[_0xf3ff('0x1c')](_0xf3ff('0x32'),inspect(_0x2e48e9));return _[_0xf3ff('0x35')](_0x2e48e9[_0xf3ff('0x34')])?null:_0x2e48e9[_0xf3ff('0x34')][_0xf3ff('0x36')]();}else{logger[_0xf3ff('0xa')](_0xf3ff('0x32'),inspect(_0x2e48e9));return null;}}else{logger['error'](_0xf3ff('0x37'));return null;}}catch(_0x4dba7b){logger[_0xf3ff('0xa')](_0x4dba7b['stack']);return null;}});}logger[_0xf3ff('0x22')](util[_0xf3ff('0x1f')](_0xf3ff('0x3a'),_0x342882[_0xf3ff('0x24')],_0x342882[_0xf3ff('0x25')],_0x342882[_0xf3ff('0x26')],_0x342882[_0xf3ff('0x27')],_0x342882[_0xf3ff('0x28')]));logger[_0xf3ff('0x22')](util[_0xf3ff('0x1f')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x342882[_0xf3ff('0x2e')],_0x342882['extension'],parseInt(_0x342882[_0xf3ff('0x30')],0xa)+0x1));_0x342882[_0xf3ff('0x3b')](_0x342882['context'],_0x342882[_0xf3ff('0x2f')],parseInt(_0x342882[_0xf3ff('0x30')],0xa)+0x1);_0x342882[_0xf3ff('0x3c')]();}function handleNotFound(_0x34b202){logger[_0xf3ff('0xa')](util[_0xf3ff('0x1f')](_0xf3ff('0x3d'),_0x34b202['arg_1']));_0x34b202[_0xf3ff('0x3b')](_0x34b202[_0xf3ff('0x2e')],_0x34b202[_0xf3ff('0x2f')],parseInt(_0x34b202[_0xf3ff('0x30')],0xa)+0x1);_0x34b202[_0xf3ff('0x3c')]();}function handleUnpublished(_0x2c09e5){logger[_0xf3ff('0xa')](util['format'](_0xf3ff('0x3e'),_0x2c09e5['arg_1']));_0x2c09e5['continueAt'](_0x2c09e5[_0xf3ff('0x2e')],_0x2c09e5[_0xf3ff('0x2f')],parseInt(_0x2c09e5[_0xf3ff('0x30')],0xa)+0x1);_0x2c09e5[_0xf3ff('0x3c')]();}module[_0xf3ff('0x3f')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize};
\ No newline at end of file
+var _0x64ae=['calleridname','uniqueid','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','exports','lodash','moment','xml2json','util','../../config/logger','agi','./graph','getSquareProjects','error','Unable\x20to\x20download\x20CallySquare\x20projects','agicommand','hasOwnProperty','maxRetry','retry','addVertex','mxCell','isArray','length','source','target','value','toJson','mxGraphModel','root','inspect','stringify','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','omit','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','dnid','traverseBFS','start','clear','debug','vertex','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','code','result','evtHangup','response','isUndefined','toString','agicommand\x20not\x20found','stack','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s'];(function(_0x4ec4c6,_0xee1082){var _0x25c91d=function(_0xdfd764){while(--_0xdfd764){_0x4ec4c6['push'](_0x4ec4c6['shift']());}};_0x25c91d(++_0xee1082);}(_0x64ae,0x87));var _0xe64a=function(_0x5a0826,_0x1d3677){_0x5a0826=_0x5a0826-0x0;var _0x2912d3=_0x64ae[_0x5a0826];return _0x2912d3;};'use strict';var _=require(_0xe64a('0x0'));var moment=require(_0xe64a('0x1'));var parser=require(_0xe64a('0x2'));var util=require(_0xe64a('0x3'));var logger=require(_0xe64a('0x4'))(_0xe64a('0x5'));var rpc=require('./rpc');var mailRpc=require('./mailRpc');var Graph=require(_0xe64a('0x6'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0xe64a('0x7')]()['catch'](function(_0x1db2a3){logger[_0xe64a('0x8')](_0xe64a('0x9'),_0x1db2a3['stack']);return[];});}function addVertex(_0xa714e9,_0x2fc630,_0xf03f7){_0x2fc630[_0xe64a('0xa')]=_0xf03f7;if(_0x2fc630[_0xe64a('0xb')]('retry')){_0x2fc630[_0xe64a('0xc')]=parseInt(_0x2fc630[_0xe64a('0xd')],0xa);}_0xa714e9[_0xe64a('0xe')](_['omit'](_0x2fc630,_0xe64a('0xf')));}function initGraph(_0x54dc18,_0x4527a7){var _0x47060c=new Graph();for(var _0xcab766 in _0x54dc18){if(_0x54dc18[_0xe64a('0xb')](_0xcab766)){if(_[_0xe64a('0x10')](_0x54dc18[_0xcab766])){for(var _0x1b4086=0x0;_0x1b4086<_0x54dc18[_0xcab766][_0xe64a('0x11')];_0x1b4086+=0x1){addVertex(_0x47060c,_0x54dc18[_0xcab766][_0x1b4086],_0xcab766);}}else{addVertex(_0x47060c,_0x54dc18[_0xcab766],_0xcab766);}}}for(var _0x5b4810=0x0;_0x5b4810<_0x4527a7[_0xe64a('0x11')];_0x5b4810+=0x1){if(_0x4527a7[_0x5b4810][_0xe64a('0x12')]&&_0x4527a7[_0x5b4810]['target']){_0x47060c['addEdge'](_0x4527a7[_0x5b4810][_0xe64a('0x12')],_0x4527a7[_0x5b4810][_0xe64a('0x13')],_0x4527a7[_0x5b4810][_0xe64a('0x14')]);}}return _0x47060c;}function getRoot(_0x5aa52b){return parser[_0xe64a('0x15')](_0x5aa52b,{'object':!![]})[_0xe64a('0x16')][_0xe64a('0x17')];}function inspect(_0x4fba68){return util[_0xe64a('0x18')](_0x4fba68,{'showHidden':![],'depth':null});}function initialize(_0x58ea1f,_0x2d891b){var _0x2074b8=getRoot(_0x58ea1f['production']);if(!_0x2074b8||!_0x2074b8['start'])return;var _0x16976f,_0x50cc82,_0x584945;logger['debug'](_0xe64a('0x17'),JSON[_0xe64a('0x19')](_0x2074b8,null,0x2));_0x2d891b[_0xe64a('0x1a')]=moment()[_0xe64a('0x1b')](_0xe64a('0x1c'));_0x16976f=initGraph(_[_0xe64a('0x1d')](_0x2074b8,'mxCell'),_0x2074b8['mxCell']);_0x50cc82=new Vertices(_0x2d891b,rpc,mailRpc);logger[_0xe64a('0x1e')](util['format'](_0xe64a('0x1f'),_0x2d891b[_0xe64a('0x20')],_0x2d891b['calleridname'],_0x2d891b[_0xe64a('0x21')],_0x2d891b[_0xe64a('0x22')],_0x2d891b['uniqueid']));_0x16976f[_0xe64a('0x23')](_0x2074b8[_0xe64a('0x24')]['id'],function(_0x13c1c7){try{_0x13c1c7=_0x50cc82[_0xe64a('0x25')](_0x13c1c7);logger[_0xe64a('0x26')](_0xe64a('0x27'),JSON[_0xe64a('0x19')](_0x13c1c7,null,0x2));if(_0x13c1c7[_0xe64a('0xa')]==='gotoc'){logger[_0xe64a('0x1e')](_0xe64a('0x28'));_0x2d891b['context']=_0x13c1c7[_0xe64a('0x29')]||_0x2d891b[_0xe64a('0x29')];_0x2d891b[_0xe64a('0x2a')]=_0x13c1c7[_0xe64a('0x2a')];_0x2d891b[_0xe64a('0x2b')]=_0x13c1c7[_0xe64a('0x2b')]?_0x13c1c7[_0xe64a('0x2b')]-0x1:0x1;return null;}else if(_0x13c1c7&&_0x50cc82[_0x13c1c7['agicommand']]){_0x584945=_0x50cc82[_0x13c1c7[_0xe64a('0xa')]](_0x13c1c7);logger[_0xe64a('0x1e')]('response',JSON['stringify'](_0x584945,null,0x2));if(_0x584945&&_0x584945[_0xe64a('0x2c')]===AGI_CODE_SUCCESS&&_0x584945[_0xe64a('0x2d')]!==AGI_RESULT_ERROR&&!_0x2d891b[_0xe64a('0x2e')]){logger[_0xe64a('0x26')](_0xe64a('0x2f'),inspect(_0x584945));return _[_0xe64a('0x30')](_0x584945[_0xe64a('0x2d')])?null:_0x584945[_0xe64a('0x2d')][_0xe64a('0x31')]();}else{logger['error'](_0xe64a('0x2f'),inspect(_0x584945));return null;}}else{logger[_0xe64a('0x8')](_0xe64a('0x32'));return null;}}catch(_0x225f93){logger[_0xe64a('0x8')](_0x225f93[_0xe64a('0x33')]);return null;}});if(_0x2074b8[_0xe64a('0x34')]){logger[_0xe64a('0x1e')](util[_0xe64a('0x1b')](_0xe64a('0x35'),_0x2d891b['arg_1'],_0x2d891b[_0xe64a('0x36')],_0x2d891b[_0xe64a('0x21')],_0x2d891b['dnid'],_0x2d891b[_0xe64a('0x37')]));_0x16976f[_0xe64a('0x23')](_0x2074b8[_0xe64a('0x34')]['id'],function(_0x453b74){try{_0x453b74=_0x50cc82[_0xe64a('0x25')](_0x453b74);logger['debug'](_0xe64a('0x27'),JSON[_0xe64a('0x19')](_0x453b74,null,0x2));if(_0x453b74&&_0x50cc82[_0x453b74['agicommand']]){_0x584945=_0x50cc82[_0x453b74['agicommand']](_0x453b74);if(_0x584945){logger[_0xe64a('0x26')]('response',inspect(_0x584945));return _['isUndefined'](_0x584945[_0xe64a('0x2d')])?null:_0x584945[_0xe64a('0x2d')][_0xe64a('0x31')]();}else{logger['error'](_0xe64a('0x2f'),inspect(_0x584945));return null;}}else{logger[_0xe64a('0x8')](_0xe64a('0x32'));return null;}}catch(_0x559a6d){logger[_0xe64a('0x8')](_0x559a6d[_0xe64a('0x33')]);return null;}});}logger[_0xe64a('0x1e')](util[_0xe64a('0x1b')](_0xe64a('0x38'),_0x2d891b[_0xe64a('0x20')],_0x2d891b[_0xe64a('0x36')],_0x2d891b['callerid'],_0x2d891b[_0xe64a('0x22')],_0x2d891b[_0xe64a('0x37')]));logger[_0xe64a('0x1e')](util[_0xe64a('0x1b')](_0xe64a('0x39'),_0x2d891b[_0xe64a('0x29')],_0x2d891b['extension'],parseInt(_0x2d891b[_0xe64a('0x2b')],0xa)+0x1));_0x2d891b[_0xe64a('0x3a')](_0x2d891b[_0xe64a('0x29')],_0x2d891b[_0xe64a('0x2a')],parseInt(_0x2d891b[_0xe64a('0x2b')],0xa)+0x1);_0x2d891b[_0xe64a('0x3b')]();}function handleNotFound(_0x388c1c){logger[_0xe64a('0x8')](util[_0xe64a('0x1b')](_0xe64a('0x3c'),_0x388c1c[_0xe64a('0x20')]));_0x388c1c['continueAt'](_0x388c1c[_0xe64a('0x29')],_0x388c1c['extension'],parseInt(_0x388c1c[_0xe64a('0x2b')],0xa)+0x1);_0x388c1c['close']();}function handleUnpublished(_0x2a71e6){logger[_0xe64a('0x8')](util[_0xe64a('0x1b')](_0xe64a('0x3d'),_0x2a71e6[_0xe64a('0x20')]));_0x2a71e6[_0xe64a('0x3a')](_0x2a71e6[_0xe64a('0x29')],_0x2a71e6[_0xe64a('0x2a')],parseInt(_0x2a71e6[_0xe64a('0x2b')],0xa)+0x1);_0x2a71e6[_0xe64a('0x3b')]();}module[_0xe64a('0x3e')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize};
\ No newline at end of file