1246c26113ee990c5a242ebbcb35da4f8fffbd51
[motion2.git] / server / services / agi / vertices.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x1587=['Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','gosub','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','RECORDING_SAVENAME','escape_digits','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','sayNumber','number','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','email','Smtp','user','bcc','subject','service','host','port','secure','authentication','auth','pass','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','sendSMS','sms_account_id','no\x20sms\x20account\x20configured','getSmsAccount','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','variable_value','START\x20CALLY\x20SQUARE','yes','Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','system','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','join','shelljs','odbc','randomstring','moment','mustache','../../config/environment','/var/opt/motion2/server/files','getdigits','channel','rpc','prototype','getVariableById','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareOdbcById','getTrunkById','getSound','getSoundById','save_name','getMailAccount','getMailAccountById','sendMailMessage','mailRpc','interval','map','getSoundPath','format','%s/sounds/converted/%s','getQueryOdbc','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','query','Query\x20executed\x20correctly\x20%s','close','createSmsMessage','uniqueid','label','arg_1','callerid','createSquareRecording','calleridname','context','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isNil','callback_','random','isEmpty','lastName','phone','list_id','scheduledAt','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','LOCAL','shellCommand','replace','googleTTS','text','google_tts_language','googleDialogflow','key','dialogflow_language','sestekNDA','ispeechTTS','ispeech_tts_language','en-US','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','aws_text_type','awsLex','aws_bot_name','googleASR','google_asr_language','appid','appsecret','uri','clear','includes','agicommand','clone','hasOwnProperty','isString','replaceAllVariables','split','length','replaceAll','getVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','extra','maxRetry','createSquareDetailsReport','sync','retry','agi','command','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','timeout','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','delay','add','minutes','noop','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','lumenvoxtts','no\x20text\x20configured','options','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','exec','lumenvoxasr','grammar','no\x20grammar\x20configured','MRCPRecog','getAndSetVariable','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','RECOG_INPUT()','SESTEK_ASR_TRANSCRIPT','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','variable_id','no\x20variable\x20found','forEach','setVariable','%s[%s][%s]','%s_ROWS_COUNT','dial','debug','sip_id','no\x20user\x20selected','getUser','no\x20user\x20found','DIAL','opts','url','Executed\x20command\x20%s','dialogflow','no\x20key\x20configured','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','out','Dialogflow\x20Result\x20%s','speech','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','toUpperCase','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','end','Enter\x20in\x20END\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','trunk_name','SIP/%s/%s','finally','file_id','no\x20file\x20audio\x20found','no\x20variable\x20selected\x20for\x20the\x20result','maxdigit','test','mindigit','hiddendigitsnum','hiddendigitspos','first','substr','generate','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','aws\x20Polly\x20%s\x20file\x20created','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','no\x20bot\x20name\x20configured','bot','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','message','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','NOBEEP','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','%s.%s','recordFile','intKey','tilde\x20%s\x20file\x20created','tildeASR','TILDE_ASR_%s','TildeASR\x20Result\x20%s','stringify','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','no\x20condition\x20configured','condition','true','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','getIntervals','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','false','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','agentLogin','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','success','operation','isArray','%s[%s]','menu','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','getData','response','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Executed\x20command\x20%s\x20%s','PLAYBACK','queue'];(function(_0xe2450a,_0x5728da){var _0x5084fd=function(_0x449cd8){while(--_0x449cd8){_0xe2450a['push'](_0xe2450a['shift']());}};_0x5084fd(++_0x5728da);}(_0x1587,0x1d7));var _0x7158=function(_0x531c0a,_0x1117a9){_0x531c0a=_0x531c0a-0x0;var _0x3276d2=_0x1587[_0x531c0a];return _0x3276d2;};'use strict';var fs=require('fs');var path=require('path');var util=require('util');var _=require('lodash');var sh=require(_0x7158('0x0'));var odbc=require(_0x7158('0x1'))();var rs=require(_0x7158('0x2'));var moment=require(_0x7158('0x3'));var Mustache=require(_0x7158('0x4'));var logger=require('../../config/logger')('agi');var config=require(_0x7158('0x5'));var scripts=require('./scripts');var FILES_PATH=_0x7158('0x6');var verticesWithRetry=['menu',_0x7158('0x7'),'getsecretdigits'];var AGIVertices=function(_0x255d31,_0x20dac0,_0x5b7c6c){this[_0x7158('0x8')]=_0x255d31;this[_0x7158('0x9')]=_0x20dac0;this['mailRpc']=_0x5b7c6c;};AGIVertices[_0x7158('0xa')]['getVariable']=function(_0x51baf5,_0x69ac2b){this[_0x7158('0x9')][_0x7158('0xb')](_0x51baf5)[_0x7158('0xc')](function(_0x6a4f18){_0x69ac2b(null,_0x6a4f18?_0x6a4f18[_0x7158('0xd')]:![]);})[_0x7158('0xe')](function(_0x375a22){_0x69ac2b(_0x375a22);});};AGIVertices[_0x7158('0xa')][_0x7158('0xf')]=function(_0x8c597e,_0x4ae1dd){this['rpc'][_0x7158('0x10')](_0x8c597e)[_0x7158('0xc')](function(_0x13c812){_0x4ae1dd(null,_0x13c812?_0x13c812[_0x7158('0xd')]:![]);})[_0x7158('0xe')](function(_0x324faa){_0x4ae1dd(_0x324faa);});};AGIVertices['prototype'][_0x7158('0x11')]=function(_0x33b0e6,_0x121206){this['rpc']['getSquareProjectById'](_0x33b0e6)[_0x7158('0xc')](function(_0x28ae9f){_0x121206(null,_0x28ae9f?_0x28ae9f[_0x7158('0xd')]:![]);})[_0x7158('0xe')](function(_0x3a7d13){_0x121206(_0x3a7d13);});};AGIVertices[_0x7158('0xa')]['getSquareOdbc']=function(_0x1d597e,_0x2dfbfd){this['rpc'][_0x7158('0x12')](_0x1d597e)[_0x7158('0xc')](function(_0x5ae410){_0x2dfbfd(null,_0x5ae410?_0x5ae410['dsn']:![]);})[_0x7158('0xe')](function(_0x153f25){_0x2dfbfd(_0x153f25);});};AGIVertices[_0x7158('0xa')]['getUser']=function(_0x480870,_0x35cc6d){this[_0x7158('0x9')]['getUserById'](_0x480870)['then'](function(_0x5e8bd9){_0x35cc6d(null,_0x5e8bd9?_0x5e8bd9['name']:![]);})['catch'](function(_0x3bc397){_0x35cc6d(_0x3bc397);});};AGIVertices[_0x7158('0xa')]['getTrunk']=function(_0x2a3234,_0x5b0ff4){this[_0x7158('0x9')][_0x7158('0x13')](_0x2a3234)[_0x7158('0xc')](function(_0x36e314){_0x5b0ff4(null,_0x36e314?_0x36e314[_0x7158('0xd')]:![]);})[_0x7158('0xe')](function(_0x4d41d4){_0x5b0ff4(_0x4d41d4);});};AGIVertices['prototype'][_0x7158('0x14')]=function(_0x813065,_0x2b9202){var _0x762a8=this;this[_0x7158('0x9')][_0x7158('0x15')](_0x813065)[_0x7158('0xc')](function(_0x5a74a5){_0x2b9202(null,_0x5a74a5?_0x762a8['getSoundPath'](_0x5a74a5[_0x7158('0x16')]):![]);})['catch'](function(_0xadcf4c){_0x2b9202(_0xadcf4c);});};AGIVertices[_0x7158('0xa')][_0x7158('0x17')]=function(_0xe5935c,_0x64fd54){this[_0x7158('0x9')][_0x7158('0x18')](_0xe5935c)['then'](function(_0x56cb02){_0x64fd54(null,_0x56cb02?_0x56cb02:![]);})[_0x7158('0xe')](function(_0x6907ce){_0x64fd54(_0x6907ce);});};AGIVertices['prototype'][_0x7158('0x19')]=function(_0x7aa456,_0x3c132b,_0x319d10){this[_0x7158('0x1a')]['sendMailMessage'](_0x7aa456,_0x3c132b)[_0x7158('0xc')](function(){_0x319d10(null);})[_0x7158('0xe')](function(_0x33f5a0){_0x319d10(_0x33f5a0);});};AGIVertices[_0x7158('0xa')]['getIntervals']=function(_0x38066b,_0x2faee2){this[_0x7158('0x9')]['getIntervalById'](_0x38066b)[_0x7158('0xc')](function(_0x1c13ef){if(_0x1c13ef){if(_0x1c13ef['IntervalId']){_0x2faee2(null,[_0x1c13ef[_0x7158('0x1b')]]);}else{_0x2faee2(null,_[_0x7158('0x1c')](_0x1c13ef['Intervals'],'interval'));}}else{_0x2faee2(null,![]);}})[_0x7158('0xe')](function(_0x41aaf6){_0x2faee2(_0x41aaf6);});};AGIVertices[_0x7158('0xa')][_0x7158('0x1d')]=function(_0x299a63){return util[_0x7158('0x1e')](_0x7158('0x1f'),FILES_PATH,_0x299a63);};AGIVertices['prototype'][_0x7158('0x20')]=function(_0x4c5912,_0x387db7,_0x5ad31a){odbc['open'](_0x4c5912,function(_0x24e47f){if(_0x24e47f){logger[_0x7158('0x21')](_0x7158('0x22'),_0x24e47f);_0x5ad31a(_0x24e47f);}else{logger[_0x7158('0x23')]('ODBC\x20connection\x20successfully');odbc[_0x7158('0x24')](_0x387db7,function(_0x45872f,_0x3ae591){if(_0x45872f){logger['info']('Error\x20executing\x20query\x20%s',_0x387db7);_0x5ad31a(_0x45872f);}else{logger['info'](_0x7158('0x25'),_0x387db7);odbc[_0x7158('0x26')](function(_0x708acd){if(_0x708acd){logger[_0x7158('0x21')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x708acd);}_0x5ad31a(null,_0x3ae591);});}});}});};AGIVertices[_0x7158('0xa')]['getSmsAccount']=function(_0x1105cd,_0x1e4cda){this[_0x7158('0x9')]['getSmsAccountById'](_0x1105cd)[_0x7158('0xc')](function(_0x3c5e3f){_0x1e4cda(null,_0x3c5e3f?_0x3c5e3f:![]);})[_0x7158('0xe')](function(_0x52306b){_0x1e4cda(_0x52306b);});};AGIVertices['prototype'][_0x7158('0x27')]=function(_0xf2833b,_0x756aee){this[_0x7158('0x9')][_0x7158('0x27')](_0xf2833b)[_0x7158('0xc')](function(_0x5517f7){_0x756aee(null,_0x5517f7);})[_0x7158('0xe')](function(_0x3c288e){_0x756aee(_0x3c288e);});};AGIVertices[_0x7158('0xa')]['createSquareDetailsReport']=function(_0x16193d,_0xc533b7,_0x1cfea9){this[_0x7158('0x9')]['createSquareDetailsReport']({'uniqueid':this[_0x7158('0x8')][_0x7158('0x28')],'node':_0x16193d[_0x7158('0x29')],'application':_0x16193d['agicommand'],'data':_0xc533b7||null,'project_name':this[_0x7158('0x8')][_0x7158('0x2a')],'callerid':this[_0x7158('0x8')][_0x7158('0x2b')]})[_0x7158('0xc')](function(_0x165f1b){if(_0x1cfea9){_0x1cfea9(null,_0x165f1b);}})[_0x7158('0xe')](function(_0x2dd409){if(_0x1cfea9){_0x1cfea9(_0x2dd409);}});};AGIVertices[_0x7158('0xa')][_0x7158('0x2c')]=function(_0x998ead,_0x12a7b0,_0x3ff360,_0x2d7bd2){this[_0x7158('0x9')][_0x7158('0x2c')]({'uniqueid':this['channel'][_0x7158('0x28')],'callerid':this[_0x7158('0x8')][_0x7158('0x2b')],'calleridname':this[_0x7158('0x8')][_0x7158('0x2d')],'context':this[_0x7158('0x8')][_0x7158('0x2e')],'extension':this[_0x7158('0x8')][_0x7158('0x2f')],'priority':this[_0x7158('0x8')][_0x7158('0x30')],'accountcode':this['channel'][_0x7158('0x31')],'dnid':this[_0x7158('0x8')][_0x7158('0x32')],'projectName':this['channel'][_0x7158('0x2a')],'saveName':_0x12a7b0,'filename':_0x998ead[_0x7158('0x33')]||_0x12a7b0,'savePath':_0x3ff360})[_0x7158('0xc')](function(_0x4cd1c7){_0x2d7bd2(null,_0x4cd1c7);})['catch'](function(_0x4ae8bc){_0x2d7bd2(_0x4ae8bc);});};AGIVertices[_0x7158('0xa')][_0x7158('0x34')]=function(_0x3ac962,_0x35497a,_0x1d273f){this[_0x7158('0x9')]['createSquareMessage']({'uniqueid':this[_0x7158('0x8')][_0x7158('0x28')],'body':_0x3ac962,'direction':_0x35497a})[_0x7158('0xc')](function(_0x19ebc2){if(_0x1d273f){_0x1d273f(null,_0x19ebc2);}})[_0x7158('0xe')](function(_0x3cb944){if(_0x1d273f){_0x1d273f(_0x3cb944);}});};AGIVertices['prototype'][_0x7158('0x35')]=function(_0x10d840,_0x31c0cc){this[_0x7158('0x9')][_0x7158('0x35')]({'firstName':_['isEmpty'](_0x10d840[_0x7158('0xd')])||_[_0x7158('0x36')](_0x10d840[_0x7158('0xd')])?_0x7158('0x37')+Math[_0x7158('0x38')]():_0x10d840[_0x7158('0xd')],'lastName':_[_0x7158('0x39')](_0x10d840['lastName'])||_['isNil'](_0x10d840['lastName'])?null:_0x10d840[_0x7158('0x3a')],'phone':_0x10d840[_0x7158('0x3b')],'ListId':_0x10d840[_0x7158('0x3c')],'scheduledAt':_0x10d840['scheduledAt'],'callbackUniqueid':this['channel'][_0x7158('0x28')],'tags':'callback','description':'Callback\x20scheduled\x20at\x20'+_0x10d840[_0x7158('0x3d')][_0x7158('0x3e')](),'priority':_0x10d840[_0x7158('0x3f')]})['then'](function(_0x37a5e7){_0x31c0cc(null,_0x37a5e7);})[_0x7158('0xe')](function(_0x3dc062){_0x31c0cc(_0x3dc062);});};AGIVertices[_0x7158('0xa')][_0x7158('0x40')]=function(_0xed8e5c,_0x5714cc){this[_0x7158('0x9')][_0x7158('0x41')](_0xed8e5c)[_0x7158('0xc')](function(_0xacc58f){_0x5714cc(null,_0xacc58f?_0xacc58f['name']:![]);})['catch'](function(_0x4e9b1f){_0x5714cc(_0x4e9b1f);});};AGIVertices[_0x7158('0xa')][_0x7158('0x42')]=function(_0x5cab80,_0x2e8f42,_0x362d06){var _0x10b054={'role':_0x7158('0x43')};_0x10b054[_0x5cab80]=this[_0x7158('0x8')][_0x7158('0x2b')];this['rpc'][_0x7158('0x42')](_0x10b054,_0x2e8f42,this['channel'][_0x7158('0x28')])[_0x7158('0xc')](function(_0x4c875c){_0x362d06(null,_['isNil'](_0x4c875c)?![]:!![]);})[_0x7158('0xe')](function(_0x15037e){logger[_0x7158('0x21')](_0x15037e);_0x362d06(null,![]);});};AGIVertices['prototype']['agentUnpause']=function(_0x20b0fa,_0x3cd7f2){var _0x293508={'role':_0x7158('0x43')};_0x293508[_0x20b0fa]=this['channel'][_0x7158('0x2b')];this[_0x7158('0x9')][_0x7158('0x44')](_0x293508)[_0x7158('0xc')](function(_0xbde840){_0x3cd7f2(null,_[_0x7158('0x36')](_0xbde840)?![]:!![]);})[_0x7158('0xe')](function(_0x19b7e4){logger['error'](_0x19b7e4);_0x3cd7f2(null,![]);});};AGIVertices[_0x7158('0xa')][_0x7158('0x45')]=function(_0x4b918e,_0x571418){var _0x212d2c={'role':_0x7158('0x43')};_0x212d2c[_0x4b918e]=this[_0x7158('0x8')][_0x7158('0x2b')];this[_0x7158('0x9')]['agentLogout'](_0x212d2c)[_0x7158('0xc')](function(_0x53cbd7){_0x571418(null,_[_0x7158('0x36')](_0x53cbd7)?![]:!![]);})[_0x7158('0xe')](function(_0x1a8866){logger['error'](_0x1a8866);_0x571418(null,![]);});};AGIVertices['prototype']['agentLogin']=function(_0x1fe890,_0x397017){var _0x260b9f={'role':'agent'};_0x260b9f[_0x1fe890]=this[_0x7158('0x8')][_0x7158('0x2b')];var _0x1e769d=_0x1fe890!='internal'?util[_0x7158('0x1e')]('%s/%s@from-sip/n',_0x7158('0x46'),this[_0x7158('0x8')]['callerid']):undefined;this['rpc']['agentLogin'](_0x260b9f,_0x1e769d)[_0x7158('0xc')](function(_0x41a036){_0x397017(null,_['isNil'](_0x41a036)?![]:!![]);})[_0x7158('0xe')](function(_0xef75d2){logger['error'](_0xef75d2);_0x397017(null,![]);});};AGIVertices['prototype'][_0x7158('0x47')]=function(_0x17b28b,_0x1a04f7){sh['exec'](_['trim'](_0x17b28b),function(_0xa8511d,_0x421f69){var _0x53fcb1=_0x421f69[_0x7158('0x48')](/(\r\n|\n|\r)/gm,'');_0x1a04f7(null,_0x53fcb1);});};AGIVertices[_0x7158('0xa')][_0x7158('0x49')]=function(_0x3c0da2,_0x4eb733){scripts['googleTTS'](_0x3c0da2[_0x7158('0x4a')],_0x3c0da2[_0x7158('0x4b')]||'en',0x1)['then'](function(_0x3c2bba){_0x4eb733(null,_0x3c2bba);})['catch'](function(_0x55c940){_0x4eb733(_0x55c940);});};AGIVertices[_0x7158('0xa')][_0x7158('0x4c')]=function(_0x3d2723,_0x3153a0){scripts['googleDialogflow'](this['channel'][_0x7158('0x28')],_0x3d2723[_0x7158('0x4d')],_0x3d2723[_0x7158('0x4a')],_0x3d2723[_0x7158('0x4e')]||'en')[_0x7158('0xc')](function(_0x322f7a){_0x3153a0(null,_0x322f7a);})['catch'](function(_0x328bf9){_0x3153a0(_0x328bf9);});};AGIVertices[_0x7158('0xa')][_0x7158('0x4f')]=function(_0x1cd3bf,_0x533381){scripts[_0x7158('0x4f')](this[_0x7158('0x8')],_0x1cd3bf)['then'](function(_0x5505a6){_0x533381(null,_0x5505a6);})[_0x7158('0xe')](function(_0x2c80a7){_0x533381(_0x2c80a7);});};AGIVertices[_0x7158('0xa')]['ispeechTTS']=function(_0x2cea3a,_0x80c00a){scripts[_0x7158('0x50')](_0x2cea3a[_0x7158('0x4d')],_0x2cea3a[_0x7158('0x4a')],_0x2cea3a[_0x7158('0x51')]||_0x7158('0x52'),_0x2cea3a[_0x7158('0x53')])[_0x7158('0xc')](function(_0x509aac){_0x80c00a(null,_0x509aac);})[_0x7158('0xe')](function(_0x3d9360){_0x80c00a(_0x3d9360);});};AGIVertices[_0x7158('0xa')][_0x7158('0x54')]=function(_0x38760f,_0x2833cf,_0x312479){scripts[_0x7158('0x54')](_0x2833cf,_0x38760f[_0x7158('0x4d')],_0x38760f[_0x7158('0x55')]||'en-US',this[_0x7158('0x56')](_0x38760f[_0x7158('0x57')])?_0x38760f[_0x7158('0x57')]:undefined)[_0x7158('0xc')](function(_0x4e947f){_0x312479(null,_0x4e947f);})[_0x7158('0xe')](function(_0x27b858){_0x312479(_0x27b858);});};AGIVertices[_0x7158('0xa')]['awsPolly']=function(_0xec7c76,_0x291f58){scripts[_0x7158('0x58')](_0xec7c76[_0x7158('0x59')],_0xec7c76[_0x7158('0x5a')],_0xec7c76[_0x7158('0x5b')],_0xec7c76[_0x7158('0x5c')]||'Amy',_0xec7c76[_0x7158('0x4a')],_0xec7c76[_0x7158('0x5d')]||'text')[_0x7158('0xc')](function(_0x18af1f){_0x291f58(null,_0x18af1f);})[_0x7158('0xe')](function(_0x24a4b1){_0x291f58(_0x24a4b1);});};AGIVertices[_0x7158('0xa')][_0x7158('0x5e')]=function(_0x19d207,_0x15f764){scripts[_0x7158('0x5e')](this[_0x7158('0x8')][_0x7158('0x28')],_0x19d207[_0x7158('0x59')],_0x19d207['aws_secret_access_key'],_0x19d207['aws_lex_region'],_0x19d207[_0x7158('0x4a')],_0x19d207[_0x7158('0x5f')])[_0x7158('0xc')](function(_0x295fbd){_0x15f764(null,_0x295fbd);})['catch'](function(_0x21263c){_0x15f764(_0x21263c);});};AGIVertices[_0x7158('0xa')][_0x7158('0x60')]=function(_0xc58448,_0x234f68,_0x23fb25){scripts[_0x7158('0x60')](_0x234f68,_0xc58448[_0x7158('0x4d')],_0xc58448[_0x7158('0x61')]||_0x7158('0x52'))[_0x7158('0xc')](function(_0x1c6f73){_0x23fb25(null,_0x1c6f73);})[_0x7158('0xe')](function(_0x1519a6){_0x23fb25(_0x1519a6);});};AGIVertices[_0x7158('0xa')]['tildeASR']=function(_0xecc278,_0x138ce2,_0x10edba){scripts['tildeASR'](_0x138ce2,_0xecc278[_0x7158('0x62')],_0xecc278[_0x7158('0x63')],_0xecc278[_0x7158('0x64')])['then'](function(_0x341c00){_0x10edba(null,_0x341c00);})[_0x7158('0xe')](function(_0xe15334){_0x10edba(_0xe15334);});};AGIVertices[_0x7158('0xa')][_0x7158('0x65')]=function(_0x3de6e4){var _0x9766d9=_[_0x7158('0x66')](verticesWithRetry,_0x3de6e4[_0x7158('0x67')])?_0x3de6e4:_[_0x7158('0x68')](_0x3de6e4);for(var _0xc790fe in _0x9766d9){if(_0x9766d9[_0x7158('0x69')](_0xc790fe)){if(_0x9766d9[_0xc790fe]&&_[_0x7158('0x6a')](_0x9766d9[_0xc790fe])){_0x9766d9[_0xc790fe]=this[_0x7158('0x6b')](_0x9766d9[_0xc790fe]);}}}return _0x9766d9;};AGIVertices['prototype'][_0x7158('0x6b')]=function(_0x16cee9){var _0x220952=_0x16cee9[_0x7158('0x6c')]('{');for(var _0x5eba8e=0x1;_0x5eba8e<_0x220952[_0x7158('0x6d')];_0x5eba8e+=0x1){var _0x2ae470=_0x220952[_0x5eba8e][_0x7158('0x6c')]('}');if(_0x2ae470[_0x7158('0x6d')]>0x1){_0x16cee9=_0x16cee9[_0x7158('0x6e')]('{'+_0x2ae470[0x0]+'}',this[_0x7158('0x8')][_0x7158('0x6f')](_0x2ae470[0x0])['extra']||_0x2ae470[0x0]);}}if(_0x220952[_0x7158('0x6d')]===0x1){return _0x16cee9['toString']();}return this[_0x7158('0x6b')](_0x16cee9);};AGIVertices[_0x7158('0xa')]['getAndSetVariable']=function(_0x45c6f0,_0x3a85c6){var _0x4afe14=this[_0x7158('0x8')][_0x7158('0x6f')](_0x45c6f0);if(_0x4afe14[_0x7158('0x70')]===-0x1){return _0x4afe14;}logger['info'](util['format'](_0x7158('0x71'),_0x3a85c6,_0x4afe14[_0x7158('0x72')]));return this['channel']['setVariable'](_0x3a85c6,_0x4afe14['extra']);};AGIVertices[_0x7158('0xa')]['isConfigured']=function(_0x56521c){return _0x56521c&&_0x56521c!=='0'&&_0x56521c!=='-1'&&_0x56521c!=='';};AGIVertices[_0x7158('0xa')][_0x7158('0x73')]=function(_0x52b437){this[_0x7158('0x74')][_0x7158('0x75')](this,_0x52b437,'-');_0x52b437[_0x7158('0x76')]=_0x52b437[_0x7158('0x73')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x7158('0xa')][_0x7158('0x77')]=function(_0x5c1472){logger['info'](util['format']('Enter\x20in\x20AGI\x20(%s)\x20block',_0x5c1472['label']));return this['channel'][_0x7158('0x77')]([_0x5c1472[_0x7158('0x78')],_0x5c1472['args']]);};AGIVertices[_0x7158('0xa')][_0x7158('0x79')]=function(_0xee8034){logger[_0x7158('0x23')](util[_0x7158('0x1e')](_0x7158('0x7a'),_0xee8034[_0x7158('0x29')]));if(this[_0x7158('0x56')](_0xee8034[_0x7158('0x7b')])){logger[_0x7158('0x23')](util[_0x7158('0x1e')]('Wait\x20%s\x20seconds\x20before\x20answer',_0xee8034[_0x7158('0x7b')]));var _0x3d9667=this[_0x7158('0x8')]['wait'](_0xee8034[_0x7158('0x7b')]);if(_0x3d9667[_0x7158('0x70')]===-0x1){return _0x3d9667;}}return this[_0x7158('0x8')][_0x7158('0x79')]();};AGIVertices['prototype'][_0x7158('0x7c')]=function(_0x3528aa){logger[_0x7158('0x23')](util['format'](_0x7158('0x7d'),_0x3528aa[_0x7158('0x29')]));if(!this[_0x7158('0x56')](_0x3528aa['list_id'])){return this['channel'][_0x7158('0x21')](_0x3528aa,'no\x20list\x20selected');}_0x3528aa['scheduledAt']=moment();if(this[_0x7158('0x56')](_0x3528aa[_0x7158('0x7e')])){_0x3528aa['scheduledAt']=moment()[_0x7158('0x7f')](_0x3528aa['delay'],_0x7158('0x80'));}if(!this[_0x7158('0x56')](_0x3528aa[_0x7158('0x3f')])){_0x3528aa[_0x7158('0x3f')]=0x2;}this[_0x7158('0x35')][_0x7158('0x75')](this,_0x3528aa);return this[_0x7158('0x8')][_0x7158('0x81')](util[_0x7158('0x1e')](_0x7158('0x82'),_0x3528aa['phone'],_0x3528aa['list_id'],_0x3528aa['scheduledAt']));};AGIVertices[_0x7158('0xa')][_0x7158('0x83')]=function(_0x3cd68f){logger[_0x7158('0x23')](util[_0x7158('0x1e')](_0x7158('0x84'),_0x3cd68f[_0x7158('0x29')]));var _0x54d3bf=this[_0x7158('0x8')]['exec'](_0x3cd68f[_0x7158('0x85')],_0x3cd68f['options']);if(_0x54d3bf[_0x7158('0x70')]===-0x1){return _0x54d3bf;}return this[_0x7158('0x8')]['noop'](util[_0x7158('0x1e')]('Executed\x20command\x20%s\x20%s',_0x3cd68f[_0x7158('0x85')],_0x3cd68f['options']));};AGIVertices[_0x7158('0xa')][_0x7158('0x86')]=function(_0x59d713){logger[_0x7158('0x23')](util[_0x7158('0x1e')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x59d713[_0x7158('0x29')]));if(!this[_0x7158('0x56')](_0x59d713['text'])){return this['channel']['noop'](_0x7158('0x87'));}var _0x4b4830='\x22'+_0x59d713[_0x7158('0x4a')]+'\x22';if(this['isConfigured'](_0x59d713[_0x7158('0x88')])){_0x4b4830+=','+_0x59d713['options'];}var _0xd6ab73=this['channel']['exec'](_0x7158('0x89'),_0x4b4830);if(_0xd6ab73[_0x7158('0x70')]===-0x1){return _0xd6ab73;}return this[_0x7158('0x8')][_0x7158('0x81')](util[_0x7158('0x1e')](_0x7158('0x8a'),_0x4b4830));};AGIVertices[_0x7158('0xa')]['sestektts']=function(_0x528409){logger[_0x7158('0x23')](util['format'](_0x7158('0x8b'),_0x528409['label']));if(!this[_0x7158('0x56')](_0x528409['text'])){return this[_0x7158('0x8')][_0x7158('0x81')](_0x7158('0x87'));}var _0x1747e1='\x22'+_0x528409[_0x7158('0x4a')]+'\x22';if(this[_0x7158('0x56')](_0x528409[_0x7158('0x88')])){_0x1747e1+=','+_0x528409[_0x7158('0x88')];}var _0x45f38e=this['channel'][_0x7158('0x8c')](_0x7158('0x89'),_0x1747e1);if(_0x45f38e[_0x7158('0x70')]===-0x1){return _0x45f38e;}return this['channel'][_0x7158('0x81')](util[_0x7158('0x1e')](_0x7158('0x8a'),_0x1747e1));};AGIVertices[_0x7158('0xa')][_0x7158('0x8d')]=function(_0xbf83e9){logger[_0x7158('0x23')](util[_0x7158('0x1e')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0xbf83e9[_0x7158('0x29')]));if(!this[_0x7158('0x56')](_0xbf83e9[_0x7158('0x8e')])){return this['channel'][_0x7158('0x81')](_0x7158('0x8f'));}var _0x5f0d34=_0xbf83e9[_0x7158('0x8e')];if(this[_0x7158('0x56')](_0xbf83e9[_0x7158('0x88')])){_0x5f0d34+=','+_0xbf83e9[_0x7158('0x88')];}var _0x14b9c1=this['channel'][_0x7158('0x8c')](_0x7158('0x90'),_0x5f0d34);if(_0x14b9c1[_0x7158('0x70')]===-0x1){return _0x14b9c1;}var _0x504875=this[_0x7158('0x91')](_0x7158('0x92'),_0x7158('0x93'));if(_0x504875[_0x7158('0x70')]===-0x1){return _0x504875;}var _0x1911a0=this[_0x7158('0x91')]('RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT');if(_0x1911a0['result']===-0x1){return _0x1911a0;}var _0x195962=this['getAndSetVariable']('RECOG_INSTANCE()',_0x7158('0x94'));if(_0x195962['result']===-0x1){return _0x195962;}return this[_0x7158('0x8')]['noop'](util[_0x7158('0x1e')](_0x7158('0x95'),_0x5f0d34));};AGIVertices['prototype'][_0x7158('0x96')]=function(_0x5c563b){logger[_0x7158('0x23')](util[_0x7158('0x1e')](_0x7158('0x97'),_0x5c563b[_0x7158('0x29')]));if(!this['isConfigured'](_0x5c563b['grammar'])){return this[_0x7158('0x8')][_0x7158('0x81')](_0x7158('0x8f'));}var _0x380b33=_0x5c563b[_0x7158('0x8e')];if(this[_0x7158('0x56')](_0x5c563b[_0x7158('0x88')])){_0x380b33+=','+_0x5c563b[_0x7158('0x88')];}var _0x1db5d=this[_0x7158('0x8')]['exec'](_0x7158('0x90'),_0x380b33);if(_0x1db5d[_0x7158('0x70')]===-0x1){return _0x1db5d;}var _0xbcdc69=this[_0x7158('0x91')]('RECOG_CONFIDENCE()','SESTEK_ASR_CONFIDENCE');if(_0xbcdc69[_0x7158('0x70')]===-0x1){return _0xbcdc69;}var _0x2ff7dd=this[_0x7158('0x91')](_0x7158('0x98'),_0x7158('0x99'));if(_0x2ff7dd[_0x7158('0x70')]===-0x1){return _0x2ff7dd;}var _0x5fd846=this['getAndSetVariable']('RECOG_INSTANCE()','SESTEK_ASR_INSTANCE');if(_0x5fd846[_0x7158('0x70')]===-0x1){return _0x5fd846;}return this[_0x7158('0x8')][_0x7158('0x81')](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0x380b33));};AGIVertices[_0x7158('0xa')][_0x7158('0x9a')]=function(_0x5ee8a2){logger[_0x7158('0x23')](util[_0x7158('0x1e')](_0x7158('0x9b'),_0x5ee8a2[_0x7158('0x29')]));if(!this[_0x7158('0x56')](_0x5ee8a2[_0x7158('0x9c')])){return this[_0x7158('0x8')]['error'](_0x5ee8a2,_0x7158('0x9d'));}var _0x8791cb=this['getSquareOdbc'][_0x7158('0x75')](this,_0x5ee8a2[_0x7158('0x9c')]);if(!_0x8791cb){return this[_0x7158('0x8')][_0x7158('0x21')](_0x5ee8a2,'no\x20odbc\x20database\x20found');}if(!this['isConfigured'](_0x5ee8a2[_0x7158('0x24')])){return this[_0x7158('0x8')][_0x7158('0x21')](_0x5ee8a2,'no\x20query\x20configured');}var _0x18a9f6=_0x5ee8a2[_0x7158('0x24')][_0x7158('0x48')](/(\r\n|\n|\r)/gm,'\x20');this['channel']['noop'](util[_0x7158('0x1e')]('query:\x20%s',_0x18a9f6));var _0x57c9f1=this['getQueryOdbc'][_0x7158('0x75')](this,_0x8791cb,_0x18a9f6);this[_0x7158('0x74')][_0x7158('0x75')](this,_0x5ee8a2,_0x18a9f6);if(!this[_0x7158('0x56')](_0x5ee8a2[_0x7158('0x9e')])){return this[_0x7158('0x8')][_0x7158('0x81')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x35a89a=this[_0x7158('0x6f')][_0x7158('0x75')](this,_0x5ee8a2['variable_id']);if(!_0x35a89a){return this[_0x7158('0x8')][_0x7158('0x21')](_0x5ee8a2,_0x7158('0x9f'));}var _0x39a4c6=this;_0x57c9f1['forEach'](function(_0x2d281e,_0x489ad6){Object['keys'](_0x2d281e)[_0x7158('0xa0')](function(_0x1716a7){_0x39a4c6[_0x7158('0x8')][_0x7158('0xa1')](util[_0x7158('0x1e')](_0x7158('0xa2'),_0x35a89a,_0x489ad6,_0x1716a7),_0x2d281e[_0x1716a7]);});});this['channel']['setVariable'](util[_0x7158('0x1e')](_0x7158('0xa3'),_0x35a89a),_0x57c9f1[_0x7158('0x6d')]);return this[_0x7158('0x8')][_0x7158('0x81')](util['format']('variable\x20%s\x20set',_0x35a89a));};AGIVertices[_0x7158('0xa')][_0x7158('0xa4')]=function(_0x3c07aa){logger[_0x7158('0xa5')](util['format']('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x3c07aa['label']));if(!this['isConfigured'](_0x3c07aa[_0x7158('0xa6')])){return this['channel'][_0x7158('0x21')](_0x3c07aa,_0x7158('0xa7'));}var _0x32cc3d=this[_0x7158('0xa8')]['sync'](this,_0x3c07aa[_0x7158('0xa6')]);if(!_0x32cc3d){return this[_0x7158('0x8')]['error'](_0x3c07aa,_0x7158('0xa9'));}var _0x5ee442=this[_0x7158('0x8')]['exec'](_0x7158('0xaa'),[util['format']('SIP/%s',_0x32cc3d),_0x3c07aa[_0x7158('0x7b')],_0x3c07aa[_0x7158('0xab')],_0x3c07aa[_0x7158('0xac')]]);if(_0x5ee442['result']===-0x1){return _0x5ee442;}return this['channel'][_0x7158('0x81')](util['format'](_0x7158('0xad'),'DIAL'));};AGIVertices['prototype'][_0x7158('0xae')]=function(_0x5b684f){logger[_0x7158('0x23')](util[_0x7158('0x1e')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x5b684f['label']));if(!this[_0x7158('0x56')](_0x5b684f[_0x7158('0x4d')])){return this[_0x7158('0x8')][_0x7158('0x81')](_0x7158('0xaf'));}if(!this[_0x7158('0x56')](_0x5b684f[_0x7158('0x4a')])){return this[_0x7158('0x8')][_0x7158('0x81')](_0x7158('0x87'));}this[_0x7158('0x8')]['bot']=!![];this['createSquareDetailsReport'](_0x5b684f);this['createSquareMessage'](_0x5b684f[_0x7158('0x4a')],'in');this[_0x7158('0x8')][_0x7158('0x81')](util['format'](_0x7158('0xb0'),_0x5b684f[_0x7158('0x4a')]));var _0x5c8d00=this[_0x7158('0x4c')][_0x7158('0x75')](this,_0x5b684f);if(_0x5c8d00){for(var _0x135816 in _0x5c8d00){if(_0x5c8d00[_0x7158('0x69')](_0x135816)){this[_0x7158('0x8')][_0x7158('0xa1')](util[_0x7158('0x1e')](_0x7158('0xb1'),_0x135816['toUpperCase']()),_0x5c8d00[_0x135816]);}}this[_0x7158('0x34')](_0x5c8d00['speech'],_0x7158('0xb2'));return this[_0x7158('0x8')][_0x7158('0x81')](util[_0x7158('0x1e')](_0x7158('0xb3'),_0x5c8d00[_0x7158('0xb4')]));}return this[_0x7158('0x8')]['error'](_0x5b684f,'Dialogflow\x20is\x20unreachable');};AGIVertices['prototype'][_0x7158('0xb5')]=function(_0xc7e8a9){logger[_0x7158('0x23')](util[_0x7158('0x1e')](_0x7158('0xb6'),_0xc7e8a9[_0x7158('0x29')]));if(!this[_0x7158('0x56')](_0xc7e8a9[_0x7158('0xb7')])){return this[_0x7158('0x8')]['noop'](_0x7158('0xb8'));}if(!this[_0x7158('0x56')](_0xc7e8a9[_0x7158('0xb9')])){return this['channel'][_0x7158('0x81')](_0x7158('0xba'));}if(!this[_0x7158('0x56')](_0xc7e8a9[_0x7158('0xbb')])){return this['channel']['noop'](_0x7158('0xbc'));}if(!this[_0x7158('0x56')](_0xc7e8a9[_0x7158('0xbd')])){return this[_0x7158('0x8')][_0x7158('0x81')]('no\x20text\x20configured');}this[_0x7158('0x8')]['bot']=!![];this[_0x7158('0x74')](_0xc7e8a9);this[_0x7158('0x34')](_0xc7e8a9[_0x7158('0x4a')],'in');this['channel'][_0x7158('0x81')](util[_0x7158('0x1e')](_0x7158('0xbe'),_0xc7e8a9[_0x7158('0x4a')]));var _0x193660=this[_0x7158('0x4f')][_0x7158('0x75')](this,_0xc7e8a9);if(_0x193660){for(var _0x58dcea in _0x193660){if(_0x193660['hasOwnProperty'](_0x58dcea)){this[_0x7158('0x8')][_0x7158('0xa1')](util['format'](_0x7158('0xbf'),_0x58dcea[_0x7158('0xc0')]()),_0x193660[_0x58dcea]);}}this[_0x7158('0x34')](_0x193660[_0x7158('0xb4')],_0x7158('0xb2'));if(_0x193660[_0x7158('0xc1')]){this[_0x7158('0x8')][_0x7158('0x81')](util[_0x7158('0x1e')](_0x7158('0xc2'),_0x193660[_0x7158('0xc1')]));var _0x1bba3b=this[_0x7158('0x8')][_0x7158('0xc3')](_0x193660['audiofile']);try{fs[_0x7158('0xc4')](_0x193660[_0x7158('0xc1')]+_0x7158('0xc5'));}catch(_0x6b2ea8){logger[_0x7158('0x21')](_0x6b2ea8);}return _0x1bba3b;}else{return this['channel']['noop'](util[_0x7158('0x1e')](_0x7158('0xc6'),_0x193660['speech']));}}return this[_0x7158('0x8')]['error'](_0xc7e8a9,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0x7158('0xa')][_0x7158('0xc7')]=function(_0x180c4e){logger['info'](util[_0x7158('0x1e')](_0x7158('0xc8'),_0x180c4e[_0x7158('0x29')]));return this['channel'][_0x7158('0x81')]('end');};AGIVertices[_0x7158('0xa')]['ext_dial']=function(_0x79b4bd){logger[_0x7158('0x23')](util['format']('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x79b4bd[_0x7158('0x29')]));var _0x45ff18='';if(_0x79b4bd[_0x7158('0xc9')]){if(!this['isConfigured'](_0x79b4bd[_0x7158('0xc9')])){return this[_0x7158('0x8')]['error'](_0x79b4bd,_0x7158('0xca'));}else{var _0x3070e4=parseInt(_0x79b4bd['trunk_id'],0xa);if(isNaN(_0x3070e4)){_0x45ff18=_0x79b4bd['trunk_id'];}else{_0x45ff18=this['getTrunk'][_0x7158('0x75')](this,_0x79b4bd['trunk_id']);if(!_0x45ff18){return this[_0x7158('0x8')][_0x7158('0x21')](_0x79b4bd,'no\x20trunk\x20found');}}}}else if(_0x79b4bd[_0x7158('0xcb')]){_0x45ff18=_0x79b4bd[_0x7158('0xcb')];}else{return this[_0x7158('0x8')]['error'](_0x79b4bd,'no\x20trunk\x20selected');}var _0x233c9d=this['channel']['exec']('DIAL',[util[_0x7158('0x1e')](_0x7158('0xcc'),_0x45ff18,_0x79b4bd[_0x7158('0x3b')]),_0x79b4bd[_0x7158('0x7b')],_0x79b4bd[_0x7158('0xab')],_0x79b4bd[_0x7158('0xac')]]);if(_0x233c9d[_0x7158('0x70')]===-0x1){return _0x233c9d;}return this['channel'][_0x7158('0x81')](util[_0x7158('0x1e')](_0x7158('0xad'),_0x7158('0xaa')));};AGIVertices[_0x7158('0xa')][_0x7158('0xcd')]=function(_0x1aee0d){logger['info'](util['format']('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x1aee0d[_0x7158('0x29')]));return this[_0x7158('0x8')][_0x7158('0x81')]('finally');};AGIVertices[_0x7158('0xa')][_0x7158('0x7')]=function(_0x1f6087){logger[_0x7158('0x23')](util[_0x7158('0x1e')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x1f6087[_0x7158('0x29')]));if(_0x1f6087[_0x7158('0x76')]===0x0){return this[_0x7158('0x73')](_0x1f6087);}_0x1f6087[_0x7158('0x76')]-=0x1;if(!this[_0x7158('0x56')](_0x1f6087[_0x7158('0xce')])){return this[_0x7158('0x8')][_0x7158('0x21')](_0x1f6087,'no\x20file\x20audio\x20selected');}var _0x4e39da=this['getSound']['sync'](this,_0x1f6087['file_id']);if(!_0x4e39da){return this[_0x7158('0x8')][_0x7158('0x21')](_0x1f6087,_0x7158('0xcf'));}if(!this[_0x7158('0x56')](_0x1f6087['variable_id'])){return this[_0x7158('0x8')][_0x7158('0x21')](_0x7158('0xd0'));}var _0x1adb13=this[_0x7158('0x8')]['getData'](_0x4e39da,_0x1f6087['response'],_0x1f6087[_0x7158('0xd1')]);var _0x2d8b4c=_0x1adb13[_0x7158('0x70')]?_0x1adb13[_0x7158('0x70')][_0x7158('0x3e')]():'';logger[_0x7158('0x23')](_0x7158('0xd2'),JSON['stringify'](_0x1adb13));if(_0x1adb13[_0x7158('0x70')]===-0x1){this[_0x7158('0x74')][_0x7158('0x75')](this,_0x1f6087,_0x2d8b4c);return _0x1adb13;}else if(_0x1adb13[_0x7158('0x72')]===_0x7158('0x7b')){_0x1adb13[_0x7158('0x70')]=_0x2d8b4c[_0x7158('0x6d')]>=parseInt(_0x1f6087[_0x7158('0xd3')])?'x':'i';}else{_0x1adb13[_0x7158('0x70')]=_0x2d8b4c[_0x7158('0x6d')]>=parseInt(_0x1f6087[_0x7158('0xd3')])&&_0x2d8b4c['length']<=parseInt(_0x1f6087['maxdigit'])?'x':'i';}var _0x259fdc=this[_0x7158('0x6f')]['sync'](this,_0x1f6087[_0x7158('0x9e')]);if(!_0x259fdc){return this['channel'][_0x7158('0x21')](_0x1f6087,_0x7158('0x9f'));}this[_0x7158('0x8')][_0x7158('0xa1')](_0x259fdc,_0x2d8b4c);if(this[_0x7158('0x56')](_0x1f6087[_0x7158('0xd4')])){var _0x1abac7=parseInt(_0x1f6087[_0x7158('0xd4')],0xa);var _0x53c406=rs['generate']({'charset':'*','length':_0x1abac7});var _0x38d2a4=_0x2d8b4c['length'];if(_0x38d2a4>0x0){if(_0x38d2a4>_0x1abac7){this[_0x7158('0x74')][_0x7158('0x75')](this,_0x1f6087,_0x1f6087[_0x7158('0xd5')]===_0x7158('0xd6')?_0x53c406+_0x2d8b4c[_0x7158('0xd7')](_0x1abac7):_0x2d8b4c[_0x7158('0xd7')](0x0,_0x38d2a4-_0x1abac7)+_0x53c406);}else{this[_0x7158('0x74')][_0x7158('0x75')](this,_0x1f6087,rs[_0x7158('0xd8')]({'charset':'*','length':_0x38d2a4}));}}else{this['createSquareDetailsReport'][_0x7158('0x75')](this,_0x1f6087,'');}}else{this[_0x7158('0x74')][_0x7158('0x75')](this,_0x1f6087,_0x2d8b4c);}return _0x1adb13;};AGIVertices[_0x7158('0xa')][_0x7158('0xd9')]=function(_0x1e6fe1){logger[_0x7158('0x23')](util[_0x7158('0x1e')](_0x7158('0xda'),_0x1e6fe1['label']));return this[_0x7158('0x7')](_0x1e6fe1);};AGIVertices[_0x7158('0xa')][_0x7158('0xdb')]=function(_0x5d8ac8){logger[_0x7158('0x23')](util[_0x7158('0x1e')](_0x7158('0xdc'),_0x5d8ac8['label']));this[_0x7158('0x74')][_0x7158('0x75')](this,_0x5d8ac8,_0x5d8ac8[_0x7158('0xdd')]);return this[_0x7158('0x8')][_0x7158('0x81')](util['format'](_0x7158('0xde'),_0x5d8ac8['goalname']));};AGIVertices[_0x7158('0xa')]['awspolly']=function(_0x270600){logger[_0x7158('0x23')](util[_0x7158('0x1e')](_0x7158('0xdf'),_0x270600['label']));if(!this['isConfigured'](_0x270600['aws_access_key_id'])||!this[_0x7158('0x56')](_0x270600[_0x7158('0x5a')])){return this[_0x7158('0x8')][_0x7158('0x81')]('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0x270600[_0x7158('0x4a')])){return this[_0x7158('0x8')]['noop'](_0x7158('0x87'));}this[_0x7158('0x8')][_0x7158('0x81')](util[_0x7158('0x1e')]('Trying\x20aws\x20Polly\x20%s',_0x270600['text']));var _0x317b7e=this[_0x7158('0x58')][_0x7158('0x75')](this,_0x270600);if(_0x317b7e){this[_0x7158('0x8')][_0x7158('0x81')](util[_0x7158('0x1e')](_0x7158('0xe0'),_0x317b7e));var _0x34d04b=this[_0x7158('0x8')][_0x7158('0xc3')](_0x317b7e);try{fs[_0x7158('0xc4')](_0x317b7e+_0x7158('0xc5'));}catch(_0x5760d6){logger[_0x7158('0x21')](_0x5760d6);}return _0x34d04b;}return this[_0x7158('0x8')]['error'](_0x270600,'aws\x20Polly\x20is\x20unreachable');};AGIVertices['prototype'][_0x7158('0xe1')]=function(_0x4e4db4){logger[_0x7158('0x23')](util['format'](_0x7158('0xe2'),_0x4e4db4['label']));if(!this[_0x7158('0x56')](_0x4e4db4[_0x7158('0x59')])||!this[_0x7158('0x56')](_0x4e4db4[_0x7158('0x5a')])){return this[_0x7158('0x8')][_0x7158('0x81')](_0x7158('0xe3'));}if(!this['isConfigured'](_0x4e4db4[_0x7158('0x5f')])){return this['channel']['noop'](_0x7158('0xe4'));}if(!this[_0x7158('0x56')](_0x4e4db4[_0x7158('0x4a')])){return this[_0x7158('0x8')][_0x7158('0x81')](_0x7158('0x87'));}this[_0x7158('0x8')][_0x7158('0xe5')]=!![];this[_0x7158('0x74')](_0x4e4db4);this['createSquareMessage'](_0x4e4db4['text'],'in');this['channel'][_0x7158('0x81')](util['format'](_0x7158('0xe6'),_0x4e4db4[_0x7158('0x4a')]));var _0x5b1744=this['awsLex'][_0x7158('0x75')](this,_0x4e4db4);if(_0x5b1744){for(var _0x4c08a1 in _0x5b1744){if(_0x5b1744[_0x7158('0x69')](_0x4c08a1)&&_['isString'](_0x5b1744[_0x4c08a1])){this[_0x7158('0x8')]['setVariable'](util[_0x7158('0x1e')](_0x7158('0xe7'),_0x4c08a1[_0x7158('0xc0')]()),_0x5b1744[_0x4c08a1]);}}if(_[_0x7158('0x36')](_0x5b1744['message'])){return this[_0x7158('0x8')]['noop']('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x7158('0x34')](_0x5b1744[_0x7158('0xe8')],_0x7158('0xb2'));return this[_0x7158('0x8')][_0x7158('0x81')](util[_0x7158('0x1e')](_0x7158('0xe9'),_0x5b1744[_0x7158('0xe8')]));}}return this[_0x7158('0x8')]['error'](_0x4e4db4,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x7158('0xa')][_0x7158('0xea')]=function(_0x48acef){logger[_0x7158('0x23')](util[_0x7158('0x1e')](_0x7158('0xeb'),_0x48acef[_0x7158('0x29')],_0x48acef[_0x7158('0x7b')]));if(!this[_0x7158('0x56')](_0x48acef[_0x7158('0x4d')])){return this[_0x7158('0x8')][_0x7158('0x81')](_0x7158('0xaf'));}var _0x353a89=_0x7158('0xec');var _0x34e11f=util[_0x7158('0x1e')](_0x7158('0xed'),FILES_PATH,rs['generate'](0x4));var _0x40f534=util[_0x7158('0x1e')]('%s.%s',_0x34e11f,_0x353a89);var _0x9c2d66=!![];if(_0x48acef[_0x7158('0xee')]===_0x7158('0xef')){_0x9c2d66=![];}var _0x3bf005=this['channel']['recordFile'](_0x34e11f,_0x353a89,_0x48acef['intKey'],_0x48acef[_0x7158('0x7b')],undefined,_0x9c2d66);if(_0x3bf005[_0x7158('0x70')]!==-0x1){this['channel'][_0x7158('0x81')](util[_0x7158('0x1e')](_0x7158('0xf0'),_0x40f534));var _0x580cad=this[_0x7158('0x60')][_0x7158('0x75')](this,_0x48acef,_0x40f534);if(_0x580cad){for(var _0x2e99a5 in _0x580cad){if(_0x580cad[_0x7158('0x69')](_0x2e99a5)){this[_0x7158('0x8')][_0x7158('0xa1')](util['format'](_0x7158('0xf1'),_0x2e99a5['toUpperCase']()),_0x580cad[_0x2e99a5]);}}return this[_0x7158('0x8')][_0x7158('0x81')](util['format'](_0x7158('0xf2'),JSON['stringify'](_0x580cad)));}}return _0x3bf005;};AGIVertices[_0x7158('0xa')][_0x7158('0xf3')]=function(_0x2ae3be){logger[_0x7158('0x23')](util[_0x7158('0x1e')](_0x7158('0xf4'),_0x2ae3be['label']));if(!this[_0x7158('0x56')](_0x2ae3be[_0x7158('0x62')])){return this[_0x7158('0x8')][_0x7158('0x81')](_0x7158('0xf5'));}if(!this[_0x7158('0x56')](_0x2ae3be[_0x7158('0x63')])){return this[_0x7158('0x8')][_0x7158('0x81')]('no\x20appsecret\x20configured');}var _0x18095f='wav';var _0x33051f=util['format'](_0x7158('0xed'),FILES_PATH,rs['generate'](0x4));var _0x484dd8=util[_0x7158('0x1e')](_0x7158('0xf6'),_0x33051f,_0x18095f);var _0x57a89d=!![];if(_0x2ae3be['beep']==='NOBEEP'){_0x57a89d=![];}var _0xeb955e=this['channel'][_0x7158('0xf7')](_0x33051f,_0x18095f,_0x2ae3be[_0x7158('0xf8')],_0x2ae3be[_0x7158('0x7b')],undefined,_0x57a89d);if(_0xeb955e[_0x7158('0x70')]!==-0x1){this[_0x7158('0x8')]['noop'](util[_0x7158('0x1e')](_0x7158('0xf9'),_0x484dd8));var _0x5a8e2d=this[_0x7158('0xfa')]['sync'](this,_0x2ae3be,_0x484dd8);if(_0x5a8e2d){for(var _0x3b6301 in _0x5a8e2d){if(_0x5a8e2d[_0x7158('0x69')](_0x3b6301)){this['channel'][_0x7158('0xa1')](util[_0x7158('0x1e')](_0x7158('0xfb'),_0x3b6301['toUpperCase']()),_0x5a8e2d[_0x3b6301]);}}return this['channel'][_0x7158('0x81')](util['format'](_0x7158('0xfc'),JSON[_0x7158('0xfd')](_0x5a8e2d)));}}return _0xeb955e;};AGIVertices[_0x7158('0xa')][_0x7158('0xfe')]=function(_0x5cbdd8){logger[_0x7158('0x23')](util[_0x7158('0x1e')](_0x7158('0xff'),_0x5cbdd8[_0x7158('0x29')]));return this[_0x7158('0x8')][_0x7158('0x100')](_0x5cbdd8[_0x7158('0x2e')],_0x5cbdd8[_0x7158('0x2f')],_0x5cbdd8[_0x7158('0x30')]);};AGIVertices['prototype'][_0x7158('0x101')]=function(_0x31ffa8){logger[_0x7158('0x23')](util['format'](_0x7158('0x102'),_0x31ffa8[_0x7158('0x29')]));if(!this['isConfigured'](_0x31ffa8['condition'])){return this[_0x7158('0x8')]['error'](_0x31ffa8,_0x7158('0x103'));}try{var _0x156f02=eval(_0x31ffa8[_0x7158('0x104')])?_0x7158('0x105'):'false';this[_0x7158('0x8')][_0x7158('0x81')](util[_0x7158('0x1e')](_0x7158('0x106'),_0x31ffa8[_0x7158('0x104')],_0x156f02));return{'code':0xc8,'result':_0x156f02};}catch(_0x5449e3){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x7158('0xa')][_0x7158('0x107')]=function(_0x2cbedd){logger[_0x7158('0x23')](util['format'](_0x7158('0x108'),_0x2cbedd['label']));if(!this[_0x7158('0x56')](_0x2cbedd[_0x7158('0x109')])){return this[_0x7158('0x8')][_0x7158('0x21')](_0x2cbedd,_0x7158('0x10a'));}var _0x1a1bc7=this[_0x7158('0x10b')][_0x7158('0x75')](this,_0x2cbedd['interval_id']);if(!_0x1a1bc7){return this[_0x7158('0x8')]['error'](_0x2cbedd,_0x7158('0x10c'));}for(var _0x307e00=0x0;_0x307e00<_0x1a1bc7['length'];_0x307e00+=0x1){var _0x560bf5=this[_0x7158('0x8')]['getVariable'](util[_0x7158('0x1e')](_0x7158('0x10d'),_0x1a1bc7[_0x307e00]));if(_0x560bf5['result']===-0x1){return _0x560bf5;}logger[_0x7158('0x23')](util['format'](_0x7158('0x10e'),_0x1a1bc7[_0x307e00],_0x560bf5[_0x7158('0x72')]));if(_0x560bf5[_0x7158('0x72')]===_0x7158('0x105')){logger[_0x7158('0x23')](util[_0x7158('0x1e')](_0x7158('0x10e'),_0x1a1bc7[_0x307e00],_0x7158('0x105')));this[_0x7158('0x8')][_0x7158('0x81')](util[_0x7158('0x1e')](_0x7158('0x10e'),_0x1a1bc7[_0x307e00],'true'));return{'code':0xc8,'result':_0x7158('0x105')};}else{logger[_0x7158('0x23')](util[_0x7158('0x1e')](_0x7158('0x10e'),_0x1a1bc7[_0x307e00],'false'));this['channel']['noop'](util[_0x7158('0x1e')](_0x7158('0x10e'),_0x1a1bc7[_0x307e00],_0x7158('0x10f')));}}return{'code':0xc8,'result':_0x7158('0x10f')};};AGIVertices[_0x7158('0xa')][_0x7158('0x110')]=function(_0x123aac){logger[_0x7158('0x23')](util[_0x7158('0x1e')](_0x7158('0x111'),_0x123aac[_0x7158('0x29')]));return this[_0x7158('0x8')][_0x7158('0x110')]();};AGIVertices[_0x7158('0xa')][_0x7158('0x112')]=function(_0x5a0efd){logger[_0x7158('0x23')](util[_0x7158('0x1e')](_0x7158('0x113'),_0x5a0efd[_0x7158('0x29')]));if(!this[_0x7158('0x56')](_0x5a0efd[_0x7158('0x4d')])){return this[_0x7158('0x8')][_0x7158('0x81')](_0x7158('0xaf'));}var _0x4ddeed=_0x7158('0xec');var _0xd74ded=util[_0x7158('0x1e')](_0x7158('0xed'),FILES_PATH,rs[_0x7158('0xd8')](0x4));var _0x3b1fad=util[_0x7158('0x1e')](_0x7158('0xf6'),_0xd74ded,_0x4ddeed);var _0x140bfa=!![];if(_0x5a0efd[_0x7158('0xee')]==='NOBEEP'){_0x140bfa=![];}var _0x10301e=this['channel']['recordFile'](_0xd74ded,_0x4ddeed,_0x5a0efd[_0x7158('0xf8')],_0x5a0efd[_0x7158('0x7b')],undefined,_0x140bfa);if(_0x10301e[_0x7158('0x70')]!==-0x1){this[_0x7158('0x8')][_0x7158('0x81')](util[_0x7158('0x1e')](_0x7158('0x114'),_0x3b1fad));var _0x4c1966=this[_0x7158('0x54')][_0x7158('0x75')](this,_0x5a0efd,_0x3b1fad);if(_0x4c1966){for(var _0xd211e4 in _0x4c1966){if(_0x4c1966[_0x7158('0x69')](_0xd211e4)){this[_0x7158('0x8')][_0x7158('0xa1')](util[_0x7158('0x1e')](_0x7158('0x115'),_0xd211e4[_0x7158('0xc0')]()),_0x4c1966[_0xd211e4]);}}return this[_0x7158('0x8')]['noop'](util['format'](_0x7158('0x116'),JSON[_0x7158('0xfd')](_0x4c1966)));}}return _0x10301e;};AGIVertices[_0x7158('0xa')][_0x7158('0x117')]=function(_0x497b02){logger[_0x7158('0x23')](util['format'](_0x7158('0x118'),_0x497b02[_0x7158('0x29')]));if(!this['isConfigured'](_0x497b02[_0x7158('0x4d')])){return this['channel'][_0x7158('0x81')](_0x7158('0xaf'));}if(!this[_0x7158('0x56')](_0x497b02[_0x7158('0x4a')])){return this['channel'][_0x7158('0x81')](_0x7158('0x87'));}this[_0x7158('0x8')][_0x7158('0x81')](util[_0x7158('0x1e')](_0x7158('0x119'),_0x497b02[_0x7158('0x4a')]));var _0x205c4a=this[_0x7158('0x50')][_0x7158('0x75')](this,_0x497b02);if(_0x205c4a){this[_0x7158('0x8')][_0x7158('0x81')](util['format'](_0x7158('0x114'),_0x205c4a));var _0x300eab=this[_0x7158('0x8')][_0x7158('0xc3')](_0x205c4a,_0x497b02[_0x7158('0xf8')]);try{fs[_0x7158('0xc4')](_0x205c4a+_0x7158('0xc5'));}catch(_0x5764c6){logger[_0x7158('0x21')](_0x5764c6);}return _0x300eab;}return this['channel'][_0x7158('0x21')](_0x497b02,_0x7158('0x11a'));};AGIVertices[_0x7158('0xa')][_0x7158('0x11b')]=function(_0x5aa969){logger['info'](util[_0x7158('0x1e')](_0x7158('0x11c'),_0x5aa969[_0x7158('0x29')]));if(!this['isConfigured'](_0x5aa969[_0x7158('0x11d')])){return this[_0x7158('0x8')][_0x7158('0x21')](_0x5aa969,_0x7158('0x11e'));}logger[_0x7158('0x23')](util[_0x7158('0x1e')](_0x7158('0x11f'),this[_0x7158('0x8')]['callerid'],_0x5aa969['findBy']));var _0x51374d=this[_0x7158('0x120')]['sync'](this,_0x5aa969[_0x7158('0x11d')]);if(_0x51374d){logger[_0x7158('0x23')](util[_0x7158('0x1e')](_0x7158('0x121'),this[_0x7158('0x8')][_0x7158('0x2b')],_0x5aa969[_0x7158('0x11d')]));this['channel'][_0x7158('0x81')](util['format'](_0x7158('0x121'),this[_0x7158('0x8')][_0x7158('0x2b')],_0x5aa969['findBy']));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0x7158('0x1e')](_0x7158('0x122'),this[_0x7158('0x8')][_0x7158('0x2b')],_0x5aa969[_0x7158('0x11d')]));this[_0x7158('0x8')][_0x7158('0x81')](util['format'](_0x7158('0x122'),this[_0x7158('0x8')]['callerid'],_0x5aa969[_0x7158('0x11d')]));return{'code':0xc8,'result':_0x7158('0x123')};}};AGIVertices[_0x7158('0xa')][_0x7158('0x124')]=function(_0x53561f){logger['info'](util[_0x7158('0x1e')](_0x7158('0x125'),_0x53561f[_0x7158('0x29')]));if(!this['isConfigured'](_0x53561f[_0x7158('0x11d')])){return this[_0x7158('0x8')]['error'](_0x53561f,_0x7158('0x11e'));}logger[_0x7158('0x23')](util[_0x7158('0x1e')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0x7158('0x2b')],_0x53561f[_0x7158('0x11d')]));var _0x1c1a81=this[_0x7158('0x45')][_0x7158('0x75')](this,_0x53561f[_0x7158('0x11d')]);if(_0x1c1a81){logger[_0x7158('0x23')](util[_0x7158('0x1e')](_0x7158('0x121'),this[_0x7158('0x8')]['callerid'],_0x53561f[_0x7158('0x11d')]));this[_0x7158('0x8')][_0x7158('0x81')](util[_0x7158('0x1e')]('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0x53561f[_0x7158('0x11d')]));return{'code':0xc8,'result':_0x7158('0x126')};}else{logger['info'](util[_0x7158('0x1e')](_0x7158('0x122'),this[_0x7158('0x8')][_0x7158('0x2b')],_0x53561f[_0x7158('0x11d')]));this[_0x7158('0x8')][_0x7158('0x81')](util[_0x7158('0x1e')](_0x7158('0x122'),this[_0x7158('0x8')]['callerid'],_0x53561f[_0x7158('0x11d')]));return{'code':0xc8,'result':_0x7158('0x123')};}};AGIVertices[_0x7158('0xa')]['math']=function(_0x13b0df){logger[_0x7158('0x23')](util[_0x7158('0x1e')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x13b0df['label']));if(!this[_0x7158('0x56')](_0x13b0df[_0x7158('0x127')])){return this[_0x7158('0x8')][_0x7158('0x21')](_0x13b0df,'no\x20operation\x20configured');}this[_0x7158('0x8')][_0x7158('0x81')](util[_0x7158('0x1e')]('math\x20%s',_0x13b0df[_0x7158('0x127')]));var _0x3c48a5=eval(_0x13b0df['operation']);if(!this[_0x7158('0x56')](_0x13b0df[_0x7158('0x9e')])){return this[_0x7158('0x8')][_0x7158('0x81')](_0x7158('0xd0'));}var _0x15b9fd=this[_0x7158('0x6f')][_0x7158('0x75')](this,_0x13b0df[_0x7158('0x9e')]);if(!_0x15b9fd){return this[_0x7158('0x8')][_0x7158('0x21')](_0x13b0df,_0x7158('0x9f'));}if(_[_0x7158('0x128')](_0x3c48a5)){var _0x293a94=this;_0x3c48a5[_0x7158('0xa0')](function(_0x3392ee,_0x2aa9aa){_0x293a94['channel'][_0x7158('0xa1')](util[_0x7158('0x1e')](_0x7158('0x129'),_0x15b9fd,_0x2aa9aa),_0x3392ee);});return this[_0x7158('0x8')][_0x7158('0x81')](util[_0x7158('0x1e')]('variable\x20%s[key]\x20set',_0x15b9fd));}else{return this['channel']['setVariable'](_0x15b9fd,_0x3c48a5);}};AGIVertices[_0x7158('0xa')][_0x7158('0x12a')]=function(_0x1b9862){logger['info'](util['format'](_0x7158('0x12b'),_0x1b9862[_0x7158('0x29')]));if(_0x1b9862[_0x7158('0x76')]===0x0){return this['maxRetry'](_0x1b9862);}_0x1b9862[_0x7158('0x76')]-=0x1;if(!this[_0x7158('0x56')](_0x1b9862['file_id'])){return this['channel'][_0x7158('0x21')](_0x1b9862,_0x7158('0x12c'));}var _0x275cdf=this[_0x7158('0x14')][_0x7158('0x75')](this,_0x1b9862[_0x7158('0xce')]);if(!_0x275cdf){return this[_0x7158('0x8')][_0x7158('0x21')](_0x1b9862,_0x7158('0xcf'));}var _0x2eb7e0=this[_0x7158('0x8')][_0x7158('0x12d')](_0x275cdf,_0x1b9862[_0x7158('0x12e')],_0x1b9862[_0x7158('0x12f')]);var _0x4846e3=_0x2eb7e0['result'];if(_0x2eb7e0[_0x7158('0x70')]===-0x1){this[_0x7158('0x74')][_0x7158('0x75')](this,_0x1b9862,'-1');return _0x2eb7e0;}else if(_0x2eb7e0[_0x7158('0x72')]==='timeout'){_0x2eb7e0[_0x7158('0x70')]=_0x2eb7e0[_0x7158('0x70')]['length']>0x0?_0x2eb7e0[_0x7158('0x70')]:'t';}else if(_[_0x7158('0x39')](_0x2eb7e0[_0x7158('0x70')])){_0x2eb7e0[_0x7158('0x70')]='#';_0x4846e3='#';}if(!this[_0x7158('0x56')](_0x1b9862['variable_id'])){this['channel']['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x56f688=this[_0x7158('0x6f')][_0x7158('0x75')](this,_0x1b9862[_0x7158('0x9e')]);if(!_0x56f688){return this[_0x7158('0x8')][_0x7158('0x21')](_0x1b9862,'no\x20variable\x20found');}this['channel']['setVariable'](_0x56f688,_0x4846e3);}this[_0x7158('0x74')]['sync'](this,_0x1b9862,_0x4846e3);return _0x2eb7e0;};AGIVertices[_0x7158('0xa')][_0x7158('0x81')]=function(_0x596b72){logger[_0x7158('0x23')](util[_0x7158('0x1e')](_0x7158('0x130'),_0x596b72[_0x7158('0x29')]));return this['channel'][_0x7158('0x81')](_0x596b72[_0x7158('0x131')]||_0x596b72[_0x7158('0x29')]);};AGIVertices[_0x7158('0xa')][_0x7158('0x132')]=function(_0x305eec){logger['info'](util['format'](_0x7158('0x133'),_0x305eec[_0x7158('0x29')]));if(!this[_0x7158('0x56')](_0x305eec[_0x7158('0x11d')])){return this[_0x7158('0x8')][_0x7158('0x21')](_0x305eec,_0x7158('0x11e'));}logger[_0x7158('0x23')](util[_0x7158('0x1e')](_0x7158('0x11f'),this['channel']['callerid'],_0x305eec[_0x7158('0x11d')]));var _0x5862cc=this[_0x7158('0x40')][_0x7158('0x75')](this,_0x305eec[_0x7158('0x134')]);var _0x190bbb=this['agentPause'][_0x7158('0x75')](this,_0x305eec[_0x7158('0x11d')],_0x5862cc);if(_0x190bbb){logger[_0x7158('0x23')](util[_0x7158('0x1e')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x7158('0x8')][_0x7158('0x2b')],_0x305eec[_0x7158('0x11d')]));this[_0x7158('0x8')][_0x7158('0x81')](util[_0x7158('0x1e')](_0x7158('0x121'),this['channel'][_0x7158('0x2b')],_0x305eec[_0x7158('0x11d')]));return{'code':0xc8,'result':_0x7158('0x126')};}else{logger[_0x7158('0x23')](util[_0x7158('0x1e')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel']['callerid'],_0x305eec[_0x7158('0x11d')]));this[_0x7158('0x8')][_0x7158('0x81')](util[_0x7158('0x1e')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x7158('0x8')][_0x7158('0x2b')],_0x305eec[_0x7158('0x11d')]));return{'code':0xc8,'result':_0x7158('0x123')};}};AGIVertices[_0x7158('0xa')][_0x7158('0x135')]=function(_0x22120e){logger[_0x7158('0x23')](util[_0x7158('0x1e')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x22120e['label']));if(!this[_0x7158('0x56')](_0x22120e[_0x7158('0xce')])){return this['channel']['error'](_0x22120e,_0x7158('0x12c'));}var _0x23e6f9=this[_0x7158('0x14')][_0x7158('0x75')](this,_0x22120e[_0x7158('0xce')]);if(!_0x23e6f9){return this[_0x7158('0x8')][_0x7158('0x21')](_0x22120e,_0x7158('0xcf'));}var _0x239cee=this['channel'][_0x7158('0x8c')]('PLAYBACK',[_0x23e6f9,_0x22120e[_0x7158('0xab')]]);if(_0x239cee[_0x7158('0x70')]===-0x1){return _0x239cee;}return this[_0x7158('0x8')][_0x7158('0x81')](util[_0x7158('0x1e')](_0x7158('0x136'),_0x7158('0x137'),_0x23e6f9));};AGIVertices[_0x7158('0xa')][_0x7158('0x138')]=function(_0x471f03){logger[_0x7158('0x23')](util['format'](_0x7158('0x139'),_0x471f03[_0x7158('0x29')]));if(!this['isConfigured'](_0x471f03[_0x7158('0x13a')])){return this[_0x7158('0x8')][_0x7158('0x21')](_0x471f03,'no\x20queue\x20selected');}var _0x309763='';var _0xcb4201=parseInt(_0x471f03[_0x7158('0x13a')],0xa);if(isNaN(_0xcb4201)){_0x309763=_0x471f03[_0x7158('0x13a')];}else{_0x309763=this[_0x7158('0xf')][_0x7158('0x75')](this,_0x471f03['queue_id']);if(!_0x309763){return this['channel'][_0x7158('0x21')](_0x471f03,'no\x20queue\x20found');}}var _0x4a300d='';if(this['isConfigured'](_0x471f03['file_id'])){var _0x27d86d=this[_0x7158('0x14')][_0x7158('0x75')](this,_0x471f03[_0x7158('0xce')]);if(_0x27d86d){_0x4a300d=_0x27d86d;}}this[_0x7158('0x74')][_0x7158('0x75')](this,_0x471f03,_0x309763);if(_0x471f03[_0x7158('0xab')]['indexOf']('x')<0x0){_0x471f03[_0x7158('0xab')]+='x';}if(_0x471f03[_0x7158('0xab')][_0x7158('0x13b')]('X')<0x0){_0x471f03[_0x7158('0xab')]+='X';}this[_0x7158('0x8')][_0x7158('0xa1')](_0x7158('0x13c'),_0x309763?_0x309763[_0x7158('0x13d')]():'');var _0x54fe0e=this[_0x7158('0x8')]['exec'](_0x7158('0x13e'),[_0x309763,_0x471f03[_0x7158('0xab')],_0x471f03[_0x7158('0xac')],_0x4a300d,_0x471f03[_0x7158('0x7b')],_0x471f03[_0x7158('0x77')],_0x471f03['macro'],_0x471f03[_0x7158('0x13f')],'',_0x471f03['position']]);if(_0x54fe0e['result']===-0x1){return _0x54fe0e;}return this['channel'][_0x7158('0x81')](util['format'](_0x7158('0x136'),_0x7158('0x13e'),_0x309763));};AGIVertices[_0x7158('0xa')][_0x7158('0x140')]=function(_0x16693c){logger[_0x7158('0x23')](util[_0x7158('0x1e')](_0x7158('0x141'),_0x16693c['label']));var _0x2856b4=_0x16693c[_0x7158('0x142')]||_0x7158('0xec');var _0x3515f8=util[_0x7158('0x1e')]('%s_%s',this[_0x7158('0x8')][_0x7158('0x28')],rs[_0x7158('0xd8')](0x5));var _0x45fe6a=util[_0x7158('0x1e')]('%s/recordings/%s.%s',FILES_PATH,_0x3515f8,_0x2856b4);var _0x49f524=util[_0x7158('0x1e')](_0x7158('0xed'),FILES_PATH,_0x3515f8);this['createSquareRecording'][_0x7158('0x75')](this,_0x16693c,_0x3515f8,_0x45fe6a);this['channel']['setVariable'](_0x7158('0x143'),_0x3515f8);logger['info']('Recording\x20%s\x20%s\x20%s\x20%s',_0x49f524,_0x2856b4,_0x16693c[_0x7158('0x144')],_0x16693c[_0x7158('0x7b')]);return this['channel'][_0x7158('0xf7')](_0x49f524,_0x2856b4,_0x16693c[_0x7158('0x144')],_0x16693c['timeout'],undefined,!![]);};AGIVertices[_0x7158('0xa')][_0x7158('0x145')]=function(_0x775f6e){logger[_0x7158('0x23')](util[_0x7158('0x1e')](_0x7158('0x146'),_0x775f6e[_0x7158('0x29')]));return this[_0x7158('0x8')][_0x7158('0x147')](_0x775f6e[_0x7158('0x148')][_0x7158('0x48')](/\s+/g,''),_0x775f6e[_0x7158('0x144')]);};AGIVertices['prototype'][_0x7158('0x149')]=function(_0x399a70){logger[_0x7158('0x23')](util['format']('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x399a70[_0x7158('0x29')]));return this[_0x7158('0x8')][_0x7158('0x14a')](_0x399a70[_0x7158('0x14b')][_0x7158('0x48')](/\s+/g,''),_0x399a70[_0x7158('0x144')]);};AGIVertices[_0x7158('0xa')][_0x7158('0x14c')]=function(_0x30ef86){logger[_0x7158('0x23')](util[_0x7158('0x1e')](_0x7158('0x14d'),_0x30ef86[_0x7158('0x29')]));return this[_0x7158('0x8')][_0x7158('0x14e')](_0x30ef86[_0x7158('0x4a')],_0x30ef86[_0x7158('0x144')]);};AGIVertices[_0x7158('0xa')][_0x7158('0x14f')]=function(_0x3e5f6c){logger['info'](util[_0x7158('0x1e')](_0x7158('0x150'),_0x3e5f6c[_0x7158('0x29')]));if(!this[_0x7158('0x56')](_0x3e5f6c[_0x7158('0x151')])){return this[_0x7158('0x8')][_0x7158('0x81')](_0x7158('0x152'));}var _0x397515=this[_0x7158('0x17')][_0x7158('0x75')](this,_0x3e5f6c[_0x7158('0x151')]);if(!_0x397515||!_0x397515['Smtp']){return this[_0x7158('0x8')][_0x7158('0x21')](_0x3e5f6c,'no\x20mail\x20account\x20found');}var _0x576ac0={'from':util[_0x7158('0x1e')]('\x22%s\x22\x20<%s>',_0x397515['name'],_0x397515[_0x7158('0x153')]||_0x397515[_0x7158('0x154')][_0x7158('0x155')]),'to':_0x3e5f6c['to']||'','cc':_0x3e5f6c['cc']||'','bcc':_0x3e5f6c[_0x7158('0x156')]||'','subject':_0x3e5f6c[_0x7158('0x157')],'html':_0x3e5f6c[_0x7158('0x4a')],'text':_0x3e5f6c[_0x7158('0x4a')]};var _0x2b6397={'tls':{'rejectUnauthorized':![]}};if(_0x397515['Smtp'][_0x7158('0x158')]){_0x2b6397[_0x7158('0x158')]=_0x397515['Smtp'][_0x7158('0x158')];}else{_0x2b6397[_0x7158('0x159')]=_0x397515[_0x7158('0x154')][_0x7158('0x159')];_0x2b6397[_0x7158('0x15a')]=_0x397515[_0x7158('0x154')][_0x7158('0x15a')];_0x2b6397[_0x7158('0x15b')]=_0x397515[_0x7158('0x154')]['secure'];}if(_0x397515[_0x7158('0x154')][_0x7158('0x15c')]){_0x2b6397[_0x7158('0x15d')]={'user':_0x397515[_0x7158('0x154')][_0x7158('0x155')],'pass':_0x397515[_0x7158('0x154')][_0x7158('0x15e')]};}if(this['isConfigured'](_0x3e5f6c['template_id'])){}logger['debug'](_0x7158('0x15f'),JSON['stringify'](_0x576ac0));this[_0x7158('0x74')][_0x7158('0x75')](this,_0x3e5f6c,_0x3e5f6c[_0x7158('0x151')]);this[_0x7158('0x8')][_0x7158('0x81')](util[_0x7158('0x1e')](_0x7158('0x160'),_0x397515[_0x7158('0xd')]));this['sendMailMessage'][_0x7158('0x75')](this,_0x2b6397,_0x576ac0);return this[_0x7158('0x8')][_0x7158('0x81')](_0x7158('0x161'));};AGIVertices[_0x7158('0xa')][_0x7158('0x162')]=function(_0x4794fc){logger[_0x7158('0x23')](util[_0x7158('0x1e')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x4794fc[_0x7158('0x29')]));return this[_0x7158('0x8')][_0x7158('0x81')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0x7158('0xa')][_0x7158('0x163')]=function(_0x2bb362){logger['info'](util[_0x7158('0x1e')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x2bb362['label']));if(!this[_0x7158('0x56')](_0x2bb362[_0x7158('0x164')])){return this[_0x7158('0x8')]['noop'](_0x7158('0x165'));}var _0x31aae2=this[_0x7158('0x166')][_0x7158('0x75')](this,_0x2bb362['sms_account_id']);if(!_0x31aae2){return this[_0x7158('0x8')][_0x7158('0x21')](_0x2bb362,_0x7158('0x167'));}var _0x355381={'body':_0x2bb362[_0x7158('0x168')],'phone':_0x2bb362['to']||'','SmsAccountId':_0x31aae2['id']};logger['debug'](_0x7158('0x169'),JSON[_0x7158('0xfd')](_0x355381));this[_0x7158('0x74')][_0x7158('0x75')](this,_0x2bb362,_0x2bb362[_0x7158('0x164')]);this['channel'][_0x7158('0x81')](util[_0x7158('0x1e')](_0x7158('0x16a'),_0x31aae2[_0x7158('0xd')]));this[_0x7158('0x27')][_0x7158('0x75')](this,_0x355381);return this[_0x7158('0x8')][_0x7158('0x81')](_0x7158('0x16b'));};AGIVertices[_0x7158('0xa')][_0x7158('0x16c')]=function(_0x1e2688){logger['info'](util[_0x7158('0x1e')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x1e2688[_0x7158('0x29')]));if(!this[_0x7158('0x56')](_0x1e2688[_0x7158('0x9e')])){return this[_0x7158('0x8')][_0x7158('0x21')](_0x1e2688,'no\x20variable\x20selected');}var _0x47cf44=this[_0x7158('0x6f')][_0x7158('0x75')](this,_0x1e2688[_0x7158('0x9e')]);if(!_0x47cf44){return this[_0x7158('0x8')][_0x7158('0x21')](_0x1e2688,_0x7158('0x9f'));}return this[_0x7158('0x8')][_0x7158('0xa1')](_0x47cf44,_0x1e2688[_0x7158('0x16d')]);};AGIVertices[_0x7158('0xa')]['start']=function(_0x2519b4){logger[_0x7158('0x23')](util['format']('Enter\x20in\x20START\x20(%s)\x20block',_0x2519b4[_0x7158('0x29')]));this[_0x7158('0x8')][_0x7158('0x81')](_0x7158('0x16e'));if(_0x2519b4['answer']===_0x7158('0x16f')){this['channel'][_0x7158('0x81')](_0x7158('0x170'));return this['channel'][_0x7158('0x79')]();}return this[_0x7158('0x8')][_0x7158('0x81')]('Skipped\x20Answer');};AGIVertices[_0x7158('0xa')][_0x7158('0x171')]=function(_0x46d5b2){logger[_0x7158('0x23')](util[_0x7158('0x1e')](_0x7158('0x172'),_0x46d5b2['label']));if(!this[_0x7158('0x56')](_0x46d5b2[_0x7158('0x173')])){return this[_0x7158('0x8')][_0x7158('0x21')](_0x46d5b2,_0x7158('0x174'));}var _0x2234d5=this['getSquareProject'][_0x7158('0x75')](this,_0x46d5b2[_0x7158('0x173')]);if(!this['isConfigured'](_0x2234d5)){return this[_0x7158('0x8')][_0x7158('0x21')](_0x46d5b2,util['format']('no\x20subproject\x20found\x20with\x20id\x20%d',_0x46d5b2['project_id']));}if(_0x2234d5===this[_0x7158('0x8')]['arg_1']){return this['channel'][_0x7158('0x21')](_0x46d5b2,_0x7158('0x175'));}this[_0x7158('0x74')][_0x7158('0x75')](this,_0x46d5b2,_0x2234d5);var _0x29cc10=this[_0x7158('0x8')][_0x7158('0x8c')](_0x7158('0x176'),util[_0x7158('0x1e')](_0x7158('0x177'),config['agi'][_0x7158('0x159')]||'127.0.0.1',_0x2234d5,this[_0x7158('0x8')][_0x7158('0x2a')]));if(_0x29cc10[_0x7158('0x70')]===-0x1){return _0x29cc10;}return this['channel'][_0x7158('0x81')](util[_0x7158('0x1e')](_0x7158('0x136'),_0x7158('0x176'),_0x2234d5));};AGIVertices[_0x7158('0xa')][_0x7158('0x178')]=function(_0x12c84c){logger[_0x7158('0x23')](util[_0x7158('0x1e')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x12c84c[_0x7158('0x29')]));var _0x4ea4cb=this[_0x7158('0x47')][_0x7158('0x75')](this,_0x12c84c['command']);this[_0x7158('0x74')][_0x7158('0x75')](this,_0x12c84c,_0x12c84c[_0x7158('0x78')]);if(this[_0x7158('0x56')](_0x12c84c['variable_id'])){var _0x3bec90=this[_0x7158('0x6f')][_0x7158('0x75')](this,_0x12c84c[_0x7158('0x9e')]);if(_0x3bec90){this['channel'][_0x7158('0xa1')](_0x3bec90,_0x4ea4cb);return this[_0x7158('0x8')]['noop'](util[_0x7158('0x1e')](_0x7158('0x179'),_0x12c84c['command'],_0x3bec90));}}return this['channel'][_0x7158('0x81')](util[_0x7158('0x1e')](_0x7158('0x17a'),_0x12c84c[_0x7158('0x78')]));};AGIVertices['prototype'][_0x7158('0x17b')]=function(_0x336744){logger[_0x7158('0x23')](util['format'](_0x7158('0x17c'),_0x336744[_0x7158('0x29')]));if(!this[_0x7158('0x56')](_0x336744[_0x7158('0x4a')])){return this['channel'][_0x7158('0x81')](_0x7158('0x87'));}this[_0x7158('0x8')][_0x7158('0x81')](util['format'](_0x7158('0x17d'),_0x336744[_0x7158('0x4a')]));var _0x483195=this[_0x7158('0x49')][_0x7158('0x75')](this,_0x336744);if(_0x483195){this[_0x7158('0x8')][_0x7158('0x81')](util[_0x7158('0x1e')](_0x7158('0x17e'),_0x483195));var _0xed9ebb=this[_0x7158('0x8')][_0x7158('0xc3')](_0x483195);try{fs[_0x7158('0xc4')](_0x483195+_0x7158('0xc5'));}catch(_0x168eb0){logger['error'](_0x168eb0);}return _0xed9ebb;}return this[_0x7158('0x8')][_0x7158('0x21')](_0x336744,_0x7158('0x17f'));};AGIVertices['prototype'][_0x7158('0x180')]=function(_0x440adf){logger[_0x7158('0x23')](util[_0x7158('0x1e')](_0x7158('0x181'),_0x440adf[_0x7158('0x29')]));if(!this[_0x7158('0x56')](_0x440adf[_0x7158('0x11d')])){return this[_0x7158('0x8')][_0x7158('0x21')](_0x440adf,_0x7158('0x11e'));}logger[_0x7158('0x23')](util['format'](_0x7158('0x11f'),this['channel'][_0x7158('0x2b')],_0x440adf['findBy']));var _0x13fa53=this['agentUnpause']['sync'](this,_0x440adf[_0x7158('0x11d')]);if(_0x13fa53){logger[_0x7158('0x23')](util[_0x7158('0x1e')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x7158('0x8')][_0x7158('0x2b')],_0x440adf[_0x7158('0x11d')]));this[_0x7158('0x8')][_0x7158('0x81')](util[_0x7158('0x1e')](_0x7158('0x121'),this[_0x7158('0x8')][_0x7158('0x2b')],_0x440adf['findBy']));return{'code':0xc8,'result':_0x7158('0x126')};}else{logger[_0x7158('0x23')](util[_0x7158('0x1e')](_0x7158('0x122'),this['channel'][_0x7158('0x2b')],_0x440adf['findBy']));this['channel']['noop'](util[_0x7158('0x1e')](_0x7158('0x122'),this['channel'][_0x7158('0x2b')],_0x440adf[_0x7158('0x11d')]));return{'code':0xc8,'result':_0x7158('0x123')};}};AGIVertices[_0x7158('0xa')][_0x7158('0x182')]=function(_0x53e942){logger[_0x7158('0x23')](util[_0x7158('0x1e')](_0x7158('0x183'),_0x53e942[_0x7158('0x29')]));var _0xd228b5=this[_0x7158('0x8')][_0x7158('0x8c')](_0x7158('0x184'),[_0x53e942[_0x7158('0x185')],_0x53e942['options']]);if(_0xd228b5[_0x7158('0x70')]===-0x1){return _0xd228b5;}return this[_0x7158('0x8')][_0x7158('0x81')](util[_0x7158('0x1e')](_0x7158('0x136'),_0x7158('0x184'),_0x53e942[_0x7158('0x185')]));};AGIVertices['prototype'][_0x7158('0x186')]=function(_0x55dab3){logger['info'](util[_0x7158('0x1e')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x55dab3[_0x7158('0x29')]));if(!this[_0x7158('0x56')](_0x55dab3[_0x7158('0x9e')])){return this[_0x7158('0x8')][_0x7158('0x21')](_0x55dab3,'no\x20variable\x20selected');}var _0x1cd332=this[_0x7158('0x6f')][_0x7158('0x75')](this,_0x55dab3[_0x7158('0x9e')]);if(!_0x1cd332){return this[_0x7158('0x8')][_0x7158('0x21')](_0x55dab3,_0x7158('0x9f'));}var _0x5ab358=this[_0x7158('0x8')][_0x7158('0x6f')](_0x1cd332);return{'code':0xc8,'result':_0x5ab358['extra']?_0x5ab358[_0x7158('0x72')]:'-'};};String[_0x7158('0xa')][_0x7158('0x6e')]=function(_0x47c933,_0x15a0bb){return this[_0x7158('0x6c')](_0x47c933)[_0x7158('0x187')](_0x15a0bb);};module['exports']=AGIVertices;