Built motion from commit (unavailable).|2.5.14
[motion2.git] / server / services / agi / index.js
index 3811d55..79698c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac31=['extension','priority','response','code','isUndefined','result','toString','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','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20%s','listening','connection','xml2json','lodash','syncho','util','moment','../../config/environment','../../config/logger','../../config/license/util','./rpc','./vertices','agi','defaults','127.0.0.1','nextTick','error','stack','log','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[%s]\x20%s','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','dnid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','uniqueid','evtHangup','toJson','mxGraphModel','agicommand','hasOwnProperty','maxRetry','retry','addVertex','omit','mxCell','isArray','length','source','addEdge','target','value','getSquareProject','then','createSquareReport','catch','indexOf','agi_','substring','inspect','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','hangup','sync','production','start','root','joinAt','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','debug','vertex','gotoc\x20block\x20stop\x20traverse\x20BFS','context'];(function(_0x3e9199,_0x98724){var _0x379a3f=function(_0x3ce1cb){while(--_0x3ce1cb){_0x3e9199['push'](_0x3e9199['shift']());}};_0x379a3f(++_0x98724);}(_0xac31,0xca));var _0x1ac3=function(_0x42c788,_0x9d6583){_0x42c788=_0x42c788-0x0;var _0x58bae9=_0xac31[_0x42c788];return _0x58bae9;};'use strict';var parser=require(_0x1ac3('0x0'));var _=require(_0x1ac3('0x1'));var syncho=require(_0x1ac3('0x2'));var util=require(_0x1ac3('0x3'));var moment=require(_0x1ac3('0x4'));var config=require(_0x1ac3('0x5'));var logger=require(_0x1ac3('0x6'))('agi');var utilLicense=require(_0x1ac3('0x7'));var rpc=require(_0x1ac3('0x8'));var mailRpc=require('./mailRpc');var Graph=require('./graph');var Vertices=require(_0x1ac3('0x9'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x1ac3('0xa')]=_[_0x1ac3('0xb')](config[_0x1ac3('0xa')],{'ip':_0x1ac3('0xc'),'port':0x11dd});function connectionHandler(_0x57893c){process[_0x1ac3('0xd')](function(){syncho(function(){try{setChannelVariables(_0x57893c);agiHandler(_0x57893c);}catch(_0x4d7695){logger[_0x1ac3('0xe')](_0x4d7695[_0x1ac3('0xf')]);}});});}function listeningHandler(){console[_0x1ac3('0x10')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0x1ac3('0xa')][_0x1ac3('0x11')]);logger[_0x1ac3('0x12')](util[_0x1ac3('0x13')](_0x1ac3('0x14'),config[_0x1ac3('0xa')]['ip'],config['agi'][_0x1ac3('0x11')]));}function errorHandler(_0x376814){if(_0x376814&&_0x376814[_0x1ac3('0x15')]&&_0x376814[_0x1ac3('0x16')]){logger['error'](util[_0x1ac3('0x13')](_0x1ac3('0x17'),_0x376814[_0x1ac3('0x15')],_0x376814[_0x1ac3('0x16')]));}else{logger['error'](util[_0x1ac3('0x13')](_0x1ac3('0x18'),_0x376814['stack']));}}function closeHandler(){logger[_0x1ac3('0x12')](util[_0x1ac3('0x13')](_0x1ac3('0x19'),this['arg_1'],this[_0x1ac3('0x1a')],this[_0x1ac3('0x1b')],this[_0x1ac3('0x1c')],this['uniqueid']));try{createSquareReport(this);}catch(_0x195683){logger['error'](_0x195683[_0x1ac3('0xf')]);}}function timeoutHandler(){logger[_0x1ac3('0x12')](util[_0x1ac3('0x13')](_0x1ac3('0x1d'),this[_0x1ac3('0x1e')],this['calleridname'],this[_0x1ac3('0x1b')],this[_0x1ac3('0x1c')],this[_0x1ac3('0x1f')]));}function hangupHandler(){logger[_0x1ac3('0x12')](util['format']('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x1ac3('0x1e')],this[_0x1ac3('0x1a')],this[_0x1ac3('0x1b')],this[_0x1ac3('0x1c')],this[_0x1ac3('0x1f')]));this[_0x1ac3('0x20')]=!![];}function getRoot(_0x23b767){return parser[_0x1ac3('0x21')](_0x23b767,{'object':!![]})[_0x1ac3('0x22')]['root'];}function addVertex(_0x1e277f,_0x231b7f,_0x4b19f2){_0x231b7f[_0x1ac3('0x23')]=_0x4b19f2;if(_0x231b7f[_0x1ac3('0x24')]('retry')){_0x231b7f[_0x1ac3('0x25')]=parseInt(_0x231b7f[_0x1ac3('0x26')],0xa);}_0x1e277f[_0x1ac3('0x27')](_[_0x1ac3('0x28')](_0x231b7f,_0x1ac3('0x29')));}function initGraph(_0x565a0f,_0x5a2ab2){var _0x503a64=new Graph();for(var _0x528807 in _0x565a0f){if(_0x565a0f['hasOwnProperty'](_0x528807)){if(_[_0x1ac3('0x2a')](_0x565a0f[_0x528807])){for(var _0x4b04fb=0x0;_0x4b04fb<_0x565a0f[_0x528807][_0x1ac3('0x2b')];_0x4b04fb+=0x1){addVertex(_0x503a64,_0x565a0f[_0x528807][_0x4b04fb],_0x528807);}}else{addVertex(_0x503a64,_0x565a0f[_0x528807],_0x528807);}}}for(var _0x3e4a4e=0x0;_0x3e4a4e<_0x5a2ab2[_0x1ac3('0x2b')];_0x3e4a4e+=0x1){if(_0x5a2ab2[_0x3e4a4e][_0x1ac3('0x2c')]&&_0x5a2ab2[_0x3e4a4e]['target']){_0x503a64[_0x1ac3('0x2d')](_0x5a2ab2[_0x3e4a4e]['source'],_0x5a2ab2[_0x3e4a4e][_0x1ac3('0x2e')],_0x5a2ab2[_0x3e4a4e][_0x1ac3('0x2f')]);}}return _0x503a64;}function getSquareProject(_0x440aed,_0x1c5653){rpc[_0x1ac3('0x30')](_0x440aed)[_0x1ac3('0x31')](function(_0x9c17c2){_0x1c5653(null,_0x9c17c2);})['catch'](function(_0x2248b6){_0x1c5653(null,_0x2248b6);});}function createSquareReport(_0x3b4c65,_0x434781){rpc[_0x1ac3('0x32')](_0x3b4c65)['then'](function(_0x3591a9){if(_0x434781){_0x434781(null,_0x3591a9);}})[_0x1ac3('0x33')](function(_0xce0836){if(_0x434781){_0x434781(null,_0xce0836);}});}function setChannelVariables(_0x294513){for(var _0x204d78 in _0x294513){if(_0x294513['hasOwnProperty'](_0x204d78)){if(_0x204d78[_0x1ac3('0x34')](_0x1ac3('0x35'))===0x0){_0x294513[_0x204d78[_0x1ac3('0x36')](0x4)]=_0x294513[_0x204d78];delete _0x294513[_0x204d78];}}}}function getLogFromObject(_0x156ccd){return util[_0x1ac3('0x37')](_0x156ccd,{'showHidden':![],'depth':null});}function agiHandler(_0x43362a){var _0x4c1283,_0x2102a1,_0x174a53,_0x431f11,_0xf6d79e;logger['debug'](_0x1ac3('0x38'),JSON[_0x1ac3('0x39')](_0x43362a,null,0x2));logger[_0x1ac3('0x12')](util[_0x1ac3('0x13')](_0x1ac3('0x3a'),_0x43362a[_0x1ac3('0x1e')],_0x43362a[_0x1ac3('0x1a')],_0x43362a[_0x1ac3('0x1b')],_0x43362a[_0x1ac3('0x1c')],_0x43362a['uniqueid']));_0x43362a['on'](_0x1ac3('0xe'),errorHandler);_0x43362a['on'](_0x1ac3('0x3b'),closeHandler);_0x43362a['on']('timeout',timeoutHandler);_0x43362a[_0x1ac3('0x20')]=![];_0x43362a['on'](_0x1ac3('0x3c'),hangupHandler);var _0x17c69e=getSquareProject[_0x1ac3('0x3d')](null,_0x43362a[_0x1ac3('0x1e')]);if(_0x17c69e){if(_0x17c69e[_0x1ac3('0x3e')]){_0x4c1283=getRoot(_0x17c69e[_0x1ac3('0x3e')]);if(_0x4c1283&&_0x4c1283[_0x1ac3('0x3f')]){logger['debug'](_0x1ac3('0x40'),JSON['stringify'](_0x4c1283,null,0x2));_0x43362a[_0x1ac3('0x41')]=moment()[_0x1ac3('0x13')](_0x1ac3('0x42'));_0x2102a1=initGraph(_[_0x1ac3('0x28')](_0x4c1283,_0x1ac3('0x29')),_0x4c1283[_0x1ac3('0x29')]);_0x174a53=new Vertices(_0x43362a,rpc,mailRpc);logger['info'](util[_0x1ac3('0x13')](_0x1ac3('0x43'),_0x43362a[_0x1ac3('0x1e')],_0x43362a['calleridname'],_0x43362a[_0x1ac3('0x1b')],_0x43362a[_0x1ac3('0x1c')],_0x43362a['uniqueid']));_0x2102a1[_0x1ac3('0x44')](_0x4c1283[_0x1ac3('0x3f')]['id'],function(_0xb4664e){try{_0xb4664e=_0x174a53[_0x1ac3('0x45')](_0xb4664e);logger[_0x1ac3('0x46')](_0x1ac3('0x47'),JSON[_0x1ac3('0x39')](_0xb4664e,null,0x2));if(_0xb4664e[_0x1ac3('0x23')]==='gotoc'){logger[_0x1ac3('0x12')](_0x1ac3('0x48'));_0x43362a[_0x1ac3('0x49')]=_0xb4664e[_0x1ac3('0x49')]||_0x43362a[_0x1ac3('0x49')];_0x43362a[_0x1ac3('0x4a')]=_0xb4664e[_0x1ac3('0x4a')];_0x43362a['priority']=_0xb4664e['priority']?_0xb4664e[_0x1ac3('0x4b')]-0x1:0x1;return null;}else if(_0xb4664e&&_0x174a53[_0xb4664e[_0x1ac3('0x23')]]){_0xf6d79e=_0x174a53[_0xb4664e['agicommand']](_0xb4664e);logger[_0x1ac3('0x12')](_0x1ac3('0x4c'),JSON['stringify'](_0xf6d79e,null,0x2));if(_0xf6d79e&&_0xf6d79e[_0x1ac3('0x4d')]===AGI_CODE_SUCCESS&&_0xf6d79e['result']!==AGI_RESULT_ERROR&&!_0x43362a[_0x1ac3('0x20')]){logger[_0x1ac3('0x46')](_0x1ac3('0x4c'),getLogFromObject(_0xf6d79e));return _[_0x1ac3('0x4e')](_0xf6d79e['result'])?null:_0xf6d79e[_0x1ac3('0x4f')][_0x1ac3('0x50')]();}else{logger[_0x1ac3('0xe')](_0x1ac3('0x4c'),getLogFromObject(_0xf6d79e));return null;}}else{logger[_0x1ac3('0xe')]('agicommand\x20not\x20found');return null;}}catch(_0x26b5b1){logger[_0x1ac3('0xe')](_0x26b5b1[_0x1ac3('0xf')]);return null;}});if(_0x4c1283[_0x1ac3('0x51')]){logger['info'](util[_0x1ac3('0x13')](_0x1ac3('0x52'),_0x43362a[_0x1ac3('0x1e')],_0x43362a[_0x1ac3('0x1a')],_0x43362a['callerid'],_0x43362a[_0x1ac3('0x1c')],_0x43362a[_0x1ac3('0x1f')]));_0x2102a1[_0x1ac3('0x44')](_0x4c1283[_0x1ac3('0x51')]['id'],function(_0x5cfd01){try{_0x5cfd01=_0x174a53[_0x1ac3('0x45')](_0x5cfd01);logger['debug'](_0x1ac3('0x47'),JSON[_0x1ac3('0x39')](_0x5cfd01,null,0x2));if(_0x5cfd01&&_0x174a53[_0x5cfd01[_0x1ac3('0x23')]]){_0xf6d79e=_0x174a53[_0x5cfd01[_0x1ac3('0x23')]](_0x5cfd01);if(_0xf6d79e){logger[_0x1ac3('0x46')](_0x1ac3('0x4c'),getLogFromObject(_0xf6d79e));return _[_0x1ac3('0x4e')](_0xf6d79e['result'])?null:_0xf6d79e['result'][_0x1ac3('0x50')]();}else{logger[_0x1ac3('0xe')](_0x1ac3('0x4c'),getLogFromObject(_0xf6d79e));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0x5b85c5){logger[_0x1ac3('0xe')](_0x5b85c5[_0x1ac3('0xf')]);return null;}});}logger['info'](util[_0x1ac3('0x13')](_0x1ac3('0x53'),_0x43362a[_0x1ac3('0x1e')],_0x43362a[_0x1ac3('0x1a')],_0x43362a['callerid'],_0x43362a['dnid'],_0x43362a[_0x1ac3('0x1f')]));logger[_0x1ac3('0x12')](util['format'](_0x1ac3('0x54'),_0x43362a['context'],_0x43362a['extension'],parseInt(_0x43362a[_0x1ac3('0x4b')],0xa)+0x1));_0x43362a[_0x1ac3('0x55')](_0x43362a['context'],_0x43362a[_0x1ac3('0x4a')],parseInt(_0x43362a['priority'],0xa)+0x1);_0x43362a[_0x1ac3('0x3b')]();}}else{logger[_0x1ac3('0xe')](util[_0x1ac3('0x13')](_0x1ac3('0x56'),_0x43362a[_0x1ac3('0x1e')]));_0x43362a[_0x1ac3('0x55')](_0x43362a[_0x1ac3('0x49')],_0x43362a[_0x1ac3('0x4a')],parseInt(_0x43362a[_0x1ac3('0x4b')],0xa)+0x1);_0x43362a[_0x1ac3('0x3b')]();}}else{logger[_0x1ac3('0xe')](util['format']('Project\x20%s\x20not\x20found',_0x43362a[_0x1ac3('0x1e')]));_0x43362a[_0x1ac3('0x55')](_0x43362a[_0x1ac3('0x49')],_0x43362a[_0x1ac3('0x4a')],parseInt(_0x43362a[_0x1ac3('0x4b')],0xa)+0x1);_0x43362a[_0x1ac3('0x3b')]();}}function main(){var _0x2ca351;return utilLicense[_0x1ac3('0x57')]()[_0x1ac3('0x31')](function(_0x3149f6){if(_0x3149f6){if(_0x3149f6['voice']){if(_0x3149f6[_0x1ac3('0x58')]&&_0x3149f6[_0x1ac3('0x58')]>0x0){logger[_0x1ac3('0x12')](util[_0x1ac3('0x13')](_0x1ac3('0x59'),_0x3149f6['callysquare']));_0x2ca351=_0x3149f6[_0x1ac3('0x58')];}else{logger[_0x1ac3('0x12')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger['info']('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x2ca351=-0x1;}}})[_0x1ac3('0x33')](function(_0x17ebb9){logger[_0x1ac3('0xe')]('[LICENSE]',_0x17ebb9[_0x1ac3('0xf')]);})['finally'](function(){var _0x5035cf=require('./server')(config['agi'][_0x1ac3('0x11')],config[_0x1ac3('0xa')]['ip'],_0x2ca351);_0x5035cf['on'](_0x1ac3('0xe'),errorHandler);_0x5035cf['on'](_0x1ac3('0x5a'),listeningHandler);_0x5035cf['on'](_0x1ac3('0x5b'),connectionHandler);_0x5035cf['on']('close',closeHandler);});}main();
\ No newline at end of file
+var _0x32ef=['Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[%s]\x20%s','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','toJson','mxGraphModel','root','agicommand','hasOwnProperty','retry','addVertex','omit','mxCell','isArray','length','target','source','value','getSquareProject','then','catch','createSquareReport','indexOf','agi_','substring','inspect','debug','variables','stringify','close','timeout','evtHangup','hangup','sync','production','start','joinAt','YYYY-MM-DD\x20HH:mm:ss','traverseBFS','clear','vertex','gotoc','context','extension','priority','response','code','result','isUndefined','toString','finally','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','continueAt','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','listening','connection','xml2json','lodash','syncho','util','moment','../../config/environment','agi','../../config/license/util','./mailRpc','./graph','./vertices','defaults','error','stack','log'];(function(_0x247502,_0x565e72){var _0x39297d=function(_0x3caa80){while(--_0x3caa80){_0x247502['push'](_0x247502['shift']());}};_0x39297d(++_0x565e72);}(_0x32ef,0xf9));var _0xf32e=function(_0x5a032b,_0x42fc7a){_0x5a032b=_0x5a032b-0x0;var _0x3517aa=_0x32ef[_0x5a032b];return _0x3517aa;};'use strict';var parser=require(_0xf32e('0x0'));var _=require(_0xf32e('0x1'));var syncho=require(_0xf32e('0x2'));var util=require(_0xf32e('0x3'));var moment=require(_0xf32e('0x4'));var config=require(_0xf32e('0x5'));var logger=require('../../config/logger')(_0xf32e('0x6'));var utilLicense=require(_0xf32e('0x7'));var rpc=require('./rpc');var mailRpc=require(_0xf32e('0x8'));var Graph=require(_0xf32e('0x9'));var Vertices=require(_0xf32e('0xa'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xf32e('0x6')]=_[_0xf32e('0xb')](config[_0xf32e('0x6')],{'ip':'127.0.0.1','port':0x11dd});function connectionHandler(_0xdac5e){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0xdac5e);agiHandler(_0xdac5e);}catch(_0x384f27){logger[_0xf32e('0xc')](_0x384f27[_0xf32e('0xd')]);}});});}function listeningHandler(){console[_0xf32e('0xe')](_0xf32e('0xf'),config['agi'][_0xf32e('0x10')]);logger[_0xf32e('0x11')](util[_0xf32e('0x12')](_0xf32e('0x13'),config[_0xf32e('0x6')]['ip'],config[_0xf32e('0x6')][_0xf32e('0x10')]));}function errorHandler(_0x303d4d){if(_0x303d4d&&_0x303d4d[_0xf32e('0x14')]&&_0x303d4d[_0xf32e('0x15')]){logger[_0xf32e('0xc')](util['format'](_0xf32e('0x16'),_0x303d4d[_0xf32e('0x14')],_0x303d4d[_0xf32e('0x15')]));}else{logger[_0xf32e('0xc')](util[_0xf32e('0x12')](_0xf32e('0x17'),_0x303d4d['stack']));}}function closeHandler(){logger[_0xf32e('0x11')](util[_0xf32e('0x12')](_0xf32e('0x18'),this[_0xf32e('0x19')],this[_0xf32e('0x1a')],this[_0xf32e('0x1b')],this[_0xf32e('0x1c')],this[_0xf32e('0x1d')]));try{createSquareReport(this);}catch(_0x21aa73){logger['error'](_0x21aa73[_0xf32e('0xd')]);}}function timeoutHandler(){logger[_0xf32e('0x11')](util[_0xf32e('0x12')](_0xf32e('0x1e'),this[_0xf32e('0x19')],this[_0xf32e('0x1a')],this[_0xf32e('0x1b')],this[_0xf32e('0x1c')],this[_0xf32e('0x1d')]));}function hangupHandler(){logger[_0xf32e('0x11')](util[_0xf32e('0x12')](_0xf32e('0x1f'),this[_0xf32e('0x19')],this[_0xf32e('0x1a')],this[_0xf32e('0x1b')],this['dnid'],this[_0xf32e('0x1d')]));this['evtHangup']=!![];}function getRoot(_0x27b92c){return parser[_0xf32e('0x20')](_0x27b92c,{'object':!![]})[_0xf32e('0x21')][_0xf32e('0x22')];}function addVertex(_0x35e34c,_0x5409b4,_0x227405){_0x5409b4[_0xf32e('0x23')]=_0x227405;if(_0x5409b4[_0xf32e('0x24')](_0xf32e('0x25'))){_0x5409b4['maxRetry']=parseInt(_0x5409b4[_0xf32e('0x25')],0xa);}_0x35e34c[_0xf32e('0x26')](_[_0xf32e('0x27')](_0x5409b4,_0xf32e('0x28')));}function initGraph(_0xb3ee4b,_0x15103f){var _0x2f925b=new Graph();for(var _0x1eb42e in _0xb3ee4b){if(_0xb3ee4b[_0xf32e('0x24')](_0x1eb42e)){if(_[_0xf32e('0x29')](_0xb3ee4b[_0x1eb42e])){for(var _0x488489=0x0;_0x488489<_0xb3ee4b[_0x1eb42e][_0xf32e('0x2a')];_0x488489+=0x1){addVertex(_0x2f925b,_0xb3ee4b[_0x1eb42e][_0x488489],_0x1eb42e);}}else{addVertex(_0x2f925b,_0xb3ee4b[_0x1eb42e],_0x1eb42e);}}}for(var _0x88eaa5=0x0;_0x88eaa5<_0x15103f[_0xf32e('0x2a')];_0x88eaa5+=0x1){if(_0x15103f[_0x88eaa5]['source']&&_0x15103f[_0x88eaa5][_0xf32e('0x2b')]){_0x2f925b['addEdge'](_0x15103f[_0x88eaa5][_0xf32e('0x2c')],_0x15103f[_0x88eaa5]['target'],_0x15103f[_0x88eaa5][_0xf32e('0x2d')]);}}return _0x2f925b;}function getSquareProject(_0x39965e,_0x3e42ac){rpc[_0xf32e('0x2e')](_0x39965e)[_0xf32e('0x2f')](function(_0x4e64d4){_0x3e42ac(null,_0x4e64d4);})[_0xf32e('0x30')](function(_0x1d3c7a){_0x3e42ac(null,_0x1d3c7a);});}function createSquareReport(_0x175096,_0x498c9c){rpc[_0xf32e('0x31')](_0x175096)[_0xf32e('0x2f')](function(_0x2d0d31){if(_0x498c9c){_0x498c9c(null,_0x2d0d31);}})[_0xf32e('0x30')](function(_0x3e0c1e){if(_0x498c9c){_0x498c9c(null,_0x3e0c1e);}});}function setChannelVariables(_0x3f4362){for(var _0x146b52 in _0x3f4362){if(_0x3f4362[_0xf32e('0x24')](_0x146b52)){if(_0x146b52[_0xf32e('0x32')](_0xf32e('0x33'))===0x0){_0x3f4362[_0x146b52[_0xf32e('0x34')](0x4)]=_0x3f4362[_0x146b52];delete _0x3f4362[_0x146b52];}}}}function getLogFromObject(_0x45524d){return util[_0xf32e('0x35')](_0x45524d,{'showHidden':![],'depth':null});}function agiHandler(_0x5c04ae){var _0x7b643e,_0x5232de,_0x576446,_0x529b70,_0x565552;logger[_0xf32e('0x36')](_0xf32e('0x37'),JSON[_0xf32e('0x38')](_0x5c04ae,null,0x2));logger[_0xf32e('0x11')](util[_0xf32e('0x12')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x5c04ae[_0xf32e('0x19')],_0x5c04ae[_0xf32e('0x1a')],_0x5c04ae[_0xf32e('0x1b')],_0x5c04ae[_0xf32e('0x1c')],_0x5c04ae['uniqueid']));_0x5c04ae['on'](_0xf32e('0xc'),errorHandler);_0x5c04ae['on'](_0xf32e('0x39'),closeHandler);_0x5c04ae['on'](_0xf32e('0x3a'),timeoutHandler);_0x5c04ae[_0xf32e('0x3b')]=![];_0x5c04ae['on'](_0xf32e('0x3c'),hangupHandler);var _0x576f37=getSquareProject[_0xf32e('0x3d')](null,_0x5c04ae[_0xf32e('0x19')]);if(_0x576f37){if(_0x576f37[_0xf32e('0x3e')]){_0x7b643e=getRoot(_0x576f37['production']);if(_0x7b643e&&_0x7b643e[_0xf32e('0x3f')]){logger['debug'](_0xf32e('0x22'),JSON[_0xf32e('0x38')](_0x7b643e,null,0x2));_0x5c04ae[_0xf32e('0x40')]=moment()['format'](_0xf32e('0x41'));_0x5232de=initGraph(_[_0xf32e('0x27')](_0x7b643e,_0xf32e('0x28')),_0x7b643e[_0xf32e('0x28')]);_0x576446=new Vertices(_0x5c04ae,rpc,mailRpc);logger[_0xf32e('0x11')](util[_0xf32e('0x12')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x5c04ae[_0xf32e('0x19')],_0x5c04ae[_0xf32e('0x1a')],_0x5c04ae[_0xf32e('0x1b')],_0x5c04ae[_0xf32e('0x1c')],_0x5c04ae[_0xf32e('0x1d')]));_0x5232de[_0xf32e('0x42')](_0x7b643e[_0xf32e('0x3f')]['id'],function(_0x56bf88){try{_0x56bf88=_0x576446[_0xf32e('0x43')](_0x56bf88);logger[_0xf32e('0x36')](_0xf32e('0x44'),JSON[_0xf32e('0x38')](_0x56bf88,null,0x2));if(_0x56bf88[_0xf32e('0x23')]===_0xf32e('0x45')){logger[_0xf32e('0x11')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x5c04ae[_0xf32e('0x46')]=_0x56bf88[_0xf32e('0x46')]||_0x5c04ae[_0xf32e('0x46')];_0x5c04ae[_0xf32e('0x47')]=_0x56bf88[_0xf32e('0x47')];_0x5c04ae[_0xf32e('0x48')]=_0x56bf88[_0xf32e('0x48')]?_0x56bf88[_0xf32e('0x48')]-0x1:0x1;return null;}else if(_0x56bf88&&_0x576446[_0x56bf88[_0xf32e('0x23')]]){_0x565552=_0x576446[_0x56bf88[_0xf32e('0x23')]](_0x56bf88);logger['info'](_0xf32e('0x49'),JSON[_0xf32e('0x38')](_0x565552,null,0x2));if(_0x565552&&_0x565552[_0xf32e('0x4a')]===AGI_CODE_SUCCESS&&_0x565552[_0xf32e('0x4b')]!==AGI_RESULT_ERROR&&!_0x5c04ae[_0xf32e('0x3b')]){logger[_0xf32e('0x36')]('response',getLogFromObject(_0x565552));return _[_0xf32e('0x4c')](_0x565552[_0xf32e('0x4b')])?null:_0x565552[_0xf32e('0x4b')][_0xf32e('0x4d')]();}else{logger[_0xf32e('0xc')]('response',getLogFromObject(_0x565552));return null;}}else{logger[_0xf32e('0xc')]('agicommand\x20not\x20found');return null;}}catch(_0xd81744){logger[_0xf32e('0xc')](_0xd81744['stack']);return null;}});if(_0x7b643e[_0xf32e('0x4e')]){logger['info'](util['format']('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x5c04ae[_0xf32e('0x19')],_0x5c04ae[_0xf32e('0x1a')],_0x5c04ae[_0xf32e('0x1b')],_0x5c04ae[_0xf32e('0x1c')],_0x5c04ae[_0xf32e('0x1d')]));_0x5232de[_0xf32e('0x42')](_0x7b643e[_0xf32e('0x4e')]['id'],function(_0x40fedb){try{_0x40fedb=_0x576446[_0xf32e('0x43')](_0x40fedb);logger[_0xf32e('0x36')](_0xf32e('0x44'),JSON[_0xf32e('0x38')](_0x40fedb,null,0x2));if(_0x40fedb&&_0x576446[_0x40fedb[_0xf32e('0x23')]]){_0x565552=_0x576446[_0x40fedb[_0xf32e('0x23')]](_0x40fedb);if(_0x565552){logger['debug'](_0xf32e('0x49'),getLogFromObject(_0x565552));return _[_0xf32e('0x4c')](_0x565552[_0xf32e('0x4b')])?null:_0x565552['result']['toString']();}else{logger['error'](_0xf32e('0x49'),getLogFromObject(_0x565552));return null;}}else{logger[_0xf32e('0xc')]('agicommand\x20not\x20found');return null;}}catch(_0x436b8a){logger[_0xf32e('0xc')](_0x436b8a['stack']);return null;}});}logger[_0xf32e('0x11')](util[_0xf32e('0x12')](_0xf32e('0x4f'),_0x5c04ae[_0xf32e('0x19')],_0x5c04ae[_0xf32e('0x1a')],_0x5c04ae[_0xf32e('0x1b')],_0x5c04ae['dnid'],_0x5c04ae[_0xf32e('0x1d')]));logger[_0xf32e('0x11')](util[_0xf32e('0x12')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x5c04ae[_0xf32e('0x46')],_0x5c04ae[_0xf32e('0x47')],parseInt(_0x5c04ae[_0xf32e('0x48')],0xa)+0x1));_0x5c04ae['continueAt'](_0x5c04ae['context'],_0x5c04ae['extension'],parseInt(_0x5c04ae[_0xf32e('0x48')],0xa)+0x1);_0x5c04ae[_0xf32e('0x39')]();}}else{logger[_0xf32e('0xc')](util[_0xf32e('0x12')]('Project\x20%s\x20not\x20published',_0x5c04ae[_0xf32e('0x19')]));_0x5c04ae[_0xf32e('0x50')](_0x5c04ae[_0xf32e('0x46')],_0x5c04ae[_0xf32e('0x47')],parseInt(_0x5c04ae[_0xf32e('0x48')],0xa)+0x1);_0x5c04ae['close']();}}else{logger[_0xf32e('0xc')](util[_0xf32e('0x12')](_0xf32e('0x51'),_0x5c04ae[_0xf32e('0x19')]));_0x5c04ae['continueAt'](_0x5c04ae[_0xf32e('0x46')],_0x5c04ae['extension'],parseInt(_0x5c04ae['priority'],0xa)+0x1);_0x5c04ae[_0xf32e('0x39')]();}}function main(){var _0x1954e1;return utilLicense[_0xf32e('0x52')]()[_0xf32e('0x2f')](function(_0x1d58fa){if(_0x1d58fa){if(_0x1d58fa[_0xf32e('0x53')]){if(_0x1d58fa[_0xf32e('0x54')]&&_0x1d58fa[_0xf32e('0x54')]>0x0){logger[_0xf32e('0x11')](util[_0xf32e('0x12')](_0xf32e('0x55'),_0x1d58fa[_0xf32e('0x54')]));_0x1954e1=_0x1d58fa['callysquare'];}else{logger[_0xf32e('0x11')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0xf32e('0x11')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x1954e1=-0x1;}}})[_0xf32e('0x30')](function(_0x2b179e){logger[_0xf32e('0xc')]('[LICENSE]',_0x2b179e[_0xf32e('0xd')]);})[_0xf32e('0x4e')](function(){var _0x500bfb=require('./server')(config['agi'][_0xf32e('0x10')],config[_0xf32e('0x6')]['ip'],_0x1954e1);_0x500bfb['on'](_0xf32e('0xc'),errorHandler);_0x500bfb['on'](_0xf32e('0x56'),listeningHandler);_0x500bfb['on'](_0xf32e('0x57'),connectionHandler);_0x500bfb['on'](_0xf32e('0x39'),closeHandler);});}main();
\ No newline at end of file