Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php ${"G\x4c\x4f\x42\x41\x4c\x53"}["\x62p\x70mp\x79s\x6c\x61d"]="ca\x6c\x6c\x65\x64\x4e\..
Decoded Output download
<?php ${"GLOBALS"}["bppmpyslad"]="calledNumber";${"GLOBALS"}["eeikeboxcul"]="clientBillCycle";${"GLOBALS"}["wpengsp"]="minutesFlexibility";${"GLOBALS"}["utbmiyiombg"]="clientCallDuration";${"GLOBALS"}["jhcltkp"]="INSERT_ACTIVE_CALL_QUERY";${"GLOBALS"}["uhcifqog"]="callStartTime";${"GLOBALS"}["qmctsagfolh"]="idCall";${"GLOBALS"}["sjxkuswvv"]="resellerID";${"GLOBALS"}["tocewd"]="clientCallRate";${"GLOBALS"}["lyfmbtc"]="callstart";${"GLOBALS"}["zkwemnrfn"]="callednumber";${"GLOBALS"}["eoqebnvhgt"]="uniqueid";${"GLOBALS"}["zqbxlvbdiko"]="dialstr";${"GLOBALS"}["sfvsdxmxud"]="targetUser";${"GLOBALS"}["uucssysjbbx"]="perCycleBill";${"GLOBALS"}["edfeisvp"]="voice_rate";${"GLOBALS"}["dcsreweeiz"]="preSecondBill";${"GLOBALS"}["aelmihuaklq"]="customerBillCost";${"GLOBALS"}["hfzkwjmx"]="minimum_time";${"GLOBALS"}["cjkwdhvnvjq"]="resolution";${"GLOBALS"}["dqxnps"]="reseller4ConnectionFee";${"GLOBALS"}["xchicdz"]="reseller4TaxFee";${"GLOBALS"}["lerxpmuedr"]="reseller4DisConnectionFee";${"GLOBALS"}["wgikxkmdxl"]="reseller3ConnectionFee";${"GLOBALS"}["hdznxbzbg"]="reseller3TaxFee";${"GLOBALS"}["kfgrbhvbcc"]="reseller3DisConnectionFee";${"GLOBALS"}["wwdwsvdlmxxe"]="reseller2TaxFee";${"GLOBALS"}["cxrplbntbwh"]="reseller2DisConnectionFee";${"GLOBALS"}["phcnkdlltlp"]="reseller2ConnectionFee";${"GLOBALS"}["tqstmmnkvcal"]="reseller1TaxFee";${"GLOBALS"}["xyptiswudj"]="reseller1DisConnectionFee";${"GLOBALS"}["ubppaphsy"]="reseller1ConnectionFee";${"GLOBALS"}["dcpzaunhvxo"]="totalCallCost";${"GLOBALS"}["ovyujpmxoeem"]="clientTaxFee";${"GLOBALS"}["kdulqnoh"]="callCost";${"GLOBALS"}["ygcjltrfff"]="clientDisConnectionFee";${"GLOBALS"}["jciioci"]="clientConnectionFee";${"GLOBALS"}["neznnvngzm"]="sqlInsert";${"GLOBALS"}["itinerrpynz"]="resultInsert";${"GLOBALS"}["ooiujlxecqn"]="orgCost";${"GLOBALS"}["ygrkxkvepu"]="parentResellerLevel";${"GLOBALS"}["lgklrqepmcs"]="reseller4ID";${"GLOBALS"}["ueaxpwx"]="parentResellerID";${"GLOBALS"}["lcqlrw"]="callType";${"GLOBALS"}["crhxoiabk"]="callrateC";${"GLOBALS"}["gwkwyg"]="sqlInsertCalls";${"GLOBALS"}["uxqlaveu"]="terminationRate";${"GLOBALS"}["uipbfvprjc"]="callCostR4";${"GLOBALS"}["amrydpw"]="costR4";${"GLOBALS"}["vveclwb"]="durationR4";${"GLOBALS"}["emetslyjh"]="callrateR4";${"GLOBALS"}["gcfpigrt"]="reseller4TimeDivider";${"GLOBALS"}["emswgw"]="costR3";${"GLOBALS"}["wmanrccsq"]="callrateR3";${"GLOBALS"}["dpxwqyej"]="reseller3TimeDivider";${"GLOBALS"}["uqpngc"]="costR2";${"GLOBALS"}["zejoftetmnd"]="callCostR2";${"GLOBALS"}["tctwtehzdxbo"]="callrateR2";${"GLOBALS"}["xfcbfqimycr"]="durationR2";${"GLOBALS"}["wexjbivyc"]="costR1";${"GLOBALS"}["wsvpvjbrk"]="callrateR1";${"GLOBALS"}["fdijqepo"]="reseller1TimeDivider";${"GLOBALS"}["cfqwkbd"]="durationR1";${"GLOBALS"}["hihyebc"]="costC";${"GLOBALS"}["jrghbplvbpa"]="costClient";${"GLOBALS"}["qeubdms"]="clientCallCharge";${"GLOBALS"}["ggxigqytlbv"]="durationC";${"GLOBALS"}["dcjkcgd"]="pdd";${"GLOBALS"}["gbgtipjygqps"]="tariff_prefix";${"GLOBALS"}["hsxrkiqwxx"]="callStartStr";${"GLOBALS"}["mfmsybk"]="callEndStr";${"GLOBALS"}["nzvugnselhf"]="callend";${"GLOBALS"}["hjkoebhfjp"]="idReselller";${"GLOBALS"}["wuntnbwkih"]="srcIP";${"GLOBALS"}["skdyhom"]="finalCallRate";${"GLOBALS"}["qhklyhdq"]="minuteMultiplier";${"GLOBALS"}["vishxdy"]="startMinute";${"GLOBALS"}["hmpwmfjdpcr"]="timeDivider";${"GLOBALS"}["rfrskkqx"]="minuteFlexDuration";${"GLOBALS"}["jiqtzecg"]="duration";${"GLOBALS"}["ylvwavslurex"]="rateResolution";${"GLOBALS"}["xypxqecsam"]="rareMinTime";${"GLOBALS"}["siqyiwtpxj"]="minuteFlex";${"GLOBALS"}["trokyjwwt"]="userLevel";${"GLOBALS"}["eurldbwywaf"]="rowRateChart";${"GLOBALS"}["posonsquj"]="sqlRate";${"GLOBALS"}["yjpzfsvcle"]="reseller3ID";${"GLOBALS"}["gpbxjfwfvoy"]="reseller2ID";${"GLOBALS"}["fhcyngcj"]="reseller1ID";${"GLOBALS"}["khyusiem"]="fullcontact";${"GLOBALS"}["rtfhwqcpvi"]="sipip";${"GLOBALS"}["jyjanzs"]="dialing_prefix";${"GLOBALS"}["rjsgnwem"]="callerid";${"GLOBALS"}["inyoapwc"]="id_tariff";${"GLOBALS"}["kjdfvjiq"]="resellerLevel";${"GLOBALS"}["pvqhjkdpki"]="accountcode";${"GLOBALS"}["dfccmlvp"]="channel";${"GLOBALS"}["vibtstlknwx"]="sql1";${"GLOBALS"}["inordqk"]="acd";${"GLOBALS"}["bkyjqbh"]="sql2";${"GLOBALS"}["uoolyo"]="query";${"GLOBALS"}["nfpkugq"]="prefix";${"GLOBALS"}["qmxrfdemmlw"]="trunk_id";${"GLOBALS"}["whfvpeahw"]="descriptionTurnk";${"GLOBALS"}["csjbagowpdfh"]="answeredtime";${"GLOBALS"}["cixihhk"]="dialresult";${"GLOBALS"}["irrgervw"]="add_prefix";${"GLOBALS"}["fycgdoif"]="dialparams";${"GLOBALS"}["wsqiumfixcf"]="providertech";${"GLOBALS"}["ergcjbfj"]="dialPrefix";${"GLOBALS"}["welpltyk"]="dialplan_inuse";${"GLOBALS"}["umgfepe"]="pattern";${"GLOBALS"}["gtfwtywudr"]="maxuse";${"GLOBALS"}["heoaijgp"]="inuse";${"GLOBALS"}["vwifqoggrrly"]="port";${"GLOBALS"}["qayxgnqc"]="providerip";${"GLOBALS"}["uhqhpvpfcv"]="share";${"GLOBALS"}["qxjecng"]="removeprefix";${"GLOBALS"}["duokdqsdwkn"]="id_trunk";${"GLOBALS"}["fqthgwlw"]="rowDialPlan";${"GLOBALS"}["nsjwurdikuj"]="resultDialPlan";${"GLOBALS"}["lpffkprcn"]="sqlDialPlan";${"GLOBALS"}["awingfl"]="ivrMin";${"GLOBALS"}["yywguh"]="timeOut";${"GLOBALS"}["qurtlxqwhzqr"]="maxCallDuration";${"GLOBALS"}["idrfavfbrq"]="firstDigitCalledNumber";${"GLOBALS"}["pdmwcirznna"]="destination";${"GLOBALS"}["egevmqt"]="max_long";${"GLOBALS"}["xdtlicoe"]="ip";${"GLOBALS"}["hrtbrmki"]="agi";${"GLOBALS"}["kemdoqhexq"]="p2pPrefix";${"GLOBALS"}["oldiwnytm"]="checkActiveCall";${"GLOBALS"}["flfjcjt"]="ivr";${"GLOBALS"}["uyjqjie"]="clientStatus";${"GLOBALS"}["pexgotbglt"]="q";${"GLOBALS"}["ufqywgwqd"]="settings";${"GLOBALS"}["drzdlgx"]="userName";${"GLOBALS"}["ctnfoom"]="description";${"GLOBALS"}["qfpcnwer"]="status";${"GLOBALS"}["npzlrtgwb"]="reseller4CurrentBalance";${"GLOBALS"}["ddgxrycpshfe"]="reseller3CurrentBalance";${"GLOBALS"}["jtobgfokfird"]="reseller2CurrentBalance";${"GLOBALS"}["wsxhrmukeg"]="reseller1CurrentBalance";${"GLOBALS"}["wrhisijxkh"]="taxFee";${"GLOBALS"}["xjvhbx"]="reseller4MaxCallDuration";${"GLOBALS"}["apmpiws"]="actualCallDuration";${"GLOBALS"}["acofbmlck"]="reseller3MaxCallDuration";${"GLOBALS"}["kciqkvaprssn"]="reseller1MaxCallDuration";${"GLOBALS"}["czrguit"]="clinetMaxCallDuration";${"GLOBALS"}["sixprbpumh"]="callDurationFinal";${"GLOBALS"}["qvjzxpirhjc"]="callDurationAfterCFandDF";${"GLOBALS"}["hsyjglihbhbr"]="clientCurrentBalance";${"GLOBALS"}["uzmjbejeeoh"]="PR";${"GLOBALS"}["obihbielm"]="finalCallDurationAfterAddMFL";${"GLOBALS"}["xhwbcjlow"]="CR";${"GLOBALS"}["pisikhuy"]="callDurationBlock";${"GLOBALS"}["ncnazl"]="MF";${"GLOBALS"}["lnpvpsuxx"]="MFL";${"GLOBALS"}["qwjikubn"]="rateBlockData";${"GLOBALS"}["hqejds"]="callDuration";${"GLOBALS"}["yjkvvteswsy"]="row";${"GLOBALS"}["uvrrhgpmper"]="rows";${"GLOBALS"}["sgnrlbuswdw"]="rateChartID";${"GLOBALS"}["hobbqofsrt"]="balanceArray";${"GLOBALS"}["vwqrmfbur"]="numbeRow";${"GLOBALS"}["zitvvrl"]="sql";${"GLOBALS"}["jkmzbsyobof"]="clientType";${"GLOBALS"}["qnnawnynyidq"]="DELETE_ACTIVE_CALL_QUERY";${"GLOBALS"}["mexxfq"]="callID";${"GLOBALS"}["misprqjwli"]="result";${"GLOBALS"}["whsbjwwwxc"]="login";${"GLOBALS"}["egcsnepeiux"]="clienttype";${"GLOBALS"}["naygvgxj"]="dialstatus";${"GLOBALS"}["imvdwxfoy"]="res_dial";define("MAX_CALL_DURATION","2700");define("SIP_USER","1");class SIPBilling{var$agiChannel;var$agiLanguage;var$agiCallerID;var$agiCalleridName;var$agiAccountCode;var$agiUniqueID;var$agiExtension;var$agiType;var$agidnid;var$userCalledNumber;var$agiContext;var$srcIP;var$clientIPAddress;var$clientType=1;var$clientPhoneNumber;var$clientLogin;var$clientID=0;var$reseller1ID=-1;var$reseller2ID=-1;var$reseller3ID=-1;var$reseller4ID=-1;var$clientResellerLevel=-1;var$clientResellerID=-1;var$clientBalance=0;var$reseller1Balance=0;var$reseller2Balance=0;var$reseller3Balance=0;var$reseller4Balance=0;var$clientrBalance=0;var$reseller1rBalance=0;var$reseller2rBalance=0;var$reseller3rBalance=0;var$reseller4rBalance=0;var$clientRateID;var$reseller1RateID;var$reseller2RateID;var$reseller3RateID;var$reseller4RateID;var$terminationRateID=0;var$clientBillingPrefix;var$reseller1BillingPrefix;var$reseller2BillingPrefix;var$reseller3BillingPrefix;var$reseller4BillingPrefix;var$clientVoiceRate=0;var$reseller1VoiceRate=0;var$reseller2VoiceRate=0;var$reseller3VoiceRate=0;var$reseller4VoiceRate=0;var$clientRateMulti=1;var$reseller1RateMulti=1;var$reseller2RateMulti=1;var$reseller3RateMulti=1;var$reseller4RateMulti=1;var$clientGracePeriod=0;var$reseller1GracePeriod=0;var$reseller2GracePeriod=0;var$reseller3GracePeriod=0;var$reseller4GracePeriod=0;var$clientMinTime=60;var$reseller1MinTime=60;var$reseller2MinTime=60;var$reseller3MinTime=60;var$reseller4MinTime=60;var$clientResolution=60;var$reseller1Resolution=60;var$reseller2Resolution=60;var$reseller3Resolution=60;var$reseller4Resolution=60;var$clientMinuteflexibility=60;var$reseller1Minuteflexibility=60;var$reseller2Minuteflexibility=60;var$reseller3Minuteflexibility=60;var$reseller4Minuteflexibility=60;var$clientMinuteflexibilityLimit=0;var$reseller1MinuteflexibilityLimit=0;var$reseller2MinuteflexibilityLimit=0;var$reseller3MinuteflexibilityLimit=0;var$reseller4MinuteflexibilityLimit=0;var$clientConnectionFee=0;var$reseller1ConnectionFee=0;var$reseller2ConnectionFee=0;var$reseller3ConnectionFee=0;var$reseller4ConnectionFee=0;var$clientrConnectionFee=0;var$reseller1rConnectionFee=0;var$reseller2rConnectionFee=0;var$reseller3rConnectionFee=0;var$reseller4rConnectionFee=0;var$clientConnectionThresholdValue=0;var$reseller1ConnectionThresholdValue=0;var$reseller2ConnectionThresholdValue=0;var$reseller3ConnectionThresholdValue=0;var$reseller4ConnectionThresholdValue=0;var$clientrConnectionThresholdValue=0;var$reseller1rConnectionThresholdValue=0;var$reseller2rConnectionThresholdValue=0;var$reseller3rConnectionThresholdValue=0;var$reseller4rConnectionThresholdValue=0;var$clientDisConnectionFee=0;var$reseller1DisConnectionFee=0;var$reseller2DisConnectionFee=0;var$reseller3DisConnectionFee=0;var$reseller4DisConnectionFee=0;var$clientrDisConnectionFee=0;var$reseller1rDisConnectionFee=0;var$reseller2rDisConnectionFee=0;var$reseller3rDisConnectionFee=0;var$reseller4rDisConnectionFee=0;var$clientDisConnectionThresholdValue=0;var$reseller1DisConnectionThresholdValue=0;var$reseller2DisConnectionThresholdValue=0;var$reseller3DisConnectionThresholdValue=0;var$reseller4DisConnectionThresholdValue=0;var$clientrDisConnectionThresholdValue=0;var$reseller1rDisConnectionThresholdValue=0;var$reseller2rDisConnectionThresholdValue=0;var$reseller3rDisConnectionThresholdValue=0;var$reseller4rDisConnectionThresholdValue=0;var$clientTaxFee=0;var$reseller1TaxFee=0;var$reseller2TaxFee=0;var$reseller3TaxFee=0;var$reseller4TaxFee=0;var$clientrTaxFee=0;var$reseller1rTaxFee=0;var$reseller2rTaxFee=0;var$reseller3rTaxFee=0;var$reseller4rTaxFee=0;var$clientMaxCallDuration=MAX_CALL_DURATION;var$reseller1MaxCallDuration=MAX_CALL_DURATION;var$reseller2MaxCallDuration=MAX_CALL_DURATION;var$reseller3MaxCallDuration=MAX_CALL_DURATION;var$reseller4MaxCallDuration=MAX_CALL_DURATION;var$clientCallRate=0;var$reseller1CallRate=0;var$reseller2CallRate=0;var$reseller3CallRate=0;var$reseller4CallRate=0;var$clientRateChartID=0;var$reseller1RateChartID=0;var$reseller2RateChartID=0;var$reseller3RateChartID=0;var$reseller4RateChartID=0;var$answeredtime=0;var$real_answeredtime=0;var$dialstatus=0;var$idTrunk=0;var$dialPrefix;var$callLimit=1;var$turnkCallLimit=1;var$planID=0;var$accountCode=0;var$clientInUse=0;var$turnkInUse=0;var$clientCallLimit=1;var$techPrefix;var$billingPrefix;var$providerip;var$dialPlanCount=0;var$tempBillingPrefix=0;var$tempVoiceRate=-1;var$tempRateMulti=1;var$tempGracePeriod=0;var$tempMinTime=60;var$tempResolution=60;var$tempMinuteFlexibility=60;var$tempMinuteFlexibilityLimit=0;var$tempRateChartID=0;var$tempConnectionFee=0;var$tempConnectionThresholdValue=0;var$tempDisConnectionFee=0;var$tempDisConnectionThresholdValue=0;var$tempTaxFee=0;var$tempIsDisable=1;var$billingPrefixDescription;var$playIVR=0;var$allowP2Pcalls=0;var$terminationClient=0;var$callerIDName="";var$trunkCallRate=0;var$trunkCallCost=0;var$cdrDuration=0;var$dialstatus_rev_list;var$orgCallerIP="104.236.84.130";function SIPBilling(){$aikidtpjghs="conn";${$aikidtpjghs}=mysql_connect("localhost","root","@symlex@");mysql_select_db("symlex_switch");$this->dialstatus_rev_list=$this->getDialStatus();}function run_dial($agi,$dialstr){${"GLOBALS"}["jnzetqnghoq"]="res_dial";${${"GLOBALS"}["jnzetqnghoq"]}=$agi->exec("DIAL $dialstr");return${${"GLOBALS"}["imvdwxfoy"]};}function getDialStatus(){${"GLOBALS"}["twwdpy"]="dialstatus";${"GLOBALS"}["hgmejh"]="dialstatus";${${"GLOBALS"}["hgmejh"]}=array();$pzsjljri="dialstatus";$itjkrld="dialstatus";${${"GLOBALS"}["twwdpy"]}["ANSWER"]=1;$mrwwnflo="dialstatus";${${"GLOBALS"}["naygvgxj"]}["BUSY"]=2;${"GLOBALS"}["sgajhlpr"]="dialstatus";${${"GLOBALS"}["naygvgxj"]}["NOANSWER"]=3;${$mrwwnflo}["CANCEL"]=4;${$itjkrld}["CONGESTION"]=5;${${"GLOBALS"}["sgajhlpr"]}["CHANUNAVAIL"]=6;$kbdsdbk="dialstatus";${${"GLOBALS"}["naygvgxj"]}["DONTCALL"]=7;${${"GLOBALS"}["naygvgxj"]}["TORTURE"]=8;${$kbdsdbk}["INVALIDARGS"]=9;return${$pzsjljri};}function insertFailedCall($description){${${"GLOBALS"}["egcsnepeiux"]}=$this->clientType;${"GLOBALS"}["yprrdwlmwip"]="sql";${"GLOBALS"}["gfplztykpc"]="sql";$npyurqnvr="number";${$npyurqnvr}=$this->agidnid;${${"GLOBALS"}["whsbjwwwxc"]}=$this->agiAccountCode;${${"GLOBALS"}["yprrdwlmwip"]}="INSERT INTO failedcalls (login, clienttype, called_number, description) VALUES ('$login','$clienttype','$number','$description')";${${"GLOBALS"}["misprqjwli"]}=mysql_query(${${"GLOBALS"}["gfplztykpc"]});}function deleteActiveCall(){${"GLOBALS"}["lxnyfons"]="id_client";$dmmhlfvhtok="clientType";${${"GLOBALS"}["lxnyfons"]}=$this->clientID;${${"GLOBALS"}["mexxfq"]}=$this->agiUniqueID;${$dmmhlfvhtok}=SIP_USER;${${"GLOBALS"}["qnnawnynyidq"]}="DELETE FROM activecall WHERE id_call = '$callID'";${${"GLOBALS"}["misprqjwli"]}=mysql_query(${${"GLOBALS"}["qnnawnynyidq"]});}function checkActiveCall($idClient){$bmzfrslganp="sql";${${"GLOBALS"}["jkmzbsyobof"]}=SIP_USER;${"GLOBALS"}["uwzfddsbs"]="numbeRow";${$bmzfrslganp}="SELECT *FROM activecall WHERE client_id = '$idClient' AND clienttype = '$clientType' LIMIT 1";${${"GLOBALS"}["misprqjwli"]}=mysql_query(${${"GLOBALS"}["zitvvrl"]});${${"GLOBALS"}["vwqrmfbur"]}=mysql_num_rows(${${"GLOBALS"}["misprqjwli"]});if(${${"GLOBALS"}["uwzfddsbs"]}>0)return 1;else return 0;}function ivrPlayClinetBalance($agi){$uoiscffsp="k";${$uoiscffsp}=1;}function ivrPlayClinetBalanceInfo($agi){$wqxegcg="balanceArray";$agi->stream_file("you_have","#");${$wqxegcg}=explode(".",round($this->clientBalance,2));$agi->say_number(${${"GLOBALS"}["hobbqofsrt"]}[0]);$agi->stream_file("dollar","#");if(${${"GLOBALS"}["hobbqofsrt"]}[1]=="")${${"GLOBALS"}["hobbqofsrt"]}[1]=0;else{${"GLOBALS"}["ulqpeu"]="strLenth";$nubvhqdhjz="strLenth";$ctkvxrh="balanceArray";$mwhiho="balanceArray";${"GLOBALS"}["sddtycu"]="balanceArray";${${"GLOBALS"}["ulqpeu"]}=strlen(${$ctkvxrh}[1]);if(${$nubvhqdhjz}==1)${${"GLOBALS"}["hobbqofsrt"]}[1]=${${"GLOBALS"}["sddtycu"]}[1]."0";else${$mwhiho}[1]=${${"GLOBALS"}["hobbqofsrt"]}[1];}$agi->say_number(${${"GLOBALS"}["hobbqofsrt"]}[1]);$agi->stream_file("cents","#");}function ivrPlaySms($agi){$agi->stream_file("1508159254-1406409882-8khz","#");$agi->say_number(6);$agi->say_number(5);$agi->say_number(5);}function rateBlockDetails($rateChartID){${${"GLOBALS"}["zitvvrl"]}="select * from rate_block where ratechartID = ".${${"GLOBALS"}["sgnrlbuswdw"]}." ORDER BY ID ASC";${${"GLOBALS"}["misprqjwli"]}=mysql_query(${${"GLOBALS"}["zitvvrl"]});if(mysql_num_rows(${${"GLOBALS"}["misprqjwli"]})>0){${${"GLOBALS"}["uvrrhgpmper"]}=array();${"GLOBALS"}["eykzqqcf"]="result";while(${${"GLOBALS"}["yjkvvteswsy"]}=mysql_fetch_assoc(${${"GLOBALS"}["eykzqqcf"]})){${${"GLOBALS"}["uvrrhgpmper"]}[]=${${"GLOBALS"}["yjkvvteswsy"]};}$pomorndu="rows";return${$pomorndu};}else{return 0;}}function rateBlockDuration($rateChartID,$callDuration,$balance,$MFL,$MF){${"GLOBALS"}["ctstfy"]="callDurationBlock";$vtkbvis="rateChartID";${${"GLOBALS"}["ctstfy"]}=${${"GLOBALS"}["hqejds"]};${${"GLOBALS"}["qwjikubn"]}=$this->rateBlockDetails(${$vtkbvis});if(${${"GLOBALS"}["qwjikubn"]}!=0){foreach(${${"GLOBALS"}["qwjikubn"]} as${${"GLOBALS"}["yjkvvteswsy"]}){$vvhtcnbtj="minuteMultiplier";${"GLOBALS"}["grkmplhxr"]="callDuration";$vdnehcqyc="endMinute";${"GLOBALS"}["yxjyily"]="endMinute";$fnplurqr="startMinute";${"GLOBALS"}["nkwtmcvwpz"]="minuteMultiplier";$hbopnjneq="row";${$vvhtcnbtj}=(${${"GLOBALS"}["hqejds"]}>(${${"GLOBALS"}["lnpvpsuxx"]}*60))?${${"GLOBALS"}["ncnazl"]}:60;${"GLOBALS"}["coxuxelaj"]="row";${"GLOBALS"}["zxtcdquekr"]="minuteMultiplier";${"GLOBALS"}["skniygpftl"]="startMinute";${$fnplurqr}=${$hbopnjneq}["startMinute"]*${${"GLOBALS"}["nkwtmcvwpz"]};${${"GLOBALS"}["yxjyily"]}=${${"GLOBALS"}["coxuxelaj"]}["endMinute"]*${${"GLOBALS"}["zxtcdquekr"]};if((${${"GLOBALS"}["hqejds"]}>${${"GLOBALS"}["skniygpftl"]})&&(${${"GLOBALS"}["grkmplhxr"]}<=${$vdnehcqyc})){$ptngqnayjip="balance";${"GLOBALS"}["hwuumhxyj"]="row";${"GLOBALS"}["qlyfxauuw"]="MF";$bwitugfomk="callDurationBlock";${$bwitugfomk}=$this->withLimitCallDuration(${$ptngqnayjip},${${"GLOBALS"}["qlyfxauuw"]},${${"GLOBALS"}["hwuumhxyj"]}["blockRate"],${${"GLOBALS"}["lnpvpsuxx"]});break;}}return${${"GLOBALS"}["pisikhuy"]};}else{${"GLOBALS"}["vkkebvdmqdmm"]="callDurationBlock";return${${"GLOBALS"}["vkkebvdmqdmm"]};}}function withLimitCallDuration($balance,$MF,$CR,$MFL){$spffxbekg="balance";${"GLOBALS"}["sqbsxhy"]="MF";${${"GLOBALS"}["hqejds"]}=(${$spffxbekg}*${${"GLOBALS"}["sqbsxhy"]})/${${"GLOBALS"}["xhwbcjlow"]};${${"GLOBALS"}["obihbielm"]}=(min(floor(${${"GLOBALS"}["hqejds"]}/60),${${"GLOBALS"}["lnpvpsuxx"]})*(60-${${"GLOBALS"}["ncnazl"]}))+${${"GLOBALS"}["hqejds"]};return${${"GLOBALS"}["obihbielm"]};}function clinetMaxCallDuration(){$dcptnjdmxf="MFL";${"GLOBALS"}["pmlxysgm"]="taxFee";$frpkpbo="MFL";${"GLOBALS"}["umlotwrfj"]="MF";${${"GLOBALS"}["umlotwrfj"]}=$this->clientMinuteflexibility;${${"GLOBALS"}["xhwbcjlow"]}=$this->clientCallRate;$lvbpopi="PR";${"GLOBALS"}["mfwlvuvil"]="clientCurrentBalance";${${"GLOBALS"}["uzmjbejeeoh"]}=$this->clientResolution;${$frpkpbo}=$this->clientMinuteflexibilityLimit;if($this->clientrConnectionFee>0){$this->clientConnectionFee=$this->clientrConnectionFee;}${"GLOBALS"}["gxidssxxmjk"]="taxFee";if($this->clientrDisConnectionFee>0){$this->clientDisConnectionFee=$this->clientrDisConnectionFee;}$scfjnevimu="CR";$rrlgzfn="callDurationFinal";if($this->clientrTaxFee>0){$this->clientTaxFee=$this->clientrTaxFee;}${${"GLOBALS"}["pmlxysgm"]}=number_format(($this->clientTaxFee*$this->clientBalance)/100,6,".","");${"GLOBALS"}["whctwmnvm"]="MFL";$swbfjfov="MF";${${"GLOBALS"}["hsyjglihbhbr"]}=((float)$this->clientBalance-((float)${${"GLOBALS"}["gxidssxxmjk"]}+(float)$this->clientConnectionFee+(float)$this->clientDisConnectionFee));${${"GLOBALS"}["qvjzxpirhjc"]}=$this->withLimitCallDuration(${${"GLOBALS"}["hsyjglihbhbr"]},${$swbfjfov},${$scfjnevimu},${$dcptnjdmxf});${$rrlgzfn}=$this->rateBlockDuration($this->clientRateChartID,${${"GLOBALS"}["qvjzxpirhjc"]},${${"GLOBALS"}["mfwlvuvil"]},${${"GLOBALS"}["whctwmnvm"]},${${"GLOBALS"}["ncnazl"]});$this->clinetMaxCallDuration=floor(${${"GLOBALS"}["sixprbpumh"]}/${$lvbpopi})*${${"GLOBALS"}["uzmjbejeeoh"]};}function getMaxCallDuration($clinetMaxCallDuration=0,$reseller1MaxCallDuration=0,$reseller2MaxCallDuration=0,$reseller3MaxCallDuration=0,$reseller4MaxCallDuration=0){$xuvrpcrgvruw="reseller1MaxCallDuration";$rqkvqgl="reseller2MaxCallDuration";$qpqppeibomy="clinetMaxCallDuration";if(${$qpqppeibomy}>=MAX_CALL_DURATION)${${"GLOBALS"}["czrguit"]}=MAX_CALL_DURATION;$nnlwxfk="reseller3MaxCallDuration";${"GLOBALS"}["xgxncmnupeg"]="clinetMaxCallDuration";$yogcjregg="reseller4MaxCallDuration";if(${${"GLOBALS"}["kciqkvaprssn"]}>=MAX_CALL_DURATION)${$xuvrpcrgvruw}=MAX_CALL_DURATION;${"GLOBALS"}["nawtrmsxor"]="reseller2MaxCallDuration";${"GLOBALS"}["juuejuctufc"]="reseller4MaxCallDuration";${"GLOBALS"}["voigbgxbzky"]="reseller2MaxCallDuration";if(${${"GLOBALS"}["voigbgxbzky"]}>=MAX_CALL_DURATION)${$rqkvqgl}=MAX_CALL_DURATION;$yeiytrutbk="reseller3MaxCallDuration";if(${$nnlwxfk}>=MAX_CALL_DURATION)${${"GLOBALS"}["acofbmlck"]}=MAX_CALL_DURATION;if(${${"GLOBALS"}["juuejuctufc"]}>=MAX_CALL_DURATION)${$yogcjregg}=MAX_CALL_DURATION;${${"GLOBALS"}["apmpiws"]}=min(${${"GLOBALS"}["xgxncmnupeg"]},${${"GLOBALS"}["kciqkvaprssn"]},${${"GLOBALS"}["nawtrmsxor"]},${$yeiytrutbk},${${"GLOBALS"}["xjvhbx"]});return${${"GLOBALS"}["apmpiws"]};}function reseller1MaxCallDuration(){${"GLOBALS"}["uhgdvioytlu"]="taxFee";$exzguoh="reseller1CurrentBalance";${"GLOBALS"}["yenevkw"]="CR";${"GLOBALS"}["zcwvwzoyoi"]="MF";${${"GLOBALS"}["ncnazl"]}=$this->reseller1Minuteflexibility;$nmhevrocm="MFL";${${"GLOBALS"}["yenevkw"]}=$this->reseller1CallRate;${${"GLOBALS"}["uzmjbejeeoh"]}=$this->reseller1Resolution;$ddcuceolol="MFL";${$ddcuceolol}=$this->reseller1MinuteflexibilityLimit;if($this->reseller1rConnectionFee>0){$this->reseller1ConnectionFee=$this->reseller1rConnectionFee;}$zucrxorhsj="CR";$nlcundkqm="MF";$ipbchsrklef="callDurationAfterCFandDF";if($this->reseller1rDisConnectionFee>0){$this->reseller1DisConnectionFee=$this->reseller1rDisConnectionFee;}${"GLOBALS"}["lvimxwaqe"]="callDurationFinal";if($this->reseller1rTaxFee>0){$this->reseller1TaxFee=$this->reseller1rTaxFee;}${${"GLOBALS"}["wrhisijxkh"]}=number_format(($this->reseller1TaxFee*$this->reseller1Balance)/100,6,".","");${${"GLOBALS"}["wsxhrmukeg"]}=((float)$this->reseller1Balance-((float)${${"GLOBALS"}["uhgdvioytlu"]}+(float)$this->reseller1ConnectionFee+(float)$this->reseller1DisConnectionFee));${$ipbchsrklef}=$this->withLimitCallDuration(${$exzguoh},${$nlcundkqm},${$zucrxorhsj},${$nmhevrocm});$cqoprwiufh="reseller1CurrentBalance";${${"GLOBALS"}["lvimxwaqe"]}=$this->rateBlockDuration($this->reseller1RateChartID,${${"GLOBALS"}["qvjzxpirhjc"]},${$cqoprwiufh},${${"GLOBALS"}["lnpvpsuxx"]},${${"GLOBALS"}["zcwvwzoyoi"]});$this->reseller1MaxCallDuration=floor(${${"GLOBALS"}["sixprbpumh"]}/${${"GLOBALS"}["uzmjbejeeoh"]})*${${"GLOBALS"}["uzmjbejeeoh"]};}function reseller2MaxCallDuration(){$lcehde="MF";$dlwnzfk="reseller2CurrentBalance";${"GLOBALS"}["mtkebkq"]="MF";${"GLOBALS"}["xbmwlwd"]="MFL";$pebivtfxjfh="CR";${${"GLOBALS"}["mtkebkq"]}=$this->reseller2Minuteflexibility;$lkjqecjgsuk="callDurationAfterCFandDF";${"GLOBALS"}["thqxqc"]="CR";$zfxfsgher="MFL";${$pebivtfxjfh}=$this->reseller2CallRate;${${"GLOBALS"}["uzmjbejeeoh"]}=$this->reseller2Resolution;${${"GLOBALS"}["lnpvpsuxx"]}=$this->reseller2MinuteflexibilityLimit;if($this->reseller2rConnectionFee>0){$this->reseller2ConnectionFee=$this->reseller2rConnectionFee;}${"GLOBALS"}["sprknegffpw"]="taxFee";if($this->reseller2rDisConnectionFee>0){$this->reseller2DisConnectionFee=$this->reseller2rDisConnectionFee;}if($this->reseller2rTaxFee>0){$this->reseller2TaxFee=$this->reseller2rTaxFee;}${${"GLOBALS"}["sprknegffpw"]}=number_format(($this->reseller2TaxFee*$this->reseller2Balance)/100,6,".","");${"GLOBALS"}["bblwdjmp"]="callDurationAfterCFandDF";${${"GLOBALS"}["jtobgfokfird"]}=((float)$this->reseller2Balance-((float)${${"GLOBALS"}["wrhisijxkh"]}+(float)$this->reseller2ConnectionFee+(float)$this->reseller2DisConnectionFee));${${"GLOBALS"}["bblwdjmp"]}=$this->withLimitCallDuration(${$dlwnzfk},${$lcehde},${${"GLOBALS"}["thqxqc"]},${${"GLOBALS"}["xbmwlwd"]});${${"GLOBALS"}["sixprbpumh"]}=$this->rateBlockDuration($this->reseller2RateChartID,${$lkjqecjgsuk},${${"GLOBALS"}["jtobgfokfird"]},${$zfxfsgher},${${"GLOBALS"}["ncnazl"]});$this->reseller2MaxCallDuration=floor(${${"GLOBALS"}["sixprbpumh"]}/${${"GLOBALS"}["uzmjbejeeoh"]})*${${"GLOBALS"}["uzmjbejeeoh"]};}function reseller3MaxCallDuration(){$pbvzlyaib="CR";$wbwipukyjpsv="MFL";$wduokhhiw="PR";${"GLOBALS"}["msgdepaxlrt"]="MF";${${"GLOBALS"}["msgdepaxlrt"]}=$this->reseller3Minuteflexibility;$vnfeyucnf="callDurationFinal";${$pbvzlyaib}=$this->reseller3CallRate;${"GLOBALS"}["ngrqndglp"]="taxFee";${${"GLOBALS"}["uzmjbejeeoh"]}=$this->reseller3Resolution;${"GLOBALS"}["cuyfykwdcuho"]="reseller3CurrentBalance";${${"GLOBALS"}["lnpvpsuxx"]}=$this->reseller3MinuteflexibilityLimit;$slnkcxml="CR";$bodscvk="PR";if($this->reseller3rConnectionFee>0){$this->reseller3ConnectionFee=$this->reseller3rConnectionFee;}if($this->reseller3rDisConnectionFee>0){$this->reseller3DisConnectionFee=$this->reseller3rDisConnectionFee;}${"GLOBALS"}["xwscmfuhe"]="reseller3CurrentBalance";if($this->reseller3rTaxFee>0){$this->reseller3TaxFee=$this->reseller3rTaxFee;}${"GLOBALS"}["famiyflwqb"]="MF";${${"GLOBALS"}["wrhisijxkh"]}=number_format(($this->reseller3TaxFee*$this->reseller3Balance)/100,6,".","");${${"GLOBALS"}["xwscmfuhe"]}=((float)$this->reseller3Balance-((float)${${"GLOBALS"}["ngrqndglp"]}+(float)$this->reseller3ConnectionFee+(float)$this->reseller3DisConnectionFee));${${"GLOBALS"}["qvjzxpirhjc"]}=$this->withLimitCallDuration(${${"GLOBALS"}["cuyfykwdcuho"]},${${"GLOBALS"}["ncnazl"]},${$slnkcxml},${$wbwipukyjpsv});${$vnfeyucnf}=$this->rateBlockDuration($this->reseller3RateChartID,${${"GLOBALS"}["qvjzxpirhjc"]},${${"GLOBALS"}["ddgxrycpshfe"]},${${"GLOBALS"}["lnpvpsuxx"]},${${"GLOBALS"}["famiyflwqb"]});$this->reseller3MaxCallDuration=floor(${${"GLOBALS"}["sixprbpumh"]}/${$bodscvk})*${$wduokhhiw};}function reseller4MaxCallDuration(){${"GLOBALS"}["jfgvjetfn"]="reseller4CurrentBalance";$dxopmom="PR";$rxsgupa="MFL";${"GLOBALS"}["lubzqmc"]="MF";${"GLOBALS"}["injfpceeodmw"]="callDurationAfterCFandDF";$oltzlmr="callDurationAfterCFandDF";$thurhvgnv="CR";${${"GLOBALS"}["ncnazl"]}=$this->reseller4Minuteflexibility;${"GLOBALS"}["qkdmfw"]="MFL";${$thurhvgnv}=$this->reseller4CallRate;${$dxopmom}=$this->reseller4Resolution;${${"GLOBALS"}["qkdmfw"]}=$this->reseller4MinuteflexibilityLimit;$kerujwljo="MFL";if($this->reseller4rConnectionFee>0){$this->reseller4ConnectionFee=$this->reseller4rConnectionFee;}${"GLOBALS"}["dpvyvjtw"]="taxFee";if($this->reseller4rDisConnectionFee>0){$this->reseller4DisConnectionFee=$this->reseller4rDisConnectionFee;}if($this->reseller4rTaxFee>0){$this->reseller4TaxFee=$this->reseller4rTaxFee;}${${"GLOBALS"}["dpvyvjtw"]}=number_format(($this->reseller4TaxFee*$this->reseller4Balance)/100,6,".","");${${"GLOBALS"}["npzlrtgwb"]}=((float)$this->reseller4Balance-((float)${${"GLOBALS"}["wrhisijxkh"]}+(float)$this->reseller4ConnectionFee+(float)$this->reseller4DisConnectionFee));${$oltzlmr}=$this->withLimitCallDuration(${${"GLOBALS"}["npzlrtgwb"]},${${"GLOBALS"}["lubzqmc"]},${${"GLOBALS"}["xhwbcjlow"]},${$kerujwljo});${${"GLOBALS"}["sixprbpumh"]}=$this->rateBlockDuration($this->reseller4RateChartID,${${"GLOBALS"}["injfpceeodmw"]},${${"GLOBALS"}["jfgvjetfn"]},${$rxsgupa},${${"GLOBALS"}["ncnazl"]});$this->reseller4MaxCallDuration=floor(${${"GLOBALS"}["sixprbpumh"]}/${${"GLOBALS"}["uzmjbejeeoh"]})*${${"GLOBALS"}["uzmjbejeeoh"]};}function reseller1Info($id,$agi){$lusqnxfguwmt="result";${"GLOBALS"}["jwshlxr"]="sql";${${"GLOBALS"}["zitvvrl"]}="SELECT
a.id,
a.login,
a.id_reseller,
a.balance,
a.id_rate,
a.status,
b.connection_fee,
b.connection_threshold,
b.disconnection_fee,
b.disconnection_threshold,
b.tax,
a.creditLimit
FROM resellers1 a
INNER JOIN ratename b
ON a.id_rate = b.id_rate
WHERE a.id='$id' LIMIT 1";${$lusqnxfguwmt}=mysql_query(${${"GLOBALS"}["jwshlxr"]});if(mysql_num_rows(${${"GLOBALS"}["misprqjwli"]})==1){$qcxqwh="row";${"GLOBALS"}["lshwdcyw"]="row";$xdvfodsey="row";${"GLOBALS"}["iabcowsvudu"]="row";$zkhyfk="row";$hxvbucpuqyud="row";${"GLOBALS"}["gsnohlxtnsr"]="row";$qdufqzfisfz="result";${${"GLOBALS"}["yjkvvteswsy"]}=mysql_fetch_row(${$qdufqzfisfz});$wajsjrcehdqr="status";$this->reseller1ID=${$qcxqwh}[0];${${"GLOBALS"}["whsbjwwwxc"]}=${${"GLOBALS"}["yjkvvteswsy"]}[1];$ffrcol="row";$this->reseller2ID=${${"GLOBALS"}["yjkvvteswsy"]}[2];$this->reseller1Balance=(float)${${"GLOBALS"}["yjkvvteswsy"]}[3]+(float)${$hxvbucpuqyud}[11];$this->reseller1RateID=${${"GLOBALS"}["gsnohlxtnsr"]}[4];${${"GLOBALS"}["qfpcnwer"]}=${${"GLOBALS"}["iabcowsvudu"]}[5];$this->reseller1ConnectionFee=${$ffrcol}[6];$this->reseller1ConnectionThresholdValue=${$zkhyfk}[7];$this->reseller1DisConnectionFee=${${"GLOBALS"}["yjkvvteswsy"]}[8];$this->reseller1DisConnectionThresholdValue=${$xdvfodsey}[9];$this->reseller1TaxFee=${${"GLOBALS"}["lshwdcyw"]}[10];if($this->reseller1Balance<=0){$avkpisjb="description";${${"GLOBALS"}["ctnfoom"]}="Reseller I has no money to make call";$this->insertFailedCall(${$avkpisjb});$agi->hangup();exit();}if(${$wajsjrcehdqr}==0){${${"GLOBALS"}["ctnfoom"]}="Reseller I is inactive";$this->insertFailedCall(${${"GLOBALS"}["ctnfoom"]});$agi->hangup();exit();}}else{${"GLOBALS"}["gdxyjdpbqokm"]="description";${${"GLOBALS"}["ctnfoom"]}="Invalid Reseller I";$this->insertFailedCall(${${"GLOBALS"}["gdxyjdpbqokm"]});$agi->hangup();exit();}}function reseller2Info($id,$agi){${${"GLOBALS"}["zitvvrl"]}="SELECT
a.id,
a.login,
a.id_reseller,
a.balance,
a.id_rate,
a.status,
b.connection_fee,
b.connection_threshold,
b.disconnection_fee,
b.disconnection_threshold,
b.tax,
a.creditLimit
FROM resellers2 a
INNER JOIN ratename b
ON a.id_rate = b.id_rate
WHERE a.id='$id' LIMIT 1";${"GLOBALS"}["qgkkmpvo"]="result";${${"GLOBALS"}["misprqjwli"]}=mysql_query(${${"GLOBALS"}["zitvvrl"]});if(mysql_num_rows(${${"GLOBALS"}["qgkkmpvo"]})==1){${"GLOBALS"}["cvosdiw"]="row";$ioblhek="row";${"GLOBALS"}["tiruytfhsmt"]="row";${"GLOBALS"}["uhgxflg"]="login";$tvcfkyyeu="row";${$ioblhek}=mysql_fetch_row(${${"GLOBALS"}["misprqjwli"]});$this->reseller2ID=${${"GLOBALS"}["yjkvvteswsy"]}[0];${${"GLOBALS"}["uhgxflg"]}=${${"GLOBALS"}["yjkvvteswsy"]}[1];$xdkxpxum="status";$this->reseller3ID=${${"GLOBALS"}["tiruytfhsmt"]}[2];$this->reseller2Balance=(float)${${"GLOBALS"}["yjkvvteswsy"]}[3]+(float)${${"GLOBALS"}["yjkvvteswsy"]}[11];$this->reseller2RateID=${${"GLOBALS"}["yjkvvteswsy"]}[4];${${"GLOBALS"}["qfpcnwer"]}=${${"GLOBALS"}["yjkvvteswsy"]}[5];$this->reseller2ConnectionFee=${${"GLOBALS"}["yjkvvteswsy"]}[6];$this->reseller2ConnectionThresholdValue=${$tvcfkyyeu}[7];$this->reseller2DisConnectionFee=${${"GLOBALS"}["cvosdiw"]}[8];$this->reseller2DisConnectionThresholdValue=${${"GLOBALS"}["yjkvvteswsy"]}[9];$this->reseller2TaxFee=${${"GLOBALS"}["yjkvvteswsy"]}[10];if($this->reseller2Balance<=0){${"GLOBALS"}["dkvbhjjiodo"]="description";${${"GLOBALS"}["ctnfoom"]}="Reseller II has no money to make call";$this->insertFailedCall(${${"GLOBALS"}["dkvbhjjiodo"]});$agi->hangup();exit();}if(${$xdkxpxum}==0){${${"GLOBALS"}["ctnfoom"]}="Reseller II is inactive";$this->insertFailedCall(${${"GLOBALS"}["ctnfoom"]});$agi->hangup();exit();}}else{$bnzdblzg="description";${$bnzdblzg}="Invalid Reseller II";$this->insertFailedCall(${${"GLOBALS"}["ctnfoom"]});$agi->hangup();exit();}}function reseller3Info($id,$agi){${"GLOBALS"}["wuhcfindxj"]="result";$vruyqya="sql";${${"GLOBALS"}["zitvvrl"]}="SELECT
a.id,
a.login,
a.id_reseller,
a.balance,
a.id_rate,
a.status,
b.connection_fee,
b.connection_threshold,
b.disconnection_fee,
b.disconnection_threshold,
b.tax,
a.creditLimit
FROM resellers3 a
INNER JOIN ratename b
ON a.id_rate = b.id_rate
WHERE a.id='$id' LIMIT 1";${${"GLOBALS"}["misprqjwli"]}=mysql_query(${$vruyqya});if(mysql_num_rows(${${"GLOBALS"}["wuhcfindxj"]})==1){$tmoeaerij="row";${"GLOBALS"}["vbfeefb"]="row";$kntvjct="row";${"GLOBALS"}["kjecrulizvli"]="login";${"GLOBALS"}["gftfrbcm"]="result";${$kntvjct}=mysql_fetch_row(${${"GLOBALS"}["gftfrbcm"]});$this->reseller3ID=${${"GLOBALS"}["yjkvvteswsy"]}[0];${${"GLOBALS"}["kjecrulizvli"]}=${${"GLOBALS"}["yjkvvteswsy"]}[1];$this->reseller4ID=${$tmoeaerij}[2];$kedbjfqdy="row";$this->reseller3Balance=(float)${${"GLOBALS"}["yjkvvteswsy"]}[3]+(float)${${"GLOBALS"}["vbfeefb"]}[11];$this->reseller3RateID=${${"GLOBALS"}["yjkvvteswsy"]}[4];${${"GLOBALS"}["qfpcnwer"]}=${${"GLOBALS"}["yjkvvteswsy"]}[5];$this->reseller3ConnectionFee=${${"GLOBALS"}["yjkvvteswsy"]}[6];$this->reseller3ConnectionThresholdValue=${${"GLOBALS"}["yjkvvteswsy"]}[7];$this->reseller3DisConnectionFee=${$kedbjfqdy}[8];$this->reseller3DisConnectionThresholdValue=${${"GLOBALS"}["yjkvvteswsy"]}[9];$this->reseller3TaxFee=${${"GLOBALS"}["yjkvvteswsy"]}[10];if($this->reseller3Balance<=0){${${"GLOBALS"}["ctnfoom"]}="Reseller III has no money to make call";$this->insertFailedCall(${${"GLOBALS"}["ctnfoom"]});$agi->hangup();exit();}if(${${"GLOBALS"}["qfpcnwer"]}==0){${${"GLOBALS"}["ctnfoom"]}="Reseller III is inactive";${"GLOBALS"}["relckle"]="description";$this->insertFailedCall(${${"GLOBALS"}["relckle"]});$agi->hangup();exit();}}else{$hdysyujqphs="description";$fjpusleuemt="description";${$hdysyujqphs}="Invalid Reseller III";$this->insertFailedCall(${$fjpusleuemt});$agi->hangup();exit();}}function reseller4Info($id,$agi){$zpvslcojf="result";${${"GLOBALS"}["zitvvrl"]}="SELECT
a.id,
a.login,
a.balance,
a.id_rate,
a.status,
b.connection_fee,
b.connection_threshold,
b.disconnection_fee,
b.disconnection_threshold,
b.tax,
a.creditLimit
FROM resellers4 a
INNER JOIN ratename b
ON a.id_rate = b.id_rate
WHERE a.id='$id' LIMIT 1";${${"GLOBALS"}["misprqjwli"]}=mysql_query(${${"GLOBALS"}["zitvvrl"]});if(mysql_num_rows(${$zpvslcojf})==1){$umqtybgquyv="row";$hponov="row";$xadgfzv="status";$nuzljxlpn="login";${"GLOBALS"}["uvfidhmfghz"]="row";${${"GLOBALS"}["yjkvvteswsy"]}=mysql_fetch_row(${${"GLOBALS"}["misprqjwli"]});$this->reseller4ID=${${"GLOBALS"}["yjkvvteswsy"]}[0];${$nuzljxlpn}=${$hponov}[1];$this->reseller4Balance=(float)${${"GLOBALS"}["uvfidhmfghz"]}[2]+(float)${${"GLOBALS"}["yjkvvteswsy"]}[10];${"GLOBALS"}["yvjcyeeb"]="status";$this->reseller4RateID=${${"GLOBALS"}["yjkvvteswsy"]}[3];${${"GLOBALS"}["yvjcyeeb"]}=${$umqtybgquyv}[4];$this->reseller4ConnectionFee=${${"GLOBALS"}["yjkvvteswsy"]}[5];$this->reseller4ConnectionThresholdValue=${${"GLOBALS"}["yjkvvteswsy"]}[6];$this->reseller4DisConnectionFee=${${"GLOBALS"}["yjkvvteswsy"]}[7];$this->reseller4DisConnectionThresholdValue=${${"GLOBALS"}["yjkvvteswsy"]}[8];$this->reseller4TaxFee=${${"GLOBALS"}["yjkvvteswsy"]}[9];if($this->reseller4Balance<=0){$lxvwqfuubj="description";${$lxvwqfuubj}="Reseller IV has no money to make call";$this->insertFailedCall(${${"GLOBALS"}["ctnfoom"]});$agi->hangup();exit();}if(${$xadgfzv}==0){${"GLOBALS"}["jbvffga"]="description";${${"GLOBALS"}["jbvffga"]}="Reseller IV is inactive";$this->insertFailedCall(${${"GLOBALS"}["ctnfoom"]});$agi->hangup();exit();}}else{${${"GLOBALS"}["ctnfoom"]}="Invalid Reseller IV";$this->insertFailedCall(${${"GLOBALS"}["ctnfoom"]});$agi->hangup();exit();}}function p2pTerminationClient($clientlogin,$idReseller=-1,$resellerLevel=-1){${"GLOBALS"}["okzfvqbhxq"]="sql";${${"GLOBALS"}["zitvvrl"]}="SELECT p2p_allow FROM clientssip WHERE login = '$clientlogin' AND p2p_allow = 1 AND id_reseller = '$idReseller' AND reseller_level = '$resellerLevel' LIMIT 1";${${"GLOBALS"}["misprqjwli"]}=mysql_query(${${"GLOBALS"}["okzfvqbhxq"]});${${"GLOBALS"}["vwqrmfbur"]}=mysql_num_rows(${${"GLOBALS"}["misprqjwli"]});if(${${"GLOBALS"}["vwqrmfbur"]}>0)return 1;else return 0;}function getSettings(){$hzacsie="sql";${"GLOBALS"}["qmemxrcdnw"]="result";${"GLOBALS"}["zdzmbkdvn"]="result";${$hzacsie}="SELECT firewall,id_rate,ivr,ivr_enabled FROM settings WHERE status = \"Y\"";${${"GLOBALS"}["qmemxrcdnw"]}=mysql_query(${${"GLOBALS"}["zitvvrl"]});return mysql_fetch_assoc(${${"GLOBALS"}["zdzmbkdvn"]});}function userAuthentication($agi){$this->agiUniqueID=$agi->request["agi_uniqueid"];${"GLOBALS"}["dmbxwy"]="sqlProxy";$this->agiChannel=$agi->request["agi_channel"];$this->agiType=$agi->request["agi_type"];$this->agiCalleridName=$agi->request["agi_calleridname"];$this->agiCallerID=$agi->request["agi_callerid"];${"GLOBALS"}["mioycaywunyk"]="agidnid";$this->agiExtension=$agi->request["agi_extension"];${"GLOBALS"}["xxkmrrl"]="result";$this->agiContext=$agi->request["agi_context"];${${"GLOBALS"}["mioycaywunyk"]}=$agi->request["agi_dnid"];$this->agidnid=$this->agiExtension;$this->agiAccountCode=$agi->request["agi_accountcode"];${${"GLOBALS"}["drzdlgx"]}=$this->agiAccountCode;${${"GLOBALS"}["jkmzbsyobof"]}=SIP_USER;$this->clientType=${${"GLOBALS"}["jkmzbsyobof"]};${${"GLOBALS"}["dmbxwy"]}="SELECT
a.id,
a.calllimit,
a.inuse,
a.id_rate,
a.balance,
a.id_reseller,
a.status,
b.fullcontact,
b.ipaddr,
a.phone,
a.login,
a.reseller_level,
a.ivr_allow,
c.connection_fee,
c.connection_threshold,
c.disconnection_fee,
c.disconnection_threshold,
c.tax,
a.p2p_allow,
a.full_name
FROM clientssip a
INNER JOIN sipusers b
ON a.id = b.id_client
INNER JOIN ratename c
ON a.id_rate = c.id_rate
INNER JOIN proxyip d
ON b.ipaddr = d.proxyip
WHERE a.login = '$userName' AND b.accountcode = '$userName' AND b.clienttype = '$clientType' AND a.status = 1 AND d.status = 1";$rmroiqqtrb="settings";${${"GLOBALS"}["zitvvrl"]}="SELECT
a.id,
a.calllimit,
a.inuse,
a.id_rate,
a.balance,
a.id_reseller,
a.status,
b.fullcontact,
b.ipaddr,
a.phone,
a.login,
a.reseller_level,
a.ivr_allow,
c.connection_fee,
c.connection_threshold,
c.disconnection_fee,
c.disconnection_threshold,
c.tax,
a.p2p_allow,
a.full_name
FROM clientssip a
INNER JOIN sipusers b
ON a.id = b.id_client
INNER JOIN ratename c
ON a.id_rate = c.id_rate
WHERE a.login = '$userName' AND b.accountcode = '$userName' AND b.clienttype = '$clientType' AND a.status = 1";${$rmroiqqtrb}=$this->getSettings();$uxsnlyu="q";if(${${"GLOBALS"}["ufqywgwqd"]}["firewall"]=="enabled"){${"GLOBALS"}["kbgoomivc"]="sqlProxy";${${"GLOBALS"}["pexgotbglt"]}=${${"GLOBALS"}["kbgoomivc"]};}else{${"GLOBALS"}["rresnyjo"]="sql";${${"GLOBALS"}["pexgotbglt"]}=${${"GLOBALS"}["rresnyjo"]};}$yhxpzfkb="result";${${"GLOBALS"}["xxkmrrl"]}=mysql_query(${$uxsnlyu});if(mysql_num_rows(${$yhxpzfkb})==1){$dvyliyxe="row";${"GLOBALS"}["szikrstqyyk"]="row";$eihwmqpxp="row";$xhykrmnct="result";${${"GLOBALS"}["szikrstqyyk"]}=mysql_fetch_row(${$xhykrmnct});${"GLOBALS"}["glhmnjnilbmc"]="row";$this->clientID=${${"GLOBALS"}["glhmnjnilbmc"]}[0];${"GLOBALS"}["tcjeyrz"]="row";$kmywftjsrb="row";$this->clientCallLimit=${${"GLOBALS"}["yjkvvteswsy"]}[1];$this->clientInUse=${${"GLOBALS"}["yjkvvteswsy"]}[2];$this->clientRateID=${${"GLOBALS"}["tcjeyrz"]}[3];$this->clientBalance=${$kmywftjsrb}[4];$mmntopemvme="row";$this->reseller1ID=${${"GLOBALS"}["yjkvvteswsy"]}[5];${"GLOBALS"}["zoerrouncbn"]="row";$this->clientResellerID=${${"GLOBALS"}["yjkvvteswsy"]}[5];${${"GLOBALS"}["uyjqjie"]}=${${"GLOBALS"}["yjkvvteswsy"]}[6];$this->clientIPAddress=${${"GLOBALS"}["yjkvvteswsy"]}[7];$this->srcIP=${$eihwmqpxp}[8];$this->clientPhoneNumber=${$mmntopemvme}[9];$this->clientLogin=${${"GLOBALS"}["yjkvvteswsy"]}[10];$this->clientResellerLevel=${${"GLOBALS"}["yjkvvteswsy"]}[11];$dsgmvvfllqe="clientStatus";${"GLOBALS"}["baowimr"]="row";$this->playIVR=${${"GLOBALS"}["zoerrouncbn"]}[12];$this->clientConnectionFee=${${"GLOBALS"}["yjkvvteswsy"]}[13];$this->clientConnectionThresholdValue=${${"GLOBALS"}["yjkvvteswsy"]}[14];$this->clientDisConnectionFee=${${"GLOBALS"}["yjkvvteswsy"]}[15];${"GLOBALS"}["eescxlyl"]="row";$this->clientDisConnectionThresholdValue=${${"GLOBALS"}["eescxlyl"]}[16];$this->clientTaxFee=${$dvyliyxe}[17];${"GLOBALS"}["xayixq"]="settings";$this->allowP2Pcalls=${${"GLOBALS"}["baowimr"]}[18];$this->callerIDName=${${"GLOBALS"}["yjkvvteswsy"]}[19];if(!empty($this->clientPhoneNumber)AND is_numeric($this->clientPhoneNumber)){$this->agiCallerID=$this->clientPhoneNumber;}else{$this->agiCallerID=$this->agiAccountCode;}if(${$dsgmvvfllqe}==0){$qnzsloknds="description";${${"GLOBALS"}["ctnfoom"]}="Client inactive";$this->insertFailedCall(${$qnzsloknds});$agi->hangup();exit();}if(empty(${${"GLOBALS"}["xayixq"]}["ivr"])){${"GLOBALS"}["xuggkrrjd"]="ivr";${${"GLOBALS"}["xuggkrrjd"]}="123";}else{$emyusedm="settings";$gphwwqnz="ivr";${$gphwwqnz}=trim(${$emyusedm}["ivr"]);}if($this->agidnid==${${"GLOBALS"}["flfjcjt"]}){${"GLOBALS"}["phtioqm"]="agi";$this->ivrPlayClinetBalanceInfo(${${"GLOBALS"}["phtioqm"]});$agi->hangup();exit();}if($this->clientBalance<=0){$wtpruhgtkq="description";${$wtpruhgtkq}="No money to make this call";$this->insertFailedCall(${${"GLOBALS"}["ctnfoom"]});$agi->hangup();exit();}if(($this->reseller1ID>0)AND($this->clientResellerLevel<0)){${"GLOBALS"}["hjxmgbsi"]="description";${${"GLOBALS"}["hjxmgbsi"]}="Invalid Client Setting user reseller";$this->insertFailedCall(${${"GLOBALS"}["ctnfoom"]});$agi->hangup();exit();}if($this->clientCallLimit<=$this->clientInUse){$kktpzohr="checkActiveCall";$this->deleteActiveCall();${$kktpzohr}=$this->checkActiveCall($this->clientID);if(${${"GLOBALS"}["oldiwnytm"]}>0){${${"GLOBALS"}["ctnfoom"]}="Client Call Limit exceed";$this->insertFailedCall(${${"GLOBALS"}["ctnfoom"]});$agi->hangup();exit();}}${${"GLOBALS"}["kemdoqhexq"]}=substr($this->agiExtension,0,3);if(${${"GLOBALS"}["kemdoqhexq"]}=="000"){${"GLOBALS"}["broydouglimm"]="agi";$this->p2pCallSetting(${${"GLOBALS"}["broydouglimm"]});}else{${"GLOBALS"}["eupjjvp"]="agi";$this->preCallSetting(${${"GLOBALS"}["eupjjvp"]});}}else{$axzunuywn="description";${${"GLOBALS"}["ctnfoom"]}="Failed User Authentication";$this->insertFailedCall(${$axzunuywn});$agi->hangup();exit();}}function preCallSetting($agi){$nrfgllwyybfw="agi";$this->checkRateChart($this->clientRateID,$this->agidnid,${$nrfgllwyybfw},0);$this->clientBillingPrefix=$this->tempBillingPrefix;$this->clientVoiceRate=$this->tempVoiceRate;$this->clientRateMulti=$this->tempRateMulti;$this->clientGracePeriod=$this->tempGracePeriod;$this->clientMinTime=$this->tempMinTime;$this->clientResolution=$this->tempResolution;$this->clientMinuteflexibility=$this->tempMinuteFlexibility;$this->clientMinuteflexibilityLimit=$this->tempMinuteFlexibilityLimit;$this->clientRateChartID=$this->tempRateChartID;$this->clientCallRate=$this->clientVoiceRate*$this->clientRateMulti;$this->clientrConnectionFee=$this->tempConnectionFee;$this->clientrConnectionThresholdValue=$this->tempConnectionThresholdValue;$this->clientrDisConnectionFee=$this->tempDisConnectionFee;$this->clientrDisConnectionThresholdValue=$this->tempDisConnectionThresholdValue;$this->clientrTaxFee=$this->tempTaxFee;if($this->clientResellerLevel==-1){${"GLOBALS"}["xyxdfnjssu"]="agi";$this->reseller1ID=-1;$this->reseller2ID=-1;$this->reseller3ID=-1;$this->reseller4ID=-1;if($this->playIVR==1)$this->ivrPlayClinetBalance(${${"GLOBALS"}["xyxdfnjssu"]});$this->clinetMaxCallDuration();$this->dialplan(${${"GLOBALS"}["hrtbrmki"]});}elseif($this->clientResellerLevel==1){$this->reseller1Info($this->reseller1ID,${${"GLOBALS"}["hrtbrmki"]});$this->checkRateChart($this->reseller1RateID,$this->agidnid,${${"GLOBALS"}["hrtbrmki"]},1);$this->reseller1BillingPrefix=$this->tempBillingPrefix;$this->reseller1VoiceRate=$this->tempVoiceRate;$this->reseller1RateMulti=$this->tempRateMulti;$this->reseller1GracePeriod=$this->tempGracePeriod;$this->reseller1MinTime=$this->tempMinTime;$this->reseller1Resolution=$this->tempResolution;$this->reseller1Minuteflexibility=$this->tempMinuteFlexibility;$this->reseller1MinuteflexibilityLimit=$this->tempMinuteFlexibilityLimit;$this->reseller1RateChartID=$this->tempRateChartID;$this->reseller1CallRate=$this->reseller1VoiceRate*$this->reseller1RateMulti;$this->reseller1rConnectionFee=$this->tempConnectionFee;$this->reseller1rConnectionThresholdValue=$this->tempConnectionThresholdValue;$this->reseller1rDisConnectionFee=$this->tempDisConnectionFee;$this->reseller1rDisConnectionThresholdValue=$this->tempDisConnectionThresholdValue;$this->reseller1rTaxFee=$this->tempTaxFee;if($this->reseller2ID==-1){$tbhfyveb="agi";$this->reseller2ID=-1;$this->reseller3ID=-1;${"GLOBALS"}["imzprkip"]="agi";$this->reseller4ID=-1;if($this->playIVR==1)$this->ivrPlayClinetBalance(${$tbhfyveb});$this->clinetMaxCallDuration();$this->reseller1MaxCallDuration();$this->dialplan(${${"GLOBALS"}["imzprkip"]});}else{$echtjuiit="agi";$this->reseller2Info($this->reseller2ID,${${"GLOBALS"}["hrtbrmki"]});$this->checkRateChart($this->reseller2RateID,$this->agidnid,${$echtjuiit},2);$this->reseller2BillingPrefix=$this->tempBillingPrefix;$this->reseller2VoiceRate=$this->tempVoiceRate;$this->reseller2RateMulti=$this->tempRateMulti;$this->reseller2GracePeriod=$this->tempGracePeriod;$this->reseller2MinTime=$this->tempMinTime;$this->reseller2Resolution=$this->tempResolution;$this->reseller2Minuteflexibility=$this->tempMinuteFlexibility;$this->reseller2MinuteflexibilityLimit=$this->tempMinuteFlexibilityLimit;$this->reseller2RateChartID=$this->tempRateChartID;$this->reseller2CallRate=$this->reseller2VoiceRate*$this->reseller2RateMulti;$this->reseller2rConnectionFee=$this->tempConnectionFee;$this->reseller2rConnectionThresholdValue=$this->tempConnectionThresholdValue;$this->reseller2rDisConnectionFee=$this->tempDisConnectionFee;$this->reseller2rDisConnectionThresholdValue=$this->tempDisConnectionThresholdValue;$this->reseller2rTaxFee=$this->tempTaxFee;if($this->reseller3ID==-1){$this->reseller3ID=-1;$this->reseller4ID=-1;if($this->playIVR==1)$this->ivrPlayClinetBalance(${${"GLOBALS"}["hrtbrmki"]});$this->clinetMaxCallDuration();$this->reseller1MaxCallDuration();$this->reseller2MaxCallDuration();$this->dialplan(${${"GLOBALS"}["hrtbrmki"]});}else{$xjiumbp="agi";$this->reseller3Info($this->reseller3ID,${${"GLOBALS"}["hrtbrmki"]});$this->checkRateChart($this->reseller3RateID,$this->agidnid,${$xjiumbp},3);$this->reseller3BillingPrefix=$this->tempBillingPrefix;$this->reseller3VoiceRate=$this->tempVoiceRate;$this->reseller3RateMulti=$this->tempRateMulti;$this->reseller3GracePeriod=$this->tempGracePeriod;$this->reseller3MinTime=$this->tempMinTime;$this->reseller3Resolution=$this->tempResolution;$this->reseller3Minuteflexibility=$this->tempMinuteFlexibility;$this->reseller3MinuteflexibilityLimit=$this->tempMinuteFlexibilityLimit;$this->reseller3RateChartID=$this->tempRateChartID;$this->reseller3CallRate=$this->reseller3VoiceRate*$this->reseller3RateMulti;$this->reseller3rConnectionFee=$this->tempConnectionFee;$this->reseller3rConnectionThresholdValue=$this->tempConnectionThresholdValue;$this->reseller3rDisConnectionFee=$this->tempDisConnectionFee;$this->reseller3rDisConnectionThresholdValue=$this->tempDisConnectionThresholdValue;$this->reseller3rTaxFee=$this->tempTaxFee;if($this->reseller4ID==-1){${"GLOBALS"}["uhtlpxom"]="agi";$this->reseller4ID=-1;${"GLOBALS"}["fqmrsgsvu"]="agi";if($this->playIVR==1)$this->ivrPlayClinetBalance(${${"GLOBALS"}["uhtlpxom"]});$this->clinetMaxCallDuration();$this->reseller1MaxCallDuration();$this->reseller2MaxCallDuration();$this->reseller3MaxCallDuration();$this->dialplan(${${"GLOBALS"}["fqmrsgsvu"]});}else{$chevtewkb="agi";$this->reseller4Info($this->reseller4ID,${$chevtewkb});$zxbjrok="agi";$this->checkRateChart($this->reseller4RateID,$this->agidnid,${$zxbjrok},4);$this->reseller4BillingPrefix=$this->tempBillingPrefix;$this->reseller4VoiceRate=$this->tempVoiceRate;$this->reseller4RateMulti=$this->tempRateMulti;$this->reseller4GracePeriod=$this->tempGracePeriod;$this->reseller4MinTime=$this->tempMinTime;$this->reseller4Resolution=$this->tempResolution;$this->reseller4Minuteflexibility=$this->tempMinuteFlexibility;$this->reseller4MinuteflexibilityLimit=$this->tempMinuteFlexibilityLimit;$this->reseller4RateChartID=$this->tempRateChartID;$this->reseller4CallRate=$this->reseller4VoiceRate*$this->reseller4RateMulti;$this->reseller4rConnectionFee=$this->tempConnectionFee;$this->reseller4rConnectionThresholdValue=$this->tempConnectionThresholdValue;$wjjrmw="agi";$this->reseller4rDisConnectionFee=$this->tempDisConnectionFee;$this->reseller4rDisConnectionThresholdValue=$this->tempDisConnectionThresholdValue;$this->reseller4rTaxFee=$this->tempTaxFee;if($this->playIVR==1)$this->ivrPlayClinetBalance(${$wjjrmw});$this->clinetMaxCallDuration();$this->reseller1MaxCallDuration();$this->reseller2MaxCallDuration();$this->reseller3MaxCallDuration();$this->reseller4MaxCallDuration();$this->dialplan(${${"GLOBALS"}["hrtbrmki"]});}}}}elseif($this->clientResellerLevel==2){$this->reseller1ID=-1;$this->reseller2ID=$this->clientResellerID;$this->reseller2Info($this->reseller2ID,${${"GLOBALS"}["hrtbrmki"]});$this->checkRateChart($this->reseller2RateID,$this->agidnid,${${"GLOBALS"}["hrtbrmki"]},2);$this->reseller2BillingPrefix=$this->tempBillingPrefix;$this->reseller2VoiceRate=$this->tempVoiceRate;$this->reseller2RateMulti=$this->tempRateMulti;$this->reseller2GracePeriod=$this->tempGracePeriod;$this->reseller2MinTime=$this->tempMinTime;$this->reseller2Resolution=$this->tempResolution;$this->reseller2Minuteflexibility=$this->tempMinuteFlexibility;$this->reseller2MinuteflexibilityLimit=$this->tempMinuteFlexibilityLimit;$this->reseller2RateChartID=$this->tempRateChartID;$this->reseller2CallRate=$this->reseller2VoiceRate*$this->reseller2RateMulti;$this->reseller2rConnectionFee=$this->tempConnectionFee;$this->reseller2rConnectionThresholdValue=$this->tempConnectionThresholdValue;$this->reseller2rDisConnectionFee=$this->tempDisConnectionFee;$this->reseller2rDisConnectionThresholdValue=$this->tempDisConnectionThresholdValue;$this->reseller2rTaxFee=$this->tempTaxFee;if($this->reseller3ID==-1){$this->reseller3ID=-1;$this->reseller4ID=-1;if($this->playIVR==1)$this->ivrPlayClinetBalance(${${"GLOBALS"}["hrtbrmki"]});$this->clinetMaxCallDuration();$this->reseller2MaxCallDuration();$this->dialplan(${${"GLOBALS"}["hrtbrmki"]});}else{$vfcgvjqmb="agi";$this->reseller3Info($this->reseller3ID,${${"GLOBALS"}["hrtbrmki"]});$this->checkRateChart($this->reseller3RateID,$this->agidnid,${$vfcgvjqmb},3);$this->reseller3BillingPrefix=$this->tempBillingPrefix;$this->reseller3VoiceRate=$this->tempVoiceRate;$this->reseller3RateMulti=$this->tempRateMulti;$this->reseller3GracePeriod=$this->tempGracePeriod;$this->reseller3MinTime=$this->tempMinTime;$this->reseller3Resolution=$this->tempResolution;$this->reseller3Minuteflexibility=$this->tempMinuteFlexibility;$this->reseller3MinuteflexibilityLimit=$this->tempMinuteFlexibilityLimit;$this->reseller3RateChartID=$this->tempRateChartID;$this->reseller3CallRate=$this->reseller3VoiceRate*$this->reseller3RateMulti;$this->reseller3rConnectionFee=$this->tempConnectionFee;$this->reseller3rConnectionThresholdValue=$this->tempConnectionThresholdValue;$this->reseller3rDisConnectionFee=$this->tempDisConnectionFee;$this->reseller3rDisConnectionThresholdValue=$this->tempDisConnectionThresholdValue;$this->reseller3rTaxFee=$this->tempTaxFee;if($this->reseller4ID==-1){$nywdlvy="agi";${"GLOBALS"}["rkvuopsueiwp"]="agi";$this->reseller4ID=-1;if($this->playIVR==1)$this->ivrPlayClinetBalance(${$nywdlvy});$this->clinetMaxCallDuration();$this->reseller2MaxCallDuration();$this->reseller3MaxCallDuration();$this->dialplan(${${"GLOBALS"}["rkvuopsueiwp"]});}else{$qvvgpcfmbt="agi";$this->reseller4Info($this->reseller4ID,${${"GLOBALS"}["hrtbrmki"]});$this->checkRateChart($this->reseller4RateID,$this->agidnid,${$qvvgpcfmbt},4);$this->reseller4BillingPrefix=$this->tempBillingPrefix;$this->reseller4VoiceRate=$this->tempVoiceRate;$this->reseller4RateMulti=$this->tempRateMulti;$this->reseller4GracePeriod=$this->tempGracePeriod;$this->reseller4MinTime=$this->tempMinTime;$this->reseller4Resolution=$this->tempResolution;$this->reseller4Minuteflexibility=$this->tempMinuteFlexibility;$this->reseller4MinuteflexibilityLimit=$this->tempMinuteFlexibilityLimit;${"GLOBALS"}["sjriqwlv"]="agi";$this->reseller4RateChartID=$this->tempRateChartID;$this->reseller4CallRate=$this->reseller4VoiceRate*$this->reseller4RateMulti;$this->reseller4rConnectionFee=$this->tempConnectionFee;$this->reseller4rConnectionThresholdValue=$this->tempConnectionThresholdValue;$this->reseller4rDisConnectionFee=$this->tempDisConnectionFee;$this->reseller4rDisConnectionThresholdValue=$this->tempDisConnectionThresholdValue;$hqdocxhj="agi";$this->reseller4rTaxFee=$this->tempTaxFee;if($this->playIVR==1)$this->ivrPlayClinetBalance(${$hqdocxhj});$this->clinetMaxCallDuration();$this->reseller2MaxCallDuration();$this->reseller3MaxCallDuration();$this->reseller4MaxCallDuration();$this->dialplan(${${"GLOBALS"}["sjriqwlv"]});}}}elseif($this->clientResellerLevel==3){${"GLOBALS"}["dtjmvacg"]="agi";$this->reseller1ID=-1;$this->reseller2ID=-1;$this->reseller3ID=$this->clientResellerID;$this->reseller3Info($this->reseller3ID,${${"GLOBALS"}["hrtbrmki"]});$this->checkRateChart($this->reseller3RateID,$this->agidnid,${${"GLOBALS"}["dtjmvacg"]},3);$this->reseller3BillingPrefix=$this->tempBillingPrefix;$this->reseller3VoiceRate=$this->tempVoiceRate;$this->reseller3RateMulti=$this->tempRateMulti;$this->reseller3GracePeriod=$this->tempGracePeriod;$this->reseller3MinTime=$this->tempMinTime;$this->reseller3Resolution=$this->tempResolution;$this->reseller3Minuteflexibility=$this->tempMinuteFlexibility;$this->reseller3MinuteflexibilityLimit=$this->tempMinuteFlexibilityLimit;$this->reseller3RateChartID=$this->tempRateChartID;$this->reseller3CallRate=$this->reseller3VoiceRate*$this->reseller3RateMulti;$this->reseller3rConnectionFee=$this->tempConnectionFee;$this->reseller3rConnectionThresholdValue=$this->tempConnectionThresholdValue;$this->reseller3rDisConnectionFee=$this->tempDisConnectionFee;$this->reseller3rDisConnectionThresholdValue=$this->tempDisConnectionThresholdValue;$this->reseller3rTaxFee=$this->tempTaxFee;if($this->reseller4ID==-1){${"GLOBALS"}["tbekvser"]="agi";$this->reseller4ID=-1;if($this->playIVR==1)$this->ivrPlayClinetBalance(${${"GLOBALS"}["tbekvser"]});$this->clinetMaxCallDuration();$this->reseller3MaxCallDuration();$this->dialplan(${${"GLOBALS"}["hrtbrmki"]});}else{$dovjfrrnmk="agi";$this->reseller4Info($this->reseller4ID,${$dovjfrrnmk});$tbtwdmwx="agi";$this->checkRateChart($this->reseller4RateID,$this->agidnid,${$tbtwdmwx},4);$this->reseller4BillingPrefix=$this->tempBillingPrefix;$this->reseller4VoiceRate=$this->tempVoiceRate;$this->reseller4RateMulti=$this->tempRateMulti;$this->reseller4GracePeriod=$this->tempGracePeriod;$this->reseller4MinTime=$this->tempMinTime;$this->reseller4Resolution=$this->tempResolution;$this->reseller4Minuteflexibility=$this->tempMinuteFlexibility;$this->reseller4MinuteflexibilityLimit=$this->tempMinuteFlexibilityLimit;${"GLOBALS"}["xdcdespk"]="agi";$this->reseller4RateChartID=$this->tempRateChartID;$this->reseller4CallRate=$this->reseller4VoiceRate*$this->reseller4RateMulti;$this->reseller4rConnectionFee=$this->tempConnectionFee;$this->reseller4rConnectionThresholdValue=$this->tempConnectionThresholdValue;$this->reseller4rDisConnectionFee=$this->tempDisConnectionFee;$ikrizqnrrrr="agi";$this->reseller4rDisConnectionThresholdValue=$this->tempDisConnectionThresholdValue;$this->reseller4rTaxFee=$this->tempTaxFee;if($this->playIVR==1)$this->ivrPlayClinetBalance(${$ikrizqnrrrr});$this->clinetMaxCallDuration();$this->reseller3MaxCallDuration();$this->reseller4MaxCallDuration();$this->dialplan(${${"GLOBALS"}["xdcdespk"]});}}elseif($this->clientResellerLevel==4){$this->reseller1ID=-1;$this->reseller2ID=-1;$this->reseller3ID=-1;$this->reseller4ID=$this->clientResellerID;$this->reseller4Info($this->reseller4ID,${${"GLOBALS"}["hrtbrmki"]});$this->checkRateChart($this->reseller4RateID,$this->agidnid,${${"GLOBALS"}["hrtbrmki"]},4);$this->reseller4BillingPrefix=$this->tempBillingPrefix;$this->reseller4VoiceRate=$this->tempVoiceRate;$this->reseller4RateMulti=$this->tempRateMulti;$this->reseller4GracePeriod=$this->tempGracePeriod;$this->reseller4MinTime=$this->tempMinTime;$this->reseller4Resolution=$this->tempResolution;$this->reseller4Minuteflexibility=$this->tempMinuteFlexibility;$this->reseller4MinuteflexibilityLimit=$this->tempMinuteFlexibilityLimit;$this->reseller4RateChartID=$this->tempRateChartID;$vxrwmnlx="agi";$this->reseller4CallRate=$this->reseller4VoiceRate*$this->reseller4RateMulti;$this->reseller4rConnectionFee=$this->tempConnectionFee;$this->reseller4rConnectionThresholdValue=$this->tempConnectionThresholdValue;$this->reseller4rDisConnectionFee=$this->tempDisConnectionFee;$this->reseller4rDisConnectionThresholdValue=$this->tempDisConnectionThresholdValue;$this->reseller4rTaxFee=$this->tempTaxFee;${"GLOBALS"}["gohfsrd"]="agi";if($this->playIVR==1)$this->ivrPlayClinetBalance(${${"GLOBALS"}["gohfsrd"]});$this->clinetMaxCallDuration();$this->reseller4MaxCallDuration();$this->dialplan(${$vxrwmnlx});}else{${"GLOBALS"}["blnwjbgegng"]="description";${${"GLOBALS"}["ctnfoom"]}="Reseller Setting is not valid";$this->insertFailedCall(${${"GLOBALS"}["blnwjbgegng"]});$agi->hangup();exit();}}function get_ip_address(){if(!empty($_SERVER["HTTP_CLIENT_IP"])){${"GLOBALS"}["ncynkvtwvos"]="ip";${${"GLOBALS"}["ncynkvtwvos"]}=$_SERVER["HTTP_CLIENT_IP"];}elseif(!empty($_SERVER["HTTP_X_FORWARDED_FOR"])){$gqkcnafiqjvj="ip";${$gqkcnafiqjvj}=$_SERVER["HTTP_X_FORWARDED_FOR"];}else{${"GLOBALS"}["tyjayrvcwge"]="ip";${${"GLOBALS"}["tyjayrvcwge"]}=$_SERVER["REMOTE_ADDR"];}return${${"GLOBALS"}["xdtlicoe"]};}function dialplan($agi){$rnjejnt="settings";${${"GLOBALS"}["egevmqt"]}=2147483647;${"GLOBALS"}["pidpqqrlt"]="maxCallDuration";${${"GLOBALS"}["pdmwcirznna"]}=$this->agidnid;${${"GLOBALS"}["idrfavfbrq"]}=substr(${${"GLOBALS"}["pdmwcirznna"]},0,1);${${"GLOBALS"}["qurtlxqwhzqr"]}=$this->getMaxCallDuration($this->clinetMaxCallDuration,$this->reseller1MaxCallDuration,$this->reseller2MaxCallDuration,$this->reseller3MaxCallDuration,$this->reseller4MaxCallDuration);$srzfxlkmrpse="dialparams";${"GLOBALS"}["xsdhptk"]="settings";${${"GLOBALS"}["yywguh"]}=${${"GLOBALS"}["pidpqqrlt"]};$agi->set_autohangup(${${"GLOBALS"}["yywguh"]});${$srzfxlkmrpse}=",30|HS($timeOut)";if(${${"GLOBALS"}["qurtlxqwhzqr"]}<$this->clientMinTime){${${"GLOBALS"}["ctnfoom"]}="Dial Plan No money to make this call";$this->insertFailedCall(${${"GLOBALS"}["ctnfoom"]});$agi->hangup();exit();}${${"GLOBALS"}["xsdhptk"]}=$this->getSettings();if($this->playIVR==1&&${$rnjejnt}["ivr_enabled"]=="Y"){${"GLOBALS"}["usyudpizc"]="ivrMin";$agi->stream_file("you_have","#");${${"GLOBALS"}["usyudpizc"]}=round($this->clientBalance/$this->clientVoiceRate,0);$agi->say_number(${${"GLOBALS"}["awingfl"]});$agi->stream_file("minutes","#");}${${"GLOBALS"}["lpffkprcn"]}="SELECT
a.id,
a.id_trunk,
a.prefix,
a.add_prefix,
a.remove_prefix,
a.priority,
a.jump,
a.share,
a.inuse dialplan_inuse,
a.from_day,
a.to_day,
a.from_hour,
a.to_hour,
a.status,
b.description,
b.providertech,
b.providerip,
b.port,
b.inuse,
b.maxuse,
b.id_rate,
b.description
FROM dialplan a
INNER JOIN trunk b
ON a.id_trunk = b.id_trunk
WHERE a.prefix LIKE '$firstDigitCalledNumber%'
AND a.status = 1 AND b.status = 1
ORDER BY a.prefix DESC,a.priority ASC, RAND()";${${"GLOBALS"}["nsjwurdikuj"]}=mysql_query(${${"GLOBALS"}["lpffkprcn"]});if(mysql_num_rows(${${"GLOBALS"}["nsjwurdikuj"]})>0){while(${${"GLOBALS"}["fqthgwlw"]}=mysql_fetch_assoc(${${"GLOBALS"}["nsjwurdikuj"]})){$hsodbfn="rowDialPlan";$rleqhy="rowDialPlan";$wwumzrwynnv="destination";${"GLOBALS"}["nqsrshhsmzz"]="port";${"GLOBALS"}["rxkwsvfuvicl"]="dialplan_inuse";${"GLOBALS"}["orflbykp"]="id_trunk";${"GLOBALS"}["buuobpdav"]="providertech";${"GLOBALS"}["wqhytkwgw"]="rowDialPlan";${"GLOBALS"}["gslvcdp"]="dialPrefix";$fujudgjy="jump";${"GLOBALS"}["qjxtqolmj"]="rowDialPlan";${${"GLOBALS"}["duokdqsdwkn"]}=${${"GLOBALS"}["fqthgwlw"]}["id_trunk"];${"GLOBALS"}["nnsnjtmchfjk"]="descriptionTurnk";${"GLOBALS"}["ryhpxg"]="providerip";${"GLOBALS"}["mlscfmmp"]="add_prefix";${${"GLOBALS"}["gslvcdp"]}=${${"GLOBALS"}["fqthgwlw"]}["prefix"];${${"GLOBALS"}["mlscfmmp"]}=${$rleqhy}["add_prefix"];${${"GLOBALS"}["qxjecng"]}=${${"GLOBALS"}["fqthgwlw"]}["remove_prefix"];${$fujudgjy}=${${"GLOBALS"}["fqthgwlw"]}["jump"];${${"GLOBALS"}["uhqhpvpfcv"]}=${${"GLOBALS"}["fqthgwlw"]}["share"];${${"GLOBALS"}["rxkwsvfuvicl"]}=${${"GLOBALS"}["fqthgwlw"]}["dialplan_inuse"];${${"GLOBALS"}["ctnfoom"]}=${${"GLOBALS"}["fqthgwlw"]}["description"];${${"GLOBALS"}["buuobpdav"]}=${${"GLOBALS"}["fqthgwlw"]}["providertech"];${${"GLOBALS"}["qayxgnqc"]}=${${"GLOBALS"}["fqthgwlw"]}["providerip"];${${"GLOBALS"}["vwifqoggrrly"]}=${${"GLOBALS"}["fqthgwlw"]}["port"];${${"GLOBALS"}["heoaijgp"]}=${$hsodbfn}["inuse"];${${"GLOBALS"}["gtfwtywudr"]}=${${"GLOBALS"}["wqhytkwgw"]}["maxuse"];${${"GLOBALS"}["nnsnjtmchfjk"]}=${${"GLOBALS"}["qjxtqolmj"]}["description"];$this->terminationRateID=${${"GLOBALS"}["fqthgwlw"]}["id_rate"];${${"GLOBALS"}["qayxgnqc"]}=${${"GLOBALS"}["ryhpxg"]}.":".${${"GLOBALS"}["nqsrshhsmzz"]};$this->idTrunk=${${"GLOBALS"}["orflbykp"]};$this->turnkCallLimit=${${"GLOBALS"}["gtfwtywudr"]};${"GLOBALS"}["ffojgkkfbfz"]="dialPrefix";$this->providerip=${${"GLOBALS"}["qayxgnqc"]};if($this->dialPlanCount==1){$agi->hangup();exit();}${${"GLOBALS"}["umgfepe"]}="/^".${${"GLOBALS"}["ffojgkkfbfz"]}."/";if(preg_match(${${"GLOBALS"}["umgfepe"]},${$wwumzrwynnv})){${"GLOBALS"}["cgtpnqedruh"]="share";$umqrzl="cond";${"GLOBALS"}["zyyuqsgl"]="maxuse";$lvzqhrey="cond";${$lvzqhrey}=(${${"GLOBALS"}["cgtpnqedruh"]}=="0")?TRUE:(${${"GLOBALS"}["uhqhpvpfcv"]}>${${"GLOBALS"}["welpltyk"]});if(${${"GLOBALS"}["zyyuqsgl"]}>${${"GLOBALS"}["heoaijgp"]}&&${$umqrzl}){${"GLOBALS"}["jqhcfwhjki"]="dialPrefix";$qcjjrhfb="dialPrefix";$deiwplrikoo="removeprefix";${"GLOBALS"}["wularpfmmfqe"]="jump";${"GLOBALS"}["bhfryvo"]="callDuration";${"GLOBALS"}["jcykkmqq"]="dialPrefix";${"GLOBALS"}["emggdtnppy"]="add_prefix";$cmrnxdgwoux="destination";${"GLOBALS"}["jtfkymxn"]="add_prefix";${"GLOBALS"}["qemfbifnzie"]="answeredtime";${"GLOBALS"}["zoimuiukbe"]="removeprefix";${"GLOBALS"}["fqucak"]="dialstr";$vyydnydu="dialPrefix";$fifnniv="providerip";$rinenosj="destination";${"GLOBALS"}["dfhhsrurwjt"]="add_prefix";$this->dialPrefix=${${"GLOBALS"}["ergcjbfj"]};$ggoxkdspzb="removeprefix";${"GLOBALS"}["bxjfdnzzfj"]="callDuration";${"GLOBALS"}["epmxsq"]="dialPrefix";${"GLOBALS"}["pfrocckqwf"]="add_prefix";if(strncmp(${$cmrnxdgwoux},${${"GLOBALS"}["qxjecng"]},strlen(${${"GLOBALS"}["zoimuiukbe"]}))==0)${${"GLOBALS"}["pdmwcirznna"]}=substr(${$rinenosj},strlen(${$deiwplrikoo}));${${"GLOBALS"}["fqucak"]}=${${"GLOBALS"}["wsqiumfixcf"]}."/".${${"GLOBALS"}["jtfkymxn"]}.${${"GLOBALS"}["pdmwcirznna"]}."@".${$fifnniv}.${${"GLOBALS"}["fycgdoif"]};$this->trunkStatusUpdate(1,$this->idTrunk,${${"GLOBALS"}["jcykkmqq"]},${${"GLOBALS"}["irrgervw"]},${${"GLOBALS"}["qxjecng"]});${"GLOBALS"}["jcesesypriwj"]="dialstr";$this->clientInUseUpdate(1,$this->clientID);$this->deleteActiveCall();${"GLOBALS"}["siimwkh"]="removeprefix";$this->insertActiveCall(${${"GLOBALS"}["irrgervw"]});${${"GLOBALS"}["cixihhk"]}=$this->run_dial(${${"GLOBALS"}["hrtbrmki"]},${${"GLOBALS"}["jcesesypriwj"]});${${"GLOBALS"}["qemfbifnzie"]}=$agi->get_variable("ANSWEREDTIME");$this->real_answeredtime=$this->answeredtime=${${"GLOBALS"}["csjbagowpdfh"]}["data"];${${"GLOBALS"}["naygvgxj"]}=$agi->get_variable("DIALSTATUS");$this->dialstatus=${${"GLOBALS"}["naygvgxj"]}["data"];switch($this->dialstatus){case"CANCEL":$this->answeredtime=0;$this->trunkStatusUpdate(0,$this->idTrunk,${$qcjjrhfb},${${"GLOBALS"}["irrgervw"]},${${"GLOBALS"}["qxjecng"]});${${"GLOBALS"}["bxjfdnzzfj"]}=$this->answeredtime;$this->billCalculation(${${"GLOBALS"}["bhfryvo"]},$this->dialstatus,${${"GLOBALS"}["irrgervw"]});$this->deleteActiveCall();$this->clientInUseUpdate(0,$this->clientID);$this->dialPlanCount=1;break;case"BUSY":case"NOANSWER":case"CHANUNAVAIL":case"CONGESTION":$this->answeredtime=0;$this->trunkStatusUpdate(0,$this->idTrunk,${${"GLOBALS"}["jqhcfwhjki"]},${${"GLOBALS"}["irrgervw"]},${${"GLOBALS"}["qxjecng"]});${${"GLOBALS"}["hqejds"]}=$this->answeredtime;$this->billCalculation(${${"GLOBALS"}["hqejds"]},$this->dialstatus,${${"GLOBALS"}["irrgervw"]});$this->deleteActiveCall();$this->clientInUseUpdate(0,$this->clientID);if(${${"GLOBALS"}["wularpfmmfqe"]}==0)$this->dialPlanCount=1;else$this->dialPlanCount=0;break;case"ANSWER":${${"GLOBALS"}["hqejds"]}=$this->answeredtime;$this->trunkStatusUpdate(0,$this->idTrunk,${${"GLOBALS"}["ergcjbfj"]},${${"GLOBALS"}["pfrocckqwf"]},${${"GLOBALS"}["siimwkh"]});$this->billCalculation(${${"GLOBALS"}["hqejds"]},$this->dialstatus,${${"GLOBALS"}["emggdtnppy"]});$this->deleteActiveCall();$this->clientInUseUpdate(0,$this->clientID);$this->update_dialplan($this->idTrunk,${$vyydnydu},${${"GLOBALS"}["dfhhsrurwjt"]},${$ggoxkdspzb});$this->dialPlanCount=1;break;default:$this->trunkStatusUpdate(0,$this->idTrunk,${${"GLOBALS"}["epmxsq"]},${${"GLOBALS"}["irrgervw"]},${${"GLOBALS"}["qxjecng"]});$this->deleteActiveCall();$this->clientInUseUpdate(0,$this->clientID);break;}}else{${${"GLOBALS"}["ctnfoom"]}=${${"GLOBALS"}["whfvpeahw"]}.":Call Limit exceeded";$this->insertFailedCall(${${"GLOBALS"}["ctnfoom"]});}}}}else{${"GLOBALS"}["lhbhosasp"]="description";${"GLOBALS"}["moshyuqerpuq"]="description";${${"GLOBALS"}["lhbhosasp"]}="Dial Plan not define";$this->insertFailedCall(${${"GLOBALS"}["moshyuqerpuq"]});$agi->hangup();exit();}}function update_dialplan($trunk_id,$prefix,$add_prefix,$rem_prefix){$roomyvm="row";${"GLOBALS"}["cefsnlvbxwvj"]="acd";${"GLOBALS"}["aafvbkpwxv"]="sql";${${"GLOBALS"}["zitvvrl"]}="SELECT COUNT(call_id) AS totalCall,SUM(duration) AS totalDuration,call_id FROM success_calls WHERE duration > 0 AND id_trunk = ".${${"GLOBALS"}["qmxrfdemmlw"]}." AND dialing_prefix = "".${${"GLOBALS"}["nfpkugq"]}."\" ORDER BY call_id DESC LIMIT 100";$aoekmcbgiqr="query";$kelqfznog="rem_prefix";$mbcpmfx="row";${$aoekmcbgiqr}=mysql_query(${${"GLOBALS"}["aafvbkpwxv"]});${$mbcpmfx}=mysql_fetch_row(${${"GLOBALS"}["uoolyo"]});${${"GLOBALS"}["cefsnlvbxwvj"]}=ceil(${${"GLOBALS"}["yjkvvteswsy"]}[1]/${$roomyvm}[0]);${${"GLOBALS"}["bkyjqbh"]}="UPDATE dialplan SET acd = ".${${"GLOBALS"}["inordqk"]}." WHERE id_trunk = ".${${"GLOBALS"}["qmxrfdemmlw"]}." AND prefix = "".${${"GLOBALS"}["nfpkugq"]}."" AND add_prefix = \"".${${"GLOBALS"}["irrgervw"]}."" AND remove_prefix = \"".${$kelqfznog}."\"";mysql_query(${${"GLOBALS"}["bkyjqbh"]});}function trunkStatusUpdate($connectionStatus=0,$id_trunk=0,$prefix,$add_prefix,$remove_prefix){${"GLOBALS"}["dfqdtwlfas"]="connectionStatus";${"GLOBALS"}["cmgdyrmblx"]="sql1";if(${${"GLOBALS"}["dfqdtwlfas"]}==1){$xniserapqi="sql";${$xniserapqi}="UPDATE trunk SET inuse = inuse + 1 where id_trunk='$id_trunk'";${${"GLOBALS"}["vibtstlknwx"]}="UPDATE dialplan SET inuse = inuse + 1 where id_trunk='$id_trunk' AND prefix = '$prefix' AND add_prefix = '$add_prefix' AND remove_prefix = '$remove_prefix'";}else{$aoutzneen="sql";${$aoutzneen}="UPDATE trunk SET inuse = inuse - 1 where id_trunk='$id_trunk' AND inuse > 0";${${"GLOBALS"}["vibtstlknwx"]}="UPDATE dialplan SET inuse = inuse - 1 where id_trunk='$id_trunk' AND inuse > 0 AND prefix = '$prefix' AND add_prefix = '$add_prefix' AND remove_prefix = '$remove_prefix'";}mysql_query(${${"GLOBALS"}["zitvvrl"]});mysql_query(${${"GLOBALS"}["cmgdyrmblx"]});}function clientInUseUpdate($connectionStatus=0,$id=0){$eigncut="sql";${"GLOBALS"}["iaqjrawve"]="result";${"GLOBALS"}["iccvwgvoist"]="connectionStatus";${"GLOBALS"}["jwpjrgt"]="sql";if(${${"GLOBALS"}["iccvwgvoist"]}==1)${${"GLOBALS"}["zitvvrl"]}="UPDATE clientssip SET inuse = inuse + 1 where id='$id'";else${${"GLOBALS"}["jwpjrgt"]}="UPDATE clientssip SET inuse = inuse - 1 where id='$id' AND inuse > 0";${${"GLOBALS"}["iaqjrawve"]}=mysql_query(${$eigncut});}function insertActiveCall($add_prefix){${"GLOBALS"}["vclviozhbl"]="tariff_prefix";$jrxqkifut="idClient";${"GLOBALS"}["sbturzf"]="idCall";${${"GLOBALS"}["sbturzf"]}=$this->agiUniqueID;${${"GLOBALS"}["dfccmlvp"]}=$this->agiChannel;${$jrxqkifut}=$this->clientID;${${"GLOBALS"}["pvqhjkdpki"]}=$this->agiAccountCode;${${"GLOBALS"}["jkmzbsyobof"]}=SIP_USER;$clxmqb="id_reseller";${${"GLOBALS"}["duokdqsdwkn"]}=$this->idTrunk;${$clxmqb}=$this->clientResellerID;$djkkwtq="proxyip";${${"GLOBALS"}["kjdfvjiq"]}=$this->clientResellerLevel;${"GLOBALS"}["xvprumc"]="result";$crtjsrj="billing_dec";${${"GLOBALS"}["inyoapwc"]}=$this->clientRateID;${"GLOBALS"}["jqccvgx"]="callednumber";${"GLOBALS"}["fgqopvmoy"]="INSERT_ACTIVE_CALL_QUERY";$niqsgdw="reseller4ID";${${"GLOBALS"}["rjsgnwem"]}=$this->agiCallerID;${${"GLOBALS"}["jqccvgx"]}=$this->agidnid;${"GLOBALS"}["zkqabbsdevd"]="INSERT_ACTIVE_CALL_QUERY";${${"GLOBALS"}["vclviozhbl"]}=$this->clientBillingPrefix;${${"GLOBALS"}["jyjanzs"]}=$this->dialPrefix;${$crtjsrj}=$this->billingPrefixDescription;${$djkkwtq}=$this->srcIP;${${"GLOBALS"}["rtfhwqcpvi"]}=$this->orgCallerIP;${${"GLOBALS"}["khyusiem"]}=$this->clientIPAddress;${${"GLOBALS"}["fhcyngcj"]}=$this->reseller1ID;${${"GLOBALS"}["gpbxjfwfvoy"]}=$this->reseller2ID;${${"GLOBALS"}["yjpzfsvcle"]}=$this->reseller3ID;${$niqsgdw}=$this->reseller4ID;${${"GLOBALS"}["zkqabbsdevd"]}="INSERT INTO activecall (id_call, channel, client_id, login, clienttype, id_trunk, id_reseller, reseller1_id, reseller2_id, reseller3_id, reseller4_id,
reseller_level, dialnumber, dialprefix, billing_prefix,add_prefix, billing_dec, caller_id, proxyip, sipip, fullcontact)
VALUES ('$idCall', '$channel', '$idClient', '$accountcode', '$clientType', '$id_trunk', '$id_reseller', '$reseller1ID', '$reseller2ID', '$reseller3ID', '$reseller4ID',
'$resellerLevel', '$callednumber', '$dialing_prefix','$add_prefix', '$tariff_prefix', '$billing_dec', '$callerid', '$proxyip', '$sipip', '$fullcontact')";${${"GLOBALS"}["xvprumc"]}=mysql_query(${${"GLOBALS"}["fgqopvmoy"]});}function checkRateChart($rateID,$calledNumber,$agi,$userLevel){$yvfiltuol="result";${"GLOBALS"}["rstcmocd"]="result";$cnsthjs="sqlRate";${$cnsthjs}="SELECT
prefix,
description,
voice_rate,
rate_mult,
grace_period,
minimal_time,
resolution,
is_disable,
minute_flex,
minute_flex_limit,
id,
connection_fee,
connection_threshold,
disconnection_fee,
disconnection_threshold,
tax
FROM ratechart
where id_rate = '$rateID' AND LOCATE(prefix,'$calledNumber')=1
AND prefix=(select max(prefix)
from ratechart where id_rate = '$rateID' AND LOCATE(prefix,'$calledNumber')=1) AND voice_rate > 0 AND rate_mult > 0 LIMIT 1";${$yvfiltuol}=mysql_query(${${"GLOBALS"}["posonsquj"]});if(mysql_num_rows(${${"GLOBALS"}["rstcmocd"]})==1){${"GLOBALS"}["iqrmfvyftwgz"]="rowRateChart";$bidlsklscpj="rowRateChart";$jufktvjzml="rowRateChart";$uxlcrnpclo="rowRateChart";${$jufktvjzml}=mysql_fetch_row(${${"GLOBALS"}["misprqjwli"]});$this->tempBillingPrefix=${${"GLOBALS"}["eurldbwywaf"]}[0];$this->billingPrefixDescription=${$uxlcrnpclo}[1];$this->tempVoiceRate=${${"GLOBALS"}["iqrmfvyftwgz"]}[2];$ucpnfwj="rowRateChart";$this->tempRateMulti=${${"GLOBALS"}["eurldbwywaf"]}[3];$vhswqyupqxmt="rowRateChart";${"GLOBALS"}["ujmbuhska"]="userLevel";${"GLOBALS"}["qgkotjxpkf"]="rowRateChart";$this->tempGracePeriod=${$bidlsklscpj}[4];$this->tempMinTime=${${"GLOBALS"}["eurldbwywaf"]}[5];$this->tempResolution=${${"GLOBALS"}["eurldbwywaf"]}[6];$this->tempIsDisable=${$ucpnfwj}[7];$this->tempMinuteFlexibility=${${"GLOBALS"}["qgkotjxpkf"]}[8];$xkitnkkih="rowRateChart";${"GLOBALS"}["yririuqr"]="rowRateChart";$this->tempMinuteFlexibilityLimit=${${"GLOBALS"}["eurldbwywaf"]}[9];$this->tempRateChartID=${$xkitnkkih}[10];$this->tempConnectionFee=${${"GLOBALS"}["yririuqr"]}[11];$this->tempConnectionThresholdValue=${$vhswqyupqxmt}[12];$this->tempDisConnectionFee=${${"GLOBALS"}["eurldbwywaf"]}[13];$this->tempDisConnectionThresholdValue=${${"GLOBALS"}["eurldbwywaf"]}[14];$this->tempTaxFee=${${"GLOBALS"}["eurldbwywaf"]}[15];if(${${"GLOBALS"}["trokyjwwt"]}==0)${${"GLOBALS"}["ctnfoom"]}="Client Billing Prefix is Disable";elseif(${${"GLOBALS"}["trokyjwwt"]}==1)${${"GLOBALS"}["ctnfoom"]}="Reseller I Billing Prefix is Disable";elseif(${${"GLOBALS"}["ujmbuhska"]}==2)${${"GLOBALS"}["ctnfoom"]}="Reseller II Billing Prefix is Disable";elseif(${${"GLOBALS"}["trokyjwwt"]}==3)${${"GLOBALS"}["ctnfoom"]}="Reseller III Billing Prefix is Disable";else${${"GLOBALS"}["ctnfoom"]}="Reseller IV Billing Prefix is Disable";if($this->tempIsDisable==1){${"GLOBALS"}["wepqeyij"]="description";$this->insertFailedCall(${${"GLOBALS"}["wepqeyij"]});$agi->hangup();exit();}}else{$xwdyqncnveaa="userLevel";$kkfosufqco="userLevel";${"GLOBALS"}["spioctcr"]="userLevel";$jbsnhbjyw="description";if(${$xwdyqncnveaa}==0)${${"GLOBALS"}["ctnfoom"]}="Client Rate Chart is not valid";elseif(${$kkfosufqco}==1)${${"GLOBALS"}["ctnfoom"]}="Reseller I Rate Chart is not valid";elseif(${${"GLOBALS"}["spioctcr"]}==2)${${"GLOBALS"}["ctnfoom"]}="Reseller II Rate Chart is not valid";elseif(${${"GLOBALS"}["trokyjwwt"]}==3)${${"GLOBALS"}["ctnfoom"]}="Reseller III Rate Chart is not valid";else${$jbsnhbjyw}="Reseller IV Rate Chart is not valid";$this->insertFailedCall(${${"GLOBALS"}["ctnfoom"]});$agi->hangup();exit();}}function trunkCallCost($rateID,$calledNumber,$duration){$ticgcn="result";${${"GLOBALS"}["posonsquj"]}="SELECT
voice_rate,
rate_mult,
grace_period,
minimal_time,
resolution,
minute_flex
FROM ratechart
where id_rate = '$rateID' AND LOCATE(prefix,'$calledNumber')=1
AND prefix=(select max(prefix)
from ratechart where id_rate = '$rateID' AND LOCATE(prefix,'$calledNumber')=1) AND voice_rate > 0 AND rate_mult > 0 LIMIT 1";${$ticgcn}=mysql_query(${${"GLOBALS"}["posonsquj"]});if(mysql_num_rows(${${"GLOBALS"}["misprqjwli"]})==1){${"GLOBALS"}["mgnhipms"]="rareMinTime";${"GLOBALS"}["kjjqxuicavf"]="rateGracePeriod";${${"GLOBALS"}["eurldbwywaf"]}=mysql_fetch_row(${${"GLOBALS"}["misprqjwli"]});$clezycrd="rateMuti";${"GLOBALS"}["ekhepgqiw"]="callRate";${${"GLOBALS"}["ekhepgqiw"]}=${${"GLOBALS"}["eurldbwywaf"]}[0];$vktohpjus="rowRateChart";${"GLOBALS"}["vlgkmqjdc"]="rateResolution";${$clezycrd}=${${"GLOBALS"}["eurldbwywaf"]}[1];$jhkoryurmwcq="callRate";$qehovxqax="callRate";${${"GLOBALS"}["kjjqxuicavf"]}=${${"GLOBALS"}["eurldbwywaf"]}[2];$lkdpxt="rateGracePeriod";${${"GLOBALS"}["mgnhipms"]}=${$vktohpjus}[3];${${"GLOBALS"}["vlgkmqjdc"]}=${${"GLOBALS"}["eurldbwywaf"]}[4];${${"GLOBALS"}["siqyiwtpxj"]}=${${"GLOBALS"}["eurldbwywaf"]}[5];$this->trunkCallRate=${$jhkoryurmwcq};$this->trunkCallCost=$this->getCallCostCalcuation(${$qehovxqax},${$lkdpxt},${${"GLOBALS"}["xypxqecsam"]},${${"GLOBALS"}["ylvwavslurex"]},${${"GLOBALS"}["jiqtzecg"]});}else{$this->trunkCallRate=0;$this->trunkCallCost=0;}}function minuteFlexibilityDivider($callDuration,$MF,$MFL){${"GLOBALS"}["gjjankgxb"]="timeDivider";${"GLOBALS"}["yaddqku"]="minuteFlexDuration";${${"GLOBALS"}["yaddqku"]}=(60*${${"GLOBALS"}["lnpvpsuxx"]});if(${${"GLOBALS"}["hqejds"]}>${${"GLOBALS"}["rfrskkqx"]}){$xsvcgantaz="MF";${"GLOBALS"}["ffdwnonly"]="timeDivider";${${"GLOBALS"}["ffdwnonly"]}=${$xsvcgantaz};}else{${${"GLOBALS"}["hmpwmfjdpcr"]}=60;}return${${"GLOBALS"}["gjjankgxb"]};}function rateBlockCallRate($rateChartID,$callDuration,$currentRate,$minuteMultiplier){$tqyumqm="currentRate";${"GLOBALS"}["hkexkms"]="finalCallRate";$polifhid="rateBlockData";$pmyzdswt="rateChartID";${${"GLOBALS"}["hkexkms"]}=${$tqyumqm};${$polifhid}=$this->rateBlockDetails(${$pmyzdswt});if(${${"GLOBALS"}["qwjikubn"]}!=0){$obumdutt="row";${"GLOBALS"}["azlmib"]="rateBlockData";foreach(${${"GLOBALS"}["azlmib"]} as${$obumdutt}){$fkkpvhvmiuoy="endMinute";$jwwyoafz="endMinute";$nxbnyrd="row";${"GLOBALS"}["hwevfkchfvno"]="startMinute";${${"GLOBALS"}["vishxdy"]}=${${"GLOBALS"}["yjkvvteswsy"]}["startMinute"]*${${"GLOBALS"}["qhklyhdq"]};${$fkkpvhvmiuoy}=${$nxbnyrd}["endMinute"]*${${"GLOBALS"}["qhklyhdq"]};if((${${"GLOBALS"}["hqejds"]}>${${"GLOBALS"}["hwevfkchfvno"]})&&(${${"GLOBALS"}["hqejds"]}<=${$jwwyoafz})){${"GLOBALS"}["vyfiqrgsx"]="finalCallRate";$kpawoe="row";${${"GLOBALS"}["vyfiqrgsx"]}=${$kpawoe}["blockRate"];break;}}return${${"GLOBALS"}["skdyhom"]};}else{return${${"GLOBALS"}["skdyhom"]};}}function billCalculation($callDuration,$status,$add_prefix){$tsmywfyevh="channel";$ilixmm="tariff_dec";$dieynon="uniqueid";${"GLOBALS"}["gtocevrinb"]="callStartStr";$biworblzm="clienttype";${$dieynon}=$this->agiUniqueID;${"GLOBALS"}["ytxlaixd"]="fullcontact";${"GLOBALS"}["hjgair"]="login";${"GLOBALS"}["qjknojpbmwo"]="id_client";$tlrcdx="clientCallRate";${${"GLOBALS"}["qjknojpbmwo"]}=$this->clientID;${"GLOBALS"}["bxyqndx"]="callend";${${"GLOBALS"}["hjgair"]}=$this->clientLogin;${"GLOBALS"}["bpozxs"]="ipnumber";${${"GLOBALS"}["wuntnbwkih"]}=$this->srcIP;${"GLOBALS"}["scovpmosrf"]="routetype";$bghtxwob="reseller1ID";$bedvoeb="callEndStr";${"GLOBALS"}["ppwichy"]="reseller4ID";${${"GLOBALS"}["ytxlaixd"]}="";${${"GLOBALS"}["bpozxs"]}=$this->srcIP;${"GLOBALS"}["geydepbuvcr"]="callstart";$wytiuivwvr="callednumber";${$tsmywfyevh}=$this->agiChannel;${${"GLOBALS"}["rjsgnwem"]}=$this->agiCallerID;$tmfgvt="sqlInsert";${$wytiuivwvr}=$this->agidnid;${${"GLOBALS"}["hjkoebhfjp"]}=$this->clientResellerID;$wdoxcsqv="dialPrefix";${${"GLOBALS"}["nzvugnselhf"]}=date("Y-m-d H:i:s");${${"GLOBALS"}["mfmsybk"]}=strtotime(${${"GLOBALS"}["bxyqndx"]});${${"GLOBALS"}["hsxrkiqwxx"]}=${$bedvoeb}-${${"GLOBALS"}["hqejds"]};${${"GLOBALS"}["geydepbuvcr"]}=date("Y-m-d H:i:s",${${"GLOBALS"}["gtocevrinb"]});${${"GLOBALS"}["scovpmosrf"]}=1;${"GLOBALS"}["lahqrsl"]="reseller4ID";${${"GLOBALS"}["inyoapwc"]}=$this->clientRateID;${"GLOBALS"}["mlzjep"]="reseller3ID";${${"GLOBALS"}["gbgtipjygqps"]}=$this->clientBillingPrefix;${$ilixmm}=$this->billingPrefixDescription;${$wdoxcsqv}=$this->dialPrefix;${$biworblzm}=SIP_USER;${${"GLOBALS"}["duokdqsdwkn"]}=$this->idTrunk;${${"GLOBALS"}["dcjkcgd"]}=10;${$bghtxwob}=$this->reseller1ID;${${"GLOBALS"}["kjdfvjiq"]}=$this->clientResellerLevel;${$tlrcdx}=$this->clientCallRate;${${"GLOBALS"}["fhcyngcj"]}=$this->reseller1ID;${${"GLOBALS"}["gpbxjfwfvoy"]}=$this->reseller2ID;${${"GLOBALS"}["mlzjep"]}=$this->reseller3ID;${${"GLOBALS"}["lahqrsl"]}=$this->reseller4ID;if(${${"GLOBALS"}["hqejds"]}>0){${"GLOBALS"}["qjknaflh"]="clientTimeDivider";$toilgrylh="cdrduration";$sbbqutnho="costClient";${"GLOBALS"}["hqbnsf"]="callDuration";$vgoqtce="callrateC";${"GLOBALS"}["rgdqgfhwit"]="callrateC";$ujpebhtnogw="clientTimeDivider";$bkebyfe="clientTimeDivider";${$toilgrylh}=${${"GLOBALS"}["hqejds"]};${${"GLOBALS"}["qjknaflh"]}=$this->minuteFlexibilityDivider(${${"GLOBALS"}["hqejds"]},$this->clientMinuteflexibility,$this->clientMinuteflexibilityLimit);${"GLOBALS"}["tbylruxrakc"]="durationC";${${"GLOBALS"}["tbylruxrakc"]}=floor(60*${${"GLOBALS"}["hqbnsf"]}/${$ujpebhtnogw});${${"GLOBALS"}["rgdqgfhwit"]}=$this->rateBlockCallRate($this->clientRateChartID,${${"GLOBALS"}["hqejds"]},$this->clientCallRate,${$bkebyfe});${$sbbqutnho}=$this->getCallCostCalcuation(${$vgoqtce},$this->clientGracePeriod,$this->clientMinTime,$this->clientResolution,${${"GLOBALS"}["ggxigqytlbv"]});${${"GLOBALS"}["qeubdms"]}=$this->getTotalClientCallCost(${${"GLOBALS"}["ggxigqytlbv"]},${${"GLOBALS"}["jrghbplvbpa"]});${${"GLOBALS"}["hihyebc"]}=${${"GLOBALS"}["qeubdms"]};$this->clientBalanceUpdate($this->clientID,${${"GLOBALS"}["qeubdms"]});if($this->reseller1ID>0){$jmuqrnouj="reseller1TimeDivider";${"GLOBALS"}["wpprxfeut"]="durationR1";$bvhgzyhbg="reseller1TimeDivider";${"GLOBALS"}["hluhnbxdv"]="callDuration";${"GLOBALS"}["fgynbcfokyb"]="callCostR1";$rvofhhgjek="callDuration";${"GLOBALS"}["kvpfopxkv"]="callDuration";${"GLOBALS"}["pwbxmwkgvlc"]="callrateR1";${$bvhgzyhbg}=$this->minuteFlexibilityDivider(${${"GLOBALS"}["kvpfopxkv"]},$this->reseller1Minuteflexibility,$this->reseller1MinuteflexibilityLimit);${${"GLOBALS"}["cfqwkbd"]}=floor(60*${$rvofhhgjek}/${$jmuqrnouj});$krqqxxyheo="callCostR1";${${"GLOBALS"}["pwbxmwkgvlc"]}=$this->rateBlockCallRate($this->reseller1RateChartID,${${"GLOBALS"}["hqejds"]},$this->reseller1CallRate,${${"GLOBALS"}["fdijqepo"]});${$krqqxxyheo}=$this->getCallCostCalcuation(${${"GLOBALS"}["wsvpvjbrk"]},$this->reseller1GracePeriod,$this->reseller1MinTime,$this->reseller1Resolution,${${"GLOBALS"}["wpprxfeut"]});${${"GLOBALS"}["wexjbivyc"]}=$this->totalReseller1CallCharge(${${"GLOBALS"}["hluhnbxdv"]},${${"GLOBALS"}["fgynbcfokyb"]});$this->reseller1BalanceUpdate($this->reseller1ID,${${"GLOBALS"}["wexjbivyc"]});}else{$pgisfa="costR1";${"GLOBALS"}["btqqwu"]="durationR1";${${"GLOBALS"}["btqqwu"]}=0;${${"GLOBALS"}["wsvpvjbrk"]}=0;${$pgisfa}=0;}if($this->reseller2ID>0){$smwwasxr="callDuration";$cmmiqumkwl="reseller2TimeDivider";$vmtoeucae="callDuration";$vrfmfynkvk="callDuration";$ipftdj="reseller2TimeDivider";$mnhlavpff="reseller2TimeDivider";${"GLOBALS"}["bzzbii"]="callDuration";${"GLOBALS"}["wtfwin"]="callrateR2";${"GLOBALS"}["dibbdnf"]="costR2";${$cmmiqumkwl}=$this->minuteFlexibilityDivider(${${"GLOBALS"}["bzzbii"]},$this->reseller2Minuteflexibility,$this->reseller2MinuteflexibilityLimit);$unvkyoe="callCostR2";${${"GLOBALS"}["xfcbfqimycr"]}=floor(60*${$smwwasxr}/${$mnhlavpff});${${"GLOBALS"}["wtfwin"]}=$this->rateBlockCallRate($this->reseller2RateChartID,${$vmtoeucae},$this->reseller2CallRate,${$ipftdj});${$unvkyoe}=$this->getCallCostCalcuation(${${"GLOBALS"}["tctwtehzdxbo"]},$this->reseller2GracePeriod,$this->reseller2MinTime,$this->reseller2Resolution,${${"GLOBALS"}["xfcbfqimycr"]});${${"GLOBALS"}["dibbdnf"]}=$this->totalReseller2CallCharge(${$vrfmfynkvk},${${"GLOBALS"}["zejoftetmnd"]});$this->reseller2BalanceUpdate($this->reseller2ID,${${"GLOBALS"}["uqpngc"]});}else{${"GLOBALS"}["fdhbgobk"]="costR2";${${"GLOBALS"}["xfcbfqimycr"]}=0;${${"GLOBALS"}["tctwtehzdxbo"]}=0;${${"GLOBALS"}["fdhbgobk"]}=0;}$wjekuydx="resultInsertCalls";if($this->reseller3ID>0){${"GLOBALS"}["ojjjtprwu"]="reseller3TimeDivider";$nhlssl="callDuration";${"GLOBALS"}["ymihxrcy"]="costR3";${"GLOBALS"}["ynedshdt"]="durationR3";${"GLOBALS"}["abpmqekn"]="callrateR3";${"GLOBALS"}["udhijlvj"]="reseller3TimeDivider";${"GLOBALS"}["bmfepprvr"]="callDuration";$zkkrbc="durationR3";${${"GLOBALS"}["ojjjtprwu"]}=$this->minuteFlexibilityDivider(${${"GLOBALS"}["hqejds"]},$this->reseller3Minuteflexibility,$this->reseller3MinuteflexibilityLimit);$bkhdbox="callCostR3";$sbgglqwdiyg="callCostR3";${${"GLOBALS"}["ynedshdt"]}=floor(60*${${"GLOBALS"}["bmfepprvr"]}/${${"GLOBALS"}["dpxwqyej"]});${${"GLOBALS"}["abpmqekn"]}=$this->rateBlockCallRate($this->reseller3RateChartID,${$nhlssl},$this->reseller3CallRate,${${"GLOBALS"}["udhijlvj"]});${$bkhdbox}=$this->getCallCostCalcuation(${${"GLOBALS"}["wmanrccsq"]},$this->reseller3GracePeriod,$this->reseller3MinTime,$this->reseller3Resolution,${$zkkrbc});${"GLOBALS"}["rjbrgvz"]="callDuration";${${"GLOBALS"}["emswgw"]}=$this->totalReseller3CallCharge(${${"GLOBALS"}["rjbrgvz"]},${$sbgglqwdiyg});$this->reseller3BalanceUpdate($this->reseller3ID,${${"GLOBALS"}["ymihxrcy"]});}else{$lcnjxll="durationR3";${$lcnjxll}=0;${${"GLOBALS"}["wmanrccsq"]}=0;${${"GLOBALS"}["emswgw"]}=0;}if($this->reseller4ID>0){${"GLOBALS"}["petclytg"]="callDuration";${"GLOBALS"}["fajmburo"]="reseller4TimeDivider";${"GLOBALS"}["iytnnhqxsr"]="callDuration";${"GLOBALS"}["nwlloh"]="callDuration";$xaeeqewuekq="durationR4";${"GLOBALS"}["ffpbexw"]="callCostR4";${"GLOBALS"}["hogcafssyzc"]="reseller4TimeDivider";${"GLOBALS"}["jhdrgxjribo"]="callDuration";${${"GLOBALS"}["hogcafssyzc"]}=$this->minuteFlexibilityDivider(${${"GLOBALS"}["petclytg"]},$this->reseller4Minuteflexibility,$this->reseller4MinuteflexibilityLimit);${"GLOBALS"}["rmujewqygoi"]="callrateR4";${$xaeeqewuekq}=floor(60*${${"GLOBALS"}["iytnnhqxsr"]}/${${"GLOBALS"}["fajmburo"]});${${"GLOBALS"}["rmujewqygoi"]}=$this->rateBlockCallRate($this->reseller4RateChartID,${${"GLOBALS"}["jhdrgxjribo"]},$this->reseller4CallRate,${${"GLOBALS"}["gcfpigrt"]});${${"GLOBALS"}["ffpbexw"]}=$this->getCallCostCalcuation(${${"GLOBALS"}["emetslyjh"]},$this->reseller4GracePeriod,$this->reseller4MinTime,$this->reseller4Resolution,${${"GLOBALS"}["vveclwb"]});${${"GLOBALS"}["amrydpw"]}=$this->totalReseller4CallCharge(${${"GLOBALS"}["nwlloh"]},${${"GLOBALS"}["uipbfvprjc"]});$this->reseller4BalanceUpdate($this->reseller4ID,${${"GLOBALS"}["amrydpw"]});}else{$csqhuop="callrateR4";$cgmevdzb="durationR4";${$cgmevdzb}=0;${$csqhuop}=0;${"GLOBALS"}["mqkskhp"]="costR4";${${"GLOBALS"}["mqkskhp"]}=0;}if($this->terminationRateID>0){${"GLOBALS"}["gaabsagwr"]="callednumber";$this->trunkCallCost($this->terminationRateID,${${"GLOBALS"}["gaabsagwr"]},${${"GLOBALS"}["hqejds"]});${"GLOBALS"}["sziojhbjepz"]="terminationCost";${${"GLOBALS"}["uxqlaveu"]}=$this->trunkCallRate;${${"GLOBALS"}["sziojhbjepz"]}=$this->trunkCallCost;}else{$zvigukimdlyn="terminationRate";$elehveprbbyd="terminationCost";${$zvigukimdlyn}=0;${$elehveprbbyd}=0;}${${"GLOBALS"}["gwkwyg"]}="INSERT INTO retail_successcalls (id_call, callerid, dial_number, callstart, prefix, description, id_client, reseller1_id,
reseller2_id, reseller3_id, reseller4_id, duration, duration_c, duration_r1, duration_r2, duration_r3, duration_r4,
callrate_c, callrate_r1, callrate_r2, callrate_r3, callrate_r4, cost_c, cost_r1, cost_r2, cost_r3, cost_r4, id_trunk,
trunk_rate, trunk_cost)
VALUES ('$uniqueid', '$callerid', '$callednumber', '$callstart', '$tariff_prefix', '$tariff_dec', '$id_client', '$reseller1ID',
'$reseller2ID', '$reseller3ID', '$reseller4ID', '$cdrduration', '$durationC', '$durationR1', '$durationR2', '$durationR3',
'$durationR4', '$callrateC', '$callrateR1', '$callrateR2', '$callrateR3', '$callrateR4', '$costC', '$costR1', '$costR2', '$costR3',
'$costR4', '$id_trunk', '$terminationRate', '$terminationCost')";${$wjekuydx}=mysql_query(${${"GLOBALS"}["gwkwyg"]});}else{$exkqwjgkm="costR4";$ldnembw="costR3";${"GLOBALS"}["uijsxqkltq"]="terminationRate";${"GLOBALS"}["ahfhsbq"]="terminationCost";${${"GLOBALS"}["crhxoiabk"]}=0;${${"GLOBALS"}["hihyebc"]}=0;${"GLOBALS"}["yvrijii"]="costR2";${${"GLOBALS"}["wexjbivyc"]}=0;${${"GLOBALS"}["yvrijii"]}=0;${$ldnembw}=0;${$exkqwjgkm}=0;${${"GLOBALS"}["uijsxqkltq"]}=0;${${"GLOBALS"}["ahfhsbq"]}=0;}${${"GLOBALS"}["lcqlrw"]}=1;if(${${"GLOBALS"}["ppwichy"]}>0){${"GLOBALS"}["dwsaygyur"]="costR4";${${"GLOBALS"}["ueaxpwx"]}=${${"GLOBALS"}["lgklrqepmcs"]};${"GLOBALS"}["bgkoemtnbmf"]="orgCost";${"GLOBALS"}["gslonurjngxt"]="parentResellerLevel";${${"GLOBALS"}["gslonurjngxt"]}=4;${${"GLOBALS"}["bgkoemtnbmf"]}=${${"GLOBALS"}["dwsaygyur"]};}else{if(${${"GLOBALS"}["yjpzfsvcle"]}>0){$qtlhkyd="reseller3ID";$whlpnucbseb="costR3";${${"GLOBALS"}["ueaxpwx"]}=${$qtlhkyd};${"GLOBALS"}["ccgbirnezn"]="orgCost";${${"GLOBALS"}["ygrkxkvepu"]}=3;${${"GLOBALS"}["ccgbirnezn"]}=${$whlpnucbseb};}else{if(${${"GLOBALS"}["gpbxjfwfvoy"]}>0){${"GLOBALS"}["wuwukbnhim"]="reseller2ID";${${"GLOBALS"}["ueaxpwx"]}=${${"GLOBALS"}["wuwukbnhim"]};${${"GLOBALS"}["ygrkxkvepu"]}=2;${${"GLOBALS"}["ooiujlxecqn"]}=${${"GLOBALS"}["uqpngc"]};}else{${"GLOBALS"}["dyoynfdv"]="reseller1ID";if(${${"GLOBALS"}["dyoynfdv"]}>0){$epsvbwakrg="reseller1ID";$gujiltldp="costR1";${${"GLOBALS"}["ueaxpwx"]}=${$epsvbwakrg};${${"GLOBALS"}["ygrkxkvepu"]}=1;${${"GLOBALS"}["ooiujlxecqn"]}=${$gujiltldp};}else{$welxxkrd="costC";$leobtlffq="orgCost";${${"GLOBALS"}["ueaxpwx"]}=-1;${${"GLOBALS"}["ygrkxkvepu"]}=-1;${$leobtlffq}=${$welxxkrd};}}}}${$tmfgvt}="INSERT INTO success_calls (call_id, channel, call_type, id_client, login, srcip, callerid, dial_number, pdd, callstart, callend, duration, id_tariff, call_rate,
tariff_prefix, tariff_dec, cost_client, cost_r1, cost_r2, cost_r3, cost_r4, reseller1_id, reseller2_id, reseller3_id, reseller4_id, parent_reseler, parent_level, parent_cost,
id_reseller, reseller_level, id_trunk, dialing_prefix,add_prefix, trunk_rate, trunk_cost, fullcontact, call_status)
VALUES ('$uniqueid', '$channel', '$callType', '$id_client', '$login', '$srcIP', '$callerid', '$callednumber', '$pdd', '$callstart', '$callend', '$callDuration', '$id_tariff',
'$callrateC', '$tariff_prefix', '$tariff_dec', '$costC', '$costR1', '$costR2', '$costR3', '$costR4', '$reseller1ID', '$reseller2ID', '$reseller3ID', '$reseller4ID',
'$parentResellerID', '$parentResellerLevel', '$orgCost', '$idReselller', '$resellerLevel', '$id_trunk', '$dialPrefix','$add_prefix', '$terminationRate', '$terminationCost', '$fullcontact', '$status')";${${"GLOBALS"}["itinerrpynz"]}=mysql_query(${${"GLOBALS"}["neznnvngzm"]});}function getTotalClientCallCost($duration,$callCost){$cglglprkc="clientConnectionFee";$doyykxp="clientDisConnectionFee";${$cglglprkc}=0;$xysswko="clientTaxFee";${$doyykxp}=0;${$xysswko}=0;if($this->clientrConnectionFee>0){$this->clientConnectionFee=$this->clientrConnectionFee;}if($this->clientrConnectionThresholdValue>0){$this->clientConnectionThresholdValue=$this->clientrConnectionThresholdValue;}if($this->clientrDisConnectionFee>0){$this->clientDisConnectionFee=$this->clientrDisConnectionFee;}if($this->clientrDisConnectionThresholdValue>0){$this->clientDisConnectionThresholdValue=$this->clientrDisConnectionThresholdValue;}if($this->clientrTaxFee>0){$this->clientTaxFee=$this->clientrTaxFee;}if(($this->clientConnectionFee>0)AND($this->clientConnectionThresholdValue>0)){$fifosai="duration";if(${$fifosai}>$this->clientConnectionThresholdValue)${${"GLOBALS"}["jciioci"]}=$this->clientConnectionFee;else${${"GLOBALS"}["jciioci"]}=0;}else{$oaykbtdpex="clientConnectionFee";${$oaykbtdpex}=0;}${"GLOBALS"}["ldgoaxricc"]="callCost";if(($this->clientDisConnectionFee>0)AND($this->clientDisConnectionThresholdValue>0)){$vhyjafn="duration";${"GLOBALS"}["pppoldnltv"]="clientDisConnectionFee";if(${$vhyjafn}>$this->clientDisConnectionThresholdValue)${${"GLOBALS"}["ygcjltrfff"]}=$this->clientDisConnectionFee;else${${"GLOBALS"}["pppoldnltv"]}=0;}else{$hesxhv="clientDisConnectionFee";${$hesxhv}=0;}if(($this->clientTaxFee>0)AND(${${"GLOBALS"}["kdulqnoh"]}>0)){${${"GLOBALS"}["ovyujpmxoeem"]}=number_format(($this->clientTaxFee*${${"GLOBALS"}["kdulqnoh"]})/100,6,".","");}${${"GLOBALS"}["dcpzaunhvxo"]}=${${"GLOBALS"}["jciioci"]}+${${"GLOBALS"}["ygcjltrfff"]}+${${"GLOBALS"}["ovyujpmxoeem"]}+${${"GLOBALS"}["ldgoaxricc"]};return${${"GLOBALS"}["dcpzaunhvxo"]};}function totalReseller1CallCharge($duration,$callCost){$ccnvcsfbwb="reseller1ConnectionFee";${${"GLOBALS"}["ubppaphsy"]}=0;$qhbafk="reseller1DisConnectionFee";${${"GLOBALS"}["xyptiswudj"]}=0;${${"GLOBALS"}["tqstmmnkvcal"]}=0;if($this->reseller1rConnectionFee>0){$this->reseller1ConnectionFee=$this->reseller1rConnectionFee;}if($this->reseller1rConnectionThresholdValue>0){$this->reseller1ConnectionThresholdValue=$this->reseller1rConnectionThresholdValue;}${"GLOBALS"}["mvnqnfqg"]="callCost";$wczbwnqinyxb="reseller1TaxFee";${"GLOBALS"}["chpkqjwec"]="totalCallCost";if($this->reseller1rDisConnectionFee>0){$this->reseller1DisConnectionFee=$this->reseller1rDisConnectionFee;}if($this->reseller1rDisConnectionThresholdValue>0){$this->reseller1DisConnectionThresholdValue=$this->reseller1rDisConnectionThresholdValue;}if($this->reseller1rTaxFee>0){$this->reseller1TaxFee=$this->reseller1rTaxFee;}if(($this->reseller1ConnectionFee>0)AND($this->reseller1ConnectionThresholdValue>0)){$bknrqmbm="reseller1ConnectionFee";$scfvfbpoqkws="reseller1ConnectionFee";if(${${"GLOBALS"}["jiqtzecg"]}>$this->reseller1ConnectionThresholdValue)${$scfvfbpoqkws}=$this->reseller1ConnectionFee;else${$bknrqmbm}=0;}else{${${"GLOBALS"}["ubppaphsy"]}=0;}$prqxuya="totalCallCost";if(($this->reseller1DisConnectionFee>0)AND($this->reseller1DisConnectionThresholdValue>0)){${"GLOBALS"}["dghpbsgedtp"]="duration";if(${${"GLOBALS"}["dghpbsgedtp"]}>$this->reseller1DisConnectionThresholdValue)${${"GLOBALS"}["xyptiswudj"]}=$this->reseller1DisConnectionFee;else${${"GLOBALS"}["xyptiswudj"]}=0;}else{$kjsontbic="reseller1DisConnectionFee";${$kjsontbic}=0;}if(($this->reseller1TaxFee>0)AND(${${"GLOBALS"}["kdulqnoh"]}>0)){${${"GLOBALS"}["tqstmmnkvcal"]}=number_format(($this->reseller1TaxFee*${${"GLOBALS"}["kdulqnoh"]})/100,6,".","");}${${"GLOBALS"}["chpkqjwec"]}=${$ccnvcsfbwb}+${$qhbafk}+${$wczbwnqinyxb}+${${"GLOBALS"}["mvnqnfqg"]};return${$prqxuya};}function totalReseller2CallCharge($duration,$callCost){${${"GLOBALS"}["phcnkdlltlp"]}=0;${${"GLOBALS"}["cxrplbntbwh"]}=0;${${"GLOBALS"}["wwdwsvdlmxxe"]}=0;if($this->reseller2rConnectionFee>0){$this->reseller2ConnectionFee=$this->reseller2rConnectionFee;}if($this->reseller2rConnectionThresholdValue>0){$this->reseller2ConnectionThresholdValue=$this->reseller2rConnectionThresholdValue;}if($this->reseller2rDisConnectionFee>0){$this->reseller2DisConnectionFee=$this->reseller2rDisConnectionFee;}$xmanubq="callCost";if($this->reseller2rDisConnectionThresholdValue>0){$this->reseller2DisConnectionThresholdValue=$this->reseller2rDisConnectionThresholdValue;}${"GLOBALS"}["yjiicisnn"]="reseller2DisConnectionFee";if($this->reseller2rTaxFee>0){$this->reseller2TaxFee=$this->reseller2rTaxFee;}if(($this->reseller2ConnectionFee>0)AND($this->reseller2ConnectionThresholdValue>0)){${"GLOBALS"}["obujwcjwa"]="duration";if(${${"GLOBALS"}["obujwcjwa"]}>$this->reseller2ConnectionThresholdValue)${${"GLOBALS"}["phcnkdlltlp"]}=$this->reseller2ConnectionFee;else${${"GLOBALS"}["phcnkdlltlp"]}=0;}else{${"GLOBALS"}["maiegbl"]="reseller2ConnectionFee";${${"GLOBALS"}["maiegbl"]}=0;}$zsylzblwto="reseller2TaxFee";if(($this->reseller2DisConnectionFee>0)AND($this->reseller2DisConnectionThresholdValue>0)){${"GLOBALS"}["rvciqop"]="reseller2DisConnectionFee";$jiplswyu="duration";$anuvdhu="reseller2DisConnectionFee";if(${$jiplswyu}>$this->reseller2DisConnectionThresholdValue)${${"GLOBALS"}["rvciqop"]}=$this->reseller2DisConnectionFee;else${$anuvdhu}=0;}else{${${"GLOBALS"}["cxrplbntbwh"]}=0;}if(($this->reseller2TaxFee>0)AND(${$xmanubq}>0)){$amiyypch="reseller2TaxFee";${$amiyypch}=number_format(($this->reseller2TaxFee*${${"GLOBALS"}["kdulqnoh"]})/100,6,".","");}${${"GLOBALS"}["dcpzaunhvxo"]}=${${"GLOBALS"}["phcnkdlltlp"]}+${${"GLOBALS"}["yjiicisnn"]}+${$zsylzblwto}+${${"GLOBALS"}["kdulqnoh"]};return${${"GLOBALS"}["dcpzaunhvxo"]};}function totalReseller3CallCharge($duration,$callCost){$bnhipnkgcflo="reseller3ConnectionFee";${$bnhipnkgcflo}=0;${${"GLOBALS"}["kfgrbhvbcc"]}=0;$bydbxrstfr="reseller3TaxFee";${"GLOBALS"}["ziwgowfhi"]="callCost";${${"GLOBALS"}["hdznxbzbg"]}=0;$hcxdsnngbbn="reseller3ConnectionFee";if($this->reseller3rConnectionFee>0){$this->reseller3ConnectionFee=$this->reseller3rConnectionFee;}if($this->reseller3rConnectionThresholdValue>0){$this->reseller3ConnectionThresholdValue=$this->reseller3rConnectionThresholdValue;}if($this->reseller3rDisConnectionFee>0){$this->reseller3DisConnectionFee=$this->reseller3rDisConnectionFee;}if($this->reseller3rDisConnectionThresholdValue>0){$this->reseller3DisConnectionThresholdValue=$this->reseller3rDisConnectionThresholdValue;}if($this->reseller3rTaxFee>0){$this->reseller3TaxFee=$this->reseller3rTaxFee;}if(($this->reseller3ConnectionFee>0)AND($this->reseller3ConnectionThresholdValue>0)){$tpwcczpxpvn="reseller3ConnectionFee";${"GLOBALS"}["wlwuxalfz"]="reseller3ConnectionFee";${"GLOBALS"}["yrocjn"]="duration";if(${${"GLOBALS"}["yrocjn"]}>$this->reseller3ConnectionThresholdValue)${$tpwcczpxpvn}=$this->reseller3ConnectionFee;else${${"GLOBALS"}["wlwuxalfz"]}=0;}else{${${"GLOBALS"}["wgikxkmdxl"]}=0;}$qyyhkvfkl="callCost";if(($this->reseller3DisConnectionFee>0)AND($this->reseller3DisConnectionThresholdValue>0)){$dktctliugue="reseller3DisConnectionFee";if(${${"GLOBALS"}["jiqtzecg"]}>$this->reseller3DisConnectionThresholdValue)${$dktctliugue}=$this->reseller3DisConnectionFee;else${${"GLOBALS"}["kfgrbhvbcc"]}=0;}else{${${"GLOBALS"}["kfgrbhvbcc"]}=0;}if(($this->reseller3TaxFee>0)AND(${${"GLOBALS"}["ziwgowfhi"]}>0)){$rlsookcu="reseller3TaxFee";${$rlsookcu}=number_format(($this->reseller3TaxFee*${${"GLOBALS"}["kdulqnoh"]})/100,6,".","");}${${"GLOBALS"}["dcpzaunhvxo"]}=${$hcxdsnngbbn}+${${"GLOBALS"}["kfgrbhvbcc"]}+${$bydbxrstfr}+${$qyyhkvfkl};return${${"GLOBALS"}["dcpzaunhvxo"]};}function totalReseller4CallCharge($duration,$callCost){${"GLOBALS"}["saofbcb"]="reseller4ConnectionFee";${${"GLOBALS"}["saofbcb"]}=0;${${"GLOBALS"}["lerxpmuedr"]}=0;${${"GLOBALS"}["xchicdz"]}=0;if($this->reseller4rConnectionFee>0){$this->reseller4ConnectionFee=$this->reseller4rConnectionFee;}if($this->reseller4rConnectionThresholdValue>0){$this->reseller4ConnectionThresholdValue=$this->reseller4rConnectionThresholdValue;}if($this->reseller4rDisConnectionFee>0){$this->reseller4DisConnectionFee=$this->reseller4rDisConnectionFee;}if($this->reseller4rDisConnectionThresholdValue>0){$this->reseller4DisConnectionThresholdValue=$this->reseller4rDisConnectionThresholdValue;}${"GLOBALS"}["gnqfqobgo"]="callCost";if($this->reseller4rTaxFee>0){$this->reseller4TaxFee=$this->reseller4rTaxFee;}${"GLOBALS"}["vwkxekdjx"]="reseller4ConnectionFee";if(($this->reseller4ConnectionFee>0)AND($this->reseller4ConnectionThresholdValue>0)){${"GLOBALS"}["nnrzetrg"]="reseller4ConnectionFee";if(${${"GLOBALS"}["jiqtzecg"]}>$this->reseller4ConnectionThresholdValue)${${"GLOBALS"}["dqxnps"]}=$this->reseller4ConnectionFee;else${${"GLOBALS"}["nnrzetrg"]}=0;}else{$jxbupjdrhv="reseller4ConnectionFee";${$jxbupjdrhv}=0;}${"GLOBALS"}["pytoqy"]="callCost";${"GLOBALS"}["vqeycipq"]="reseller4DisConnectionFee";if(($this->reseller4DisConnectionFee>0)AND($this->reseller4DisConnectionThresholdValue>0)){$vytznsdhiy="reseller4DisConnectionFee";if(${${"GLOBALS"}["jiqtzecg"]}>$this->reseller4DisConnectionThresholdValue)${$vytznsdhiy}=$this->reseller4DisConnectionFee;else${${"GLOBALS"}["lerxpmuedr"]}=0;}else{${${"GLOBALS"}["lerxpmuedr"]}=0;}if(($this->reseller4TaxFee>0)AND(${${"GLOBALS"}["gnqfqobgo"]}>0)){${"GLOBALS"}["adxckbn"]="reseller4TaxFee";${${"GLOBALS"}["adxckbn"]}=number_format(($this->reseller4TaxFee*${${"GLOBALS"}["kdulqnoh"]})/100,6,".","");}${${"GLOBALS"}["dcpzaunhvxo"]}=${${"GLOBALS"}["vwkxekdjx"]}+${${"GLOBALS"}["vqeycipq"]}+${${"GLOBALS"}["xchicdz"]}+${${"GLOBALS"}["pytoqy"]};return${${"GLOBALS"}["dcpzaunhvxo"]};}function getCallCostCalcuation($voice_rate=0,$grace_period=0,$minimum_time=0,$resolution=0,$duration=0){${"GLOBALS"}["utxcqmxmkkmh"]="duration";if(${${"GLOBALS"}["utxcqmxmkkmh"]}>0){$ylamymyxenc="grace_period";$icpvhrzt="customerBillCost";$xvmuhmx="duration";$cjlukv="minimum_time";$phsftyusvoi="duration";${$icpvhrzt}=0;${"GLOBALS"}["cwbfqumpbu"]="duration";${"GLOBALS"}["yhlwxk"]="minimum_time";$sibrnloloybl="resolution";${"GLOBALS"}["yinopqtgcjn"]="customerBillCost";if(${${"GLOBALS"}["cjkwdhvnvjq"]}==0)${${"GLOBALS"}["cjkwdhvnvjq"]}=60;if(${${"GLOBALS"}["hfzkwjmx"]}==0)${$cjlukv}=${$sibrnloloybl};if(${$xvmuhmx}<${$ylamymyxenc}){${${"GLOBALS"}["aelmihuaklq"]}=0;}elseif(${${"GLOBALS"}["cwbfqumpbu"]}<${${"GLOBALS"}["yhlwxk"]}){${"GLOBALS"}["vchgtvfaga"]="customerBillCost";${"GLOBALS"}["xyqhctiz"]="preSecondBill";${${"GLOBALS"}["dcsreweeiz"]}=${${"GLOBALS"}["edfeisvp"]}/60;${${"GLOBALS"}["vchgtvfaga"]}=${${"GLOBALS"}["xyqhctiz"]}*${${"GLOBALS"}["hfzkwjmx"]};}elseif(${$phsftyusvoi}>=${${"GLOBALS"}["hfzkwjmx"]}){$tgrhgu="totalBillingCycle";${"GLOBALS"}["wsisausq"]="totalBillingCycle";$rqeemjsvl="resolution";${"GLOBALS"}["ekpissiv"]="perCycleBill";${"GLOBALS"}["nvpkriml"]="duration";${${"GLOBALS"}["uucssysjbbx"]}=(${${"GLOBALS"}["edfeisvp"]}/60)*${$rqeemjsvl};${$tgrhgu}=ceil(${${"GLOBALS"}["nvpkriml"]}/${${"GLOBALS"}["cjkwdhvnvjq"]});${${"GLOBALS"}["aelmihuaklq"]}=${${"GLOBALS"}["ekpissiv"]}*${${"GLOBALS"}["wsisausq"]};}return round(${${"GLOBALS"}["yinopqtgcjn"]},5);}else{return 0;}}function clientBalanceUpdate($id,$cost){$ueocmgj="result";${${"GLOBALS"}["zitvvrl"]}="UPDATE clientssip set balance = balance - '$cost' where id = '$id'";${$ueocmgj}=mysql_query(${${"GLOBALS"}["zitvvrl"]});}function reseller1BalanceUpdate($id,$cost){${"GLOBALS"}["bgqdcobtq"]="sql";${"GLOBALS"}["eyqlpxxlbtq"]="sql";${${"GLOBALS"}["bgqdcobtq"]}="UPDATE resellers1 set balance = balance - '$cost' where id = '$id'";${${"GLOBALS"}["misprqjwli"]}=mysql_query(${${"GLOBALS"}["eyqlpxxlbtq"]});}function reseller2BalanceUpdate($id,$cost){$lccjvyfuh="sql";${${"GLOBALS"}["zitvvrl"]}="UPDATE resellers2 set balance = balance - '$cost' where id = '$id'";${${"GLOBALS"}["misprqjwli"]}=mysql_query(${$lccjvyfuh});}function reseller3BalanceUpdate($id,$cost){$uhikwinxxu="sql";${$uhikwinxxu}="UPDATE resellers3 set balance = balance - '$cost' where id = '$id'";${${"GLOBALS"}["misprqjwli"]}=mysql_query(${${"GLOBALS"}["zitvvrl"]});}function reseller4BalanceUpdate($id,$cost){${"GLOBALS"}["rllixxju"]="sql";$xcdslwxpq="sql";${${"GLOBALS"}["rllixxju"]}="UPDATE resellers4 set balance = balance - '$cost' where id = '$id'";${${"GLOBALS"}["misprqjwli"]}=mysql_query(${$xcdslwxpq});}function p2pCallSetting($agi){$this->checkP2PRateChart($this->clientRateID,$this->agidnid);$this->clientBillingPrefix=$this->tempBillingPrefix;$this->clientVoiceRate=$this->tempVoiceRate;$this->clientRateMulti=$this->tempRateMulti;$this->clientGracePeriod=$this->tempGracePeriod;$this->clientMinTime=$this->tempMinTime;$this->clientResolution=$this->tempResolution;$this->clientMinuteflexibility=$this->tempMinuteFlexibility;$this->clientMinuteflexibilityLimit=$this->tempMinuteFlexibilityLimit;$this->clientRateChartID=$this->tempRateChartID;$this->clientCallRate=$this->clientVoiceRate*$this->clientRateMulti;if($this->clientResellerLevel==1){$this->reseller1ID=$this->clientResellerID;$this->reseller2ID=-1;$this->reseller3ID=-1;$this->reseller4ID=-1;}elseif($this->clientResellerLevel==2){$this->reseller1ID=-1;$this->reseller2ID=$this->clientResellerID;$this->reseller3ID=-1;$this->reseller4ID=-1;}elseif($this->clientResellerLevel==3){$this->reseller1ID=-1;$this->reseller2ID=-1;$this->reseller3ID=$this->clientResellerID;$this->reseller4ID=-1;}elseif($this->clientResellerLevel==4){$this->reseller1ID=-1;$this->reseller2ID=-1;$this->reseller3ID=-1;$this->reseller4ID=$this->clientResellerID;}else{$this->reseller1ID=-1;$this->reseller2ID=-1;$this->reseller3ID=-1;$this->reseller4ID=-1;}$this->p2pMaxCallDuration();$this->p2pDialPlan(${${"GLOBALS"}["hrtbrmki"]});}function p2pDialPlan($agi){${"GLOBALS"}["qhkhbsbpku"]="callDuration";${"GLOBALS"}["jxmncgquw"]="destination";$tsfgliwqpkew="dialresult";${"GLOBALS"}["asfciziwked"]="dialparams";$nzdiggbhm="firstDigitCalledNumber";${"GLOBALS"}["efztelntszm"]="max_long";${"GLOBALS"}["pqkbnrl"]="description";${"GLOBALS"}["nuorksq"]="destination";$qrnllqk="agi";${${"GLOBALS"}["efztelntszm"]}=2147483647;$itaakxsvdt="callerID";${"GLOBALS"}["hzqddzohkti"]="dialstatus";${"GLOBALS"}["llvmkjin"]="targetUser";$yqzqpqg="callerID";${${"GLOBALS"}["nuorksq"]}=$this->agidnid;${$nzdiggbhm}=substr(${${"GLOBALS"}["jxmncgquw"]},0,1);${${"GLOBALS"}["qurtlxqwhzqr"]}=$this->clinetMaxCallDuration;${${"GLOBALS"}["yywguh"]}=${${"GLOBALS"}["qurtlxqwhzqr"]};$agi->set_autohangup(${${"GLOBALS"}["yywguh"]});${${"GLOBALS"}["asfciziwked"]}=",30|HS($timeOut)";${$itaakxsvdt}=$this->callerIDName."<".$this->agiAccountCode.">";$agi->set_callerid(${$yqzqpqg});if(${${"GLOBALS"}["qurtlxqwhzqr"]}<$this->clientMinTime){${"GLOBALS"}["dqydqrxtsu"]="description";${${"GLOBALS"}["dqydqrxtsu"]}="Dial Plan No money to make this call";$this->insertFailedCall(${${"GLOBALS"}["ctnfoom"]});$agi->hangup();exit();}${${"GLOBALS"}["sfvsdxmxud"]}=substr($this->agiExtension,3);${${"GLOBALS"}["zqbxlvbdiko"]}="SIP/".${${"GLOBALS"}["llvmkjin"]}.${${"GLOBALS"}["fycgdoif"]};$this->deleteP2PActiveCall();$this->insertP2PActiveCall();${$tsfgliwqpkew}=$this->run_dial(${$qrnllqk},${${"GLOBALS"}["zqbxlvbdiko"]});${${"GLOBALS"}["csjbagowpdfh"]}=$agi->get_variable("ANSWEREDTIME");$lqtseyplowm="callDuration";$this->real_answeredtime=$this->answeredtime=${${"GLOBALS"}["csjbagowpdfh"]}["data"];${${"GLOBALS"}["naygvgxj"]}=$agi->get_variable("DIALSTATUS");$this->dialstatus=${${"GLOBALS"}["hzqddzohkti"]}["data"];switch($this->dialstatus){case"ANSWER":${${"GLOBALS"}["hqejds"]}=$this->answeredtime;$this->billCalculationP2P(${${"GLOBALS"}["hqejds"]},$this->dialstatus);$this->deleteP2PActiveCall();break;case"BUSY":case"CANCEL":$this->answeredtime=0;${$lqtseyplowm}=$this->answeredtime;$this->billCalculationP2P(${${"GLOBALS"}["qhkhbsbpku"]},$this->dialstatus);$this->deleteP2PActiveCall();break;case"NOANSWER":case"CHANUNAVAIL":case"CONGESTION":$this->answeredtime=0;${${"GLOBALS"}["hqejds"]}=$this->answeredtime;$this->billCalculationP2P(${${"GLOBALS"}["hqejds"]},$this->dialstatus);$this->deleteP2PActiveCall();break;default:$this->deleteP2PActiveCall();${${"GLOBALS"}["ctnfoom"]}="Dial Plan not define";$this->insertFailedCall(${${"GLOBALS"}["pqkbnrl"]});$agi->hangup();break;}}function billCalculationP2P($callDuration,$status){$pjknqlw="sqlInsert";${"GLOBALS"}["wiejjlsx"]="callStartStr";${"GLOBALS"}["xoomndotu"]="callDuration";${"GLOBALS"}["ojuxbpnxrx"]="callend";${${"GLOBALS"}["eoqebnvhgt"]}=$this->agiUniqueID;${${"GLOBALS"}["dfccmlvp"]}=$this->agiChannel;$gpkueztfv="sqlInsert";$ecbvid="callDuration";${${"GLOBALS"}["pvqhjkdpki"]}=$this->agiAccountCode;${${"GLOBALS"}["zkwemnrfn"]}=$this->agidnid;${${"GLOBALS"}["nzvugnselhf"]}=date("Y-m-d H:i:s");${${"GLOBALS"}["mfmsybk"]}=strtotime(${${"GLOBALS"}["ojuxbpnxrx"]});${${"GLOBALS"}["hsxrkiqwxx"]}=${${"GLOBALS"}["mfmsybk"]}-${${"GLOBALS"}["xoomndotu"]};${${"GLOBALS"}["lyfmbtc"]}=date("Y-m-d H:i:s",${${"GLOBALS"}["wiejjlsx"]});${"GLOBALS"}["oevcpxl"]="resultInsert";${${"GLOBALS"}["tocewd"]}=$this->clientCallRate;${${"GLOBALS"}["sjxkuswvv"]}=$this->clientResellerID;${${"GLOBALS"}["kjdfvjiq"]}=$this->clientResellerLevel;if(${$ecbvid}>0){${"GLOBALS"}["igmrpkrtxwm"]="clientCallRate";${"GLOBALS"}["nbjfpwp"]="costClient";${"GLOBALS"}["pyobgvqrmn"]="callDuration";${${"GLOBALS"}["nbjfpwp"]}=$this->billCalculationP2P(${${"GLOBALS"}["igmrpkrtxwm"]},$this->clientGracePeriod,$this->clientMinTime,$this->clientResolution,${${"GLOBALS"}["hqejds"]},$this->clientMinuteflexibility);${${"GLOBALS"}["qeubdms"]}=$this->totalClientCallCharge(${${"GLOBALS"}["pyobgvqrmn"]},${${"GLOBALS"}["jrghbplvbpa"]});$this->clientBalanceUpdate($this->clientID,${${"GLOBALS"}["qeubdms"]});}else${${"GLOBALS"}["qeubdms"]}=0;${$gpkueztfv}="INSERT INTO success_calls_p2p (call_id, channel, caller_id, called_id, callstart, callend, duration, call_rate, reseller_id, reseller_level, call_cost, call_status)
VALUES ('$uniqueid', '$channel', '$accountcode', '$callednumber', '$callstart', '$callend', '$callDuration', '$clientCallRate', '$resellerID', '$resellerLevel', '$clientCallCharge', '$status')";${${"GLOBALS"}["oevcpxl"]}=mysql_query(${$pjknqlw});return mysql_insert_id();}function insertP2PActiveCall(){${"GLOBALS"}["gkniinphlyf"]="idClient";${"GLOBALS"}["jobhfkmlofvc"]="resellerLevel";${${"GLOBALS"}["qmctsagfolh"]}=$this->agiUniqueID;${"GLOBALS"}["btohbsy"]="accountcode";$pbtltbe="resellerID";${${"GLOBALS"}["dfccmlvp"]}=$this->agiChannel;$gmkgzxbxtb="result";${${"GLOBALS"}["gkniinphlyf"]}=$this->clientID;${${"GLOBALS"}["btohbsy"]}=$this->agiAccountCode;${${"GLOBALS"}["zkwemnrfn"]}=$this->agidnid;${$pbtltbe}=$this->clientResellerID;${${"GLOBALS"}["jobhfkmlofvc"]}=$this->clientResellerLevel;${${"GLOBALS"}["uhcifqog"]}=date("Y-m-d H:i:s");$fqemnh="INSERT_ACTIVE_CALL_QUERY";${${"GLOBALS"}["jhcltkp"]}="INSERT INTO activecalls_p2p (id_call, channel, caller_id, called_id, id_reseller, reseller_level, call_start)
VALUES ('$idCall', '$channel', '$accountcode', '$callednumber', '$resellerID', '$resellerLevel', '$callStartTime')";${$gmkgzxbxtb}=mysql_query(${$fqemnh});}function deleteP2PActiveCall(){${${"GLOBALS"}["mexxfq"]}=$this->agiUniqueID;${${"GLOBALS"}["qnnawnynyidq"]}="DELETE FROM activecalls_p2p WHERE id_call = '$callID'";${${"GLOBALS"}["misprqjwli"]}=mysql_query(${${"GLOBALS"}["qnnawnynyidq"]});}function p2pMaxCallDuration(){$dfjvoxsrg="minutesFlexibility";$jfdxkf="clientCallDuration";${$dfjvoxsrg}=$this->clientMinuteflexibility;${${"GLOBALS"}["utbmiyiombg"]}=$this->clientBalance*${${"GLOBALS"}["wpengsp"]}/$this->clientCallRate;$jgiymskrjnee="clientBillCycle";${${"GLOBALS"}["eeikeboxcul"]}=floor(${$jfdxkf}/$this->clientResolution);$this->clinetMaxCallDuration=${$jgiymskrjnee}*$this->clientResolution;}function checkP2PRateChart($rateID,$calledNumber){$xlquscpdyvp="sqlRate";${${"GLOBALS"}["posonsquj"]}="SELECT
prefix,
description,
voice_rate,
rate_mult,
grace_period,
minimal_time,
resolution,
is_disable,
minute_flex,
minute_flex_limit,
id
FROM ratechart
where id_rate = '$rateID' AND LOCATE(prefix,'$calledNumber')=1
AND prefix=(select max(prefix)
from ratechart where id_rate = '$rateID' AND LOCATE(prefix,'$calledNumber')=1) AND voice_rate > 0 AND rate_mult > 0 LIMIT 1";$fkdlfknegw="result";${${"GLOBALS"}["misprqjwli"]}=mysql_query(${$xlquscpdyvp});if(mysql_num_rows(${$fkdlfknegw})==1){${"GLOBALS"}["rctognzxhah"]="rowRateChart";${"GLOBALS"}["vojmheedrkow"]="rowRateChart";$jnkywri="rowRateChart";${${"GLOBALS"}["eurldbwywaf"]}=mysql_fetch_row(${${"GLOBALS"}["misprqjwli"]});$qeybxta="rowRateChart";$this->tempBillingPrefix=${$qeybxta}[0];$bkosysb="rowRateChart";$this->billingPrefixDescription=${$jnkywri}[1];$this->tempVoiceRate=${${"GLOBALS"}["rctognzxhah"]}[2];$eoewydcc="rowRateChart";$this->tempRateMulti=${$eoewydcc}[3];$this->tempGracePeriod=${${"GLOBALS"}["eurldbwywaf"]}[4];$this->tempMinTime=${${"GLOBALS"}["vojmheedrkow"]}[5];$this->tempResolution=${${"GLOBALS"}["eurldbwywaf"]}[6];${"GLOBALS"}["wwdhshbruy"]="rowRateChart";$this->tempIsDisable=${${"GLOBALS"}["eurldbwywaf"]}[7];$this->tempMinuteFlexibility=${${"GLOBALS"}["wwdhshbruy"]}[8];$mwwrdoe="rowRateChart";$this->tempMinuteFlexibilityLimit=${$bkosysb}[9];$this->tempRateChartID=${$mwwrdoe}[10];}else{${"GLOBALS"}["pfnyefkyphjv"]="calledNumber";$this->tempBillingPrefix=${${"GLOBALS"}["bppmpyslad"]};$this->billingPrefixDescription=${${"GLOBALS"}["pfnyefkyphjv"]};$this->tempVoiceRate="0.000000001";$this->tempRateMulti=1;$this->tempGracePeriod=1;$this->tempMinTime=1;$this->tempResolution=1;$this->tempIsDisable=0;$this->tempMinuteFlexibility=60;$this->tempMinuteFlexibilityLimit=0;$this->tempRateChartID=0;}}}
?>
Did this file decode correctly?
Original Code
<?php ${"G\x4c\x4f\x42\x41\x4c\x53"}["\x62p\x70mp\x79s\x6c\x61d"]="ca\x6c\x6c\x65\x64\x4e\x75mb\x65r";${"\x47L\x4f\x42\x41\x4cS"}["\x65e\x69\x6b\x65bo\x78\x63u\x6c"]="\x63\x6c\x69\x65\x6e\x74\x42i\x6c\x6cC\x79\x63le";${"\x47\x4c\x4fB\x41\x4c\x53"}["\x77pe\x6e\x67\x73\x70"]="m\x69n\x75\x74\x65sF\x6c\x65x\x69\x62i\x6c\x69\x74y";${"G\x4c\x4f\x42ALS"}["\x75\x74b\x6d\x69\x79\x69o\x6d\x62\x67"]="\x63\x6c\x69e\x6et\x43\x61\x6c\x6c\x44\x75ra\x74i\x6f\x6e";${"\x47L\x4f\x42\x41L\x53"}["j\x68c\x6c\x74\x6b\x70"]="\x49\x4eS\x45\x52\x54\x5f\x41CT\x49\x56E\x5f\x43\x41\x4c\x4c\x5f\x51\x55\x45\x52\x59";${"G\x4c\x4fB\x41LS"}["\x75\x68\x63i\x66\x71\x6f\x67"]="\x63\x61\x6c\x6c\x53ta\x72\x74Ti\x6d\x65";${"\x47\x4c\x4fB\x41\x4cS"}["q\x6d\x63\x74sa\x67\x66\x6f\x6c\x68"]="i\x64\x43\x61\x6c\x6c";${"G\x4c\x4f\x42\x41\x4cS"}["\x73\x6a\x78\x6bu\x73w\x76\x76"]="\x72\x65\x73\x65l\x6c\x65\x72\x49\x44";${"\x47LO\x42\x41\x4c\x53"}["\x74\x6fc\x65\x77d"]="\x63l\x69\x65\x6e\x74\x43a\x6c\x6cR\x61\x74\x65";${"G\x4c\x4f\x42A\x4cS"}["\x6c\x79\x66mb\x74\x63"]="\x63a\x6c\x6c\x73\x74\x61r\x74";${"G\x4cO\x42A\x4c\x53"}["\x7a\x6b\x77e\x6d\x6er\x66n"]="\x63al\x6c\x65\x64\x6e\x75\x6d\x62\x65r";${"\x47L\x4fBAL\x53"}["\x65\x6f\x71\x65b\x6e\x76h\x67\x74"]="u\x6e\x69\x71\x75\x65\x69\x64";${"\x47\x4c\x4f\x42\x41L\x53"}["\x7a\x71\x62\x78\x6c\x76\x62\x64i\x6bo"]="\x64\x69a\x6cs\x74\x72";${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x73fv\x73d\x78\x6d\x78\x75d"]="\x74a\x72\x67\x65\x74\x55\x73\x65r";${"\x47\x4cO\x42AL\x53"}["\x75\x75\x63s\x73y\x73\x6a\x62bx"]="p\x65r\x43\x79c\x6c\x65\x42i\x6cl";${"\x47L\x4f\x42\x41\x4c\x53"}["\x65\x64fe\x69\x73\x76\x70"]="v\x6fi\x63e\x5f\x72\x61te";${"\x47L\x4f\x42\x41L\x53"}["\x64c\x73\x72\x65wee\x69z"]="pr\x65S\x65c\x6f\x6ed\x42\x69\x6c\x6c";${"G\x4c\x4f\x42\x41L\x53"}["\x61\x65l\x6d\x69\x68\x75\x61k\x6c\x71"]="\x63u\x73\x74o\x6d\x65\x72\x42\x69\x6c\x6cCo\x73t";${"G\x4cO\x42\x41L\x53"}["\x68\x66\x7a\x6b\x77\x6a\x6d\x78"]="\x6d\x69\x6eim\x75\x6d\x5ft\x69m\x65";${"\x47\x4c\x4fBA\x4c\x53"}["c\x6ak\x77\x64\x68v\x6evj\x71"]="\x72e\x73o\x6cu\x74\x69\x6f\x6e";${"GL\x4f\x42\x41\x4c\x53"}["\x64\x71\x78\x6e\x70s"]="\x72\x65\x73\x65\x6c\x6ce\x72\x34\x43o\x6en\x65c\x74io\x6e\x46ee";${"\x47\x4c\x4f\x42\x41\x4cS"}["\x78c\x68\x69\x63dz"]="\x72\x65s\x65l\x6c\x65\x72\x34T\x61\x78\x46ee";${"G\x4c\x4f\x42\x41\x4c\x53"}["\x6c\x65\x72\x78\x70\x6d\x75e\x64\x72"]="\x72\x65\x73el\x6c\x65\x72\x34D\x69s\x43onn\x65c\x74\x69o\x6e\x46\x65\x65";${"G\x4c\x4f\x42\x41\x4c\x53"}["w\x67\x69\x6b\x78k\x6ddxl"]="\x72\x65\x73e\x6c\x6c\x65r\x33\x43on\x6e\x65ct\x69\x6fn\x46\x65e";${"\x47\x4c\x4f\x42\x41\x4cS"}["\x68dz\x6ex\x62\x7a\x62\x67"]="\x72e\x73e\x6c\x6ce\x72\x33T\x61x\x46\x65e";${"\x47\x4c\x4f\x42AL\x53"}["k\x66g\x72bhvb\x63\x63"]="\x72e\x73\x65\x6c\x6c\x65\x72\x33D\x69\x73\x43on\x6e\x65ct\x69o\x6eFee";${"GL\x4f\x42\x41L\x53"}["w\x77d\x77\x73\x76dl\x6d\x78x\x65"]="\x72e\x73\x65ller\x32T\x61\x78\x46e\x65";${"G\x4cO\x42\x41\x4cS"}["\x63\x78r\x70\x6c\x62nt\x62w\x68"]="re\x73e\x6c\x6ce\x72\x32D\x69\x73Co\x6e\x6eec\x74io\x6eF\x65\x65";${"G\x4cOB\x41\x4cS"}["p\x68\x63\x6e\x6b\x64l\x6c\x74\x6c\x70"]="\x72e\x73\x65l\x6ce\x72\x32C\x6f\x6en\x65c\x74\x69\x6f\x6eF\x65\x65";${"\x47\x4cO\x42\x41LS"}["t\x71\x73\x74\x6d\x6d\x6e\x6b\x76\x63a\x6c"]="r\x65\x73\x65\x6cl\x65r1\x54\x61\x78\x46e\x65";${"\x47\x4cO\x42\x41L\x53"}["x\x79\x70t\x69\x73\x77ud\x6a"]="\x72\x65s\x65\x6c\x6c\x65r\x31D\x69sConn\x65\x63\x74\x69\x6f\x6e\x46ee";${"GL\x4f\x42\x41\x4cS"}["\x75\x62p\x70\x61\x70h\x73y"]="\x72\x65s\x65\x6cl\x65\x72\x31\x43onne\x63\x74ion\x46ee";${"\x47LO\x42\x41\x4c\x53"}["\x64cp\x7aa\x75\x6e\x68\x76\x78\x6f"]="t\x6f\x74\x61\x6c\x43\x61ll\x43\x6fs\x74";${"G\x4c\x4f\x42A\x4cS"}["\x6f\x76\x79\x75\x6a\x70\x6d\x78\x6f\x65\x65\x6d"]="c\x6cie\x6et\x54\x61\x78\x46\x65e";${"G\x4c\x4f\x42\x41\x4c\x53"}["kd\x75\x6c\x71\x6e\x6fh"]="\x63\x61\x6c\x6c\x43\x6fs\x74";${"GL\x4fB\x41\x4cS"}["y\x67cj\x6ct\x72\x66\x66\x66"]="\x63l\x69\x65\x6e\x74D\x69\x73\x43\x6f\x6e\x6e\x65c\x74i\x6fn\x46\x65\x65";${"G\x4c\x4f\x42AL\x53"}["\x6a\x63\x69i\x6f\x63i"]="\x63\x6ci\x65n\x74\x43o\x6en\x65\x63ti\x6f\x6e\x46\x65e";${"\x47\x4c\x4f\x42ALS"}["ne\x7a\x6en\x76n\x67\x7a\x6d"]="\x73\x71\x6c\x49n\x73\x65\x72t";${"\x47\x4cO\x42A\x4c\x53"}["it\x69\x6e\x65\x72\x72\x70y\x6e\x7a"]="\x72e\x73\x75\x6c\x74I\x6e\x73\x65\x72\x74";${"\x47L\x4fBAL\x53"}["\x6fo\x69\x75j\x6cx\x65c\x71\x6e"]="\x6f\x72\x67C\x6fst";${"\x47L\x4f\x42\x41\x4c\x53"}["\x79\x67r\x6b\x78k\x76\x65\x70\x75"]="p\x61\x72\x65\x6et\x52\x65s\x65ll\x65r\x4c\x65ve\x6c";${"\x47\x4cO\x42\x41\x4c\x53"}["\x6c\x67k\x6crq\x65\x70mc\x73"]="r\x65\x73\x65l\x6ce\x72\x34I\x44";${"\x47L\x4f\x42\x41\x4c\x53"}["\x75\x65a\x78p\x77\x78"]="\x70\x61ren\x74\x52\x65\x73\x65lle\x72\x49D";${"\x47LOBA\x4cS"}["\x6c\x63\x71\x6c\x72\x77"]="\x63\x61l\x6c\x54y\x70\x65";${"\x47\x4cOB\x41\x4cS"}["\x63\x72h\x78\x6f\x69\x61b\x6b"]="\x63\x61ll\x72a\x74eC";${"G\x4cOB\x41L\x53"}["\x67w\x6bwy\x67"]="\x73\x71\x6c\x49\x6es\x65\x72\x74C\x61\x6cls";${"\x47\x4c\x4fB\x41LS"}["u\x78\x71l\x61\x76e\x75"]="\x74er\x6d\x69n\x61\x74\x69\x6f\x6e\x52\x61\x74\x65";${"G\x4c\x4f\x42\x41\x4c\x53"}["\x75\x69\x70\x62\x66\x76\x70rj\x63"]="\x63allC\x6f\x73\x74R\x34";${"\x47\x4cO\x42AL\x53"}["\x61\x6dr\x79\x64\x70\x77"]="\x63\x6fst\x52\x34";${"\x47\x4c\x4f\x42A\x4cS"}["\x76\x76e\x63\x6c\x77\x62"]="\x64\x75\x72\x61\x74\x69o\x6eR4";${"\x47\x4c\x4fB\x41\x4c\x53"}["\x65m\x65\x74\x73\x6c\x79\x6a\x68"]="\x63\x61\x6c\x6cr\x61\x74\x65R\x34";${"\x47\x4c\x4f\x42A\x4c\x53"}["\x67cfp\x69\x67rt"]="\x72\x65\x73ell\x65r4\x54\x69\x6d\x65Di\x76i\x64e\x72";${"\x47L\x4f\x42\x41L\x53"}["\x65\x6d\x73\x77gw"]="co\x73\x74\x523";${"\x47L\x4fB\x41L\x53"}["w\x6d\x61\x6e\x72cc\x73\x71"]="\x63\x61\x6c\x6c\x72\x61\x74e\x52\x33";${"\x47L\x4fBA\x4c\x53"}["\x64\x70xw\x71\x79e\x6a"]="r\x65s\x65l\x6c\x65\x72\x33\x54\x69\x6de\x44\x69v\x69d\x65\x72";${"\x47\x4cO\x42\x41\x4cS"}["\x75q\x70\x6e\x67\x63"]="\x63o\x73tR2";${"\x47\x4c\x4f\x42A\x4cS"}["\x7a\x65\x6ao\x66\x74\x65\x74\x6d\x6ed"]="c\x61\x6c\x6c\x43o\x73\x74R2";${"GLOB\x41L\x53"}["t\x63tw\x74\x65h\x7a\x64xbo"]="\x63\x61\x6cl\x72\x61\x74e\x52\x32";${"G\x4c\x4f\x42\x41\x4cS"}["\x78\x66cb\x66\x71i\x6d\x79cr"]="\x64\x75\x72\x61tio\x6e\x52\x32";${"\x47\x4c\x4f\x42AL\x53"}["w\x65xjb\x69v\x79\x63"]="\x63\x6fs\x74\x521";${"\x47L\x4f\x42\x41\x4cS"}["ws\x76pv\x6a\x62rk"]="ca\x6cl\x72\x61t\x65R1";${"\x47\x4c\x4fB\x41L\x53"}["\x66di\x6a\x71\x65p\x6f"]="\x72e\x73\x65\x6c\x6c\x65\x72\x31Ti\x6d\x65\x44i\x76\x69\x64\x65\x72";${"\x47\x4c\x4f\x42A\x4c\x53"}["cfq\x77\x6bbd"]="du\x72\x61t\x69\x6f\x6e\x52\x31";${"\x47L\x4f\x42\x41\x4c\x53"}["\x68\x69\x68\x79ebc"]="\x63\x6fs\x74\x43";${"\x47L\x4fBA\x4cS"}["\x6a\x72g\x68\x62plv\x62\x70\x61"]="\x63\x6f\x73t\x43\x6c\x69\x65n\x74";${"\x47LO\x42\x41\x4cS"}["q\x65\x75b\x64\x6d\x73"]="\x63l\x69\x65\x6e\x74\x43\x61l\x6c\x43\x68ar\x67\x65";${"G\x4c\x4f\x42\x41L\x53"}["\x67\x67\x78\x69\x67\x71\x79t\x6c\x62v"]="\x64u\x72\x61t\x69o\x6e\x43";${"\x47\x4cO\x42\x41\x4cS"}["\x64\x63\x6akc\x67d"]="\x70\x64\x64";${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x67\x62\x67tipjy\x67qp\x73"]="ta\x72i\x66\x66_\x70\x72e\x66i\x78";${"\x47\x4cO\x42\x41\x4c\x53"}["\x68sx\x72k\x69\x71\x77\x78x"]="\x63\x61\x6c\x6cSt\x61\x72t\x53\x74\x72";${"\x47\x4c\x4f\x42A\x4c\x53"}["m\x66m\x73\x79\x62\x6b"]="c\x61\x6c\x6c\x45\x6e\x64\x53tr";${"GLO\x42\x41\x4c\x53"}["\x6e\x7a\x76\x75gn\x73el\x68\x66"]="\x63\x61l\x6c\x65n\x64";${"\x47\x4cO\x42\x41\x4c\x53"}["h\x6akoe\x62\x68\x66\x6ap"]="idRe\x73el\x6cl\x65r";${"G\x4cOBA\x4c\x53"}["\x77\x75\x6et\x6e\x62\x77\x6b\x69\x68"]="sr\x63IP";${"G\x4c\x4f\x42\x41\x4c\x53"}["\x73\x6bdyh\x6f\x6d"]="\x66\x69nalC\x61\x6cl\x52a\x74\x65";${"G\x4c\x4fB\x41\x4c\x53"}["q\x68\x6bl\x79h\x64q"]="min\x75\x74eM\x75\x6cti\x70\x6c\x69\x65\x72";${"\x47LO\x42\x41L\x53"}["vi\x73\x68\x78\x64\x79"]="\x73\x74\x61rtMin\x75t\x65";${"G\x4cO\x42\x41\x4c\x53"}["\x68m\x70\x77\x6d\x66\x6a\x64\x70\x63\x72"]="\x74\x69m\x65\x44\x69v\x69d\x65\x72";${"\x47\x4c\x4f\x42\x41\x4cS"}["\x72\x66\x72\x73\x6bk\x71\x78"]="m\x69n\x75t\x65\x46\x6c\x65\x78\x44u\x72\x61t\x69\x6f\x6e";${"\x47L\x4fB\x41\x4c\x53"}["\x6aiq\x74z\x65c\x67"]="\x64\x75\x72\x61\x74i\x6fn";${"\x47\x4cO\x42A\x4cS"}["\x79\x6c\x76\x77\x61\x76\x73l\x75\x72\x65\x78"]="\x72\x61teR\x65\x73\x6f\x6c\x75\x74\x69o\x6e";${"\x47LOB\x41L\x53"}["x\x79\x70\x78q\x65c\x73\x61\x6d"]="ra\x72\x65\x4d\x69n\x54\x69\x6d\x65";${"\x47LO\x42\x41\x4cS"}["\x73\x69\x71\x79i\x77\x74\x70\x78j"]="\x6d\x69\x6e\x75\x74\x65\x46lex";${"\x47L\x4fB\x41LS"}["t\x72o\x6b\x79\x6aww\x74"]="u\x73\x65\x72\x4c\x65v\x65l";${"\x47\x4c\x4f\x42\x41\x4cS"}["\x65\x75\x72\x6c\x64\x62w\x79w\x61\x66"]="\x72\x6f\x77\x52\x61\x74e\x43\x68\x61\x72\x74";${"\x47\x4c\x4fB\x41\x4c\x53"}["\x70\x6f\x73\x6f\x6es\x71u\x6a"]="\x73\x71lR\x61\x74\x65";${"\x47\x4cOB\x41L\x53"}["\x79j\x70z\x66s\x76c\x6c\x65"]="\x72e\x73\x65\x6c\x6c\x65r\x33\x49\x44";${"\x47LOBA\x4cS"}["\x67pb\x78\x6a\x66\x77f\x76\x6fy"]="r\x65\x73\x65\x6c\x6ce\x72\x32I\x44";${"\x47L\x4f\x42\x41\x4c\x53"}["f\x68\x63y\x6e\x67\x63\x6a"]="\x72\x65\x73\x65\x6c\x6c\x65r\x31\x49\x44";${"\x47L\x4f\x42\x41\x4c\x53"}["k\x68\x79u\x73i\x65m"]="\x66\x75ll\x63\x6f\x6e\x74ac\x74";${"G\x4c\x4fB\x41\x4cS"}["\x72t\x66\x68wq\x63p\x76\x69"]="\x73i\x70i\x70";${"\x47\x4c\x4f\x42\x41\x4cS"}["\x6a\x79\x6a\x61\x6e\x7a\x73"]="\x64\x69\x61\x6ci\x6eg\x5f\x70\x72\x65f\x69x";${"GL\x4fBA\x4c\x53"}["\x72\x6a\x73g\x6e\x77\x65m"]="\x63al\x6c\x65ri\x64";${"\x47\x4c\x4f\x42\x41L\x53"}["\x69\x6eyoa\x70w\x63"]="\x69d\x5f\x74\x61\x72\x69\x66f";${"\x47\x4cO\x42\x41\x4cS"}["\x6b\x6a\x64f\x76\x6a\x69\x71"]="\x72\x65s\x65l\x6c\x65r\x4c\x65\x76\x65\x6c";${"\x47\x4c\x4fB\x41\x4cS"}["\x70\x76\x71\x68\x6a\x6b\x64p\x6bi"]="\x61c\x63o\x75\x6et\x63\x6f\x64\x65";${"\x47LOBA\x4cS"}["\x64fc\x63\x6d\x6cv\x70"]="ch\x61\x6en\x65\x6c";${"G\x4c\x4f\x42ALS"}["vi\x62\x74\x73\x74\x6c\x6bnw\x78"]="\x73\x71l1";${"G\x4cOB\x41\x4c\x53"}["\x69\x6e\x6f\x72\x64\x71k"]="a\x63\x64";${"G\x4cOB\x41L\x53"}["\x62\x6b\x79j\x71\x62h"]="\x73q\x6c2";${"\x47LO\x42A\x4cS"}["\x75\x6fo\x6c\x79\x6f"]="\x71\x75\x65\x72\x79";${"\x47\x4c\x4fB\x41L\x53"}["nfp\x6b\x75\x67\x71"]="pr\x65\x66i\x78";${"\x47\x4cO\x42\x41\x4cS"}["q\x6d\x78\x72\x66\x64em\x6d\x6c\x77"]="t\x72\x75\x6e\x6b\x5f\x69\x64";${"\x47LOB\x41L\x53"}["\x77\x68\x66\x76\x70\x65\x61\x68\x77"]="de\x73\x63\x72i\x70\x74i\x6f\x6e\x54\x75rn\x6b";${"G\x4c\x4f\x42\x41\x4c\x53"}["\x63sj\x62\x61go\x77\x70\x64\x66\x68"]="\x61ns\x77\x65\x72\x65\x64\x74\x69\x6d\x65";${"GLO\x42\x41L\x53"}["\x63i\x78i\x68h\x6b"]="dia\x6cre\x73\x75lt";${"GL\x4f\x42\x41LS"}["irrger\x76\x77"]="\x61\x64\x64_\x70\x72\x65\x66i\x78";${"\x47\x4c\x4f\x42A\x4c\x53"}["\x66\x79c\x67d\x6fif"]="\x64\x69\x61lpa\x72\x61\x6d\x73";${"\x47\x4cO\x42\x41LS"}["\x77\x73q\x69\x75\x6df\x69\x78\x63\x66"]="\x70\x72\x6f\x76i\x64\x65rt\x65\x63\x68";${"\x47\x4c\x4fB\x41LS"}["\x65\x72\x67\x63\x6a\x62\x66\x6a"]="\x64\x69a\x6cP\x72e\x66\x69x";${"G\x4c\x4f\x42AL\x53"}["\x77el\x70\x6c\x74\x79\x6b"]="\x64ia\x6cpl\x61\x6e_i\x6e\x75\x73\x65";${"GL\x4f\x42\x41\x4c\x53"}["um\x67\x66\x65\x70\x65"]="\x70\x61t\x74\x65\x72\x6e";${"\x47L\x4f\x42\x41\x4cS"}["\x67\x74\x66wt\x79\x77\x75d\x72"]="\x6d\x61\x78\x75se";${"\x47L\x4f\x42\x41\x4c\x53"}["\x68e\x6f\x61\x69\x6ag\x70"]="\x69\x6e\x75s\x65";${"\x47LO\x42\x41\x4c\x53"}["\x76\x77\x69f\x71o\x67g\x72\x72\x6c\x79"]="p\x6f\x72\x74";${"\x47\x4c\x4f\x42A\x4c\x53"}["\x71\x61\x79xg\x6eq\x63"]="\x70\x72\x6fv\x69\x64er\x69\x70";${"G\x4cO\x42\x41\x4c\x53"}["\x75\x68\x71\x68\x70\x76\x70\x66c\x76"]="\x73h\x61\x72\x65";${"\x47\x4cO\x42ALS"}["q\x78j\x65c\x6e\x67"]="\x72emo\x76\x65\x70\x72\x65\x66i\x78";${"G\x4c\x4f\x42AL\x53"}["d\x75\x6fk\x64\x71\x73\x64w\x6b\x6e"]="\x69d\x5f\x74\x72u\x6ek";${"\x47\x4cO\x42\x41\x4c\x53"}["\x66q\x74\x68g\x77\x6c\x77"]="\x72\x6fw\x44i\x61l\x50\x6c\x61\x6e";${"\x47\x4cOB\x41\x4c\x53"}["\x6es\x6a\x77\x75\x72\x64\x69k\x75j"]="r\x65\x73\x75l\x74\x44ialP\x6c\x61n";${"\x47L\x4f\x42\x41\x4c\x53"}["\x6c\x70\x66\x66\x6b\x70r\x63n"]="s\x71l\x44\x69a\x6c\x50\x6c\x61\x6e";${"\x47L\x4fBA\x4c\x53"}["\x61win\x67\x66\x6c"]="\x69v\x72\x4d\x69\x6e";${"GL\x4f\x42ALS"}["\x79\x79\x77\x67uh"]="\x74\x69\x6de\x4f\x75\x74";${"\x47\x4cOBAL\x53"}["\x71u\x72\x74\x6c\x78qwh\x7a\x71\x72"]="\x6d\x61\x78\x43al\x6c\x44\x75\x72\x61\x74io\x6e";${"\x47LOB\x41\x4cS"}["\x69\x64r\x66\x61vf\x62\x72\x71"]="fir\x73\x74D\x69g\x69t\x43a\x6c\x6c\x65\x64\x4eu\x6db\x65r";${"G\x4c\x4f\x42AL\x53"}["\x70\x64\x6dw\x63\x69\x72\x7ann\x61"]="d\x65\x73t\x69\x6e\x61\x74i\x6fn";${"\x47\x4cO\x42\x41\x4c\x53"}["\x65g\x65v\x6dqt"]="m\x61x_\x6c\x6fn\x67";${"\x47\x4c\x4f\x42A\x4c\x53"}["x\x64t\x6c\x69\x63\x6f\x65"]="\x69\x70";${"G\x4cO\x42\x41\x4cS"}["\x68\x72\x74\x62rmki"]="\x61\x67\x69";${"\x47\x4cO\x42A\x4c\x53"}["k\x65\x6d\x64o\x71h\x65\x78q"]="p\x32\x70\x50\x72\x65\x66\x69x";${"GL\x4fB\x41\x4c\x53"}["\x6f\x6c\x64i\x77\x6ey\x74m"]="\x63\x68\x65\x63\x6b\x41c\x74i\x76\x65\x43\x61\x6c\x6c";${"G\x4cOB\x41L\x53"}["\x66l\x66\x6a\x63j\x74"]="\x69v\x72";${"\x47\x4cO\x42\x41L\x53"}["\x75y\x6a\x71ji\x65"]="clie\x6e\x74St\x61\x74\x75\x73";${"\x47\x4c\x4f\x42\x41LS"}["pe\x78\x67\x6f\x74\x62\x67\x6c\x74"]="q";${"\x47L\x4fB\x41\x4c\x53"}["\x75\x66qy\x77\x67w\x71\x64"]="s\x65\x74\x74\x69\x6egs";${"\x47\x4cO\x42A\x4c\x53"}["drzd\x6c\x67\x78"]="\x75s\x65\x72N\x61\x6de";${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x63\x74\x6e\x66\x6f\x6f\x6d"]="d\x65s\x63\x72\x69p\x74\x69\x6f\x6e";${"\x47\x4cOB\x41\x4c\x53"}["q\x66\x70\x63n\x77\x65\x72"]="\x73t\x61\x74\x75\x73";${"G\x4cO\x42\x41\x4c\x53"}["\x6ep\x7a\x6cr\x74\x67\x77b"]="\x72ese\x6cl\x65\x724\x43\x75\x72\x72e\x6e\x74\x42a\x6c\x61n\x63e";${"G\x4cO\x42A\x4c\x53"}["dd\x67\x78\x72\x79c\x70\x73\x68f\x65"]="\x72\x65s\x65ll\x65\x72\x33C\x75\x72\x72\x65\x6e\x74Bal\x61\x6e\x63\x65";${"\x47L\x4f\x42A\x4cS"}["\x6at\x6f\x62\x67\x66\x6f\x6b\x66\x69\x72d"]="res\x65\x6c\x6c\x65\x72\x32Cu\x72r\x65\x6e\x74B\x61\x6ca\x6ece";${"\x47L\x4f\x42A\x4c\x53"}["\x77\x73\x78\x68\x72\x6d\x75\x6be\x67"]="\x72\x65\x73\x65l\x6ce\x721\x43u\x72re\x6e\x74\x42a\x6c\x61\x6ec\x65";${"\x47L\x4fBAL\x53"}["\x77\x72\x68\x69\x73\x69\x6axk\x68"]="t\x61\x78\x46\x65\x65";${"\x47\x4cOBALS"}["xj\x76\x68\x62\x78"]="\x72\x65\x73\x65\x6cl\x65r4\x4d\x61\x78\x43a\x6c\x6c\x44\x75\x72\x61\x74i\x6fn";${"\x47\x4c\x4f\x42ALS"}["\x61p\x6dp\x69w\x73"]="\x61\x63\x74\x75a\x6c\x43\x61\x6clD\x75\x72\x61t\x69on";${"\x47LOBALS"}["\x61\x63\x6f\x66\x62\x6d\x6c\x63\x6b"]="\x72\x65\x73\x65\x6c\x6c\x65r\x33M\x61\x78C\x61\x6cl\x44\x75r\x61\x74\x69\x6fn";${"GL\x4f\x42\x41\x4c\x53"}["k\x63i\x71\x6bv\x61\x70\x72\x73s\x6e"]="\x72\x65s\x65\x6c\x6c\x65\x72\x31\x4d\x61x\x43a\x6c\x6c\x44u\x72a\x74io\x6e";${"\x47\x4cOB\x41\x4c\x53"}["\x63\x7ar\x67uit"]="\x63\x6c\x69\x6e\x65\x74MaxC\x61\x6c\x6c\x44\x75ra\x74\x69o\x6e";${"GLOBA\x4cS"}["\x73\x69xpr\x62\x70um\x68"]="ca\x6clD\x75\x72\x61\x74\x69o\x6e\x46i\x6e\x61\x6c";${"\x47LOBA\x4cS"}["\x71\x76\x6a\x7a\x78\x70\x69\x72h\x6ac"]="c\x61\x6c\x6c\x44\x75\x72at\x69\x6f\x6eAft\x65r\x43\x46a\x6e\x64\x44F";${"\x47\x4c\x4fBALS"}["\x68\x73y\x6ag\x6cihb\x68\x62r"]="c\x6c\x69\x65n\x74C\x75r\x72\x65\x6e\x74\x42\x61\x6c\x61\x6e\x63\x65";${"\x47L\x4f\x42ALS"}["u\x7am\x6abej\x65\x65\x6f\x68"]="\x50R";${"\x47L\x4f\x42\x41\x4cS"}["o\x62i\x68biel\x6d"]="\x66\x69n\x61\x6c\x43\x61\x6c\x6c\x44\x75\x72at\x69o\x6e\x41\x66t\x65\x72\x41\x64\x64\x4d\x46L";${"G\x4c\x4f\x42AL\x53"}["\x78\x68\x77\x62\x63\x6a\x6co\x77"]="\x43R";${"\x47LOB\x41\x4cS"}["\x70i\x73\x69\x6bhu\x79"]="c\x61\x6c\x6c\x44u\x72a\x74i\x6fnBl\x6f\x63\x6b";${"\x47L\x4f\x42\x41\x4c\x53"}["n\x63\x6e\x61z\x6c"]="\x4d\x46";${"\x47\x4cO\x42AL\x53"}["\x6c\x6epv\x70su\x78\x78"]="\x4d\x46\x4c";${"\x47LOB\x41LS"}["\x71\x77\x6a\x69ku\x62\x6e"]="\x72a\x74\x65\x42l\x6f\x63\x6b\x44\x61\x74\x61";${"\x47\x4c\x4f\x42AL\x53"}["\x68\x71\x65\x6a\x64s"]="c\x61\x6c\x6c\x44u\x72\x61t\x69\x6f\x6e";${"G\x4c\x4f\x42A\x4c\x53"}["yj\x6b\x76vt\x65\x73\x77\x73\x79"]="\x72\x6f\x77";${"G\x4cOB\x41\x4cS"}["\x75\x76\x72r\x68gp\x6d\x70e\x72"]="r\x6f\x77\x73";${"\x47\x4c\x4f\x42\x41\x4cS"}["\x73\x67\x6e\x72\x6c\x62\x75\x73\x77\x64w"]="\x72a\x74\x65\x43h\x61\x72\x74ID";${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x68o\x62\x62\x71\x6f\x66\x73r\x74"]="\x62\x61\x6c\x61\x6e\x63\x65\x41r\x72ay";${"\x47L\x4f\x42A\x4cS"}["\x76wqrmfb\x75\x72"]="n\x75\x6d\x62e\x52\x6f\x77";${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x7ai\x74vv\x72\x6c"]="\x73\x71l";${"\x47\x4cO\x42\x41\x4cS"}["\x6a\x6bmz\x62\x73y\x6fb\x6f\x66"]="\x63\x6c\x69\x65n\x74\x54yp\x65";${"\x47L\x4f\x42\x41\x4c\x53"}["q\x6enawn\x79\x6e\x79\x69\x64q"]="D\x45\x4c\x45T\x45\x5f\x41CT\x49VE\x5fC\x41\x4c\x4c\x5fQ\x55\x45R\x59";${"\x47\x4cOB\x41\x4c\x53"}["m\x65\x78xfq"]="\x63\x61\x6c\x6c\x49\x44";${"G\x4c\x4f\x42\x41\x4c\x53"}["m\x69spr\x71\x6aw\x6c\x69"]="\x72es\x75lt";${"\x47L\x4f\x42\x41L\x53"}["\x77h\x73b\x6a\x77\x77w\x78\x63"]="\x6c\x6f\x67\x69\x6e";${"\x47\x4c\x4f\x42\x41L\x53"}["e\x67\x63sn\x65\x70\x65\x69\x75\x78"]="\x63\x6ci\x65nttyp\x65";${"G\x4c\x4f\x42AL\x53"}["\x6ea\x79\x67vgxj"]="\x64i\x61\x6cs\x74a\x74\x75s";${"\x47L\x4f\x42ALS"}["i\x6d\x76\x64w\x78\x66oy"]="\x72e\x73\x5f\x64\x69al";define("M\x41\x58_CALL_\x44\x55R\x41\x54\x49O\x4e","\x32\x370\x30");define("SI\x50\x5fU\x53\x45R","1");class SIPBilling{var$agiChannel;var$agiLanguage;var$agiCallerID;var$agiCalleridName;var$agiAccountCode;var$agiUniqueID;var$agiExtension;var$agiType;var$agidnid;var$userCalledNumber;var$agiContext;var$srcIP;var$clientIPAddress;var$clientType=1;var$clientPhoneNumber;var$clientLogin;var$clientID=0;var$reseller1ID=-1;var$reseller2ID=-1;var$reseller3ID=-1;var$reseller4ID=-1;var$clientResellerLevel=-1;var$clientResellerID=-1;var$clientBalance=0;var$reseller1Balance=0;var$reseller2Balance=0;var$reseller3Balance=0;var$reseller4Balance=0;var$clientrBalance=0;var$reseller1rBalance=0;var$reseller2rBalance=0;var$reseller3rBalance=0;var$reseller4rBalance=0;var$clientRateID;var$reseller1RateID;var$reseller2RateID;var$reseller3RateID;var$reseller4RateID;var$terminationRateID=0;var$clientBillingPrefix;var$reseller1BillingPrefix;var$reseller2BillingPrefix;var$reseller3BillingPrefix;var$reseller4BillingPrefix;var$clientVoiceRate=0;var$reseller1VoiceRate=0;var$reseller2VoiceRate=0;var$reseller3VoiceRate=0;var$reseller4VoiceRate=0;var$clientRateMulti=1;var$reseller1RateMulti=1;var$reseller2RateMulti=1;var$reseller3RateMulti=1;var$reseller4RateMulti=1;var$clientGracePeriod=0;var$reseller1GracePeriod=0;var$reseller2GracePeriod=0;var$reseller3GracePeriod=0;var$reseller4GracePeriod=0;var$clientMinTime=60;var$reseller1MinTime=60;var$reseller2MinTime=60;var$reseller3MinTime=60;var$reseller4MinTime=60;var$clientResolution=60;var$reseller1Resolution=60;var$reseller2Resolution=60;var$reseller3Resolution=60;var$reseller4Resolution=60;var$clientMinuteflexibility=60;var$reseller1Minuteflexibility=60;var$reseller2Minuteflexibility=60;var$reseller3Minuteflexibility=60;var$reseller4Minuteflexibility=60;var$clientMinuteflexibilityLimit=0;var$reseller1MinuteflexibilityLimit=0;var$reseller2MinuteflexibilityLimit=0;var$reseller3MinuteflexibilityLimit=0;var$reseller4MinuteflexibilityLimit=0;var$clientConnectionFee=0;var$reseller1ConnectionFee=0;var$reseller2ConnectionFee=0;var$reseller3ConnectionFee=0;var$reseller4ConnectionFee=0;var$clientrConnectionFee=0;var$reseller1rConnectionFee=0;var$reseller2rConnectionFee=0;var$reseller3rConnectionFee=0;var$reseller4rConnectionFee=0;var$clientConnectionThresholdValue=0;var$reseller1ConnectionThresholdValue=0;var$reseller2ConnectionThresholdValue=0;var$reseller3ConnectionThresholdValue=0;var$reseller4ConnectionThresholdValue=0;var$clientrConnectionThresholdValue=0;var$reseller1rConnectionThresholdValue=0;var$reseller2rConnectionThresholdValue=0;var$reseller3rConnectionThresholdValue=0;var$reseller4rConnectionThresholdValue=0;var$clientDisConnectionFee=0;var$reseller1DisConnectionFee=0;var$reseller2DisConnectionFee=0;var$reseller3DisConnectionFee=0;var$reseller4DisConnectionFee=0;var$clientrDisConnectionFee=0;var$reseller1rDisConnectionFee=0;var$reseller2rDisConnectionFee=0;var$reseller3rDisConnectionFee=0;var$reseller4rDisConnectionFee=0;var$clientDisConnectionThresholdValue=0;var$reseller1DisConnectionThresholdValue=0;var$reseller2DisConnectionThresholdValue=0;var$reseller3DisConnectionThresholdValue=0;var$reseller4DisConnectionThresholdValue=0;var$clientrDisConnectionThresholdValue=0;var$reseller1rDisConnectionThresholdValue=0;var$reseller2rDisConnectionThresholdValue=0;var$reseller3rDisConnectionThresholdValue=0;var$reseller4rDisConnectionThresholdValue=0;var$clientTaxFee=0;var$reseller1TaxFee=0;var$reseller2TaxFee=0;var$reseller3TaxFee=0;var$reseller4TaxFee=0;var$clientrTaxFee=0;var$reseller1rTaxFee=0;var$reseller2rTaxFee=0;var$reseller3rTaxFee=0;var$reseller4rTaxFee=0;var$clientMaxCallDuration=MAX_CALL_DURATION;var$reseller1MaxCallDuration=MAX_CALL_DURATION;var$reseller2MaxCallDuration=MAX_CALL_DURATION;var$reseller3MaxCallDuration=MAX_CALL_DURATION;var$reseller4MaxCallDuration=MAX_CALL_DURATION;var$clientCallRate=0;var$reseller1CallRate=0;var$reseller2CallRate=0;var$reseller3CallRate=0;var$reseller4CallRate=0;var$clientRateChartID=0;var$reseller1RateChartID=0;var$reseller2RateChartID=0;var$reseller3RateChartID=0;var$reseller4RateChartID=0;var$answeredtime=0;var$real_answeredtime=0;var$dialstatus=0;var$idTrunk=0;var$dialPrefix;var$callLimit=1;var$turnkCallLimit=1;var$planID=0;var$accountCode=0;var$clientInUse=0;var$turnkInUse=0;var$clientCallLimit=1;var$techPrefix;var$billingPrefix;var$providerip;var$dialPlanCount=0;var$tempBillingPrefix=0;var$tempVoiceRate=-1;var$tempRateMulti=1;var$tempGracePeriod=0;var$tempMinTime=60;var$tempResolution=60;var$tempMinuteFlexibility=60;var$tempMinuteFlexibilityLimit=0;var$tempRateChartID=0;var$tempConnectionFee=0;var$tempConnectionThresholdValue=0;var$tempDisConnectionFee=0;var$tempDisConnectionThresholdValue=0;var$tempTaxFee=0;var$tempIsDisable=1;var$billingPrefixDescription;var$playIVR=0;var$allowP2Pcalls=0;var$terminationClient=0;var$callerIDName="";var$trunkCallRate=0;var$trunkCallCost=0;var$cdrDuration=0;var$dialstatus_rev_list;var$orgCallerIP="104.236.84.130";function SIPBilling(){$aikidtpjghs="co\x6en";${$aikidtpjghs}=mysql_connect("\x6cocal\x68o\x73\x74","r\x6fot","@s\x79m\x6c\x65x\x40");mysql_select_db("\x73\x79m\x6ce\x78\x5f\x73w\x69\x74\x63\x68");$this->dialstatus_rev_list=$this->getDialStatus();}function run_dial($agi,$dialstr){${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x6a\x6e\x7a\x65\x74\x71\x6e\x67h\x6f\x71"]="re\x73_d\x69al";${${"GL\x4f\x42\x41L\x53"}["\x6anz\x65t\x71\x6eg\x68\x6f\x71"]}=$agi->exec("D\x49A\x4c\x20$dialstr");return${${"\x47LOB\x41\x4c\x53"}["\x69\x6d\x76dwxf\x6fy"]};}function getDialStatus(){${"G\x4c\x4fB\x41LS"}["\x74w\x77\x64\x70\x79"]="d\x69\x61\x6c\x73\x74a\x74u\x73";${"G\x4c\x4f\x42\x41\x4c\x53"}["\x68g\x6d\x65j\x68"]="\x64\x69al\x73\x74\x61\x74\x75s";${${"GLO\x42\x41\x4c\x53"}["hgm\x65\x6a\x68"]}=array();$pzsjljri="\x64i\x61l\x73t\x61t\x75\x73";$itjkrld="\x64\x69a\x6c\x73\x74\x61t\x75\x73";${${"G\x4c\x4f\x42AL\x53"}["\x74\x77\x77\x64\x70y"]}["A\x4eS\x57\x45R"]=1;$mrwwnflo="\x64i\x61\x6csta\x74u\x73";${${"\x47L\x4f\x42\x41\x4c\x53"}["\x6ea\x79gvg\x78\x6a"]}["\x42\x55\x53\x59"]=2;${"G\x4c\x4fB\x41LS"}["\x73ga\x6ahl\x70\x72"]="\x64\x69\x61ls\x74\x61\x74us";${${"\x47L\x4f\x42\x41\x4cS"}["\x6e\x61\x79g\x76\x67\x78\x6a"]}["\x4e\x4f\x41\x4eS\x57\x45\x52"]=3;${$mrwwnflo}["CANC\x45\x4c"]=4;${$itjkrld}["CONG\x45\x53TI\x4fN"]=5;${${"\x47L\x4fB\x41LS"}["\x73\x67\x61jh\x6cpr"]}["\x43HANU\x4eAV\x41\x49L"]=6;$kbdsdbk="\x64i\x61\x6cst\x61\x74\x75\x73";${${"\x47\x4c\x4f\x42A\x4cS"}["\x6e\x61\x79\x67\x76g\x78\x6a"]}["DON\x54\x43\x41\x4cL"]=7;${${"GL\x4f\x42A\x4c\x53"}["na\x79\x67vgx\x6a"]}["TO\x52\x54URE"]=8;${$kbdsdbk}["I\x4e\x56A\x4c\x49DA\x52\x47\x53"]=9;return${$pzsjljri};}function insertFailedCall($description){${${"\x47\x4c\x4f\x42A\x4c\x53"}["\x65\x67\x63\x73\x6e\x65p\x65iu\x78"]}=$this->clientType;${"\x47\x4c\x4fB\x41L\x53"}["\x79\x70rrdwl\x6d\x77i\x70"]="\x73q\x6c";${"\x47L\x4f\x42AL\x53"}["\x67\x66\x70l\x7a\x74\x79\x6b\x70\x63"]="sq\x6c";$npyurqnvr="\x6e\x75\x6db\x65\x72";${$npyurqnvr}=$this->agidnid;${${"\x47\x4cO\x42A\x4c\x53"}["w\x68\x73\x62\x6a\x77w\x77\x78\x63"]}=$this->agiAccountCode;${${"\x47\x4c\x4fB\x41\x4c\x53"}["\x79pr\x72\x64w\x6cmwi\x70"]}="\x49\x4eSER\x54 INT\x4f\x20\x66\x61\x69ledc\x61ll\x73 (\x6c\x6fg\x69\x6e, c\x6ci\x65nt\x74\x79\x70\x65,\x20ca\x6cle\x64\x5fn\x75\x6d\x62\x65r,\x20de\x73\x63ri\x70\x74i\x6f\x6e) \x56A\x4c\x55ES (\x27$login','$clienttype','$number\x27,\x27$description\x27)";${${"\x47\x4c\x4fB\x41\x4cS"}["\x6d\x69s\x70\x72q\x6a\x77\x6ci"]}=mysql_query(${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["g\x66\x70\x6cz\x74yk\x70\x63"]});}function deleteActiveCall(){${"\x47L\x4f\x42\x41L\x53"}["\x6c\x78\x6e\x79f\x6f\x6e\x73"]="\x69\x64\x5f\x63li\x65n\x74";$dmmhlfvhtok="\x63\x6c\x69\x65\x6e\x74\x54y\x70\x65";${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x6cx\x6e\x79\x66on\x73"]}=$this->clientID;${${"\x47L\x4f\x42\x41L\x53"}["\x6d\x65\x78\x78f\x71"]}=$this->agiUniqueID;${$dmmhlfvhtok}=SIP_USER;${${"\x47LO\x42\x41\x4c\x53"}["\x71\x6e\x6e\x61w\x6e\x79\x6e\x79\x69\x64\x71"]}="\x44\x45LE\x54E \x46R\x4fM\x20\x61cti\x76e\x63\x61ll\x20W\x48\x45RE id_cal\x6c\x20= '$callID'";${${"\x47\x4c\x4fBAL\x53"}["m\x69\x73\x70r\x71j\x77li"]}=mysql_query(${${"G\x4c\x4fB\x41L\x53"}["qn\x6e\x61\x77n\x79\x6e\x79\x69\x64q"]});}function checkActiveCall($idClient){$bmzfrslganp="\x73q\x6c";${${"\x47\x4cO\x42A\x4cS"}["\x6a\x6b\x6d\x7ab\x73y\x6f\x62\x6f\x66"]}=SIP_USER;${"\x47L\x4fB\x41\x4c\x53"}["u\x77z\x66\x64d\x73\x62\x73"]="n\x75m\x62e\x52\x6f\x77";${$bmzfrslganp}="\x53\x45\x4c\x45\x43T \x20*\x46R\x4f\x4d\x20a\x63\x74iveca\x6c\x6c \x20\x57\x48\x45RE \x63\x6c\x69en\x74_id \x3d\x20'$idClient'\x20A\x4e\x44 \x63\x6cien\x74t\x79\x70e = \x27$clientType\x27 LI\x4dIT 1";${${"G\x4cO\x42\x41L\x53"}["\x6d\x69s\x70r\x71\x6a\x77\x6c\x69"]}=mysql_query(${${"\x47L\x4f\x42\x41\x4c\x53"}["\x7ai\x74v\x76r\x6c"]});${${"\x47\x4c\x4f\x42AL\x53"}["\x76\x77\x71\x72\x6d\x66\x62ur"]}=mysql_num_rows(${${"\x47\x4c\x4fB\x41L\x53"}["\x6d\x69\x73p\x72qj\x77l\x69"]});if(${${"\x47LO\x42\x41\x4c\x53"}["u\x77\x7af\x64d\x73\x62\x73"]}>0)return 1;else return 0;}function ivrPlayClinetBalance($agi){$uoiscffsp="k";${$uoiscffsp}=1;}function ivrPlayClinetBalanceInfo($agi){$wqxegcg="\x62al\x61\x6ece\x41\x72\x72a\x79";$agi->stream_file("yo\x75_\x68ave","#");${$wqxegcg}=explode(".",round($this->clientBalance,2));$agi->say_number(${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x68o\x62\x62\x71\x6f\x66s\x72\x74"]}[0]);$agi->stream_file("\x64\x6fl\x6c\x61\x72","#");if(${${"G\x4c\x4f\x42A\x4cS"}["\x68\x6fb\x62q\x6f\x66\x73\x72t"]}[1]=="")${${"G\x4c\x4fB\x41LS"}["\x68\x6f\x62\x62q\x6ffs\x72\x74"]}[1]=0;else{${"\x47\x4c\x4f\x42\x41LS"}["\x75l\x71\x70\x65u"]="\x73t\x72Lent\x68";$nubvhqdhjz="st\x72\x4c\x65\x6et\x68";$ctkvxrh="\x62\x61\x6c\x61nc\x65A\x72\x72a\x79";$mwhiho="b\x61\x6c\x61n\x63\x65\x41rr\x61\x79";${"\x47\x4c\x4fB\x41\x4c\x53"}["\x73\x64\x64t\x79\x63\x75"]="\x62\x61\x6c\x61nc\x65\x41\x72r\x61\x79";${${"\x47\x4c\x4f\x42AL\x53"}["u\x6cq\x70\x65\x75"]}=strlen(${$ctkvxrh}[1]);if(${$nubvhqdhjz}==1)${${"G\x4c\x4fBA\x4cS"}["\x68obb\x71o\x66s\x72\x74"]}[1]=${${"\x47LO\x42\x41\x4c\x53"}["\x73d\x64ty\x63u"]}[1]."0";else${$mwhiho}[1]=${${"\x47\x4cO\x42A\x4cS"}["\x68\x6fb\x62\x71\x6ffsrt"]}[1];}$agi->say_number(${${"G\x4c\x4f\x42\x41\x4c\x53"}["hob\x62qo\x66s\x72\x74"]}[1]);$agi->stream_file("\x63en\x74s","\x23");}function ivrPlaySms($agi){$agi->stream_file("\x31\x35081\x359\x32\x35\x34-\x31\x34\x306\x34\x309\x38\x382-\x38\x6b\x68\x7a","#");$agi->say_number(6);$agi->say_number(5);$agi->say_number(5);}function rateBlockDetails($rateChartID){${${"\x47\x4cOB\x41\x4c\x53"}["zi\x74\x76v\x72\x6c"]}="\x73\x65le\x63\x74 * fro\x6d\x20ra\x74\x65\x5fb\x6c\x6f\x63k\x20w\x68ere \x72ate\x63\x68a\x72\x74\x49D =\x20".${${"\x47L\x4f\x42\x41\x4c\x53"}["\x73gn\x72l\x62\x75\x73wdw"]}."\x20ORD\x45R\x20BY\x20I\x44\x20\x41\x53C";${${"\x47\x4c\x4f\x42\x41\x4cS"}["\x6d\x69s\x70r\x71j\x77\x6ci"]}=mysql_query(${${"G\x4c\x4fB\x41L\x53"}["\x7a\x69\x74\x76v\x72l"]});if(mysql_num_rows(${${"\x47L\x4f\x42\x41L\x53"}["\x6d\x69\x73p\x72\x71\x6aw\x6c\x69"]})>0){${${"G\x4cO\x42\x41\x4c\x53"}["\x75\x76rr\x68\x67p\x6dp\x65\x72"]}=array();${"G\x4cOB\x41L\x53"}["\x65y\x6b\x7a\x71\x71\x63\x66"]="\x72esul\x74";while(${${"\x47\x4cOBALS"}["y\x6ak\x76vt\x65\x73w\x73\x79"]}=mysql_fetch_assoc(${${"G\x4c\x4fBA\x4c\x53"}["e\x79kz\x71q\x63f"]})){${${"G\x4c\x4f\x42AL\x53"}["\x75v\x72\x72h\x67\x70\x6d\x70\x65\x72"]}[]=${${"\x47L\x4fB\x41\x4c\x53"}["y\x6a\x6bv\x76\x74\x65\x73w\x73\x79"]};}$pomorndu="row\x73";return${$pomorndu};}else{return 0;}}function rateBlockDuration($rateChartID,$callDuration,$balance,$MFL,$MF){${"G\x4cO\x42\x41LS"}["c\x74s\x74\x66\x79"]="\x63\x61\x6c\x6c\x44u\x72\x61t\x69\x6f\x6e\x42l\x6fck";$vtkbvis="r\x61\x74\x65Ch\x61\x72tI\x44";${${"G\x4c\x4fB\x41\x4c\x53"}["c\x74stfy"]}=${${"G\x4cO\x42A\x4c\x53"}["\x68\x71\x65\x6ad\x73"]};${${"\x47\x4c\x4f\x42ALS"}["\x71\x77j\x69\x6b\x75\x62n"]}=$this->rateBlockDetails(${$vtkbvis});if(${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["qw\x6aik\x75\x62\x6e"]}!=0){foreach(${${"\x47L\x4f\x42\x41\x4c\x53"}["\x71wji\x6b\x75\x62\x6e"]} as${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x79\x6a\x6b\x76v\x74\x65\x73\x77s\x79"]}){$vvhtcnbtj="m\x69\x6e\x75te\x4du\x6c\x74\x69\x70\x6ci\x65\x72";${"\x47\x4cO\x42\x41L\x53"}["\x67\x72\x6bm\x70\x6c\x68\x78\x72"]="\x63\x61ll\x44\x75rat\x69\x6fn";$vdnehcqyc="\x65nd\x4d\x69\x6e\x75te";${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x79x\x6a\x79\x69\x6cy"]="en\x64\x4d\x69\x6eu\x74\x65";$fnplurqr="\x73\x74\x61\x72\x74M\x69\x6e\x75\x74e";${"\x47\x4c\x4fB\x41L\x53"}["\x6e\x6b\x77\x74\x6d\x63\x76w\x70z"]="\x6d\x69n\x75\x74\x65\x4du\x6cti\x70\x6c\x69\x65\x72";$hbopnjneq="\x72\x6fw";${$vvhtcnbtj}=(${${"\x47\x4cO\x42\x41\x4c\x53"}["\x68\x71\x65\x6ad\x73"]}>(${${"GL\x4f\x42A\x4c\x53"}["\x6cnp\x76\x70\x73\x75x\x78"]}*60))?${${"G\x4c\x4fB\x41\x4cS"}["\x6e\x63\x6eaz\x6c"]}:60;${"\x47\x4c\x4fB\x41\x4c\x53"}["\x63o\x78u\x78el\x61\x6a"]="\x72\x6fw";${"\x47L\x4f\x42ALS"}["\x7ax\x74\x63\x64\x71\x75e\x6b\x72"]="\x6dinut\x65\x4dultip\x6c\x69e\x72";${"\x47\x4cO\x42AL\x53"}["sk\x6e\x69y\x67pf\x74\x6c"]="s\x74a\x72tM\x69\x6eu\x74\x65";${$fnplurqr}=${$hbopnjneq}["st\x61\x72tM\x69n\x75\x74e"]*${${"\x47\x4c\x4fBALS"}["n\x6bwt\x6d\x63\x76\x77\x70\x7a"]};${${"G\x4c\x4f\x42A\x4cS"}["\x79xjy\x69ly"]}=${${"\x47L\x4fBAL\x53"}["\x63o\x78\x75xel\x61j"]}["endMi\x6e\x75\x74e"]*${${"\x47L\x4f\x42\x41\x4cS"}["\x7axt\x63\x64\x71\x75e\x6b\x72"]};if((${${"\x47\x4cO\x42\x41\x4c\x53"}["\x68\x71e\x6ads"]}>${${"\x47\x4c\x4f\x42\x41L\x53"}["\x73\x6bn\x69\x79g\x70\x66\x74\x6c"]})&&(${${"G\x4c\x4f\x42\x41\x4cS"}["\x67r\x6b\x6dpl\x68x\x72"]}<=${$vdnehcqyc})){$ptngqnayjip="\x62a\x6c\x61nce";${"GL\x4f\x42\x41\x4c\x53"}["\x68\x77uumh\x78\x79j"]="\x72ow";${"\x47\x4c\x4f\x42\x41L\x53"}["\x71\x6cy\x66xa\x75uw"]="\x4d\x46";$bwitugfomk="\x63\x61l\x6cDu\x72\x61t\x69o\x6e\x42\x6c\x6f\x63\x6b";${$bwitugfomk}=$this->withLimitCallDuration(${$ptngqnayjip},${${"\x47\x4cO\x42\x41\x4cS"}["\x71\x6cyf\x78\x61\x75\x75w"]},${${"\x47L\x4f\x42A\x4cS"}["h\x77u\x75\x6d\x68xy\x6a"]}["\x62\x6co\x63k\x52\x61te"],${${"\x47\x4c\x4f\x42ALS"}["l\x6ep\x76\x70su\x78x"]});break;}}return${${"\x47\x4cOB\x41L\x53"}["p\x69\x73\x69\x6b\x68\x75\x79"]};}else{${"GLO\x42AL\x53"}["\x76\x6bk\x65\x62\x76d\x6d\x71\x64\x6dm"]="ca\x6c\x6c\x44\x75\x72\x61\x74\x69\x6f\x6eBl\x6fc\x6b";return${${"\x47\x4c\x4fB\x41L\x53"}["vk\x6b\x65\x62\x76\x64\x6dqdm\x6d"]};}}function withLimitCallDuration($balance,$MF,$CR,$MFL){$spffxbekg="\x62a\x6c\x61\x6ec\x65";${"\x47\x4cO\x42A\x4c\x53"}["\x73qbsx\x68\x79"]="M\x46";${${"\x47LO\x42\x41L\x53"}["\x68q\x65jd\x73"]}=(${$spffxbekg}*${${"\x47\x4c\x4f\x42A\x4cS"}["\x73\x71b\x73\x78hy"]})/${${"\x47\x4c\x4f\x42\x41\x4cS"}["xhw\x62\x63jlo\x77"]};${${"\x47\x4c\x4f\x42\x41\x4cS"}["o\x62\x69hb\x69el\x6d"]}=(min(floor(${${"\x47\x4c\x4f\x42\x41\x4cS"}["\x68\x71\x65\x6ad\x73"]}/60),${${"\x47\x4cOB\x41\x4c\x53"}["lnp\x76\x70\x73\x75x\x78"]})*(60-${${"G\x4c\x4fB\x41\x4cS"}["n\x63\x6eaz\x6c"]}))+${${"G\x4cOBA\x4c\x53"}["h\x71\x65jds"]};return${${"\x47\x4cO\x42AL\x53"}["o\x62ihb\x69elm"]};}function clinetMaxCallDuration(){$dcptnjdmxf="\x4d\x46L";${"G\x4c\x4fBA\x4c\x53"}["\x70\x6dlxy\x73\x67\x6d"]="\x74\x61\x78\x46\x65\x65";$frpkpbo="\x4dFL";${"G\x4c\x4f\x42\x41LS"}["uml\x6ft\x77r\x66j"]="\x4d\x46";${${"\x47L\x4f\x42A\x4c\x53"}["\x75\x6dl\x6f\x74\x77rf\x6a"]}=$this->clientMinuteflexibility;${${"\x47LO\x42A\x4c\x53"}["xh\x77\x62\x63\x6a\x6c\x6f\x77"]}=$this->clientCallRate;$lvbpopi="P\x52";${"G\x4c\x4f\x42\x41\x4c\x53"}["mfw\x6c\x76\x75\x76\x69\x6c"]="c\x6cien\x74\x43\x75\x72\x72\x65\x6et\x42\x61l\x61n\x63\x65";${${"\x47LO\x42AL\x53"}["\x75\x7a\x6djbe\x6ae\x65\x6f\x68"]}=$this->clientResolution;${$frpkpbo}=$this->clientMinuteflexibilityLimit;if($this->clientrConnectionFee>0){$this->clientConnectionFee=$this->clientrConnectionFee;}${"\x47L\x4f\x42\x41LS"}["g\x78\x69\x64\x73s\x78\x78\x6dj\x6b"]="ta\x78\x46\x65\x65";if($this->clientrDisConnectionFee>0){$this->clientDisConnectionFee=$this->clientrDisConnectionFee;}$scfjnevimu="\x43\x52";$rrlgzfn="\x63\x61\x6c\x6c\x44\x75\x72\x61\x74\x69\x6f\x6eF\x69\x6e\x61\x6c";if($this->clientrTaxFee>0){$this->clientTaxFee=$this->clientrTaxFee;}${${"GLOBA\x4cS"}["\x70\x6dlx\x79\x73\x67m"]}=number_format(($this->clientTaxFee*$this->clientBalance)/100,6,".","");${"\x47LO\x42AL\x53"}["\x77h\x63\x74\x77m\x6ev\x6d"]="M\x46\x4c";$swbfjfov="\x4d\x46";${${"GL\x4f\x42\x41\x4cS"}["h\x73\x79\x6a\x67li\x68\x62\x68\x62\x72"]}=((float)$this->clientBalance-((float)${${"\x47\x4c\x4f\x42\x41\x4cS"}["\x67\x78id\x73\x73\x78\x78m\x6a\x6b"]}+(float)$this->clientConnectionFee+(float)$this->clientDisConnectionFee));${${"\x47L\x4f\x42\x41\x4cS"}["\x71\x76\x6a\x7a\x78\x70\x69rhj\x63"]}=$this->withLimitCallDuration(${${"GLO\x42\x41\x4cS"}["\x68s\x79\x6a\x67\x6ci\x68b\x68\x62\x72"]},${$swbfjfov},${$scfjnevimu},${$dcptnjdmxf});${$rrlgzfn}=$this->rateBlockDuration($this->clientRateChartID,${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x71\x76j\x7a\x78p\x69\x72\x68jc"]},${${"\x47L\x4f\x42\x41\x4cS"}["\x6df\x77l\x76\x75\x76\x69\x6c"]},${${"\x47L\x4f\x42\x41\x4cS"}["\x77hc\x74wm\x6ev\x6d"]},${${"\x47LO\x42\x41L\x53"}["\x6ec\x6e\x61\x7a\x6c"]});$this->clinetMaxCallDuration=floor(${${"\x47LO\x42\x41\x4c\x53"}["\x73\x69\x78p\x72\x62\x70u\x6d\x68"]}/${$lvbpopi})*${${"\x47\x4c\x4f\x42A\x4cS"}["\x75\x7a\x6d\x6abe\x6ae\x65\x6fh"]};}function getMaxCallDuration($clinetMaxCallDuration=0,$reseller1MaxCallDuration=0,$reseller2MaxCallDuration=0,$reseller3MaxCallDuration=0,$reseller4MaxCallDuration=0){$xuvrpcrgvruw="\x72\x65\x73\x65l\x6ce\x721\x4da\x78Ca\x6c\x6c\x44u\x72\x61\x74i\x6f\x6e";$rqkvqgl="r\x65s\x65\x6c\x6cer2\x4da\x78\x43\x61llD\x75\x72\x61\x74\x69o\x6e";$qpqppeibomy="c\x6c\x69n\x65t\x4d\x61x\x43\x61\x6cl\x44\x75r\x61\x74\x69on";if(${$qpqppeibomy}>=MAX_CALL_DURATION)${${"G\x4cO\x42\x41\x4c\x53"}["c\x7a\x72\x67\x75\x69\x74"]}=MAX_CALL_DURATION;$nnlwxfk="\x72e\x73ell\x65\x72\x33\x4d\x61x\x43\x61\x6c\x6c\x44\x75\x72\x61\x74i\x6f\x6e";${"\x47L\x4fBALS"}["\x78\x67x\x6e\x63\x6dnupe\x67"]="c\x6cin\x65tM\x61\x78\x43al\x6cD\x75\x72\x61\x74ion";$yogcjregg="\x72\x65s\x65l\x6c\x65\x72\x34\x4d\x61\x78\x43\x61l\x6cD\x75\x72\x61\x74i\x6fn";if(${${"\x47\x4c\x4f\x42\x41L\x53"}["k\x63i\x71\x6b\x76\x61p\x72s\x73\x6e"]}>=MAX_CALL_DURATION)${$xuvrpcrgvruw}=MAX_CALL_DURATION;${"\x47LO\x42\x41\x4c\x53"}["\x6e\x61\x77\x74\x72ms\x78\x6fr"]="\x72\x65\x73e\x6c\x6c\x65r\x32\x4d\x61\x78\x43\x61ll\x44\x75\x72\x61\x74io\x6e";${"\x47\x4cO\x42\x41\x4c\x53"}["\x6a\x75\x75e\x6a\x75ct\x75fc"]="\x72e\x73\x65\x6cl\x65\x724M\x61\x78\x43\x61ll\x44\x75\x72\x61t\x69\x6fn";${"G\x4c\x4f\x42\x41L\x53"}["\x76\x6f\x69\x67b\x67\x78\x62\x7aky"]="r\x65s\x65\x6c\x6cer\x32M\x61\x78\x43\x61\x6c\x6c\x44\x75\x72\x61tio\x6e";if(${${"\x47\x4cOB\x41\x4c\x53"}["\x76\x6f\x69\x67\x62\x67\x78\x62\x7ak\x79"]}>=MAX_CALL_DURATION)${$rqkvqgl}=MAX_CALL_DURATION;$yeiytrutbk="\x72\x65\x73ell\x65\x72\x33\x4da\x78\x43\x61llD\x75r\x61\x74i\x6f\x6e";if(${$nnlwxfk}>=MAX_CALL_DURATION)${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x61\x63of\x62\x6dlc\x6b"]}=MAX_CALL_DURATION;if(${${"\x47\x4c\x4f\x42A\x4cS"}["\x6au\x75eju\x63tu\x66\x63"]}>=MAX_CALL_DURATION)${$yogcjregg}=MAX_CALL_DURATION;${${"\x47\x4c\x4f\x42\x41L\x53"}["\x61\x70\x6d\x70i\x77\x73"]}=min(${${"\x47L\x4f\x42\x41L\x53"}["\x78\x67xn\x63mn\x75\x70\x65\x67"]},${${"G\x4cO\x42\x41\x4cS"}["\x6b\x63\x69\x71\x6bv\x61p\x72\x73sn"]},${${"\x47\x4cO\x42\x41\x4cS"}["\x6e\x61\x77t\x72msx\x6f\x72"]},${$yeiytrutbk},${${"\x47\x4cOBA\x4cS"}["\x78\x6av\x68\x62\x78"]});return${${"G\x4cOB\x41\x4c\x53"}["\x61\x70mp\x69\x77\x73"]};}function reseller1MaxCallDuration(){${"G\x4cO\x42AL\x53"}["\x75\x68\x67\x64vi\x6f\x79t\x6c\x75"]="t\x61\x78F\x65\x65";$exzguoh="\x72e\x73e\x6cler\x31\x43\x75\x72\x72\x65\x6e\x74\x42ala\x6e\x63\x65";${"G\x4c\x4f\x42\x41\x4c\x53"}["yene\x76\x6b\x77"]="\x43R";${"G\x4c\x4fB\x41LS"}["\x7ac\x77\x76w\x7aoyo\x69"]="M\x46";${${"\x47L\x4f\x42\x41L\x53"}["\x6e\x63\x6eaz\x6c"]}=$this->reseller1Minuteflexibility;$nmhevrocm="M\x46\x4c";${${"GL\x4f\x42\x41\x4c\x53"}["\x79\x65ne\x76\x6b\x77"]}=$this->reseller1CallRate;${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["u\x7a\x6d\x6a\x62e\x6a\x65\x65o\x68"]}=$this->reseller1Resolution;$ddcuceolol="\x4d\x46\x4c";${$ddcuceolol}=$this->reseller1MinuteflexibilityLimit;if($this->reseller1rConnectionFee>0){$this->reseller1ConnectionFee=$this->reseller1rConnectionFee;}$zucrxorhsj="\x43\x52";$nlcundkqm="M\x46";$ipbchsrklef="cal\x6c\x44\x75\x72a\x74\x69onA\x66\x74\x65\x72CF\x61\x6ed\x44\x46";if($this->reseller1rDisConnectionFee>0){$this->reseller1DisConnectionFee=$this->reseller1rDisConnectionFee;}${"\x47\x4c\x4f\x42A\x4c\x53"}["\x6c\x76im\x78\x77a\x71\x65"]="\x63\x61\x6c\x6cD\x75r\x61\x74i\x6f\x6eF\x69\x6eal";if($this->reseller1rTaxFee>0){$this->reseller1TaxFee=$this->reseller1rTaxFee;}${${"G\x4cOB\x41LS"}["\x77\x72h\x69s\x69j\x78k\x68"]}=number_format(($this->reseller1TaxFee*$this->reseller1Balance)/100,6,".","");${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["ws\x78\x68\x72muk\x65\x67"]}=((float)$this->reseller1Balance-((float)${${"G\x4c\x4f\x42\x41L\x53"}["uh\x67d\x76\x69\x6f\x79\x74\x6c\x75"]}+(float)$this->reseller1ConnectionFee+(float)$this->reseller1DisConnectionFee));${$ipbchsrklef}=$this->withLimitCallDuration(${$exzguoh},${$nlcundkqm},${$zucrxorhsj},${$nmhevrocm});$cqoprwiufh="res\x65\x6cler1C\x75r\x72\x65\x6e\x74\x42\x61\x6can\x63\x65";${${"\x47\x4c\x4f\x42\x41\x4cS"}["\x6cv\x69\x6d\x78\x77a\x71\x65"]}=$this->rateBlockDuration($this->reseller1RateChartID,${${"G\x4c\x4f\x42\x41\x4c\x53"}["\x71\x76\x6azx\x70i\x72\x68jc"]},${$cqoprwiufh},${${"\x47\x4c\x4f\x42\x41L\x53"}["\x6cnp\x76p\x73\x75\x78\x78"]},${${"G\x4c\x4fB\x41\x4c\x53"}["\x7a\x63wvwzo\x79\x6fi"]});$this->reseller1MaxCallDuration=floor(${${"\x47LOB\x41LS"}["\x73\x69x\x70\x72b\x70\x75\x6d\x68"]}/${${"\x47L\x4f\x42\x41\x4c\x53"}["\x75\x7am\x6a\x62\x65\x6ae\x65\x6f\x68"]})*${${"\x47\x4c\x4fB\x41\x4c\x53"}["\x75z\x6d\x6a\x62e\x6ae\x65\x6fh"]};}function reseller2MaxCallDuration(){$lcehde="\x4d\x46";$dlwnzfk="\x72\x65\x73e\x6c\x6c\x65\x72\x32\x43\x75\x72\x72\x65n\x74\x42\x61l\x61\x6ece";${"\x47\x4cO\x42\x41L\x53"}["\x6dt\x6b\x65\x62\x6bq"]="M\x46";${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x78\x62\x6d\x77lwd"]="MFL";$pebivtfxjfh="CR";${${"GL\x4f\x42\x41L\x53"}["\x6d\x74k\x65b\x6bq"]}=$this->reseller2Minuteflexibility;$lkjqecjgsuk="\x63\x61\x6clD\x75\x72\x61\x74\x69\x6f\x6eA\x66te\x72\x43\x46\x61\x6e\x64\x44F";${"\x47LO\x42A\x4c\x53"}["\x74h\x71\x78\x71\x63"]="CR";$zfxfsgher="\x4dFL";${$pebivtfxjfh}=$this->reseller2CallRate;${${"G\x4cO\x42\x41\x4c\x53"}["u\x7am\x6a\x62\x65\x6a\x65eo\x68"]}=$this->reseller2Resolution;${${"G\x4c\x4f\x42A\x4cS"}["\x6c\x6e\x70\x76p\x73\x75x\x78"]}=$this->reseller2MinuteflexibilityLimit;if($this->reseller2rConnectionFee>0){$this->reseller2ConnectionFee=$this->reseller2rConnectionFee;}${"\x47\x4cO\x42\x41L\x53"}["s\x70\x72kneg\x66f\x70\x77"]="\x74\x61\x78F\x65\x65";if($this->reseller2rDisConnectionFee>0){$this->reseller2DisConnectionFee=$this->reseller2rDisConnectionFee;}if($this->reseller2rTaxFee>0){$this->reseller2TaxFee=$this->reseller2rTaxFee;}${${"\x47\x4cO\x42\x41\x4cS"}["s\x70r\x6bneg\x66\x66p\x77"]}=number_format(($this->reseller2TaxFee*$this->reseller2Balance)/100,6,"\x2e","");${"\x47\x4c\x4fBA\x4c\x53"}["\x62\x62\x6c\x77\x64\x6a\x6dp"]="ca\x6c\x6c\x44\x75\x72a\x74\x69\x6f\x6e\x41\x66\x74\x65r\x43Fa\x6edD\x46";${${"\x47L\x4fBA\x4c\x53"}["\x6at\x6f\x62\x67f\x6fk\x66\x69rd"]}=((float)$this->reseller2Balance-((float)${${"GLO\x42A\x4c\x53"}["\x77\x72\x68\x69\x73\x69j\x78\x6b\x68"]}+(float)$this->reseller2ConnectionFee+(float)$this->reseller2DisConnectionFee));${${"\x47\x4cO\x42\x41\x4cS"}["b\x62l\x77d\x6a\x6d\x70"]}=$this->withLimitCallDuration(${$dlwnzfk},${$lcehde},${${"\x47LO\x42\x41\x4c\x53"}["th\x71x\x71\x63"]},${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["xb\x6d\x77l\x77\x64"]});${${"G\x4c\x4f\x42AL\x53"}["\x73\x69x\x70r\x62p\x75\x6d\x68"]}=$this->rateBlockDuration($this->reseller2RateChartID,${$lkjqecjgsuk},${${"\x47L\x4fB\x41L\x53"}["\x6a\x74obgfok\x66ird"]},${$zfxfsgher},${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x6e\x63\x6eazl"]});$this->reseller2MaxCallDuration=floor(${${"\x47\x4c\x4fB\x41\x4cS"}["s\x69\x78prb\x70\x75\x6dh"]}/${${"G\x4c\x4f\x42\x41\x4cS"}["u\x7am\x6a\x62\x65\x6a\x65\x65\x6f\x68"]})*${${"\x47\x4c\x4fB\x41LS"}["\x75\x7a\x6d\x6a\x62\x65\x6a\x65eo\x68"]};}function reseller3MaxCallDuration(){$pbvzlyaib="\x43R";$wbwipukyjpsv="M\x46L";$wduokhhiw="\x50\x52";${"G\x4c\x4f\x42\x41L\x53"}["m\x73gd\x65\x70\x61xlr\x74"]="\x4dF";${${"G\x4cO\x42\x41\x4c\x53"}["m\x73\x67d\x65pax\x6cr\x74"]}=$this->reseller3Minuteflexibility;$vnfeyucnf="\x63\x61l\x6cD\x75rati\x6fn\x46\x69\x6e\x61\x6c";${$pbvzlyaib}=$this->reseller3CallRate;${"G\x4cO\x42\x41\x4cS"}["\x6eg\x72\x71\x6e\x64\x67\x6cp"]="t\x61\x78F\x65\x65";${${"G\x4cOB\x41\x4c\x53"}["uz\x6d\x6a\x62\x65j\x65e\x6f\x68"]}=$this->reseller3Resolution;${"\x47\x4c\x4fB\x41\x4c\x53"}["\x63uy\x66\x79\x6b\x77d\x63u\x68\x6f"]="\x72esel\x6cer\x33Cu\x72\x72en\x74\x42a\x6ca\x6e\x63\x65";${${"\x47L\x4fB\x41\x4c\x53"}["\x6c\x6e\x70\x76\x70s\x75\x78x"]}=$this->reseller3MinuteflexibilityLimit;$slnkcxml="\x43\x52";$bodscvk="\x50\x52";if($this->reseller3rConnectionFee>0){$this->reseller3ConnectionFee=$this->reseller3rConnectionFee;}if($this->reseller3rDisConnectionFee>0){$this->reseller3DisConnectionFee=$this->reseller3rDisConnectionFee;}${"\x47\x4c\x4f\x42\x41LS"}["\x78w\x73c\x6d\x66u\x68\x65"]="\x72\x65\x73\x65l\x6c\x65r\x33\x43ur\x72\x65n\x74\x42\x61\x6c\x61\x6e\x63e";if($this->reseller3rTaxFee>0){$this->reseller3TaxFee=$this->reseller3rTaxFee;}${"\x47\x4c\x4f\x42\x41L\x53"}["f\x61\x6d\x69\x79\x66\x6c\x77\x71\x62"]="\x4dF";${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["w\x72\x68is\x69j\x78k\x68"]}=number_format(($this->reseller3TaxFee*$this->reseller3Balance)/100,6,"\x2e","");${${"\x47\x4c\x4fB\x41\x4cS"}["\x78w\x73\x63\x6d\x66uh\x65"]}=((float)$this->reseller3Balance-((float)${${"GL\x4f\x42\x41\x4c\x53"}["ng\x72\x71\x6e\x64\x67\x6cp"]}+(float)$this->reseller3ConnectionFee+(float)$this->reseller3DisConnectionFee));${${"\x47\x4cO\x42\x41\x4c\x53"}["q\x76\x6a\x7a\x78\x70\x69r\x68\x6a\x63"]}=$this->withLimitCallDuration(${${"\x47L\x4f\x42A\x4cS"}["\x63u\x79f\x79\x6b\x77\x64\x63\x75ho"]},${${"\x47LO\x42\x41\x4c\x53"}["\x6ec\x6e\x61\x7al"]},${$slnkcxml},${$wbwipukyjpsv});${$vnfeyucnf}=$this->rateBlockDuration($this->reseller3RateChartID,${${"\x47\x4c\x4f\x42\x41\x4cS"}["q\x76\x6az\x78p\x69\x72\x68jc"]},${${"G\x4cO\x42\x41\x4c\x53"}["ddgxr\x79\x63\x70\x73hf\x65"]},${${"G\x4c\x4f\x42AL\x53"}["\x6c\x6ep\x76\x70su\x78\x78"]},${${"\x47L\x4f\x42\x41L\x53"}["\x66\x61m\x69\x79f\x6c\x77q\x62"]});$this->reseller3MaxCallDuration=floor(${${"\x47L\x4f\x42A\x4cS"}["s\x69\x78\x70r\x62pu\x6dh"]}/${$bodscvk})*${$wduokhhiw};}function reseller4MaxCallDuration(){${"GL\x4f\x42ALS"}["j\x66\x67\x76\x6a\x65\x74f\x6e"]="\x72\x65\x73\x65\x6cl\x65r\x34Cu\x72\x72\x65\x6et\x42\x61\x6c\x61n\x63\x65";$dxopmom="P\x52";$rxsgupa="M\x46L";${"G\x4c\x4fB\x41\x4c\x53"}["\x6c\x75\x62\x7a\x71\x6d\x63"]="\x4dF";${"\x47\x4c\x4f\x42A\x4c\x53"}["\x69nj\x66\x70c\x65\x65\x6fd\x6d\x77"]="call\x44ur\x61t\x69\x6fnAf\x74e\x72CF\x61\x6e\x64\x44\x46";$oltzlmr="c\x61\x6c\x6cDu\x72\x61t\x69\x6f\x6e\x41ft\x65\x72\x43F\x61\x6ed\x44\x46";$thurhvgnv="\x43\x52";${${"GL\x4fB\x41L\x53"}["\x6e\x63\x6e\x61\x7a\x6c"]}=$this->reseller4Minuteflexibility;${"\x47\x4cO\x42\x41\x4c\x53"}["\x71\x6b\x64\x6d\x66\x77"]="\x4d\x46\x4c";${$thurhvgnv}=$this->reseller4CallRate;${$dxopmom}=$this->reseller4Resolution;${${"G\x4c\x4fB\x41\x4c\x53"}["\x71kdm\x66\x77"]}=$this->reseller4MinuteflexibilityLimit;$kerujwljo="M\x46L";if($this->reseller4rConnectionFee>0){$this->reseller4ConnectionFee=$this->reseller4rConnectionFee;}${"\x47LO\x42A\x4c\x53"}["\x64\x70\x76\x79v\x6a\x74w"]="\x74\x61\x78\x46\x65e";if($this->reseller4rDisConnectionFee>0){$this->reseller4DisConnectionFee=$this->reseller4rDisConnectionFee;}if($this->reseller4rTaxFee>0){$this->reseller4TaxFee=$this->reseller4rTaxFee;}${${"\x47L\x4fB\x41LS"}["\x64\x70v\x79\x76\x6a\x74\x77"]}=number_format(($this->reseller4TaxFee*$this->reseller4Balance)/100,6,"\x2e","");${${"\x47\x4cO\x42\x41\x4cS"}["\x6e\x70z\x6crt\x67\x77\x62"]}=((float)$this->reseller4Balance-((float)${${"G\x4cOB\x41\x4c\x53"}["wrh\x69\x73\x69\x6ax\x6bh"]}+(float)$this->reseller4ConnectionFee+(float)$this->reseller4DisConnectionFee));${$oltzlmr}=$this->withLimitCallDuration(${${"\x47L\x4fB\x41\x4c\x53"}["\x6e\x70z\x6cr\x74\x67w\x62"]},${${"G\x4c\x4fB\x41\x4c\x53"}["\x6c\x75\x62z\x71m\x63"]},${${"\x47LOBA\x4c\x53"}["\x78\x68wbc\x6a\x6c\x6f\x77"]},${$kerujwljo});${${"\x47\x4c\x4fB\x41\x4cS"}["\x73ix\x70\x72\x62pumh"]}=$this->rateBlockDuration($this->reseller4RateChartID,${${"G\x4c\x4fB\x41\x4c\x53"}["\x69n\x6a\x66\x70\x63\x65\x65\x6f\x64m\x77"]},${${"\x47\x4cO\x42\x41LS"}["\x6af\x67v\x6ae\x74fn"]},${$rxsgupa},${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["n\x63\x6ea\x7a\x6c"]});$this->reseller4MaxCallDuration=floor(${${"\x47\x4cO\x42A\x4c\x53"}["s\x69x\x70r\x62p\x75\x6dh"]}/${${"GL\x4f\x42\x41\x4c\x53"}["\x75\x7a\x6d\x6a\x62\x65\x6a\x65\x65\x6f\x68"]})*${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x75\x7a\x6d\x6a\x62\x65\x6a\x65\x65\x6f\x68"]};}function reseller1Info($id,$agi){$lusqnxfguwmt="\x72\x65s\x75lt";${"GL\x4fB\x41L\x53"}["jwshlx\x72"]="\x73\x71\x6c";${${"\x47\x4cO\x42\x41\x4cS"}["\x7a\x69tv\x76\x72\x6c"]}="\x53E\x4cE\x43\x54\n\t\t\t\x61\x2e\x69d,\n\t\t\ta.l\x6fg\x69\x6e,\n\t\t\ta.\x69\x64_\x72e\x73elle\x72,\n\t\t\t\x61.b\x61lan\x63e,\n\t\t\t\x61.\x69\x64_\x72\x61\x74e,\n\t\t\ta\x2es\x74atu\x73,\n\t\t\tb\x2ec\x6fn\x6ee\x63tio\x6e\x5ff\x65e,\n\t\t\tb.\x63onn\x65ct\x69on_\x74\x68\x72esh\x6fld,\n\t\t\tb.discon\x6e\x65ct\x69o\x6e_\x66\x65e,\n\t\t\t\x62\x2edi\x73c\x6fnne\x63ti\x6fn\x5ft\x68r\x65\x73\x68ol\x64,\n\t\t\t\x62\x2etax,\n\t\t\t\x61.c\x72\x65d\x69\x74L\x69\x6d\x69t\n\x20\x20\x20\x20\x20\x20 \x20 \x20 F\x52\x4f\x4d \x72\x65\x73\x65\x6cl\x65\x72s\x31 \x61\n \x20 \x20 \x20\x20\x20IN\x4eER\x20\x4a\x4f\x49N\x20ra\x74ena\x6d\x65 b\n\x20\x20 \x20 \x20 ON\x20\x61.i\x64\x5f\x72\x61\x74e\x20 =\x20b\x2eid_\x72at\x65\n \x20 \x20\x20\x20\x20\x20\x20 \x20W\x48\x45\x52E \x20a.i\x64=\x27$id'\x20L\x49\x4dIT\x201";${$lusqnxfguwmt}=mysql_query(${${"\x47\x4c\x4f\x42\x41\x4cS"}["\x6aw\x73\x68\x6cx\x72"]});if(mysql_num_rows(${${"\x47L\x4fBA\x4c\x53"}["\x6d\x69\x73\x70\x72qjwli"]})==1){$qcxqwh="r\x6f\x77";${"G\x4c\x4fB\x41L\x53"}["lshw\x64\x63\x79\x77"]="r\x6f\x77";$xdvfodsey="\x72ow";${"\x47\x4cOB\x41\x4c\x53"}["ia\x62\x63\x6f\x77\x73\x76\x75d\x75"]="row";$zkhyfk="ro\x77";$hxvbucpuqyud="\x72o\x77";${"\x47\x4cOBALS"}["\x67\x73\x6e\x6f\x68l\x78\x74\x6es\x72"]="\x72\x6fw";$qdufqzfisfz="r\x65\x73\x75\x6c\x74";${${"\x47\x4cO\x42\x41L\x53"}["\x79\x6a\x6b\x76\x76tes\x77s\x79"]}=mysql_fetch_row(${$qdufqzfisfz});$wajsjrcehdqr="\x73t\x61tu\x73";$this->reseller1ID=${$qcxqwh}[0];${${"\x47L\x4f\x42\x41\x4c\x53"}["w\x68\x73\x62j\x77\x77\x77\x78\x63"]}=${${"G\x4cOBALS"}["\x79\x6a\x6bvvt\x65\x73\x77\x73y"]}[1];$ffrcol="\x72\x6f\x77";$this->reseller2ID=${${"\x47L\x4fBAL\x53"}["\x79jkvv\x74\x65\x73w\x73y"]}[2];$this->reseller1Balance=(float)${${"\x47\x4c\x4fB\x41\x4c\x53"}["\x79\x6a\x6b\x76\x76t\x65\x73\x77\x73y"]}[3]+(float)${$hxvbucpuqyud}[11];$this->reseller1RateID=${${"G\x4c\x4fBAL\x53"}["g\x73n\x6f\x68\x6cx\x74\x6e\x73\x72"]}[4];${${"G\x4c\x4f\x42\x41\x4c\x53"}["qf\x70c\x6e\x77\x65r"]}=${${"\x47LO\x42\x41\x4cS"}["\x69\x61\x62c\x6f\x77\x73\x76\x75\x64\x75"]}[5];$this->reseller1ConnectionFee=${$ffrcol}[6];$this->reseller1ConnectionThresholdValue=${$zkhyfk}[7];$this->reseller1DisConnectionFee=${${"G\x4cOB\x41\x4c\x53"}["\x79\x6a\x6bv\x76\x74\x65\x73\x77\x73\x79"]}[8];$this->reseller1DisConnectionThresholdValue=${$xdvfodsey}[9];$this->reseller1TaxFee=${${"\x47\x4c\x4fBA\x4c\x53"}["l\x73hwdc\x79\x77"]}[10];if($this->reseller1Balance<=0){$avkpisjb="\x64\x65\x73\x63r\x69\x70\x74i\x6fn";${${"\x47\x4c\x4f\x42AL\x53"}["\x63\x74\x6ef\x6fo\x6d"]}="\x52e\x73\x65l\x6cer \x49\x20h\x61\x73\x20\x6e\x6f mone\x79\x20t\x6f\x20m\x61k\x65 c\x61l\x6c";$this->insertFailedCall(${$avkpisjb});$agi->hangup();exit();}if(${$wajsjrcehdqr}==0){${${"\x47\x4c\x4fBA\x4cS"}["ctnfo\x6f\x6d"]}="\x52\x65se\x6cle\x72\x20I \x69\x73 i\x6e\x61\x63ti\x76\x65";$this->insertFailedCall(${${"\x47\x4c\x4fBA\x4c\x53"}["\x63\x74\x6e\x66\x6f\x6fm"]});$agi->hangup();exit();}}else{${"\x47LO\x42\x41L\x53"}["\x67d\x78\x79\x6a\x64\x70\x62\x71o\x6b\x6d"]="d\x65sc\x72\x69\x70t\x69\x6f\x6e";${${"\x47\x4c\x4f\x42\x41\x4cS"}["c\x74\x6ef\x6fo\x6d"]}="In\x76\x61lid\x20R\x65se\x6c\x6c\x65\x72\x20\x49";$this->insertFailedCall(${${"G\x4c\x4f\x42\x41\x4c\x53"}["\x67dx\x79jd\x70\x62q\x6f\x6b\x6d"]});$agi->hangup();exit();}}function reseller2Info($id,$agi){${${"\x47\x4cO\x42\x41L\x53"}["\x7ait\x76v\x72l"]}="SE\x4cECT\n\t\t\ta.i\x64,\n\t\t\t\x61.l\x6fgi\x6e,\n\t\t\ta\x2ei\x64\x5f\x72\x65se\x6c\x6c\x65r,\n\t\t\t\x61\x2e\x62al\x61n\x63e,\n\t\t\t\x61.\x69\x64_\x72a\x74e,\n\t\t\ta\x2est\x61\x74\x75s,\n\t\t\tb\x2e\x63\x6f\x6en\x65\x63tion\x5f\x66e\x65,\n\t\t\t\x62.c\x6fn\x6e\x65\x63ti\x6f\x6e\x5f\x74\x68\x72\x65\x73\x68\x6f\x6c\x64,\n\t\t\tb.d\x69\x73conn\x65\x63tion_\x66\x65e,\n\t\t\t\x62\x2ed\x69\x73con\x6ee\x63ti\x6f\x6e\x5f\x74\x68re\x73\x68o\x6cd,\n\t\t\tb.\x74\x61x,\n\t\t\ta\x2ecr\x65\x64i\x74Li\x6dit\n \x20 \x20 \x20 \x20 \x46\x52O\x4d \x72e\x73e\x6cler\x73\x32\x20\x61\n\x20\x20 \x20 \x20\x20 \x20 \x49\x4e\x4eER\x20\x4aO\x49N\x20r\x61t\x65n\x61\x6d\x65 b\n\x20 \x20 \x20 \x20\x20\x20 O\x4e\x20a\x2e\x69\x64_rat\x65 \x20= b\x2ei\x64_ra\x74\x65\n\x20 \x20\x20W\x48\x45\x52E \x20a\x2eid\x3d\x27$id'\x20L\x49MI\x54\x201";${"\x47\x4cO\x42\x41\x4c\x53"}["\x71\x67kkm\x70vo"]="\x72\x65\x73\x75\x6c\x74";${${"G\x4c\x4f\x42\x41L\x53"}["\x6di\x73\x70\x72\x71j\x77l\x69"]}=mysql_query(${${"\x47\x4c\x4f\x42\x41L\x53"}["zi\x74vvr\x6c"]});if(mysql_num_rows(${${"\x47L\x4f\x42\x41\x4c\x53"}["\x71\x67kk\x6d\x70\x76o"]})==1){${"G\x4cOB\x41\x4cS"}["\x63\x76o\x73\x64i\x77"]="\x72\x6f\x77";$ioblhek="\x72\x6f\x77";${"GL\x4f\x42\x41\x4c\x53"}["\x74\x69\x72u\x79\x74\x66\x68s\x6d\x74"]="r\x6fw";${"\x47L\x4f\x42\x41LS"}["\x75\x68\x67\x78f\x6c\x67"]="log\x69\x6e";$tvcfkyyeu="r\x6f\x77";${$ioblhek}=mysql_fetch_row(${${"GL\x4fBA\x4c\x53"}["\x6d\x69\x73p\x72\x71\x6aw\x6c\x69"]});$this->reseller2ID=${${"\x47\x4c\x4fBA\x4c\x53"}["\x79j\x6b\x76\x76\x74\x65\x73\x77\x73y"]}[0];${${"\x47\x4cOB\x41\x4c\x53"}["u\x68g\x78\x66\x6c\x67"]}=${${"\x47\x4cOB\x41LS"}["\x79\x6a\x6b\x76v\x74e\x73\x77\x73y"]}[1];$xdkxpxum="s\x74\x61t\x75s";$this->reseller3ID=${${"G\x4cOB\x41\x4c\x53"}["\x74i\x72\x75\x79\x74\x66h\x73m\x74"]}[2];$this->reseller2Balance=(float)${${"\x47\x4cO\x42\x41\x4c\x53"}["\x79j\x6bv\x76\x74\x65sw\x73\x79"]}[3]+(float)${${"\x47\x4c\x4fB\x41\x4c\x53"}["\x79j\x6bv\x76\x74\x65\x73\x77\x73y"]}[11];$this->reseller2RateID=${${"G\x4cO\x42A\x4c\x53"}["\x79\x6ak\x76\x76t\x65s\x77\x73y"]}[4];${${"\x47\x4cO\x42A\x4c\x53"}["qfp\x63\x6e\x77\x65r"]}=${${"\x47\x4c\x4f\x42A\x4c\x53"}["\x79\x6ak\x76v\x74\x65\x73\x77\x73\x79"]}[5];$this->reseller2ConnectionFee=${${"G\x4c\x4fB\x41\x4c\x53"}["\x79jk\x76\x76\x74\x65\x73\x77\x73\x79"]}[6];$this->reseller2ConnectionThresholdValue=${$tvcfkyyeu}[7];$this->reseller2DisConnectionFee=${${"\x47\x4cOB\x41L\x53"}["\x63\x76\x6fsd\x69w"]}[8];$this->reseller2DisConnectionThresholdValue=${${"\x47\x4c\x4f\x42\x41L\x53"}["\x79\x6akv\x76\x74es\x77\x73\x79"]}[9];$this->reseller2TaxFee=${${"GL\x4f\x42\x41L\x53"}["\x79\x6ak\x76\x76\x74e\x73w\x73y"]}[10];if($this->reseller2Balance<=0){${"\x47\x4cOBAL\x53"}["\x64\x6bvb\x68jji\x6f\x64\x6f"]="de\x73\x63\x72\x69\x70\x74i\x6fn";${${"\x47\x4c\x4fBA\x4c\x53"}["\x63tnf\x6fo\x6d"]}="\x52e\x73\x65\x6c\x6ce\x72\x20I\x49 \x68a\x73\x20\x6e\x6f \x6do\x6e\x65y\x20t\x6f ma\x6b\x65 \x63al\x6c";$this->insertFailedCall(${${"GL\x4f\x42AL\x53"}["\x64\x6b\x76\x62\x68\x6aj\x69\x6f\x64\x6f"]});$agi->hangup();exit();}if(${$xdkxpxum}==0){${${"\x47\x4c\x4f\x42\x41L\x53"}["ctn\x66\x6fo\x6d"]}="Re\x73\x65\x6cl\x65r\x20\x49\x49 \x69\x73 \x69\x6ea\x63\x74\x69\x76e";$this->insertFailedCall(${${"\x47L\x4f\x42\x41L\x53"}["\x63\x74\x6e\x66\x6f\x6f\x6d"]});$agi->hangup();exit();}}else{$bnzdblzg="\x64es\x63\x72\x69\x70t\x69\x6f\x6e";${$bnzdblzg}="\x49\x6e\x76ali\x64 \x52\x65s\x65l\x6ce\x72 \x49\x49";$this->insertFailedCall(${${"\x47\x4c\x4fB\x41\x4cS"}["\x63\x74\x6e\x66\x6fo\x6d"]});$agi->hangup();exit();}}function reseller3Info($id,$agi){${"\x47\x4c\x4fBA\x4c\x53"}["w\x75\x68\x63\x66\x69\x6e\x64\x78\x6a"]="r\x65\x73u\x6c\x74";$vruyqya="\x73ql";${${"G\x4c\x4f\x42\x41LS"}["zit\x76v\x72\x6c"]}="\x53EL\x45CT\n\t\t\t\x61\x2e\x69\x64,\n\t\t\t\x61.l\x6f\x67i\x6e,\n\t\t\ta.i\x64_r\x65se\x6cl\x65r,\n\t\t\ta.balanc\x65,\n\t\t\ta\x2ei\x64_rate,\n\t\t\t\x61\x2est\x61t\x75s,\n\t\t\t\x62\x2econ\x6e\x65ction\x5ff\x65\x65,\n\t\t\t\x62.con\x6e\x65\x63\x74\x69on_\x74\x68\x72e\x73\x68\x6fld,\n\t\t\tb.d\x69s\x63\x6f\x6en\x65ct\x69\x6fn_\x66e\x65,\n\t\t\t\x62.d\x69\x73conn\x65\x63\x74ion_t\x68\x72es\x68\x6f\x6cd,\n\t\t\tb\x2e\x74\x61\x78,\n\t\t\ta.c\x72\x65\x64\x69t\x4cimi\x74\n\x20 \x20 \x20 \x46R\x4fM\x20r\x65\x73\x65\x6c\x6c\x65\x72s3\x20\x61\n\x20\x20 \x20\x20 \x20 \x49N\x4eE\x52\x20J\x4f\x49\x4e ratenam\x65 \x62\n\x20\x20 \x20\x20 \x20ON \x61\x2eid_ra\x74\x65 \x3d b\x2ei\x64_r\x61\x74e\n \x20 \x20 \x20 WH\x45R\x45\x20\x20a.\x69d=\x27$id'\x20\x4cI\x4dI\x54\x201";${${"\x47\x4c\x4f\x42A\x4cS"}["\x6dis\x70r\x71\x6a\x77\x6c\x69"]}=mysql_query(${$vruyqya});if(mysql_num_rows(${${"\x47L\x4f\x42\x41\x4cS"}["wu\x68\x63f\x69\x6e\x64\x78j"]})==1){$tmoeaerij="\x72\x6fw";${"\x47LO\x42\x41\x4c\x53"}["\x76\x62\x66ee\x66\x62"]="\x72\x6f\x77";$kntvjct="\x72\x6f\x77";${"\x47L\x4fBA\x4c\x53"}["\x6bj\x65\x63r\x75li\x7a\x76l\x69"]="\x6c\x6f\x67\x69n";${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x67\x66\x74\x66r\x62cm"]="\x72\x65su\x6c\x74";${$kntvjct}=mysql_fetch_row(${${"\x47\x4cOBAL\x53"}["g\x66\x74\x66r\x62cm"]});$this->reseller3ID=${${"\x47L\x4fB\x41L\x53"}["\x79jk\x76\x76t\x65\x73\x77sy"]}[0];${${"G\x4cOB\x41\x4c\x53"}["\x6bj\x65\x63ruli\x7av\x6c\x69"]}=${${"G\x4c\x4fB\x41\x4c\x53"}["\x79\x6a\x6b\x76\x76\x74es\x77\x73y"]}[1];$this->reseller4ID=${$tmoeaerij}[2];$kedbjfqdy="r\x6f\x77";$this->reseller3Balance=(float)${${"\x47\x4c\x4f\x42A\x4c\x53"}["\x79\x6akv\x76t\x65\x73\x77\x73\x79"]}[3]+(float)${${"G\x4cO\x42\x41\x4c\x53"}["\x76\x62\x66eef\x62"]}[11];$this->reseller3RateID=${${"\x47L\x4f\x42\x41\x4c\x53"}["\x79\x6a\x6bv\x76te\x73w\x73y"]}[4];${${"\x47LO\x42\x41\x4c\x53"}["qf\x70\x63\x6ew\x65r"]}=${${"\x47L\x4f\x42AL\x53"}["y\x6akv\x76\x74\x65sw\x73\x79"]}[5];$this->reseller3ConnectionFee=${${"\x47L\x4f\x42\x41\x4cS"}["\x79\x6a\x6b\x76v\x74e\x73\x77\x73\x79"]}[6];$this->reseller3ConnectionThresholdValue=${${"\x47\x4c\x4fB\x41\x4c\x53"}["\x79\x6a\x6b\x76\x76\x74e\x73\x77sy"]}[7];$this->reseller3DisConnectionFee=${$kedbjfqdy}[8];$this->reseller3DisConnectionThresholdValue=${${"\x47\x4c\x4f\x42A\x4cS"}["\x79j\x6bv\x76t\x65\x73\x77\x73y"]}[9];$this->reseller3TaxFee=${${"\x47LOB\x41\x4cS"}["yjk\x76\x76t\x65\x73\x77\x73\x79"]}[10];if($this->reseller3Balance<=0){${${"\x47L\x4f\x42\x41\x4c\x53"}["\x63\x74\x6e\x66\x6fom"]}="R\x65seller \x49\x49\x49\x20ha\x73\x20no \x6d\x6f\x6e\x65y \x74o\x20\x6d\x61ke cal\x6c";$this->insertFailedCall(${${"\x47L\x4fB\x41LS"}["c\x74\x6e\x66\x6fom"]});$agi->hangup();exit();}if(${${"\x47\x4cO\x42\x41L\x53"}["\x71\x66\x70\x63\x6e\x77e\x72"]}==0){${${"\x47L\x4f\x42A\x4c\x53"}["\x63tn\x66\x6fo\x6d"]}="\x52\x65\x73e\x6c\x6c\x65\x72\x20\x49I\x49 is ina\x63\x74\x69v\x65";${"GL\x4f\x42\x41\x4cS"}["r\x65\x6c\x63kle"]="d\x65\x73\x63\x72\x69\x70\x74\x69o\x6e";$this->insertFailedCall(${${"GLO\x42\x41\x4c\x53"}["r\x65\x6c\x63\x6b\x6c\x65"]});$agi->hangup();exit();}}else{$hdysyujqphs="\x64\x65\x73\x63\x72i\x70tio\x6e";$fjpusleuemt="d\x65sc\x72\x69\x70\x74\x69\x6fn";${$hdysyujqphs}="I\x6ev\x61\x6cid \x52e\x73e\x6cl\x65\x72 \x49II";$this->insertFailedCall(${$fjpusleuemt});$agi->hangup();exit();}}function reseller4Info($id,$agi){$zpvslcojf="\x72e\x73u\x6c\x74";${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["z\x69\x74v\x76\x72l"]}="\x53ELECT\n\t\t\t\x61.\x69d,\n\t\t\ta\x2elo\x67in,\n\t\t\ta.b\x61\x6c\x61\x6e\x63\x65,\n\t\t\ta.\x69d_\x72at\x65,\n\t\t\ta.sta\x74\x75s,\n\t\t\tb\x2e\x63\x6f\x6en\x65\x63\x74\x69o\x6e\x5f\x66\x65\x65,\n\t\t\t\x62.\x63on\x6ee\x63\x74io\x6e\x5f\x74hr\x65shold,\n\t\t\t\x62\x2e\x64i\x73c\x6f\x6e\x6e\x65ct\x69on\x5f\x66ee,\n\t\t\tb\x2e\x64i\x73co\x6en\x65\x63\x74\x69on\x5fth\x72\x65sho\x6c\x64,\n\t\t\tb.t\x61x,\n\t\t\ta.c\x72edi\x74\x4c\x69\x6d\x69t\n\n \x20\x20 \x20 \x20\x46ROM res\x65lle\x72s4 \x61\n\x20\x20 \x20 \x20 I\x4e\x4eER \x4aO\x49N \x72\x61ten\x61m\x65 \x62\n \x20 \x20 \x20\x20ON\x20a\x2eid\x5frat\x65\x20 =\x20\x62\x2e\x69d_\x72a\x74\x65\n\x20\x20\x20\x20 \x20\x20\x20\x20 \x20W\x48\x45RE a\x2ei\x64\x3d\x27$id\x27 LIM\x49\x54 \x31";${${"\x47L\x4f\x42\x41L\x53"}["\x6d\x69\x73\x70\x72q\x6aw\x6c\x69"]}=mysql_query(${${"\x47\x4cO\x42\x41L\x53"}["\x7a\x69t\x76vr\x6c"]});if(mysql_num_rows(${$zpvslcojf})==1){$umqtybgquyv="ro\x77";$hponov="\x72\x6f\x77";$xadgfzv="s\x74a\x74us";$nuzljxlpn="l\x6f\x67i\x6e";${"\x47\x4cO\x42AL\x53"}["\x75v\x66\x69\x64\x68m\x66\x67\x68\x7a"]="\x72\x6f\x77";${${"GL\x4f\x42A\x4c\x53"}["y\x6a\x6bvv\x74\x65s\x77\x73\x79"]}=mysql_fetch_row(${${"G\x4c\x4f\x42A\x4c\x53"}["m\x69\x73\x70\x72qj\x77l\x69"]});$this->reseller4ID=${${"\x47LOB\x41\x4c\x53"}["y\x6a\x6b\x76\x76t\x65\x73\x77sy"]}[0];${$nuzljxlpn}=${$hponov}[1];$this->reseller4Balance=(float)${${"\x47\x4cO\x42\x41\x4c\x53"}["\x75v\x66i\x64\x68\x6d\x66gh\x7a"]}[2]+(float)${${"\x47\x4c\x4f\x42\x41\x4cS"}["yj\x6bv\x76\x74esw\x73y"]}[10];${"G\x4c\x4f\x42A\x4cS"}["\x79\x76j\x63y\x65\x65\x62"]="\x73\x74\x61\x74\x75s";$this->reseller4RateID=${${"G\x4c\x4fB\x41\x4c\x53"}["y\x6a\x6bv\x76t\x65\x73ws\x79"]}[3];${${"\x47\x4cO\x42\x41\x4c\x53"}["yv\x6a\x63ye\x65b"]}=${$umqtybgquyv}[4];$this->reseller4ConnectionFee=${${"GL\x4f\x42AL\x53"}["\x79\x6ak\x76\x76\x74\x65\x73\x77\x73\x79"]}[5];$this->reseller4ConnectionThresholdValue=${${"\x47\x4cO\x42\x41\x4cS"}["y\x6a\x6b\x76\x76\x74es\x77\x73\x79"]}[6];$this->reseller4DisConnectionFee=${${"\x47\x4cO\x42\x41\x4c\x53"}["yj\x6b\x76\x76\x74\x65s\x77\x73\x79"]}[7];$this->reseller4DisConnectionThresholdValue=${${"G\x4c\x4fBA\x4cS"}["y\x6a\x6bv\x76\x74e\x73\x77\x73y"]}[8];$this->reseller4TaxFee=${${"\x47\x4cO\x42\x41\x4c\x53"}["y\x6a\x6b\x76\x76t\x65\x73w\x73\x79"]}[9];if($this->reseller4Balance<=0){$lxvwqfuubj="\x64\x65\x73\x63r\x69\x70ti\x6fn";${$lxvwqfuubj}="R\x65\x73ell\x65r \x49\x56 has\x20n\x6f \x6do\x6ee\x79\x20\x74o ma\x6b\x65 call";$this->insertFailedCall(${${"G\x4c\x4f\x42AL\x53"}["c\x74\x6ef\x6fo\x6d"]});$agi->hangup();exit();}if(${$xadgfzv}==0){${"\x47L\x4fBA\x4c\x53"}["j\x62vf\x66ga"]="\x64\x65\x73c\x72i\x70\x74i\x6f\x6e";${${"GL\x4fB\x41\x4c\x53"}["j\x62\x76\x66\x66ga"]}="\x52e\x73el\x6ce\x72 I\x56 \x69s i\x6ea\x63\x74\x69\x76e";$this->insertFailedCall(${${"\x47L\x4f\x42A\x4c\x53"}["\x63\x74n\x66oom"]});$agi->hangup();exit();}}else{${${"\x47LO\x42\x41\x4c\x53"}["\x63\x74\x6ef\x6f\x6f\x6d"]}="I\x6ev\x61l\x69d\x20Re\x73\x65\x6c\x6cer\x20I\x56";$this->insertFailedCall(${${"\x47L\x4fB\x41\x4c\x53"}["\x63\x74\x6e\x66\x6fo\x6d"]});$agi->hangup();exit();}}function p2pTerminationClient($clientlogin,$idReseller=-1,$resellerLevel=-1){${"G\x4c\x4f\x42\x41LS"}["\x6f\x6b\x7afv\x71\x62\x68\x78\x71"]="s\x71\x6c";${${"GLOB\x41LS"}["\x7aitv\x76\x72l"]}="\x53EL\x45CT\x20\x702\x70\x5f\x61\x6cl\x6f\x77 \x46R\x4fM \x63\x6ci\x65\x6e\x74\x73\x73\x69\x70\x20W\x48\x45R\x45\x20\x6co\x67in =\x20\x27$clientlogin' \x41ND \x70\x32\x70_\x61l\x6cow\x20=\x20\x31 \x41\x4e\x44 i\x64\x5fre\x73\x65\x6cl\x65r \x3d\x20\x27$idReseller' \x41ND r\x65\x73\x65l\x6c\x65\x72_\x6cev\x65l\x20\x3d \x27$resellerLevel'\x20\x4c\x49M\x49\x54\x201";${${"GL\x4f\x42\x41\x4c\x53"}["\x6di\x73\x70r\x71\x6a\x77\x6c\x69"]}=mysql_query(${${"G\x4c\x4fB\x41\x4cS"}["\x6f\x6b\x7a\x66\x76\x71\x62\x68\x78\x71"]});${${"\x47\x4cO\x42A\x4cS"}["\x76w\x71rm\x66bur"]}=mysql_num_rows(${${"\x47\x4c\x4f\x42A\x4cS"}["\x6d\x69\x73\x70\x72q\x6awl\x69"]});if(${${"\x47\x4cO\x42\x41\x4cS"}["v\x77\x71rm\x66\x62\x75r"]}>0)return 1;else return 0;}function getSettings(){$hzacsie="s\x71\x6c";${"G\x4c\x4f\x42A\x4cS"}["\x71\x6d\x65\x6dx\x72\x63\x64n\x77"]="r\x65\x73\x75\x6c\x74";${"G\x4c\x4f\x42\x41\x4cS"}["\x7a\x64z\x6d\x62\x6b\x64\x76\x6e"]="r\x65\x73ult";${$hzacsie}="SE\x4cEC\x54 f\x69\x72e\x77\x61\x6cl,\x69d\x5f\x72\x61t\x65,\x69\x76r,iv\x72_\x65nab\x6c\x65d \x46\x52OM\x20\x73\x65\x74ti\x6eg\x73\x20WHE\x52E\x20st\x61\x74\x75\x73\x20= \"Y\"";${${"\x47\x4c\x4fBAL\x53"}["\x71\x6de\x6d\x78r\x63\x64\x6ew"]}=mysql_query(${${"\x47\x4c\x4f\x42A\x4cS"}["\x7ai\x74\x76\x76\x72\x6c"]});return mysql_fetch_assoc(${${"G\x4cO\x42\x41\x4cS"}["\x7ad\x7a\x6dbk\x64\x76\x6e"]});}function userAuthentication($agi){$this->agiUniqueID=$agi->request["agi\x5fu\x6eiq\x75e\x69d"];${"\x47\x4cO\x42\x41L\x53"}["dm\x62\x78\x77\x79"]="s\x71l\x50\x72\x6fxy";$this->agiChannel=$agi->request["\x61g\x69_c\x68\x61\x6ene\x6c"];$this->agiType=$agi->request["a\x67i\x5f\x74\x79pe"];$this->agiCalleridName=$agi->request["ag\x69\x5fcal\x6ce\x72i\x64name"];$this->agiCallerID=$agi->request["\x61\x67i_ca\x6c\x6c\x65r\x69d"];${"GL\x4fBALS"}["\x6d\x69\x6f\x79\x63a\x79\x77\x75\x6ey\x6b"]="\x61\x67i\x64n\x69\x64";$this->agiExtension=$agi->request["agi_e\x78te\x6e\x73\x69on"];${"G\x4cO\x42AL\x53"}["\x78\x78\x6bm\x72\x72l"]="r\x65\x73ul\x74";$this->agiContext=$agi->request["\x61g\x69_\x63\x6f\x6ete\x78t"];${${"\x47\x4cO\x42A\x4c\x53"}["m\x69oyc\x61\x79\x77\x75n\x79\x6b"]}=$agi->request["\x61g\x69\x5f\x64\x6e\x69d"];$this->agidnid=$this->agiExtension;$this->agiAccountCode=$agi->request["\x61gi_\x61c\x63\x6f\x75\x6etc\x6fde"];${${"\x47\x4cOB\x41L\x53"}["\x64\x72\x7a\x64\x6cg\x78"]}=$this->agiAccountCode;${${"G\x4cO\x42\x41\x4c\x53"}["\x6a\x6b\x6dz\x62s\x79obo\x66"]}=SIP_USER;$this->clientType=${${"\x47\x4c\x4fB\x41\x4c\x53"}["\x6akm\x7a\x62\x73\x79\x6fb\x6f\x66"]};${${"\x47\x4c\x4fBAL\x53"}["\x64mb\x78\x77\x79"]}="\x53E\x4cE\x43T\n\t\t \x20 \x20 \x20 a.id,\n\t\t\t\t\x61.\x63allli\x6d\x69\x74,\n\t\t\t\t\x61\x2e\x69nus\x65,\n\t\t\t\t\x61.\x69\x64_ra\x74e,\n\t\t\t\t\x61\x2eb\x61\x6c\x61n\x63\x65,\n\t\t\t\ta\x2e\x69d\x5f\x72\x65se\x6cl\x65\x72,\n\t\t\t\ta\x2esta\x74us,\n\t\t\t\t\x62.\x66\x75l\x6c\x63o\x6e\x74a\x63\x74,\n\t\t\t\tb.\x69\x70\x61\x64dr,\n\t\t\t\t\x61.\x70\x68one,\n\t\t\t\t\x61.\x6co\x67in,\n\t\t\t\ta.\x72e\x73\x65\x6cler_l\x65vel,\n\t\t\t\ta\x2ei\x76r\x5f\x61llo\x77,\n\t\t\t\tc.connec\x74ion\x5f\x66\x65\x65,\n\t\t\t\t\x63\x2eco\x6e\x6ee\x63\x74ion\x5ft\x68\x72es\x68\x6f\x6c\x64,\n\t\t\t\t\x63\x2e\x64i\x73\x63onnect\x69\x6f\x6e\x5ffee,\n\t\t\t\tc\x2e\x64i\x73c\x6fnn\x65\x63\x74ion_\x74\x68r\x65s\x68o\x6cd,\n\t\t\t\t\x63\x2e\x74\x61\x78,\n\t\t\t\t\x61.\x702p_a\x6clow,\n\t\t\t\ta.\x66\x75\x6c\x6c_\x6e\x61m\x65\n\t\t\t\t\x46RO\x4d \x63\x6c\x69\x65\x6etssi\x70\x20\x61\n\t\t\t\tINN\x45\x52 J\x4fI\x4e\x20\x73ipus\x65rs\x20b\n\t\t \x20 \x20\x20 ON \x61\x2eid = b.i\x64\x5fcl\x69\x65nt\n\t\t\t\tIN\x4e\x45R \x4a\x4fI\x4e\x20\x72\x61\x74ena\x6de\x20\x63\n\t\t\x20 \x20\x20\x20 \x20O\x4e \x61.\x69d\x5f\x72ate\x20\x3d c.\x69\x64\x5frat\x65\n\t\t\t\tI\x4e\x4e\x45R\x20J\x4f\x49\x4e \x70rox\x79i\x70\x20d\n\t\t\x20\x20\x20\x20 \x20\x20\x4f\x4e \x62\x2e\x69pa\x64d\x72\x20\x3d\x20d\x2e\x70r\x6f\x78\x79\x69p\n\t\t \x20\x20\x20\x20\x20 WH\x45\x52E \x61.l\x6fg\x69\x6e\x20=\x20'$userName' \x41\x4e\x44 \x62\x2ea\x63\x63\x6fu\x6e\x74code = \x27$userName\x27\x20 \x41ND\x20\x62.\x63\x6c\x69\x65\x6e\x74t\x79\x70e\x20= '$clientType\x27\x20\x41\x4e\x44 \x61.\x73ta\x74\x75s\x20= 1\x20A\x4eD \x64.\x73\x74a\x74u\x73\x20= 1";$rmroiqqtrb="\x73e\x74\x74\x69\x6e\x67\x73";${${"\x47L\x4fB\x41\x4c\x53"}["\x7a\x69\x74v\x76r\x6c"]}="S\x45L\x45\x43T\n\t\t\x20\x20\x20 \x20 \x61.i\x64,\n\t\t\t\ta.\x63al\x6c\x6c\x69mi\x74,\n\t\t\t\ta\x2ei\x6e\x75se,\n\t\t\t\ta\x2eid_\x72at\x65,\n\t\t\t\ta.b\x61lance,\n\t\t\t\t\x61\x2ei\x64_r\x65sel\x6c\x65r,\n\t\t\t\ta.\x73ta\x74\x75\x73,\n\t\t\t\t\x62\x2e\x66\x75l\x6ccon\x74a\x63t,\n\t\t\t\t\x62\x2ei\x70\x61dd\x72,\n\t\t\t\t\x61.\x70hone,\n\t\t\t\ta\x2elog\x69n,\n\t\t\t\ta.\x72\x65\x73\x65\x6cl\x65r_\x6c\x65v\x65\x6c,\n\t\t\t\t\x61\x2eivr\x5f\x61ll\x6f\x77,\n\t\t\t\t\x63\x2e\x63o\x6e\x6eection\x5ffee,\n\t\t\t\t\x63.\x63\x6f\x6enect\x69o\x6e\x5fthr\x65s\x68\x6fl\x64,\n\t\t\t\t\x63.\x64\x69\x73\x63on\x6ee\x63\x74\x69\x6fn_fee,\n\t\t\t\tc\x2e\x64\x69\x73\x63\x6f\x6en\x65\x63ti\x6fn\x5ft\x68re\x73hold,\n\t\t\t\tc\x2e\x74a\x78,\n\t\t\t\t\x61\x2e\x70\x32p\x5f\x61\x6clo\x77,\n\t\t\t\ta.fu\x6cl\x5f\x6e\x61\x6d\x65\n\t\t\t\t\x46\x52OM c\x6c\x69\x65\x6et\x73si\x70\x20\x61\n\t\t\t\tI\x4eN\x45R\x20\x4a\x4f\x49\x4e\x20\x73\x69\x70\x75\x73er\x73\x20\x62\n\t\t \x20\x20 \x20 \x20\x20\x4fN \x61.\x69\x64\x20\x3d b.\x69\x64_\x63l\x69\x65\x6e\x74\n\t\t\t\tI\x4e\x4e\x45\x52 J\x4f\x49\x4e\x20\x72\x61\x74\x65na\x6d\x65 c\n\t\t\x20\x20\x20 \x20 ON a.\x69\x64_\x72at\x65 \x3d\x20c.\x69d_rate\n\t\t\x20 \x20\x20\x20 \x57\x48E\x52\x45 \x61.l\x6fgin = '$userName\x27 A\x4eD \x62.a\x63coun\x74c\x6f\x64\x65 \x3d\x20'$userName'\x20\x20\x41\x4e\x44 \x62.\x63lien\x74t\x79\x70e\x20= \x27$clientType' AND \x61\x2e\x73\x74\x61tus \x3d 1";${$rmroiqqtrb}=$this->getSettings();$uxsnlyu="\x71";if(${${"G\x4c\x4f\x42\x41L\x53"}["\x75\x66qy\x77\x67w\x71d"]}["\x66ire\x77all"]=="en\x61bled"){${"G\x4cOB\x41\x4cS"}["\x6b\x62\x67o\x6f\x6d\x69\x76\x63"]="\x73\x71\x6c\x50\x72o\x78\x79";${${"G\x4c\x4fB\x41L\x53"}["\x70\x65\x78\x67ot\x62\x67\x6c\x74"]}=${${"\x47\x4c\x4fB\x41\x4cS"}["k\x62\x67\x6f\x6f\x6d\x69v\x63"]};}else{${"\x47\x4c\x4fB\x41LS"}["rr\x65\x73\x6e\x79\x6a\x6f"]="s\x71\x6c";${${"G\x4cO\x42A\x4cS"}["pe\x78\x67\x6ft\x62gl\x74"]}=${${"\x47L\x4fBA\x4c\x53"}["\x72\x72\x65\x73\x6e\x79jo"]};}$yhxpzfkb="r\x65\x73\x75\x6ct";${${"\x47LO\x42\x41\x4c\x53"}["\x78\x78k\x6drrl"]}=mysql_query(${$uxsnlyu});if(mysql_num_rows(${$yhxpzfkb})==1){$dvyliyxe="\x72o\x77";${"\x47\x4cO\x42\x41\x4c\x53"}["\x73\x7a\x69k\x72\x73\x74q\x79\x79\x6b"]="ro\x77";$eihwmqpxp="r\x6f\x77";$xhykrmnct="\x72es\x75\x6c\x74";${${"\x47\x4cOB\x41\x4cS"}["\x73\x7aik\x72st\x71y\x79\x6b"]}=mysql_fetch_row(${$xhykrmnct});${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x67\x6chmn\x6a\x6e\x69\x6c\x62\x6d\x63"]="\x72o\x77";$this->clientID=${${"\x47\x4c\x4fB\x41\x4cS"}["\x67\x6ch\x6d\x6ej\x6e\x69\x6cb\x6d\x63"]}[0];${"\x47\x4cOB\x41L\x53"}["\x74\x63je\x79\x72\x7a"]="\x72o\x77";$kmywftjsrb="r\x6f\x77";$this->clientCallLimit=${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x79j\x6b\x76\x76tesw\x73y"]}[1];$this->clientInUse=${${"G\x4c\x4f\x42\x41\x4c\x53"}["\x79\x6a\x6b\x76\x76t\x65sw\x73\x79"]}[2];$this->clientRateID=${${"G\x4c\x4f\x42A\x4c\x53"}["\x74\x63je\x79r\x7a"]}[3];$this->clientBalance=${$kmywftjsrb}[4];$mmntopemvme="r\x6f\x77";$this->reseller1ID=${${"G\x4c\x4fB\x41\x4c\x53"}["\x79\x6ak\x76\x76\x74e\x73\x77\x73\x79"]}[5];${"\x47\x4c\x4f\x42\x41L\x53"}["z\x6fe\x72\x72o\x75\x6ec\x62\x6e"]="\x72\x6f\x77";$this->clientResellerID=${${"\x47L\x4f\x42\x41\x4c\x53"}["y\x6a\x6b\x76v\x74eswsy"]}[5];${${"\x47L\x4f\x42A\x4c\x53"}["\x75\x79\x6a\x71\x6a\x69e"]}=${${"G\x4cO\x42\x41\x4c\x53"}["yjk\x76\x76t\x65\x73\x77\x73\x79"]}[6];$this->clientIPAddress=${${"GL\x4f\x42A\x4c\x53"}["\x79\x6a\x6b\x76\x76\x74\x65\x73\x77s\x79"]}[7];$this->srcIP=${$eihwmqpxp}[8];$this->clientPhoneNumber=${$mmntopemvme}[9];$this->clientLogin=${${"\x47\x4c\x4fB\x41\x4c\x53"}["\x79\x6ak\x76\x76\x74\x65\x73\x77\x73y"]}[10];$this->clientResellerLevel=${${"\x47\x4c\x4fB\x41\x4c\x53"}["\x79\x6ak\x76\x76\x74\x65\x73\x77s\x79"]}[11];$dsgmvvfllqe="c\x6c\x69e\x6e\x74S\x74\x61\x74u\x73";${"\x47\x4c\x4f\x42\x41L\x53"}["\x62\x61o\x77\x69\x6d\x72"]="\x72o\x77";$this->playIVR=${${"\x47L\x4f\x42\x41LS"}["z\x6f\x65\x72r\x6f\x75\x6ecbn"]}[12];$this->clientConnectionFee=${${"\x47\x4cO\x42A\x4cS"}["\x79j\x6b\x76vt\x65\x73\x77sy"]}[13];$this->clientConnectionThresholdValue=${${"\x47\x4cO\x42A\x4cS"}["\x79jk\x76\x76\x74\x65\x73w\x73y"]}[14];$this->clientDisConnectionFee=${${"\x47\x4cO\x42\x41\x4cS"}["\x79\x6akvv\x74\x65\x73\x77sy"]}[15];${"\x47\x4c\x4f\x42\x41L\x53"}["ees\x63\x78\x6c\x79\x6c"]="\x72o\x77";$this->clientDisConnectionThresholdValue=${${"\x47\x4c\x4fB\x41\x4c\x53"}["\x65\x65\x73c\x78lyl"]}[16];$this->clientTaxFee=${$dvyliyxe}[17];${"G\x4c\x4fB\x41\x4cS"}["\x78\x61\x79\x69\x78q"]="\x73\x65\x74t\x69n\x67\x73";$this->allowP2Pcalls=${${"\x47\x4c\x4fBA\x4c\x53"}["\x62\x61\x6f\x77\x69mr"]}[18];$this->callerIDName=${${"\x47\x4c\x4f\x42A\x4c\x53"}["\x79\x6a\x6b\x76\x76\x74\x65s\x77\x73\x79"]}[19];if(!empty($this->clientPhoneNumber)AND is_numeric($this->clientPhoneNumber)){$this->agiCallerID=$this->clientPhoneNumber;}else{$this->agiCallerID=$this->agiAccountCode;}if(${$dsgmvvfllqe}==0){$qnzsloknds="\x64\x65\x73cr\x69\x70t\x69o\x6e";${${"GL\x4f\x42\x41L\x53"}["c\x74\x6e\x66oo\x6d"]}="C\x6ci\x65nt\x20\x69n\x61c\x74\x69ve";$this->insertFailedCall(${$qnzsloknds});$agi->hangup();exit();}if(empty(${${"\x47\x4c\x4f\x42A\x4c\x53"}["\x78\x61\x79ix\x71"]}["i\x76r"])){${"\x47\x4c\x4f\x42AL\x53"}["xug\x67krr\x6a\x64"]="\x69\x76r";${${"\x47\x4c\x4f\x42\x41LS"}["\x78u\x67g\x6b\x72\x72j\x64"]}="1\x32\x33";}else{$emyusedm="s\x65\x74\x74i\x6egs";$gphwwqnz="i\x76\x72";${$gphwwqnz}=trim(${$emyusedm}["\x69vr"]);}if($this->agidnid==${${"\x47\x4cO\x42\x41\x4c\x53"}["\x66\x6c\x66\x6a\x63\x6a\x74"]}){${"GL\x4f\x42A\x4cS"}["\x70h\x74i\x6f\x71m"]="\x61\x67\x69";$this->ivrPlayClinetBalanceInfo(${${"\x47LO\x42\x41\x4c\x53"}["ph\x74i\x6f\x71m"]});$agi->hangup();exit();}if($this->clientBalance<=0){$wtpruhgtkq="\x64\x65\x73c\x72\x69\x70\x74i\x6f\x6e";${$wtpruhgtkq}="\x4e\x6f\x20\x6d\x6fn\x65y to\x20ma\x6be\x20\x74\x68i\x73\x20c\x61ll";$this->insertFailedCall(${${"\x47\x4c\x4f\x42\x41\x4cS"}["\x63t\x6e\x66\x6f\x6f\x6d"]});$agi->hangup();exit();}if(($this->reseller1ID>0)AND($this->clientResellerLevel<0)){${"\x47\x4c\x4fB\x41\x4c\x53"}["\x68\x6axm\x67\x62s\x69"]="\x64e\x73\x63\x72\x69\x70t\x69\x6f\x6e";${${"\x47\x4c\x4f\x42\x41LS"}["\x68\x6a\x78m\x67\x62\x73i"]}="\x49\x6ev\x61\x6c\x69\x64 \x43\x6c\x69e\x6et\x20\x53etting us\x65r \x72\x65\x73e\x6c\x6ce\x72";$this->insertFailedCall(${${"\x47L\x4f\x42\x41\x4c\x53"}["ct\x6e\x66\x6f\x6f\x6d"]});$agi->hangup();exit();}if($this->clientCallLimit<=$this->clientInUse){$kktpzohr="\x63\x68\x65\x63\x6b\x41\x63\x74i\x76e\x43al\x6c";$this->deleteActiveCall();${$kktpzohr}=$this->checkActiveCall($this->clientID);if(${${"\x47\x4cO\x42A\x4c\x53"}["ol\x64\x69\x77\x6ey\x74\x6d"]}>0){${${"\x47LOB\x41\x4c\x53"}["\x63\x74n\x66\x6f\x6fm"]}="\x43lien\x74 C\x61ll \x4c\x69\x6d\x69\x74 e\x78\x63\x65\x65\x64";$this->insertFailedCall(${${"\x47\x4c\x4fB\x41\x4c\x53"}["\x63t\x6e\x66\x6fo\x6d"]});$agi->hangup();exit();}}${${"\x47\x4c\x4fB\x41LS"}["\x6b\x65\x6d\x64\x6f\x71\x68\x65\x78\x71"]}=substr($this->agiExtension,0,3);if(${${"GLO\x42\x41\x4cS"}["ke\x6d\x64o\x71\x68\x65\x78\x71"]}=="\x30\x300"){${"\x47\x4c\x4fB\x41\x4cS"}["\x62\x72\x6f\x79d\x6f\x75\x67\x6c\x69mm"]="a\x67\x69";$this->p2pCallSetting(${${"GLO\x42A\x4cS"}["br\x6fy\x64o\x75\x67l\x69mm"]});}else{${"GL\x4fB\x41\x4c\x53"}["\x65\x75\x70\x6ajvp"]="\x61\x67\x69";$this->preCallSetting(${${"\x47L\x4f\x42A\x4c\x53"}["\x65\x75\x70\x6a\x6av\x70"]});}}else{$axzunuywn="\x64\x65\x73\x63r\x69\x70\x74\x69\x6fn";${${"GL\x4f\x42A\x4c\x53"}["c\x74nf\x6f\x6f\x6d"]}="Fai\x6c\x65d U\x73\x65r\x20A\x75\x74h\x65\x6et\x69ca\x74i\x6f\x6e";$this->insertFailedCall(${$axzunuywn});$agi->hangup();exit();}}function preCallSetting($agi){$nrfgllwyybfw="\x61g\x69";$this->checkRateChart($this->clientRateID,$this->agidnid,${$nrfgllwyybfw},0);$this->clientBillingPrefix=$this->tempBillingPrefix;$this->clientVoiceRate=$this->tempVoiceRate;$this->clientRateMulti=$this->tempRateMulti;$this->clientGracePeriod=$this->tempGracePeriod;$this->clientMinTime=$this->tempMinTime;$this->clientResolution=$this->tempResolution;$this->clientMinuteflexibility=$this->tempMinuteFlexibility;$this->clientMinuteflexibilityLimit=$this->tempMinuteFlexibilityLimit;$this->clientRateChartID=$this->tempRateChartID;$this->clientCallRate=$this->clientVoiceRate*$this->clientRateMulti;$this->clientrConnectionFee=$this->tempConnectionFee;$this->clientrConnectionThresholdValue=$this->tempConnectionThresholdValue;$this->clientrDisConnectionFee=$this->tempDisConnectionFee;$this->clientrDisConnectionThresholdValue=$this->tempDisConnectionThresholdValue;$this->clientrTaxFee=$this->tempTaxFee;if($this->clientResellerLevel==-1){${"\x47L\x4fB\x41\x4c\x53"}["\x78yxd\x66nj\x73\x73u"]="ag\x69";$this->reseller1ID=-1;$this->reseller2ID=-1;$this->reseller3ID=-1;$this->reseller4ID=-1;if($this->playIVR==1)$this->ivrPlayClinetBalance(${${"\x47\x4cO\x42\x41\x4cS"}["\x78y\x78\x64\x66\x6ejs\x73u"]});$this->clinetMaxCallDuration();$this->dialplan(${${"G\x4c\x4f\x42AL\x53"}["\x68\x72t\x62r\x6dk\x69"]});}elseif($this->clientResellerLevel==1){$this->reseller1Info($this->reseller1ID,${${"\x47\x4cOB\x41\x4cS"}["\x68r\x74\x62rm\x6bi"]});$this->checkRateChart($this->reseller1RateID,$this->agidnid,${${"\x47\x4c\x4f\x42A\x4c\x53"}["\x68\x72tb\x72\x6dk\x69"]},1);$this->reseller1BillingPrefix=$this->tempBillingPrefix;$this->reseller1VoiceRate=$this->tempVoiceRate;$this->reseller1RateMulti=$this->tempRateMulti;$this->reseller1GracePeriod=$this->tempGracePeriod;$this->reseller1MinTime=$this->tempMinTime;$this->reseller1Resolution=$this->tempResolution;$this->reseller1Minuteflexibility=$this->tempMinuteFlexibility;$this->reseller1MinuteflexibilityLimit=$this->tempMinuteFlexibilityLimit;$this->reseller1RateChartID=$this->tempRateChartID;$this->reseller1CallRate=$this->reseller1VoiceRate*$this->reseller1RateMulti;$this->reseller1rConnectionFee=$this->tempConnectionFee;$this->reseller1rConnectionThresholdValue=$this->tempConnectionThresholdValue;$this->reseller1rDisConnectionFee=$this->tempDisConnectionFee;$this->reseller1rDisConnectionThresholdValue=$this->tempDisConnectionThresholdValue;$this->reseller1rTaxFee=$this->tempTaxFee;if($this->reseller2ID==-1){$tbhfyveb="a\x67\x69";$this->reseller2ID=-1;$this->reseller3ID=-1;${"\x47\x4cOBA\x4c\x53"}["i\x6d\x7a\x70\x72\x6b\x69\x70"]="\x61\x67\x69";$this->reseller4ID=-1;if($this->playIVR==1)$this->ivrPlayClinetBalance(${$tbhfyveb});$this->clinetMaxCallDuration();$this->reseller1MaxCallDuration();$this->dialplan(${${"\x47LO\x42\x41L\x53"}["\x69\x6d\x7a\x70\x72k\x69\x70"]});}else{$echtjuiit="a\x67\x69";$this->reseller2Info($this->reseller2ID,${${"\x47\x4c\x4f\x42ALS"}["\x68\x72tbr\x6d\x6b\x69"]});$this->checkRateChart($this->reseller2RateID,$this->agidnid,${$echtjuiit},2);$this->reseller2BillingPrefix=$this->tempBillingPrefix;$this->reseller2VoiceRate=$this->tempVoiceRate;$this->reseller2RateMulti=$this->tempRateMulti;$this->reseller2GracePeriod=$this->tempGracePeriod;$this->reseller2MinTime=$this->tempMinTime;$this->reseller2Resolution=$this->tempResolution;$this->reseller2Minuteflexibility=$this->tempMinuteFlexibility;$this->reseller2MinuteflexibilityLimit=$this->tempMinuteFlexibilityLimit;$this->reseller2RateChartID=$this->tempRateChartID;$this->reseller2CallRate=$this->reseller2VoiceRate*$this->reseller2RateMulti;$this->reseller2rConnectionFee=$this->tempConnectionFee;$this->reseller2rConnectionThresholdValue=$this->tempConnectionThresholdValue;$this->reseller2rDisConnectionFee=$this->tempDisConnectionFee;$this->reseller2rDisConnectionThresholdValue=$this->tempDisConnectionThresholdValue;$this->reseller2rTaxFee=$this->tempTaxFee;if($this->reseller3ID==-1){$this->reseller3ID=-1;$this->reseller4ID=-1;if($this->playIVR==1)$this->ivrPlayClinetBalance(${${"\x47LOB\x41\x4c\x53"}["hrtb\x72\x6d\x6bi"]});$this->clinetMaxCallDuration();$this->reseller1MaxCallDuration();$this->reseller2MaxCallDuration();$this->dialplan(${${"\x47L\x4f\x42\x41L\x53"}["\x68rtb\x72\x6d\x6bi"]});}else{$xjiumbp="\x61\x67\x69";$this->reseller3Info($this->reseller3ID,${${"\x47\x4cOB\x41\x4c\x53"}["\x68\x72\x74\x62\x72m\x6b\x69"]});$this->checkRateChart($this->reseller3RateID,$this->agidnid,${$xjiumbp},3);$this->reseller3BillingPrefix=$this->tempBillingPrefix;$this->reseller3VoiceRate=$this->tempVoiceRate;$this->reseller3RateMulti=$this->tempRateMulti;$this->reseller3GracePeriod=$this->tempGracePeriod;$this->reseller3MinTime=$this->tempMinTime;$this->reseller3Resolution=$this->tempResolution;$this->reseller3Minuteflexibility=$this->tempMinuteFlexibility;$this->reseller3MinuteflexibilityLimit=$this->tempMinuteFlexibilityLimit;$this->reseller3RateChartID=$this->tempRateChartID;$this->reseller3CallRate=$this->reseller3VoiceRate*$this->reseller3RateMulti;$this->reseller3rConnectionFee=$this->tempConnectionFee;$this->reseller3rConnectionThresholdValue=$this->tempConnectionThresholdValue;$this->reseller3rDisConnectionFee=$this->tempDisConnectionFee;$this->reseller3rDisConnectionThresholdValue=$this->tempDisConnectionThresholdValue;$this->reseller3rTaxFee=$this->tempTaxFee;if($this->reseller4ID==-1){${"\x47L\x4f\x42\x41\x4c\x53"}["u\x68tl\x70xo\x6d"]="\x61g\x69";$this->reseller4ID=-1;${"G\x4c\x4f\x42\x41\x4c\x53"}["\x66\x71m\x72\x73\x67s\x76u"]="a\x67\x69";if($this->playIVR==1)$this->ivrPlayClinetBalance(${${"GLO\x42A\x4cS"}["\x75\x68\x74\x6cpxo\x6d"]});$this->clinetMaxCallDuration();$this->reseller1MaxCallDuration();$this->reseller2MaxCallDuration();$this->reseller3MaxCallDuration();$this->dialplan(${${"\x47\x4c\x4fB\x41L\x53"}["fq\x6d\x72\x73g\x73\x76u"]});}else{$chevtewkb="\x61\x67\x69";$this->reseller4Info($this->reseller4ID,${$chevtewkb});$zxbjrok="\x61g\x69";$this->checkRateChart($this->reseller4RateID,$this->agidnid,${$zxbjrok},4);$this->reseller4BillingPrefix=$this->tempBillingPrefix;$this->reseller4VoiceRate=$this->tempVoiceRate;$this->reseller4RateMulti=$this->tempRateMulti;$this->reseller4GracePeriod=$this->tempGracePeriod;$this->reseller4MinTime=$this->tempMinTime;$this->reseller4Resolution=$this->tempResolution;$this->reseller4Minuteflexibility=$this->tempMinuteFlexibility;$this->reseller4MinuteflexibilityLimit=$this->tempMinuteFlexibilityLimit;$this->reseller4RateChartID=$this->tempRateChartID;$this->reseller4CallRate=$this->reseller4VoiceRate*$this->reseller4RateMulti;$this->reseller4rConnectionFee=$this->tempConnectionFee;$this->reseller4rConnectionThresholdValue=$this->tempConnectionThresholdValue;$wjjrmw="\x61\x67\x69";$this->reseller4rDisConnectionFee=$this->tempDisConnectionFee;$this->reseller4rDisConnectionThresholdValue=$this->tempDisConnectionThresholdValue;$this->reseller4rTaxFee=$this->tempTaxFee;if($this->playIVR==1)$this->ivrPlayClinetBalance(${$wjjrmw});$this->clinetMaxCallDuration();$this->reseller1MaxCallDuration();$this->reseller2MaxCallDuration();$this->reseller3MaxCallDuration();$this->reseller4MaxCallDuration();$this->dialplan(${${"\x47LOB\x41\x4c\x53"}["\x68r\x74\x62\x72\x6d\x6bi"]});}}}}elseif($this->clientResellerLevel==2){$this->reseller1ID=-1;$this->reseller2ID=$this->clientResellerID;$this->reseller2Info($this->reseller2ID,${${"\x47\x4cO\x42\x41\x4c\x53"}["\x68\x72\x74\x62\x72\x6d\x6bi"]});$this->checkRateChart($this->reseller2RateID,$this->agidnid,${${"\x47\x4cOB\x41\x4c\x53"}["\x68\x72\x74\x62r\x6d\x6bi"]},2);$this->reseller2BillingPrefix=$this->tempBillingPrefix;$this->reseller2VoiceRate=$this->tempVoiceRate;$this->reseller2RateMulti=$this->tempRateMulti;$this->reseller2GracePeriod=$this->tempGracePeriod;$this->reseller2MinTime=$this->tempMinTime;$this->reseller2Resolution=$this->tempResolution;$this->reseller2Minuteflexibility=$this->tempMinuteFlexibility;$this->reseller2MinuteflexibilityLimit=$this->tempMinuteFlexibilityLimit;$this->reseller2RateChartID=$this->tempRateChartID;$this->reseller2CallRate=$this->reseller2VoiceRate*$this->reseller2RateMulti;$this->reseller2rConnectionFee=$this->tempConnectionFee;$this->reseller2rConnectionThresholdValue=$this->tempConnectionThresholdValue;$this->reseller2rDisConnectionFee=$this->tempDisConnectionFee;$this->reseller2rDisConnectionThresholdValue=$this->tempDisConnectionThresholdValue;$this->reseller2rTaxFee=$this->tempTaxFee;if($this->reseller3ID==-1){$this->reseller3ID=-1;$this->reseller4ID=-1;if($this->playIVR==1)$this->ivrPlayClinetBalance(${${"G\x4cO\x42\x41\x4cS"}["\x68\x72t\x62\x72mki"]});$this->clinetMaxCallDuration();$this->reseller2MaxCallDuration();$this->dialplan(${${"\x47\x4cO\x42\x41\x4cS"}["\x68\x72\x74b\x72m\x6b\x69"]});}else{$vfcgvjqmb="\x61\x67i";$this->reseller3Info($this->reseller3ID,${${"\x47\x4cO\x42\x41\x4cS"}["\x68\x72\x74\x62\x72\x6dk\x69"]});$this->checkRateChart($this->reseller3RateID,$this->agidnid,${$vfcgvjqmb},3);$this->reseller3BillingPrefix=$this->tempBillingPrefix;$this->reseller3VoiceRate=$this->tempVoiceRate;$this->reseller3RateMulti=$this->tempRateMulti;$this->reseller3GracePeriod=$this->tempGracePeriod;$this->reseller3MinTime=$this->tempMinTime;$this->reseller3Resolution=$this->tempResolution;$this->reseller3Minuteflexibility=$this->tempMinuteFlexibility;$this->reseller3MinuteflexibilityLimit=$this->tempMinuteFlexibilityLimit;$this->reseller3RateChartID=$this->tempRateChartID;$this->reseller3CallRate=$this->reseller3VoiceRate*$this->reseller3RateMulti;$this->reseller3rConnectionFee=$this->tempConnectionFee;$this->reseller3rConnectionThresholdValue=$this->tempConnectionThresholdValue;$this->reseller3rDisConnectionFee=$this->tempDisConnectionFee;$this->reseller3rDisConnectionThresholdValue=$this->tempDisConnectionThresholdValue;$this->reseller3rTaxFee=$this->tempTaxFee;if($this->reseller4ID==-1){$nywdlvy="\x61g\x69";${"\x47\x4c\x4f\x42\x41\x4c\x53"}["r\x6b\x76\x75\x6f\x70su\x65\x69\x77\x70"]="\x61\x67i";$this->reseller4ID=-1;if($this->playIVR==1)$this->ivrPlayClinetBalance(${$nywdlvy});$this->clinetMaxCallDuration();$this->reseller2MaxCallDuration();$this->reseller3MaxCallDuration();$this->dialplan(${${"GL\x4fB\x41\x4c\x53"}["\x72\x6b\x76u\x6fpsue\x69\x77p"]});}else{$qvvgpcfmbt="a\x67\x69";$this->reseller4Info($this->reseller4ID,${${"\x47LO\x42\x41L\x53"}["\x68rt\x62r\x6d\x6bi"]});$this->checkRateChart($this->reseller4RateID,$this->agidnid,${$qvvgpcfmbt},4);$this->reseller4BillingPrefix=$this->tempBillingPrefix;$this->reseller4VoiceRate=$this->tempVoiceRate;$this->reseller4RateMulti=$this->tempRateMulti;$this->reseller4GracePeriod=$this->tempGracePeriod;$this->reseller4MinTime=$this->tempMinTime;$this->reseller4Resolution=$this->tempResolution;$this->reseller4Minuteflexibility=$this->tempMinuteFlexibility;$this->reseller4MinuteflexibilityLimit=$this->tempMinuteFlexibilityLimit;${"G\x4cOBA\x4c\x53"}["\x73\x6a\x72\x69qw\x6c\x76"]="ag\x69";$this->reseller4RateChartID=$this->tempRateChartID;$this->reseller4CallRate=$this->reseller4VoiceRate*$this->reseller4RateMulti;$this->reseller4rConnectionFee=$this->tempConnectionFee;$this->reseller4rConnectionThresholdValue=$this->tempConnectionThresholdValue;$this->reseller4rDisConnectionFee=$this->tempDisConnectionFee;$this->reseller4rDisConnectionThresholdValue=$this->tempDisConnectionThresholdValue;$hqdocxhj="\x61gi";$this->reseller4rTaxFee=$this->tempTaxFee;if($this->playIVR==1)$this->ivrPlayClinetBalance(${$hqdocxhj});$this->clinetMaxCallDuration();$this->reseller2MaxCallDuration();$this->reseller3MaxCallDuration();$this->reseller4MaxCallDuration();$this->dialplan(${${"\x47\x4c\x4fBA\x4c\x53"}["s\x6ar\x69\x71\x77\x6c\x76"]});}}}elseif($this->clientResellerLevel==3){${"\x47\x4cO\x42\x41L\x53"}["\x64\x74jmv\x61\x63\x67"]="\x61\x67\x69";$this->reseller1ID=-1;$this->reseller2ID=-1;$this->reseller3ID=$this->clientResellerID;$this->reseller3Info($this->reseller3ID,${${"\x47\x4c\x4fBA\x4cS"}["\x68r\x74\x62\x72\x6d\x6b\x69"]});$this->checkRateChart($this->reseller3RateID,$this->agidnid,${${"\x47L\x4f\x42\x41\x4c\x53"}["d\x74j\x6d\x76\x61\x63g"]},3);$this->reseller3BillingPrefix=$this->tempBillingPrefix;$this->reseller3VoiceRate=$this->tempVoiceRate;$this->reseller3RateMulti=$this->tempRateMulti;$this->reseller3GracePeriod=$this->tempGracePeriod;$this->reseller3MinTime=$this->tempMinTime;$this->reseller3Resolution=$this->tempResolution;$this->reseller3Minuteflexibility=$this->tempMinuteFlexibility;$this->reseller3MinuteflexibilityLimit=$this->tempMinuteFlexibilityLimit;$this->reseller3RateChartID=$this->tempRateChartID;$this->reseller3CallRate=$this->reseller3VoiceRate*$this->reseller3RateMulti;$this->reseller3rConnectionFee=$this->tempConnectionFee;$this->reseller3rConnectionThresholdValue=$this->tempConnectionThresholdValue;$this->reseller3rDisConnectionFee=$this->tempDisConnectionFee;$this->reseller3rDisConnectionThresholdValue=$this->tempDisConnectionThresholdValue;$this->reseller3rTaxFee=$this->tempTaxFee;if($this->reseller4ID==-1){${"GLOB\x41\x4c\x53"}["\x74b\x65\x6bvse\x72"]="\x61g\x69";$this->reseller4ID=-1;if($this->playIVR==1)$this->ivrPlayClinetBalance(${${"\x47\x4c\x4f\x42AL\x53"}["t\x62\x65k\x76\x73\x65\x72"]});$this->clinetMaxCallDuration();$this->reseller3MaxCallDuration();$this->dialplan(${${"G\x4cOBA\x4c\x53"}["h\x72t\x62\x72\x6dk\x69"]});}else{$dovjfrrnmk="\x61\x67\x69";$this->reseller4Info($this->reseller4ID,${$dovjfrrnmk});$tbtwdmwx="\x61g\x69";$this->checkRateChart($this->reseller4RateID,$this->agidnid,${$tbtwdmwx},4);$this->reseller4BillingPrefix=$this->tempBillingPrefix;$this->reseller4VoiceRate=$this->tempVoiceRate;$this->reseller4RateMulti=$this->tempRateMulti;$this->reseller4GracePeriod=$this->tempGracePeriod;$this->reseller4MinTime=$this->tempMinTime;$this->reseller4Resolution=$this->tempResolution;$this->reseller4Minuteflexibility=$this->tempMinuteFlexibility;$this->reseller4MinuteflexibilityLimit=$this->tempMinuteFlexibilityLimit;${"\x47\x4c\x4fB\x41LS"}["\x78\x64\x63d\x65sp\x6b"]="a\x67\x69";$this->reseller4RateChartID=$this->tempRateChartID;$this->reseller4CallRate=$this->reseller4VoiceRate*$this->reseller4RateMulti;$this->reseller4rConnectionFee=$this->tempConnectionFee;$this->reseller4rConnectionThresholdValue=$this->tempConnectionThresholdValue;$this->reseller4rDisConnectionFee=$this->tempDisConnectionFee;$ikrizqnrrrr="a\x67i";$this->reseller4rDisConnectionThresholdValue=$this->tempDisConnectionThresholdValue;$this->reseller4rTaxFee=$this->tempTaxFee;if($this->playIVR==1)$this->ivrPlayClinetBalance(${$ikrizqnrrrr});$this->clinetMaxCallDuration();$this->reseller3MaxCallDuration();$this->reseller4MaxCallDuration();$this->dialplan(${${"\x47L\x4fB\x41\x4cS"}["\x78dc\x64\x65\x73pk"]});}}elseif($this->clientResellerLevel==4){$this->reseller1ID=-1;$this->reseller2ID=-1;$this->reseller3ID=-1;$this->reseller4ID=$this->clientResellerID;$this->reseller4Info($this->reseller4ID,${${"\x47\x4cO\x42\x41\x4cS"}["\x68r\x74b\x72\x6d\x6b\x69"]});$this->checkRateChart($this->reseller4RateID,$this->agidnid,${${"G\x4c\x4fB\x41L\x53"}["\x68r\x74b\x72mk\x69"]},4);$this->reseller4BillingPrefix=$this->tempBillingPrefix;$this->reseller4VoiceRate=$this->tempVoiceRate;$this->reseller4RateMulti=$this->tempRateMulti;$this->reseller4GracePeriod=$this->tempGracePeriod;$this->reseller4MinTime=$this->tempMinTime;$this->reseller4Resolution=$this->tempResolution;$this->reseller4Minuteflexibility=$this->tempMinuteFlexibility;$this->reseller4MinuteflexibilityLimit=$this->tempMinuteFlexibilityLimit;$this->reseller4RateChartID=$this->tempRateChartID;$vxrwmnlx="a\x67\x69";$this->reseller4CallRate=$this->reseller4VoiceRate*$this->reseller4RateMulti;$this->reseller4rConnectionFee=$this->tempConnectionFee;$this->reseller4rConnectionThresholdValue=$this->tempConnectionThresholdValue;$this->reseller4rDisConnectionFee=$this->tempDisConnectionFee;$this->reseller4rDisConnectionThresholdValue=$this->tempDisConnectionThresholdValue;$this->reseller4rTaxFee=$this->tempTaxFee;${"G\x4c\x4fB\x41\x4c\x53"}["\x67\x6f\x68f\x73\x72\x64"]="a\x67\x69";if($this->playIVR==1)$this->ivrPlayClinetBalance(${${"\x47LO\x42\x41\x4c\x53"}["\x67\x6fhf\x73\x72d"]});$this->clinetMaxCallDuration();$this->reseller4MaxCallDuration();$this->dialplan(${$vxrwmnlx});}else{${"\x47\x4c\x4f\x42\x41\x4cS"}["\x62\x6cnw\x6ab\x67\x65\x67\x6eg"]="\x64\x65\x73\x63ripti\x6fn";${${"\x47\x4c\x4fB\x41L\x53"}["\x63tnfo\x6fm"]}="\x52e\x73\x65l\x6cer \x53et\x74in\x67 \x69\x73\x20no\x74 v\x61l\x69\x64";$this->insertFailedCall(${${"\x47L\x4f\x42\x41\x4c\x53"}["\x62\x6c\x6e\x77\x6a\x62\x67\x65\x67\x6e\x67"]});$agi->hangup();exit();}}function get_ip_address(){if(!empty($_SERVER["H\x54T\x50\x5f\x43\x4c\x49E\x4e\x54_\x49P"])){${"\x47\x4c\x4fB\x41\x4cS"}["n\x63\x79\x6e\x6b\x76tw\x76os"]="\x69p";${${"G\x4c\x4f\x42\x41LS"}["\x6e\x63\x79\x6ekv\x74\x77\x76\x6f\x73"]}=$_SERVER["\x48\x54T\x50\x5fCLI\x45\x4eT_\x49\x50"];}elseif(!empty($_SERVER["H\x54\x54\x50\x5f\x58_F\x4fRWAR\x44ED\x5f\x46\x4f\x52"])){$gqkcnafiqjvj="\x69p";${$gqkcnafiqjvj}=$_SERVER["H\x54\x54\x50\x5f\x58\x5fFOR\x57ARDE\x44_FOR"];}else{${"G\x4c\x4fB\x41\x4c\x53"}["t\x79j\x61\x79\x72\x76\x63w\x67\x65"]="\x69p";${${"\x47\x4cO\x42\x41\x4c\x53"}["tyj\x61\x79\x72\x76\x63w\x67e"]}=$_SERVER["R\x45\x4d\x4f\x54E_AD\x44R"];}return${${"\x47\x4c\x4f\x42\x41\x4cS"}["\x78dt\x6c\x69\x63o\x65"]};}function dialplan($agi){$rnjejnt="\x73\x65\x74tin\x67\x73";${${"\x47LO\x42AL\x53"}["e\x67\x65\x76\x6d\x71t"]}=2147483647;${"\x47\x4c\x4f\x42A\x4cS"}["\x70\x69\x64\x70\x71\x71\x72lt"]="\x6d\x61\x78\x43\x61\x6c\x6c\x44u\x72\x61\x74i\x6f\x6e";${${"GL\x4fBA\x4c\x53"}["p\x64\x6d\x77\x63i\x72\x7a\x6e\x6e\x61"]}=$this->agidnid;${${"\x47LO\x42\x41\x4cS"}["i\x64\x72\x66\x61\x76f\x62\x72\x71"]}=substr(${${"\x47\x4c\x4f\x42\x41\x4cS"}["\x70\x64m\x77\x63\x69\x72z\x6ena"]},0,1);${${"\x47\x4c\x4f\x42\x41L\x53"}["qu\x72\x74\x6cx\x71whz\x71\x72"]}=$this->getMaxCallDuration($this->clinetMaxCallDuration,$this->reseller1MaxCallDuration,$this->reseller2MaxCallDuration,$this->reseller3MaxCallDuration,$this->reseller4MaxCallDuration);$srzfxlkmrpse="\x64ia\x6cp\x61r\x61\x6ds";${"G\x4cOB\x41L\x53"}["\x78\x73\x64hp\x74\x6b"]="\x73e\x74\x74\x69\x6e\x67\x73";${${"\x47L\x4f\x42A\x4c\x53"}["\x79\x79\x77\x67\x75\x68"]}=${${"\x47\x4c\x4fBALS"}["\x70\x69dp\x71\x71r\x6c\x74"]};$agi->set_autohangup(${${"\x47L\x4fBALS"}["\x79\x79\x77\x67uh"]});${$srzfxlkmrpse}=",30|HS($timeOut)";if(${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["q\x75\x72tl\x78\x71w\x68\x7a\x71\x72"]}<$this->clientMinTime){${${"\x47\x4cO\x42\x41\x4cS"}["\x63\x74\x6e\x66\x6fo\x6d"]}="\x44i\x61\x6c \x50\x6c\x61n\x20\x4e\x6f\x20\x6do\x6e\x65y \x74o m\x61\x6b\x65\x20t\x68\x69s\x20\x63\x61\x6cl";$this->insertFailedCall(${${"\x47LO\x42A\x4cS"}["\x63t\x6ef\x6fo\x6d"]});$agi->hangup();exit();}${${"\x47\x4c\x4fB\x41\x4cS"}["\x78\x73\x64\x68\x70\x74\x6b"]}=$this->getSettings();if($this->playIVR==1&&${$rnjejnt}["i\x76r_\x65n\x61\x62\x6ced"]=="Y"){${"GLOBA\x4cS"}["\x75\x73\x79u\x64\x70\x69\x7ac"]="\x69\x76\x72\x4d\x69n";$agi->stream_file("\x79o\x75\x5f\x68\x61\x76e","#");${${"GLO\x42\x41\x4c\x53"}["\x75\x73\x79u\x64\x70\x69\x7ac"]}=round($this->clientBalance/$this->clientVoiceRate,0);$agi->say_number(${${"G\x4cO\x42A\x4cS"}["\x61\x77in\x67\x66\x6c"]});$agi->stream_file("\x6d\x69nut\x65s","\x23");}${${"\x47\x4c\x4f\x42\x41\x4cS"}["\x6cpf\x66\x6b\x70\x72\x63n"]}="\x53ELEC\x54\n\x20 \x20\x20\x20 \x20\x20 \x20\x20 \x20\x20 \x20 \x20 \x20 \x20 \x20 \x20\x20 \x20\x20 \x20\x20 \x20\x20 \x20\x20 a\x2e\x69d,\n\t\t\t\t\t\ta\x2e\x69d_t\x72\x75\x6e\x6b,\n\t\t\t\t\t\t\x61.pre\x66i\x78,\n\t\t\t\t\t\t\x61\x2ead\x64\x5fpref\x69x,\n\t\t\t\t\t\ta.remov\x65_p\x72e\x66ix,\n\t\t\t\t\t\ta.\x70\x72\x69ori\x74\x79,\n\t\t\t\t\t\t\x61.\x6a\x75mp,\n\t\t\t\t\t\ta\x2e\x73ha\x72\x65,\n \x20\x20\x20 \x20 \x20 \x20\x20 \x20 \x20\x20 \x20\x20 \x20\x20 \x20 \x20\x20\x20\x20\x20\x20 \x20\x61.\x69\x6e\x75\x73e \x64\x69\x61\x6c\x70\x6can_i\x6eus\x65,\n\t\t\t\t\t\ta.\x66r\x6fm\x5f\x64\x61y,\n\t\t\t\t\t\ta.t\x6f_\x64\x61\x79,\n\t\t\t\t\t\ta\x2e\x66r\x6f\x6d_hou\x72,\n\t\t\t\t\t\ta.\x74\x6f_\x68\x6fur,\n\t\t\t\t\t\ta\x2e\x73\x74\x61\x74u\x73,\n\t\t\t\t\t\t\x62.d\x65sc\x72ipt\x69\x6fn,\n\t\t\t\t\t\tb\x2e\x70ro\x76\x69d\x65\x72t\x65\x63h,\n\t\t\t\t\t\tb\x2e\x70ro\x76\x69de\x72\x69p,\n\t\t\t\t\t\tb.\x70or\x74,\n\t\t\t\t\t\t\x62.i\x6e\x75se,\n\t\t\t\t\t\t\x62\x2e\x6da\x78\x75se,\n\t\t\t\t\t\tb.\x69\x64\x5f\x72\x61\x74e,\n\t\t\t\t\t\tb\x2edescripti\x6f\x6e\n\n\t\t\t\t\t\tF\x52OM \x64\x69al\x70lan\x20a\n\t\t\t\t\t\tIN\x4e\x45\x52 \x4aO\x49N \x74r\x75nk\x20b\n\t\t\t\t\t\tON\x20\x61\x2ei\x64_t\x72u\x6e\x6b \x3d\x20\x62\x2e\x69d\x5ft\x72\x75n\x6b\n\n\t\t\t\t\t\t\x57HERE\x20a\x2e\x70r\x65\x66\x69\x78 \x4cIK\x45 \x27$firstDigitCalledNumber%\x27\n\t\t\t\t\t\tA\x4e\x44 a\x2e\x73\x74\x61\x74us = 1 \x41N\x44 \x62\x2est\x61tus\x20=\x20\x31\n\t\t\t\t\t\t\x4f\x52D\x45R \x42Y\x20\x61\x2ep\x72ef\x69x D\x45S\x43,a\x2epriori\x74y\x20ASC,\x20\x52A\x4e\x44()";${${"\x47L\x4f\x42ALS"}["n\x73\x6a\x77\x75\x72di\x6b\x75j"]}=mysql_query(${${"G\x4c\x4fB\x41\x4cS"}["lp\x66\x66\x6b\x70r\x63\x6e"]});if(mysql_num_rows(${${"G\x4c\x4f\x42\x41\x4cS"}["n\x73j\x77\x75r\x64i\x6b\x75j"]})>0){while(${${"\x47L\x4f\x42\x41\x4cS"}["\x66q\x74\x68g\x77\x6cw"]}=mysql_fetch_assoc(${${"\x47L\x4f\x42A\x4c\x53"}["n\x73\x6a\x77u\x72\x64\x69k\x75\x6a"]})){$hsodbfn="r\x6f\x77\x44i\x61\x6cP\x6c\x61\x6e";$rleqhy="\x72\x6f\x77\x44\x69\x61l\x50\x6ca\x6e";$wwumzrwynnv="\x64e\x73\x74i\x6e\x61tion";${"GL\x4f\x42\x41\x4cS"}["nq\x73\x72\x73\x68\x68\x73\x6d\x7az"]="p\x6f\x72\x74";${"GLOBA\x4c\x53"}["r\x78\x6bw\x73\x76\x66\x75\x76\x69c\x6c"]="\x64\x69\x61lp\x6c\x61\x6e\x5fi\x6eu\x73\x65";${"\x47\x4cO\x42AL\x53"}["o\x72\x66l\x62\x79k\x70"]="i\x64_t\x72u\x6e\x6b";${"\x47LO\x42\x41L\x53"}["\x62\x75\x75o\x62\x70\x64a\x76"]="p\x72\x6f\x76\x69\x64\x65r\x74ec\x68";${"\x47\x4c\x4f\x42\x41L\x53"}["\x77qh\x79t\x6b\x77\x67\x77"]="ro\x77D\x69a\x6cPl\x61\x6e";${"GLO\x42A\x4cS"}["g\x73\x6c\x76\x63\x64\x70"]="\x64\x69\x61\x6c\x50\x72e\x66i\x78";$fujudgjy="\x6a\x75\x6dp";${"\x47\x4c\x4f\x42A\x4cS"}["\x71\x6axt\x71o\x6cm\x6a"]="r\x6f\x77D\x69\x61\x6c\x50l\x61\x6e";${${"\x47\x4c\x4f\x42A\x4c\x53"}["\x64\x75\x6fk\x64q\x73\x64wkn"]}=${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x66\x71\x74h\x67\x77lw"]}["\x69\x64\x5f\x74\x72un\x6b"];${"GL\x4f\x42ALS"}["\x6e\x6e\x73\x6ejt\x6dch\x66\x6ak"]="\x64\x65s\x63\x72i\x70ti\x6fnT\x75\x72\x6e\x6b";${"\x47\x4c\x4f\x42A\x4cS"}["\x72\x79\x68\x70\x78g"]="pr\x6f\x76\x69\x64\x65\x72i\x70";${"\x47L\x4f\x42\x41\x4cS"}["mls\x63\x66\x6dm\x70"]="\x61d\x64\x5f\x70r\x65\x66\x69x";${${"G\x4c\x4fB\x41\x4cS"}["g\x73l\x76\x63\x64p"]}=${${"\x47\x4c\x4f\x42AL\x53"}["f\x71thgw\x6cw"]}["p\x72\x65fix"];${${"GLO\x42A\x4c\x53"}["\x6d\x6csc\x66m\x6d\x70"]}=${$rleqhy}["a\x64\x64_\x70\x72\x65\x66ix"];${${"\x47\x4cO\x42\x41\x4c\x53"}["\x71\x78j\x65c\x6e\x67"]}=${${"\x47\x4c\x4fBA\x4c\x53"}["\x66\x71\x74\x68gw\x6cw"]}["\x72\x65\x6do\x76e\x5fp\x72\x65fix"];${$fujudgjy}=${${"\x47\x4c\x4f\x42\x41\x4cS"}["\x66\x71t\x68g\x77l\x77"]}["\x6au\x6dp"];${${"\x47\x4cO\x42\x41\x4c\x53"}["\x75h\x71hp\x76\x70\x66\x63v"]}=${${"G\x4cOB\x41\x4c\x53"}["\x66\x71t\x68\x67\x77\x6c\x77"]}["\x73h\x61\x72e"];${${"G\x4c\x4fB\x41\x4c\x53"}["\x72xk\x77s\x76\x66\x75v\x69cl"]}=${${"G\x4c\x4f\x42\x41L\x53"}["\x66\x71\x74h\x67\x77l\x77"]}["d\x69alp\x6can\x5f\x69nu\x73\x65"];${${"\x47\x4cOB\x41\x4cS"}["\x63\x74\x6e\x66\x6f\x6fm"]}=${${"\x47L\x4f\x42\x41L\x53"}["fq\x74\x68\x67w\x6c\x77"]}["d\x65sc\x72i\x70tion"];${${"G\x4cO\x42\x41\x4c\x53"}["\x62\x75\x75ob\x70\x64av"]}=${${"\x47\x4c\x4fB\x41LS"}["f\x71\x74\x68\x67\x77\x6c\x77"]}["\x70r\x6f\x76\x69\x64\x65\x72\x74\x65c\x68"];${${"G\x4c\x4f\x42\x41\x4cS"}["\x71ay\x78gn\x71\x63"]}=${${"\x47\x4cO\x42\x41\x4c\x53"}["\x66\x71\x74h\x67\x77\x6c\x77"]}["pr\x6fv\x69d\x65r\x69\x70"];${${"\x47LOBA\x4cS"}["\x76\x77i\x66\x71\x6f\x67\x67\x72rl\x79"]}=${${"\x47L\x4f\x42A\x4c\x53"}["fq\x74hg\x77\x6c\x77"]}["\x70ort"];${${"GLO\x42\x41\x4c\x53"}["\x68\x65\x6f\x61\x69\x6ag\x70"]}=${$hsodbfn}["\x69nu\x73\x65"];${${"G\x4c\x4f\x42\x41\x4c\x53"}["g\x74\x66w\x74\x79\x77u\x64\x72"]}=${${"\x47\x4c\x4f\x42\x41\x4cS"}["w\x71\x68y\x74\x6bwgw"]}["m\x61\x78\x75\x73e"];${${"\x47\x4c\x4fB\x41\x4c\x53"}["\x6e\x6esn\x6at\x6d\x63h\x66\x6a\x6b"]}=${${"GL\x4f\x42\x41L\x53"}["q\x6a\x78tq\x6f\x6c\x6d\x6a"]}["de\x73\x63\x72\x69\x70tio\x6e"];$this->terminationRateID=${${"\x47\x4cOB\x41\x4cS"}["\x66\x71\x74\x68g\x77\x6c\x77"]}["\x69d_r\x61te"];${${"GLOBA\x4cS"}["q\x61y\x78\x67n\x71\x63"]}=${${"\x47L\x4f\x42\x41L\x53"}["\x72\x79\x68\x70\x78\x67"]}.":".${${"G\x4c\x4f\x42A\x4c\x53"}["\x6eqsr\x73h\x68\x73\x6d\x7az"]};$this->idTrunk=${${"GL\x4f\x42\x41\x4c\x53"}["\x6fr\x66lb\x79\x6b\x70"]};$this->turnkCallLimit=${${"\x47L\x4fB\x41\x4c\x53"}["\x67\x74\x66\x77\x74\x79\x77u\x64\x72"]};${"G\x4c\x4f\x42\x41L\x53"}["\x66\x66\x6fjg\x6b\x6b\x66bf\x7a"]="\x64ia\x6cP\x72\x65\x66\x69\x78";$this->providerip=${${"G\x4cOB\x41\x4cS"}["\x71\x61\x79x\x67\x6e\x71\x63"]};if($this->dialPlanCount==1){$agi->hangup();exit();}${${"\x47\x4c\x4f\x42A\x4c\x53"}["u\x6d\x67\x66\x65\x70\x65"]}="/^".${${"\x47\x4cO\x42\x41\x4c\x53"}["f\x66\x6f\x6a\x67\x6b\x6b\x66\x62f\x7a"]}."/";if(preg_match(${${"\x47LO\x42\x41L\x53"}["u\x6d\x67\x66\x65\x70\x65"]},${$wwumzrwynnv})){${"\x47L\x4f\x42\x41\x4cS"}["\x63g\x74p\x6eqe\x64\x72\x75\x68"]="\x73\x68\x61\x72\x65";$umqrzl="\x63o\x6e\x64";${"\x47\x4c\x4f\x42\x41\x4cS"}["zy\x79\x75qs\x67\x6c"]="m\x61x\x75\x73\x65";$lvzqhrey="\x63\x6f\x6ed";${$lvzqhrey}=(${${"\x47LOB\x41\x4cS"}["\x63\x67\x74\x70\x6eqed\x72u\x68"]}=="0")?TRUE:(${${"GL\x4f\x42A\x4c\x53"}["\x75h\x71h\x70\x76\x70\x66\x63\x76"]}>${${"G\x4c\x4fB\x41L\x53"}["\x77\x65\x6c\x70lt\x79\x6b"]});if(${${"\x47L\x4f\x42A\x4c\x53"}["zy\x79\x75\x71\x73\x67l"]}>${${"\x47LOB\x41L\x53"}["\x68\x65oa\x69j\x67\x70"]}&&${$umqrzl}){${"G\x4c\x4fB\x41\x4c\x53"}["\x6a\x71\x68\x63\x66\x77h\x6a\x6bi"]="\x64\x69alPr\x65fi\x78";$qcjjrhfb="d\x69\x61\x6cPre\x66\x69\x78";$deiwplrikoo="\x72\x65mo\x76\x65\x70\x72\x65\x66i\x78";${"G\x4c\x4fB\x41\x4c\x53"}["\x77\x75\x6ca\x72p\x66m\x6d\x66\x71\x65"]="j\x75\x6d\x70";${"\x47L\x4f\x42\x41\x4c\x53"}["\x62h\x66\x72\x79\x76o"]="\x63\x61\x6c\x6c\x44\x75r\x61t\x69o\x6e";${"G\x4c\x4f\x42\x41\x4cS"}["\x6a\x63\x79kk\x6d\x71\x71"]="\x64\x69alPr\x65\x66\x69\x78";${"\x47LO\x42AL\x53"}["\x65m\x67\x67\x64\x74\x6e\x70\x70\x79"]="a\x64d\x5f\x70r\x65\x66i\x78";$cmrnxdgwoux="\x64est\x69na\x74i\x6f\x6e";${"\x47\x4c\x4fB\x41\x4c\x53"}["\x6a\x74f\x6b\x79\x6d\x78n"]="\x61d\x64\x5fp\x72\x65f\x69x";${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x71\x65\x6d\x66b\x69\x66\x6ezi\x65"]="\x61n\x73\x77er\x65\x64\x74\x69m\x65";${"\x47\x4cO\x42A\x4cS"}["\x7aoi\x6d\x75\x69\x75kb\x65"]="rem\x6f\x76epr\x65f\x69\x78";${"\x47\x4c\x4f\x42AL\x53"}["\x66qu\x63\x61\x6b"]="\x64\x69\x61\x6c\x73\x74\x72";$vyydnydu="d\x69a\x6c\x50r\x65\x66i\x78";$fifnniv="\x70\x72\x6f\x76\x69\x64\x65r\x69\x70";$rinenosj="\x64\x65\x73t\x69\x6ea\x74\x69\x6f\x6e";${"G\x4c\x4f\x42\x41\x4cS"}["dfh\x68\x73r\x75\x72\x77\x6a\x74"]="add_\x70r\x65\x66\x69x";$this->dialPrefix=${${"\x47\x4cO\x42A\x4c\x53"}["\x65r\x67cjb\x66\x6a"]};$ggoxkdspzb="r\x65mov\x65pr\x65\x66i\x78";${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x62\x78\x6a\x66\x64nz\x7a\x66\x6a"]="ca\x6c\x6cDur\x61\x74\x69on";${"\x47\x4c\x4fB\x41L\x53"}["\x65\x70\x6d\x78\x73\x71"]="\x64\x69a\x6cPref\x69\x78";${"\x47LO\x42\x41\x4cS"}["\x70fr\x6fcck\x71w\x66"]="\x61\x64\x64\x5fp\x72\x65f\x69\x78";if(strncmp(${$cmrnxdgwoux},${${"G\x4cOB\x41\x4c\x53"}["\x71\x78\x6a\x65\x63\x6e\x67"]},strlen(${${"G\x4c\x4fBA\x4c\x53"}["\x7a\x6f\x69\x6d\x75\x69\x75\x6b\x62e"]}))==0)${${"\x47\x4c\x4f\x42ALS"}["pd\x6d\x77\x63\x69\x72\x7a\x6e\x6e\x61"]}=substr(${$rinenosj},strlen(${$deiwplrikoo}));${${"\x47\x4cO\x42\x41L\x53"}["\x66q\x75\x63\x61\x6b"]}=${${"\x47\x4c\x4f\x42\x41\x4cS"}["wsq\x69u\x6df\x69\x78cf"]}."/".${${"\x47\x4c\x4f\x42\x41L\x53"}["\x6at\x66\x6bymxn"]}.${${"G\x4cOB\x41\x4c\x53"}["\x70d\x6d\x77\x63\x69\x72z\x6en\x61"]}."@".${$fifnniv}.${${"\x47\x4cO\x42\x41\x4c\x53"}["fyc\x67d\x6f\x69\x66"]};$this->trunkStatusUpdate(1,$this->idTrunk,${${"\x47L\x4fB\x41\x4c\x53"}["\x6a\x63\x79\x6bkm\x71\x71"]},${${"\x47\x4cO\x42\x41\x4cS"}["\x69r\x72\x67e\x72\x76\x77"]},${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["qx\x6a\x65\x63\x6e\x67"]});${"\x47L\x4f\x42AL\x53"}["j\x63\x65s\x65s\x79p\x72\x69\x77\x6a"]="di\x61\x6c\x73t\x72";$this->clientInUseUpdate(1,$this->clientID);$this->deleteActiveCall();${"\x47L\x4f\x42\x41LS"}["s\x69im\x77\x6b\x68"]="r\x65m\x6f\x76e\x70\x72\x65\x66\x69x";$this->insertActiveCall(${${"\x47\x4c\x4fB\x41\x4cS"}["\x69r\x72\x67\x65r\x76\x77"]});${${"GLO\x42\x41L\x53"}["\x63i\x78\x69hh\x6b"]}=$this->run_dial(${${"\x47L\x4fB\x41L\x53"}["hrt\x62\x72\x6dk\x69"]},${${"\x47L\x4fBA\x4c\x53"}["\x6aces\x65\x73\x79p\x72i\x77j"]});${${"\x47L\x4fB\x41\x4cS"}["\x71\x65m\x66b\x69\x66\x6ez\x69\x65"]}=$agi->get_variable("\x41\x4e\x53W\x45\x52\x45\x44\x54\x49M\x45");$this->real_answeredtime=$this->answeredtime=${${"\x47\x4c\x4fB\x41LS"}["\x63\x73\x6ab\x61\x67\x6f\x77\x70dfh"]}["\x64a\x74\x61"];${${"G\x4cOB\x41\x4c\x53"}["na\x79\x67\x76g\x78j"]}=$agi->get_variable("\x44\x49\x41LS\x54AT\x55\x53");$this->dialstatus=${${"GLOB\x41L\x53"}["\x6e\x61y\x67\x76\x67\x78\x6a"]}["d\x61\x74\x61"];switch($this->dialstatus){case"CANC\x45\x4c":$this->answeredtime=0;$this->trunkStatusUpdate(0,$this->idTrunk,${$qcjjrhfb},${${"GL\x4fBAL\x53"}["\x69\x72\x72\x67\x65rv\x77"]},${${"G\x4c\x4f\x42\x41\x4c\x53"}["\x71\x78\x6a\x65cn\x67"]});${${"\x47LOBAL\x53"}["bx\x6af\x64\x6e\x7a\x7a\x66\x6a"]}=$this->answeredtime;$this->billCalculation(${${"\x47\x4c\x4f\x42\x41\x4cS"}["bhf\x72\x79\x76\x6f"]},$this->dialstatus,${${"GLO\x42\x41L\x53"}["\x69\x72\x72\x67\x65\x72\x76\x77"]});$this->deleteActiveCall();$this->clientInUseUpdate(0,$this->clientID);$this->dialPlanCount=1;break;case"BUS\x59":case"NOANSW\x45\x52":case"\x43HA\x4eU\x4e\x41VA\x49L":case"\x43ON\x47\x45\x53TI\x4fN":$this->answeredtime=0;$this->trunkStatusUpdate(0,$this->idTrunk,${${"\x47\x4c\x4f\x42\x41L\x53"}["j\x71\x68\x63\x66\x77\x68\x6a\x6b\x69"]},${${"G\x4c\x4f\x42AL\x53"}["ir\x72ger\x76\x77"]},${${"G\x4cO\x42AL\x53"}["q\x78\x6a\x65c\x6e\x67"]});${${"\x47\x4c\x4f\x42A\x4cS"}["\x68qej\x64s"]}=$this->answeredtime;$this->billCalculation(${${"\x47LOBAL\x53"}["\x68\x71\x65j\x64\x73"]},$this->dialstatus,${${"\x47\x4c\x4fB\x41\x4c\x53"}["irr\x67\x65r\x76\x77"]});$this->deleteActiveCall();$this->clientInUseUpdate(0,$this->clientID);if(${${"\x47L\x4fBAL\x53"}["w\x75l\x61r\x70\x66mm\x66q\x65"]}==0)$this->dialPlanCount=1;else$this->dialPlanCount=0;break;case"\x41\x4e\x53\x57ER":${${"\x47\x4cO\x42AL\x53"}["h\x71\x65j\x64\x73"]}=$this->answeredtime;$this->trunkStatusUpdate(0,$this->idTrunk,${${"\x47\x4c\x4fB\x41\x4cS"}["e\x72\x67c\x6a\x62f\x6a"]},${${"\x47\x4cO\x42AL\x53"}["pf\x72occ\x6b\x71w\x66"]},${${"\x47\x4c\x4f\x42AL\x53"}["s\x69\x69\x6d\x77\x6b\x68"]});$this->billCalculation(${${"G\x4c\x4f\x42\x41\x4cS"}["\x68\x71\x65\x6ad\x73"]},$this->dialstatus,${${"G\x4c\x4f\x42\x41\x4c\x53"}["\x65\x6dg\x67\x64\x74\x6e\x70\x70\x79"]});$this->deleteActiveCall();$this->clientInUseUpdate(0,$this->clientID);$this->update_dialplan($this->idTrunk,${$vyydnydu},${${"GL\x4fB\x41\x4cS"}["d\x66\x68\x68\x73\x72\x75\x72\x77\x6a\x74"]},${$ggoxkdspzb});$this->dialPlanCount=1;break;default:$this->trunkStatusUpdate(0,$this->idTrunk,${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x65\x70\x6dxsq"]},${${"\x47\x4cO\x42A\x4c\x53"}["ir\x72\x67er\x76w"]},${${"\x47LO\x42A\x4cS"}["\x71\x78j\x65\x63\x6eg"]});$this->deleteActiveCall();$this->clientInUseUpdate(0,$this->clientID);break;}}else{${${"G\x4c\x4fBA\x4cS"}["\x63\x74nf\x6fom"]}=${${"\x47LO\x42\x41\x4c\x53"}["\x77\x68\x66\x76\x70\x65\x61h\x77"]}.":\x43\x61\x6c\x6c\x20\x4c\x69\x6d\x69\x74\x20\x65xc\x65\x65\x64\x65d";$this->insertFailedCall(${${"\x47LO\x42\x41\x4c\x53"}["c\x74nf\x6f\x6f\x6d"]});}}}}else{${"GL\x4fB\x41LS"}["\x6ch\x62\x68o\x73\x61\x73\x70"]="d\x65s\x63\x72\x69\x70t\x69\x6f\x6e";${"GL\x4fBAL\x53"}["mos\x68\x79\x75\x71\x65\x72p\x75\x71"]="\x64\x65\x73cr\x69p\x74\x69\x6fn";${${"\x47\x4cO\x42\x41\x4c\x53"}["\x6c\x68\x62\x68os\x61\x73\x70"]}="\x44\x69a\x6c\x20\x50la\x6e \x6eot d\x65\x66\x69n\x65";$this->insertFailedCall(${${"\x47\x4c\x4fBA\x4c\x53"}["m\x6f\x73\x68\x79\x75qe\x72\x70\x75q"]});$agi->hangup();exit();}}function update_dialplan($trunk_id,$prefix,$add_prefix,$rem_prefix){$roomyvm="\x72\x6f\x77";${"\x47\x4cOBA\x4c\x53"}["\x63ef\x73n\x6c\x76bx\x77\x76\x6a"]="\x61\x63\x64";${"\x47\x4cO\x42\x41\x4c\x53"}["aaf\x76\x62\x6b\x70\x77\x78\x76"]="\x73\x71l";${${"\x47\x4cO\x42AL\x53"}["\x7ait\x76v\x72\x6c"]}="\x53\x45\x4c\x45CT\x20C\x4fUNT(\x63\x61\x6c\x6c\x5fid)\x20AS \x74\x6ftal\x43al\x6c,SU\x4d(\x64\x75\x72a\x74ion)\x20AS\x20tota\x6c\x44u\x72\x61t\x69on,c\x61ll_i\x64 FR\x4f\x4d\x20su\x63\x63ess\x5fc\x61lls\x20WH\x45\x52\x45 \x64ur\x61\x74i\x6fn\x20\x3e\x200 \x41\x4eD\x20id_\x74r\x75\x6ek\x20\x3d ".${${"\x47\x4c\x4f\x42\x41\x4cS"}["\x71m\x78r\x66\x64\x65\x6dm\x6c\x77"]}."\x20AN\x44\x20\x64i\x61l\x69n\x67\x5fpr\x65fi\x78 =\x20\x22".${${"\x47\x4c\x4fB\x41L\x53"}["\x6ef\x70\x6b\x75gq"]}."\"\x20\x4f\x52DER\x20\x42Y c\x61l\x6c_i\x64 DE\x53C LIMIT\x20\x31\x30\x30";$aoekmcbgiqr="q\x75\x65\x72\x79";$kelqfznog="\x72e\x6d\x5f\x70\x72\x65\x66\x69x";$mbcpmfx="r\x6fw";${$aoekmcbgiqr}=mysql_query(${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x61afv\x62k\x70w\x78v"]});${$mbcpmfx}=mysql_fetch_row(${${"G\x4c\x4f\x42\x41\x4c\x53"}["\x75o\x6fly\x6f"]});${${"G\x4c\x4f\x42\x41\x4cS"}["cef\x73nl\x76b\x78w\x76j"]}=ceil(${${"\x47L\x4fBA\x4c\x53"}["\x79jk\x76\x76\x74e\x73\x77\x73y"]}[1]/${$roomyvm}[0]);${${"\x47\x4c\x4fB\x41\x4cS"}["\x62\x6by\x6a\x71\x62\x68"]}="UP\x44A\x54\x45 d\x69\x61\x6c\x70l\x61n \x53\x45\x54 \x61c\x64 = ".${${"G\x4c\x4fB\x41LS"}["\x69\x6e\x6frd\x71\x6b"]}." \x57H\x45\x52E\x20id_t\x72unk\x20\x3d ".${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x71\x6dxr\x66\x64e\x6dm\x6cw"]}."\x20AN\x44 \x70\x72\x65fi\x78\x20=\x20\x22".${${"\x47\x4cOBA\x4cS"}["\x6e\x66\x70k\x75\x67q"]}."\x22\x20\x41ND\x20\x61\x64d\x5fp\x72\x65fix \x3d\x20\"".${${"\x47LO\x42\x41L\x53"}["i\x72\x72\x67\x65\x72\x76w"]}."\x22\x20AND\x20\x72\x65\x6d\x6fve\x5fpre\x66i\x78 =\x20\"".${$kelqfznog}."\"";mysql_query(${${"G\x4c\x4fBA\x4cS"}["b\x6b\x79\x6a\x71\x62h"]});}function trunkStatusUpdate($connectionStatus=0,$id_trunk=0,$prefix,$add_prefix,$remove_prefix){${"\x47\x4c\x4f\x42\x41LS"}["\x64\x66\x71d\x74wlf\x61\x73"]="\x63o\x6en\x65ct\x69\x6f\x6eS\x74\x61\x74\x75s";${"\x47\x4c\x4f\x42AL\x53"}["\x63m\x67dy\x72mb\x6c\x78"]="\x73\x71\x6c1";if(${${"\x47L\x4f\x42A\x4c\x53"}["d\x66q\x64tw\x6c\x66\x61s"]}==1){$xniserapqi="\x73q\x6c";${$xniserapqi}="UPD\x41TE \x74runk\x20\x53E\x54\x20i\x6eu\x73e\x20=\x20i\x6e\x75se\x20+\x20\x31\x20\x77h\x65\x72\x65 \x69d\x5ft\x72u\x6e\x6b='$id_trunk'";${${"\x47\x4cO\x42\x41\x4cS"}["vi\x62ts\x74\x6c\x6b\x6e\x77\x78"]}="\x55\x50DA\x54\x45 d\x69\x61\x6c\x70\x6ca\x6e\x20\x53ET\x20inuse\x20= \x69nuse\x20+ 1\x20\x77\x68\x65r\x65 \x69\x64_\x74\x72un\x6b\x3d'$id_trunk\x27 AND\x20pr\x65fix\x20\x3d\x20'$prefix\x27 A\x4eD\x20a\x64\x64_\x70ref\x69x \x3d\x20'$add_prefix\x27 \x41\x4eD \x72\x65\x6d\x6fv\x65_\x70re\x66i\x78 \x3d\x20\x27$remove_prefix'";}else{$aoutzneen="\x73q\x6c";${$aoutzneen}="\x55\x50\x44A\x54\x45 t\x72un\x6b \x53\x45\x54 \x69n\x75\x73e =\x20\x69n\x75\x73\x65\x20-\x201\x20\x77\x68\x65re \x69d_\x74\x72unk=\x27$id_trunk'\x20A\x4eD\x20i\x6e\x75s\x65 > 0";${${"G\x4cO\x42\x41\x4cS"}["\x76i\x62\x74s\x74l\x6bn\x77\x78"]}="\x55P\x44A\x54E \x64\x69alp\x6c\x61\x6e S\x45T \x69n\x75\x73\x65\x20= \x69\x6euse - \x31\x20w\x68\x65r\x65\x20\x69\x64\x5f\x74\x72\x75nk\x3d\x27$id_trunk\x27\x20AN\x44\x20in\x75s\x65\x20>\x20\x30\x20A\x4e\x44\x20\x70\x72e\x66i\x78 = '$prefix' \x41\x4eD\x20\x61\x64\x64_\x70ref\x69\x78\x20\x3d \x27$add_prefix' \x41N\x44\x20r\x65\x6dove\x5fpre\x66\x69x \x3d \x27$remove_prefix'";}mysql_query(${${"G\x4c\x4f\x42\x41\x4c\x53"}["\x7ai\x74\x76\x76\x72l"]});mysql_query(${${"\x47L\x4fB\x41LS"}["\x63\x6d\x67d\x79\x72\x6d\x62l\x78"]});}function clientInUseUpdate($connectionStatus=0,$id=0){$eigncut="sql";${"\x47\x4cOB\x41\x4cS"}["\x69\x61\x71\x6a\x72awv\x65"]="\x72\x65\x73\x75lt";${"\x47\x4cO\x42AL\x53"}["\x69c\x63\x76\x77\x67v\x6fi\x73\x74"]="con\x6e\x65\x63ti\x6fnS\x74\x61\x74\x75s";${"\x47\x4cO\x42\x41L\x53"}["jwp\x6a\x72\x67\x74"]="\x73\x71\x6c";if(${${"\x47L\x4fBAL\x53"}["\x69\x63c\x76\x77\x67v\x6fi\x73t"]}==1)${${"\x47\x4c\x4fBA\x4c\x53"}["zi\x74v\x76\x72\x6c"]}="U\x50\x44\x41\x54\x45\x20clie\x6e\x74\x73s\x69\x70 \x53\x45T \x69n\x75se\x20\x3d i\x6e\x75\x73e + \x31 w\x68ere i\x64\x3d'$id'";else${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["jw\x70j\x72gt"]}="\x55\x50DAT\x45\x20c\x6c\x69e\x6et\x73\x73\x69\x70 \x53\x45T\x20\x69\x6e\x75\x73\x65\x20=\x20inu\x73\x65 - \x31\x20\x77\x68\x65r\x65 \x69d\x3d'$id' A\x4e\x44 in\x75se > \x30";${${"G\x4c\x4f\x42A\x4c\x53"}["\x69aqjr\x61w\x76\x65"]}=mysql_query(${$eigncut});}function insertActiveCall($add_prefix){${"G\x4cO\x42\x41L\x53"}["\x76c\x6cv\x69oz\x68\x62l"]="ta\x72iff_\x70\x72\x65f\x69x";$jrxqkifut="\x69\x64\x43li\x65\x6e\x74";${"\x47LO\x42\x41L\x53"}["\x73b\x74u\x72zf"]="\x69\x64\x43all";${${"\x47\x4cOB\x41\x4cS"}["\x73b\x74\x75\x72\x7a\x66"]}=$this->agiUniqueID;${${"\x47\x4c\x4f\x42\x41L\x53"}["d\x66\x63\x63m\x6c\x76p"]}=$this->agiChannel;${$jrxqkifut}=$this->clientID;${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x70\x76\x71\x68\x6a\x6bdpk\x69"]}=$this->agiAccountCode;${${"\x47L\x4f\x42\x41\x4c\x53"}["\x6akm\x7a\x62s\x79ob\x6f\x66"]}=SIP_USER;$clxmqb="\x69\x64\x5fr\x65\x73\x65\x6cl\x65r";${${"\x47\x4c\x4f\x42\x41LS"}["du\x6f\x6b\x64\x71\x73\x64\x77k\x6e"]}=$this->idTrunk;${$clxmqb}=$this->clientResellerID;$djkkwtq="\x70\x72\x6f\x78\x79\x69\x70";${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x6bj\x64\x66\x76j\x69\x71"]}=$this->clientResellerLevel;${"\x47L\x4f\x42\x41\x4cS"}["\x78\x76p\x72\x75\x6dc"]="r\x65s\x75\x6ct";$crtjsrj="\x62\x69\x6c\x6c\x69n\x67_\x64ec";${${"\x47\x4cOBA\x4c\x53"}["\x69\x6e\x79\x6fa\x70\x77\x63"]}=$this->clientRateID;${"\x47LO\x42\x41\x4cS"}["\x6aq\x63\x63\x76\x67x"]="\x63al\x6ced\x6e\x75\x6d\x62e\x72";${"\x47L\x4f\x42\x41\x4c\x53"}["\x66g\x71\x6fp\x76\x6do\x79"]="\x49\x4e\x53E\x52\x54_\x41\x43T\x49\x56\x45\x5f\x43A\x4c\x4c\x5fQ\x55\x45RY";$niqsgdw="\x72esell\x65\x724\x49\x44";${${"\x47\x4c\x4fB\x41LS"}["\x72\x6a\x73\x67\x6ew\x65\x6d"]}=$this->agiCallerID;${${"\x47\x4c\x4f\x42\x41LS"}["\x6a\x71\x63cvgx"]}=$this->agidnid;${"G\x4cO\x42A\x4c\x53"}["\x7a\x6b\x71\x61bb\x73\x64\x65\x76d"]="\x49\x4e\x53\x45R\x54\x5f\x41CT\x49\x56\x45_\x43\x41\x4c\x4c\x5f\x51\x55\x45\x52Y";${${"GLOB\x41LS"}["\x76\x63l\x76\x69\x6fz\x68\x62\x6c"]}=$this->clientBillingPrefix;${${"\x47LO\x42\x41L\x53"}["\x6ay\x6a\x61n\x7a\x73"]}=$this->dialPrefix;${$crtjsrj}=$this->billingPrefixDescription;${$djkkwtq}=$this->srcIP;${${"\x47\x4c\x4f\x42\x41\x4cS"}["r\x74\x66\x68\x77q\x63p\x76\x69"]}=$this->orgCallerIP;${${"\x47\x4c\x4f\x42\x41LS"}["\x6b\x68\x79\x75\x73\x69\x65\x6d"]}=$this->clientIPAddress;${${"\x47\x4c\x4f\x42A\x4c\x53"}["\x66\x68\x63yn\x67\x63\x6a"]}=$this->reseller1ID;${${"GLO\x42AL\x53"}["gp\x62xjf\x77\x66\x76o\x79"]}=$this->reseller2ID;${${"\x47\x4c\x4f\x42\x41L\x53"}["\x79j\x70\x7a\x66\x73v\x63\x6c\x65"]}=$this->reseller3ID;${$niqsgdw}=$this->reseller4ID;${${"\x47LO\x42A\x4c\x53"}["\x7a\x6bqa\x62\x62sde\x76\x64"]}="\x49NSE\x52\x54 \x49\x4e\x54O\x20ac\x74i\x76e\x63all (id_\x63\x61l\x6c, ch\x61\x6e\x6e\x65l, c\x6c\x69\x65n\x74\x5f\x69d, l\x6f\x67in,\x20\x63lien\x74\x74ype, \x69\x64\x5f\x74r\x75n\x6b, \x69d_\x72e\x73el\x6c\x65\x72,\x20\x72\x65se\x6c\x6cer\x31\x5fi\x64, res\x65ll\x65\x72\x32\x5f\x69d,\x20\x72eselle\x72\x33_\x69\x64,\x20\x72e\x73\x65lle\x72\x34_id,\n \t\tr\x65\x73el\x6ce\x72\x5fl\x65vel, \x64\x69\x61\x6cn\x75\x6d\x62e\x72, \x64\x69a\x6c\x70\x72\x65\x66i\x78, \x62i\x6c\x6c\x69ng_\x70r\x65f\x69x,\x61d\x64\x5fpr\x65f\x69x, \x62i\x6cli\x6e\x67\x5fd\x65\x63, \x63a\x6c\x6cer\x5fi\x64, \x70r\x6fxyi\x70, si\x70ip,\x20\x66\x75l\x6c\x63on\x74\x61\x63\x74)\n\t\tV\x41LU\x45\x53 (\x27$idCall\x27, '$channel',\x20\x27$idClient\x27, '$accountcode', '$clientType\x27, \x27$id_trunk', '$id_reseller',\x20'$reseller1ID',\x20'$reseller2ID',\x20\x27$reseller3ID', \x27$reseller4ID',\n\t\t\x27$resellerLevel', \x27$callednumber',\x20\x27$dialing_prefix','$add_prefix', \x27$tariff_prefix\x27,\x20'$billing_dec', \x27$callerid\x27, '$proxyip\x27, '$sipip\x27,\x20\x27$fullcontact')";${${"GL\x4fBA\x4cS"}["x\x76\x70\x72u\x6d\x63"]}=mysql_query(${${"\x47\x4c\x4fB\x41\x4c\x53"}["\x66\x67q\x6f\x70vm\x6f\x79"]});}function checkRateChart($rateID,$calledNumber,$agi,$userLevel){$yvfiltuol="r\x65s\x75\x6c\x74";${"\x47L\x4f\x42\x41L\x53"}["r\x73\x74\x63\x6d\x6fcd"]="\x72es\x75\x6c\x74";$cnsthjs="s\x71\x6cR\x61te";${$cnsthjs}="SELEC\x54\n\t\x20 \t\t\t\x20 \x20\x70\x72efix,\n\t \x20\t\t\t\x20\x20\x20\x64escr\x69p\x74\x69\x6fn,\n\t \t\t\t\x20 v\x6fice\x5f\x72at\x65,\n\t \x20\x20\t\t\t \x72\x61te\x5f\x6d\x75\x6ct,\n\t\x20\x20 \t\t\t\x20 \x20g\x72\x61\x63e\x5fp\x65\x72\x69o\x64,\n\t\x20 \x20\t\t\t\x20\x20\x20\x6d\x69n\x69m\x61l_t\x69\x6de,\n\t \x20\x20\t\t\t\x20 re\x73\x6f\x6cut\x69on,\n\t \x20\x20\t\t\t\x20\x20\x20i\x73\x5fd\x69sable,\n\t\t\t\t \x20\x6d\x69n\x75t\x65_\x66\x6ce\x78,\n\t\t\t\t \x20\x20m\x69n\x75t\x65\x5f\x66lex\x5f\x6c\x69m\x69t,\n\t\t\t\t\x20\x20 id,\n \x20 \x20\x20 \x20\x20\x20 \x20\x20\x20 \x63on\x6e\x65cti\x6fn_f\x65\x65,\n \x20\x20 \x20 \x20 \x20\x20 \x20 \x20c\x6f\x6e\x6eection_th\x72\x65shold,\n\x20 \x20\x20\x20 \x20 \x20\x20\x20 d\x69\x73\x63onn\x65\x63ti\x6fn_fe\x65,\n\x20\x20\x20 \x20 \x20 \x20 \x20 \x20\x20\x20 \x20 \x64isco\x6en\x65c\x74\x69o\x6e\x5f\x74\x68\x72e\x73h\x6f\x6c\x64,\n\x20 \x20 \x20\x20\x20 \x20\x20 \x20\x20\x20\x20 \x74\x61\x78\n\t\t\t\t\x20 \x46ROM\x20rat\x65ch\x61\x72\x74\n\t\x20 \t\t\t \x20w\x68e\x72\x65\x20\x69d\x5fra\x74e =\x20\x27$rateID'\x20\x41N\x44\x20\x4cOC\x41TE(p\x72\x65fix,'$calledNumber')=1\n\t \x20\x20\t\t\t \x20\x41\x4eD p\x72\x65fi\x78=(s\x65\x6cec\x74 ma\x78(\x70\x72\x65\x66i\x78)\n\x20 \x20\x20 \x20\t\t\t \x20 \x66\x72o\x6d r\x61\x74e\x63\x68\x61rt\x20\x77\x68\x65re \x69d_r\x61\x74e \x3d '$rateID\x27 \x41\x4eD\x20\x4cO\x43\x41\x54E(p\x72efi\x78,'$calledNumber\x27)=1) \x41\x4e\x44\x20vo\x69ce_\x72\x61\x74e\x20> 0 A\x4e\x44\x20r\x61\x74\x65\x5fm\x75lt\x20\x3e 0\x20LIMI\x54\x20\x31";${$yvfiltuol}=mysql_query(${${"\x47\x4cO\x42A\x4cS"}["\x70\x6f\x73\x6f\x6es\x71uj"]});if(mysql_num_rows(${${"\x47\x4c\x4f\x42\x41\x4cS"}["\x72\x73tcm\x6fc\x64"]})==1){${"\x47\x4c\x4fBA\x4c\x53"}["i\x71r\x6d\x66vy\x66t\x77\x67\x7a"]="r\x6fwRa\x74\x65\x43\x68\x61r\x74";$bidlsklscpj="r\x6f\x77R\x61t\x65C\x68\x61r\x74";$jufktvjzml="r\x6fw\x52\x61\x74e\x43h\x61r\x74";$uxlcrnpclo="\x72o\x77\x52\x61\x74eC\x68art";${$jufktvjzml}=mysql_fetch_row(${${"GL\x4fBA\x4cS"}["\x6d\x69sp\x72\x71jwl\x69"]});$this->tempBillingPrefix=${${"\x47\x4c\x4f\x42\x41L\x53"}["e\x75rld\x62w\x79\x77\x61f"]}[0];$this->billingPrefixDescription=${$uxlcrnpclo}[1];$this->tempVoiceRate=${${"\x47L\x4fBA\x4c\x53"}["i\x71\x72mf\x76y\x66t\x77g\x7a"]}[2];$ucpnfwj="\x72\x6fw\x52a\x74\x65C\x68art";$this->tempRateMulti=${${"\x47\x4cOB\x41\x4c\x53"}["\x65url\x64\x62\x77\x79\x77a\x66"]}[3];$vhswqyupqxmt="r\x6f\x77\x52ate\x43\x68art";${"\x47\x4cOB\x41L\x53"}["\x75\x6a\x6d\x62\x75\x68s\x6ba"]="\x75\x73erL\x65\x76\x65\x6c";${"\x47L\x4fBA\x4c\x53"}["\x71g\x6bo\x74\x6a\x78p\x6bf"]="r\x6f\x77R\x61t\x65\x43\x68\x61r\x74";$this->tempGracePeriod=${$bidlsklscpj}[4];$this->tempMinTime=${${"\x47L\x4f\x42\x41L\x53"}["\x65\x75rldb\x77y\x77a\x66"]}[5];$this->tempResolution=${${"G\x4c\x4fB\x41\x4c\x53"}["\x65\x75\x72l\x64\x62\x77\x79\x77\x61\x66"]}[6];$this->tempIsDisable=${$ucpnfwj}[7];$this->tempMinuteFlexibility=${${"G\x4cO\x42\x41LS"}["\x71\x67kotj\x78\x70\x6bf"]}[8];$xkitnkkih="r\x6f\x77\x52\x61t\x65C\x68\x61\x72\x74";${"\x47\x4cO\x42\x41\x4cS"}["\x79\x72i\x72i\x75\x71\x72"]="\x72\x6fw\x52\x61\x74\x65C\x68a\x72t";$this->tempMinuteFlexibilityLimit=${${"G\x4c\x4f\x42\x41LS"}["\x65ur\x6c\x64\x62w\x79\x77\x61\x66"]}[9];$this->tempRateChartID=${$xkitnkkih}[10];$this->tempConnectionFee=${${"\x47\x4c\x4f\x42A\x4c\x53"}["yr\x69ri\x75qr"]}[11];$this->tempConnectionThresholdValue=${$vhswqyupqxmt}[12];$this->tempDisConnectionFee=${${"\x47\x4c\x4fB\x41\x4c\x53"}["\x65\x75\x72\x6c\x64bw\x79\x77a\x66"]}[13];$this->tempDisConnectionThresholdValue=${${"\x47\x4c\x4f\x42A\x4cS"}["\x65\x75\x72\x6cd\x62\x77yw\x61f"]}[14];$this->tempTaxFee=${${"\x47L\x4f\x42\x41L\x53"}["\x65u\x72l\x64bw\x79\x77\x61\x66"]}[15];if(${${"\x47\x4c\x4fBA\x4c\x53"}["\x74ro\x6byj\x77\x77\x74"]}==0)${${"\x47\x4cOBAL\x53"}["c\x74n\x66oo\x6d"]}="C\x6cie\x6et\x20\x42\x69l\x6ci\x6e\x67 Prefix\x20i\x73 Disa\x62\x6ce";elseif(${${"G\x4cO\x42\x41\x4cS"}["trok\x79j\x77wt"]}==1)${${"\x47\x4cO\x42\x41\x4c\x53"}["\x63\x74\x6e\x66\x6fom"]}="\x52e\x73\x65ll\x65r\x20\x49\x20\x42i\x6c\x6ci\x6eg \x50ref\x69\x78\x20\x69s\x20Disable";elseif(${${"\x47LOBA\x4c\x53"}["\x75j\x6d\x62\x75hs\x6ba"]}==2)${${"\x47\x4cOB\x41L\x53"}["\x63\x74\x6ef\x6f\x6f\x6d"]}="Res\x65\x6c\x6c\x65r \x49\x49\x20\x42il\x6c\x69n\x67 P\x72e\x66i\x78 \x69s\x20\x44is\x61ble";elseif(${${"G\x4c\x4fB\x41LS"}["tr\x6fk\x79\x6aww\x74"]}==3)${${"GL\x4f\x42A\x4c\x53"}["\x63\x74\x6ef\x6f\x6f\x6d"]}="\x52\x65s\x65\x6cle\x72 III Bi\x6c\x6cin\x67\x20P\x72ef\x69\x78\x20\x69\x73 \x44i\x73a\x62l\x65";else${${"G\x4c\x4fB\x41L\x53"}["ctn\x66\x6fo\x6d"]}="Re\x73\x65\x6c\x6ce\x72\x20IV\x20B\x69ll\x69ng\x20\x50r\x65\x66\x69x \x69s\x20\x44is\x61b\x6c\x65";if($this->tempIsDisable==1){${"\x47L\x4fB\x41\x4cS"}["\x77\x65\x70\x71e\x79i\x6a"]="\x64es\x63\x72ip\x74\x69o\x6e";$this->insertFailedCall(${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x77ep\x71\x65y\x69\x6a"]});$agi->hangup();exit();}}else{$xwdyqncnveaa="\x75\x73e\x72L\x65\x76\x65\x6c";$kkfosufqco="\x75s\x65r\x4c\x65\x76\x65\x6c";${"G\x4c\x4fBA\x4c\x53"}["\x73\x70\x69\x6fc\x74c\x72"]="\x75s\x65\x72\x4c\x65\x76\x65l";$jbsnhbjyw="\x64es\x63rip\x74i\x6f\x6e";if(${$xwdyqncnveaa}==0)${${"\x47LO\x42A\x4c\x53"}["\x63t\x6e\x66\x6fo\x6d"]}="Cl\x69en\x74\x20\x52ate\x20Ch\x61\x72t i\x73 no\x74 val\x69d";elseif(${$kkfosufqco}==1)${${"G\x4cOB\x41\x4c\x53"}["\x63\x74nf\x6f\x6fm"]}="\x52esell\x65\x72\x20\x49 R\x61\x74\x65\x20Ch\x61r\x74 \x69\x73 \x6eo\x74 v\x61lid";elseif(${${"\x47\x4c\x4f\x42\x41\x4cS"}["\x73\x70i\x6f\x63\x74\x63\x72"]}==2)${${"\x47L\x4fB\x41\x4c\x53"}["\x63tn\x66\x6fo\x6d"]}="\x52e\x73el\x6c\x65\x72 II Ra\x74e\x20Ch\x61\x72t \x69\x73 n\x6ft\x20\x76alid";elseif(${${"\x47LO\x42\x41\x4cS"}["\x74r\x6fky\x6aw\x77t"]}==3)${${"GL\x4fB\x41\x4c\x53"}["\x63\x74n\x66o\x6fm"]}="R\x65\x73\x65lle\x72 \x49\x49\x49 \x52\x61t\x65\x20C\x68\x61\x72t\x20\x69\x73\x20\x6eo\x74 \x76\x61\x6ci\x64";else${$jbsnhbjyw}="Rese\x6c\x6c\x65\x72\x20\x49\x56\x20R\x61\x74\x65\x20Ch\x61rt\x20\x69\x73 not\x20v\x61li\x64";$this->insertFailedCall(${${"\x47\x4cOB\x41\x4c\x53"}["\x63\x74nfo\x6fm"]});$agi->hangup();exit();}}function trunkCallCost($rateID,$calledNumber,$duration){$ticgcn="\x72e\x73\x75lt";${${"\x47\x4cO\x42A\x4c\x53"}["\x70o\x73\x6fn\x73qu\x6a"]}="\x53\x45LE\x43T\n\t \x20\x20\t\t\t \x20v\x6f\x69\x63\x65\x5frate,\n\t\x20 \x20\t\t\t ra\x74e\x5fmu\x6c\x74,\n\t\x20\x20 \t\t\t grace_\x70\x65\x72\x69o\x64,\n\t\x20\x20\x20\t\t\t\x20 \x20mi\x6eimal_\x74ime,\n\t\x20 \t\t\t \x72\x65solu\x74\x69on,\n\t\x20 \t\t\t\x20\x20 m\x69\x6eu\x74\x65_\x66l\x65x\n\t\t\t\t\x20\x20\x20\x46RO\x4d rate\x63\x68ar\x74\n\t\x20 \t\t\t \x20w\x68\x65\x72e\x20\x69d_r\x61\x74\x65\x20= '$rateID' AND\x20LO\x43\x41TE(pref\x69x,\x27$calledNumber\x27)\x3d1\n\t \t\t\t \x20\x20\x41ND p\x72\x65fix=(\x73\x65lect\x20\x6d\x61\x78(pre\x66i\x78)\n \x20\x20\x20 \x20\x20\t\t\t\x20 \x20\x66r\x6f\x6d \x72\x61\x74\x65\x63\x68\x61r\x74 \x77\x68\x65\x72\x65\x20\x69d\x5f\x72a\x74e = \x27$rateID\x27 AND\x20LO\x43A\x54\x45(pr\x65\x66\x69x,\x27$calledNumber')\x3d\x31) \x41\x4e\x44 v\x6fi\x63\x65\x5fr\x61t\x65\x20\x3e \x30\x20\x41N\x44\x20\x72\x61te\x5fmu\x6ct \x3e\x200 \x4cI\x4d\x49T \x31";${$ticgcn}=mysql_query(${${"GLO\x42\x41\x4cS"}["p\x6f\x73o\x6e\x73\x71\x75\x6a"]});if(mysql_num_rows(${${"\x47L\x4fB\x41\x4cS"}["\x6di\x73\x70rqjwl\x69"]})==1){${"\x47\x4cO\x42\x41L\x53"}["\x6d\x67\x6e\x68\x69\x70\x6d\x73"]="r\x61r\x65\x4dinT\x69me";${"\x47LO\x42\x41\x4c\x53"}["k\x6a\x6a\x71\x78uic\x61vf"]="\x72\x61\x74\x65\x47r\x61ceP\x65\x72\x69\x6f\x64";${${"G\x4c\x4f\x42\x41\x4cS"}["\x65\x75rl\x64\x62\x77\x79w\x61\x66"]}=mysql_fetch_row(${${"GL\x4f\x42\x41\x4c\x53"}["\x6dis\x70r\x71\x6a\x77l\x69"]});$clezycrd="r\x61\x74\x65\x4d\x75\x74i";${"\x47\x4c\x4f\x42A\x4cS"}["\x65k\x68\x65\x70g\x71\x69\x77"]="c\x61ll\x52\x61te";${${"\x47L\x4f\x42\x41\x4cS"}["\x65k\x68ep\x67\x71\x69\x77"]}=${${"\x47\x4cO\x42\x41LS"}["\x65u\x72\x6c\x64b\x77yw\x61\x66"]}[0];$vktohpjus="\x72\x6f\x77R\x61\x74\x65\x43\x68a\x72t";${"\x47LO\x42\x41\x4c\x53"}["\x76l\x67\x6b\x6d\x71j\x64\x63"]="r\x61\x74\x65R\x65sol\x75t\x69on";${$clezycrd}=${${"\x47\x4cO\x42AL\x53"}["eur\x6c\x64\x62w\x79\x77\x61f"]}[1];$jhkoryurmwcq="c\x61\x6cl\x52\x61\x74e";$qehovxqax="\x63\x61\x6cl\x52a\x74\x65";${${"\x47\x4cO\x42A\x4c\x53"}["\x6b\x6a\x6a\x71\x78\x75\x69ca\x76f"]}=${${"\x47\x4c\x4fB\x41\x4cS"}["e\x75r\x6c\x64b\x77ywa\x66"]}[2];$lkdpxt="r\x61t\x65\x47rac\x65P\x65\x72\x69\x6f\x64";${${"\x47LOB\x41L\x53"}["\x6d\x67nhi\x70\x6ds"]}=${$vktohpjus}[3];${${"\x47\x4c\x4fB\x41\x4cS"}["v\x6c\x67k\x6d\x71jdc"]}=${${"\x47\x4c\x4f\x42\x41L\x53"}["e\x75\x72l\x64b\x77y\x77\x61\x66"]}[4];${${"\x47L\x4f\x42\x41L\x53"}["\x73\x69\x71\x79\x69\x77t\x70x\x6a"]}=${${"\x47\x4c\x4f\x42A\x4c\x53"}["\x65u\x72\x6cdb\x77\x79\x77\x61\x66"]}[5];$this->trunkCallRate=${$jhkoryurmwcq};$this->trunkCallCost=$this->getCallCostCalcuation(${$qehovxqax},${$lkdpxt},${${"\x47LO\x42\x41L\x53"}["xyp\x78qec\x73\x61\x6d"]},${${"\x47\x4c\x4f\x42AL\x53"}["\x79\x6cvw\x61v\x73l\x75\x72e\x78"]},${${"\x47\x4c\x4fB\x41\x4c\x53"}["j\x69\x71tz\x65c\x67"]});}else{$this->trunkCallRate=0;$this->trunkCallCost=0;}}function minuteFlexibilityDivider($callDuration,$MF,$MFL){${"G\x4cO\x42\x41\x4c\x53"}["\x67\x6a\x6aa\x6e\x6b\x67\x78\x62"]="\x74i\x6d\x65\x44\x69\x76\x69de\x72";${"G\x4cOB\x41L\x53"}["y\x61\x64\x64qk\x75"]="\x6d\x69n\x75\x74e\x46\x6c\x65x\x44\x75\x72\x61\x74ion";${${"\x47\x4c\x4f\x42\x41LS"}["\x79a\x64d\x71k\x75"]}=(60*${${"\x47L\x4f\x42\x41\x4c\x53"}["\x6c\x6e\x70\x76\x70su\x78x"]});if(${${"\x47\x4c\x4f\x42\x41LS"}["\x68q\x65jds"]}>${${"GL\x4f\x42A\x4c\x53"}["r\x66\x72s\x6b\x6bq\x78"]}){$xsvcgantaz="\x4d\x46";${"\x47L\x4f\x42\x41\x4c\x53"}["f\x66\x64\x77\x6e\x6f\x6e\x6c\x79"]="\x74i\x6d\x65\x44iv\x69d\x65\x72";${${"\x47LO\x42\x41\x4c\x53"}["\x66\x66d\x77\x6eo\x6ely"]}=${$xsvcgantaz};}else{${${"G\x4c\x4f\x42\x41\x4c\x53"}["\x68\x6d\x70w\x6df\x6adp\x63\x72"]}=60;}return${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x67\x6a\x6a\x61\x6e\x6b\x67\x78b"]};}function rateBlockCallRate($rateChartID,$callDuration,$currentRate,$minuteMultiplier){$tqyumqm="c\x75r\x72\x65\x6e\x74R\x61t\x65";${"\x47L\x4f\x42\x41L\x53"}["h\x6b\x65\x78km\x73"]="\x66in\x61\x6cCa\x6c\x6cR\x61t\x65";$polifhid="\x72\x61\x74\x65B\x6c\x6f\x63\x6bD\x61\x74\x61";$pmyzdswt="\x72\x61\x74eC\x68\x61\x72tI\x44";${${"GL\x4fB\x41\x4c\x53"}["\x68k\x65x\x6bm\x73"]}=${$tqyumqm};${$polifhid}=$this->rateBlockDetails(${$pmyzdswt});if(${${"\x47\x4cO\x42\x41\x4c\x53"}["\x71\x77\x6aik\x75\x62n"]}!=0){$obumdutt="\x72\x6f\x77";${"\x47\x4c\x4f\x42\x41LS"}["\x61\x7al\x6d\x69\x62"]="\x72a\x74\x65\x42\x6c\x6f\x63k\x44\x61\x74a";foreach(${${"GL\x4f\x42A\x4c\x53"}["\x61zl\x6d\x69b"]} as${$obumdutt}){$fkkpvhvmiuoy="\x65\x6edM\x69n\x75\x74e";$jwwyoafz="\x65\x6e\x64\x4di\x6e\x75t\x65";$nxbnyrd="row";${"\x47LO\x42A\x4c\x53"}["\x68w\x65\x76\x66\x6bc\x68\x66\x76\x6e\x6f"]="\x73\x74\x61rt\x4d\x69n\x75te";${${"\x47\x4c\x4f\x42\x41\x4cS"}["\x76i\x73hx\x64y"]}=${${"G\x4cOBA\x4c\x53"}["\x79\x6a\x6bv\x76t\x65\x73\x77sy"]}["\x73t\x61r\x74M\x69\x6e\x75t\x65"]*${${"\x47\x4cOB\x41\x4c\x53"}["\x71h\x6b\x6c\x79\x68\x64q"]};${$fkkpvhvmiuoy}=${$nxbnyrd}["\x65\x6e\x64\x4d\x69n\x75t\x65"]*${${"\x47\x4c\x4fB\x41\x4c\x53"}["\x71h\x6b\x6cy\x68\x64\x71"]};if((${${"\x47L\x4fB\x41\x4c\x53"}["\x68\x71\x65j\x64\x73"]}>${${"G\x4c\x4f\x42A\x4cS"}["\x68\x77\x65\x76\x66\x6b\x63h\x66\x76\x6e\x6f"]})&&(${${"\x47L\x4fB\x41\x4cS"}["\x68\x71\x65\x6a\x64\x73"]}<=${$jwwyoafz})){${"GL\x4fB\x41\x4c\x53"}["\x76y\x66\x69q\x72g\x73\x78"]="f\x69\x6e\x61\x6c\x43\x61\x6c\x6cRate";$kpawoe="\x72\x6f\x77";${${"\x47L\x4f\x42\x41\x4cS"}["\x76y\x66\x69q\x72g\x73\x78"]}=${$kpawoe}["\x62\x6coc\x6bR\x61t\x65"];break;}}return${${"\x47LO\x42\x41L\x53"}["\x73\x6b\x64\x79\x68\x6fm"]};}else{return${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["s\x6b\x64\x79\x68\x6f\x6d"]};}}function billCalculation($callDuration,$status,$add_prefix){$tsmywfyevh="\x63\x68a\x6e\x6ee\x6c";$ilixmm="\x74a\x72\x69ff\x5fde\x63";$dieynon="\x75\x6e\x69\x71\x75ei\x64";${"G\x4c\x4f\x42A\x4c\x53"}["g\x74\x6f\x63\x65\x76\x72i\x6e\x62"]="cal\x6c\x53\x74a\x72\x74S\x74r";$biworblzm="\x63li\x65\x6et\x74ype";${$dieynon}=$this->agiUniqueID;${"\x47\x4cOBAL\x53"}["\x79\x74\x78\x6c\x61\x69x\x64"]="f\x75\x6c\x6cc\x6fnt\x61ct";${"\x47\x4c\x4f\x42\x41\x4cS"}["\x68\x6a\x67\x61\x69\x72"]="\x6c\x6f\x67\x69n";${"G\x4c\x4f\x42A\x4c\x53"}["q\x6a\x6b\x6eoj\x70\x62\x6dwo"]="i\x64_\x63\x6c\x69\x65nt";$tlrcdx="\x63li\x65\x6e\x74C\x61\x6c\x6cR\x61\x74e";${${"G\x4c\x4f\x42A\x4c\x53"}["\x71\x6ak\x6eojpb\x6d\x77\x6f"]}=$this->clientID;${"\x47\x4cOBAL\x53"}["\x62\x78y\x71nd\x78"]="\x63\x61\x6c\x6c\x65\x6e\x64";${${"\x47\x4cOB\x41L\x53"}["\x68j\x67\x61ir"]}=$this->clientLogin;${"\x47\x4cOB\x41\x4cS"}["\x62\x70\x6f\x7a\x78\x73"]="ip\x6e\x75\x6d\x62\x65r";${${"\x47LOB\x41L\x53"}["\x77u\x6et\x6e\x62w\x6bi\x68"]}=$this->srcIP;${"G\x4cO\x42\x41\x4c\x53"}["\x73\x63o\x76\x70m\x6f\x73r\x66"]="r\x6fu\x74etyp\x65";$bghtxwob="\x72\x65\x73\x65l\x6c\x65\x721\x49D";$bedvoeb="\x63\x61l\x6c\x45\x6e\x64\x53\x74r";${"G\x4c\x4fB\x41\x4cS"}["\x70p\x77\x69\x63\x68\x79"]="\x72\x65\x73e\x6c\x6c\x65\x72\x34\x49\x44";${${"\x47\x4c\x4f\x42AL\x53"}["\x79\x74\x78\x6ca\x69x\x64"]}="";${${"G\x4c\x4fB\x41\x4cS"}["\x62\x70oz\x78\x73"]}=$this->srcIP;${"G\x4c\x4fB\x41\x4c\x53"}["\x67\x65\x79\x64e\x70\x62\x75vc\x72"]="c\x61ll\x73\x74\x61\x72t";$wytiuivwvr="c\x61\x6cl\x65\x64n\x75\x6d\x62\x65\x72";${$tsmywfyevh}=$this->agiChannel;${${"GLOB\x41\x4cS"}["r\x6a\x73\x67\x6ewe\x6d"]}=$this->agiCallerID;$tmfgvt="\x73q\x6cI\x6e\x73\x65\x72t";${$wytiuivwvr}=$this->agidnid;${${"\x47L\x4f\x42A\x4c\x53"}["hj\x6b\x6f\x65\x62\x68\x66\x6ap"]}=$this->clientResellerID;$wdoxcsqv="d\x69a\x6c\x50r\x65f\x69\x78";${${"G\x4c\x4f\x42\x41\x4c\x53"}["\x6e\x7a\x76\x75\x67n\x73e\x6c\x68f"]}=date("Y-\x6d-\x64\x20\x48:\x69:\x73");${${"\x47\x4c\x4fB\x41LS"}["m\x66\x6d\x73\x79\x62\x6b"]}=strtotime(${${"\x47\x4c\x4f\x42\x41LS"}["b\x78\x79\x71\x6e\x64x"]});${${"\x47\x4cO\x42A\x4cS"}["h\x73\x78\x72\x6b\x69\x71w\x78x"]}=${$bedvoeb}-${${"G\x4cO\x42\x41LS"}["\x68\x71\x65\x6ad\x73"]};${${"\x47L\x4f\x42\x41\x4c\x53"}["gey\x64\x65pb\x75\x76\x63\x72"]}=date("Y-m-\x64 H:i:s",${${"\x47\x4c\x4f\x42A\x4cS"}["\x67t\x6f\x63\x65\x76\x72\x69\x6e\x62"]});${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x73co\x76p\x6d\x6fsr\x66"]}=1;${"G\x4c\x4fB\x41\x4c\x53"}["la\x68qr\x73l"]="res\x65\x6c\x6c\x65\x724\x49\x44";${${"G\x4cOB\x41\x4c\x53"}["\x69\x6e\x79o\x61\x70wc"]}=$this->clientRateID;${"\x47L\x4f\x42A\x4c\x53"}["\x6d\x6czjep"]="rese\x6c\x6c\x65\x72\x33\x49\x44";${${"G\x4c\x4f\x42A\x4c\x53"}["gb\x67\x74\x69\x70jyg\x71\x70\x73"]}=$this->clientBillingPrefix;${$ilixmm}=$this->billingPrefixDescription;${$wdoxcsqv}=$this->dialPrefix;${$biworblzm}=SIP_USER;${${"\x47L\x4f\x42\x41LS"}["\x64\x75okd\x71s\x64\x77k\x6e"]}=$this->idTrunk;${${"GL\x4f\x42\x41L\x53"}["\x64c\x6a\x6b\x63g\x64"]}=10;${$bghtxwob}=$this->reseller1ID;${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["k\x6a\x64\x66vj\x69q"]}=$this->clientResellerLevel;${$tlrcdx}=$this->clientCallRate;${${"G\x4c\x4f\x42\x41\x4cS"}["f\x68\x63\x79\x6e\x67c\x6a"]}=$this->reseller1ID;${${"\x47L\x4f\x42\x41\x4c\x53"}["\x67\x70b\x78jf\x77\x66\x76\x6f\x79"]}=$this->reseller2ID;${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["m\x6cz\x6ae\x70"]}=$this->reseller3ID;${${"GL\x4fBA\x4c\x53"}["\x6c\x61\x68\x71\x72s\x6c"]}=$this->reseller4ID;if(${${"G\x4c\x4f\x42AL\x53"}["h\x71e\x6ad\x73"]}>0){${"G\x4c\x4f\x42ALS"}["\x71\x6a\x6b\x6ea\x66\x6ch"]="cli\x65\x6et\x54\x69\x6d\x65D\x69v\x69\x64e\x72";$toilgrylh="\x63\x64\x72\x64u\x72\x61t\x69\x6f\x6e";$sbbqutnho="c\x6f\x73\x74\x43li\x65\x6e\x74";${"\x47\x4c\x4fBA\x4c\x53"}["h\x71\x62\x6es\x66"]="\x63\x61\x6c\x6c\x44u\x72\x61\x74\x69\x6f\x6e";$vgoqtce="\x63all\x72ateC";${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x72g\x64\x71\x67\x66\x68\x77\x69\x74"]="c\x61l\x6cr\x61te\x43";$ujpebhtnogw="\x63l\x69\x65n\x74Ti\x6d\x65\x44\x69\x76\x69\x64er";$bkebyfe="cl\x69\x65n\x74\x54i\x6de\x44i\x76\x69d\x65\x72";${$toilgrylh}=${${"\x47\x4cOB\x41L\x53"}["\x68qej\x64s"]};${${"GLO\x42ALS"}["\x71\x6akn\x61\x66\x6ch"]}=$this->minuteFlexibilityDivider(${${"\x47\x4c\x4fB\x41\x4c\x53"}["\x68\x71ej\x64s"]},$this->clientMinuteflexibility,$this->clientMinuteflexibilityLimit);${"GLOBA\x4c\x53"}["\x74\x62\x79\x6c\x72\x75x\x72a\x6b\x63"]="\x64\x75ra\x74i\x6f\x6e\x43";${${"G\x4cO\x42AL\x53"}["t\x62\x79\x6c\x72ux\x72\x61kc"]}=floor(60*${${"G\x4c\x4fB\x41\x4c\x53"}["\x68\x71\x62\x6e\x73\x66"]}/${$ujpebhtnogw});${${"\x47L\x4fBA\x4c\x53"}["\x72\x67\x64q\x67\x66\x68\x77\x69t"]}=$this->rateBlockCallRate($this->clientRateChartID,${${"\x47\x4c\x4f\x42A\x4c\x53"}["h\x71ej\x64s"]},$this->clientCallRate,${$bkebyfe});${$sbbqutnho}=$this->getCallCostCalcuation(${$vgoqtce},$this->clientGracePeriod,$this->clientMinTime,$this->clientResolution,${${"\x47\x4c\x4f\x42A\x4c\x53"}["\x67\x67\x78\x69\x67q\x79tlb\x76"]});${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["q\x65\x75\x62\x64\x6d\x73"]}=$this->getTotalClientCallCost(${${"\x47\x4c\x4f\x42A\x4cS"}["\x67\x67\x78ig\x71\x79\x74\x6cb\x76"]},${${"\x47\x4cO\x42A\x4c\x53"}["\x6ar\x67\x68\x62\x70\x6c\x76\x62\x70a"]});${${"\x47\x4cOB\x41\x4cS"}["\x68\x69h\x79\x65\x62\x63"]}=${${"\x47\x4c\x4f\x42\x41LS"}["\x71\x65\x75\x62\x64\x6ds"]};$this->clientBalanceUpdate($this->clientID,${${"G\x4c\x4f\x42A\x4cS"}["qe\x75\x62\x64\x6d\x73"]});if($this->reseller1ID>0){$jmuqrnouj="\x72\x65\x73e\x6c\x6c\x65\x72\x31Tim\x65D\x69\x76\x69\x64e\x72";${"\x47\x4c\x4fBA\x4cS"}["\x77\x70\x70\x72\x78\x66\x65\x75\x74"]="\x64\x75ra\x74\x69\x6fn\x52\x31";$bvhgzyhbg="\x72\x65\x73e\x6c\x6c\x65\x721T\x69\x6d\x65D\x69\x76\x69\x64\x65r";${"\x47\x4cOB\x41\x4c\x53"}["\x68\x6c\x75\x68n\x62\x78\x64\x76"]="\x63\x61\x6c\x6cD\x75r\x61\x74i\x6fn";${"\x47\x4cO\x42A\x4cS"}["f\x67y\x6e\x62\x63f\x6fk\x79\x62"]="\x63\x61ll\x43o\x73\x74\x52\x31";$rvofhhgjek="ca\x6c\x6cD\x75\x72\x61t\x69\x6fn";${"G\x4c\x4fB\x41LS"}["\x6bvpf\x6fpx\x6b\x76"]="\x63\x61\x6clDur\x61\x74\x69\x6fn";${"\x47\x4cOBA\x4c\x53"}["p\x77b\x78m\x77\x6b\x67\x76l\x63"]="\x63\x61\x6c\x6c\x72a\x74\x65\x521";${$bvhgzyhbg}=$this->minuteFlexibilityDivider(${${"\x47LO\x42\x41\x4c\x53"}["\x6b\x76\x70\x66\x6f\x70\x78\x6b\x76"]},$this->reseller1Minuteflexibility,$this->reseller1MinuteflexibilityLimit);${${"G\x4c\x4f\x42AL\x53"}["cfq\x77\x6bb\x64"]}=floor(60*${$rvofhhgjek}/${$jmuqrnouj});$krqqxxyheo="\x63\x61\x6c\x6c\x43os\x74\x52\x31";${${"\x47\x4c\x4f\x42\x41\x4cS"}["\x70w\x62\x78\x6dwk\x67vl\x63"]}=$this->rateBlockCallRate($this->reseller1RateChartID,${${"G\x4cO\x42\x41L\x53"}["h\x71\x65\x6a\x64\x73"]},$this->reseller1CallRate,${${"\x47\x4c\x4fB\x41LS"}["\x66\x64\x69\x6a\x71\x65p\x6f"]});${$krqqxxyheo}=$this->getCallCostCalcuation(${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x77\x73\x76p\x76\x6a\x62r\x6b"]},$this->reseller1GracePeriod,$this->reseller1MinTime,$this->reseller1Resolution,${${"GL\x4f\x42A\x4cS"}["\x77\x70p\x72\x78\x66eu\x74"]});${${"\x47\x4c\x4fB\x41\x4c\x53"}["w\x65xj\x62\x69v\x79c"]}=$this->totalReseller1CallCharge(${${"\x47\x4cO\x42\x41\x4c\x53"}["\x68l\x75\x68\x6e\x62x\x64\x76"]},${${"G\x4cO\x42\x41\x4c\x53"}["fg\x79n\x62\x63\x66\x6fk\x79\x62"]});$this->reseller1BalanceUpdate($this->reseller1ID,${${"\x47\x4cO\x42\x41\x4cS"}["\x77\x65\x78\x6a\x62\x69\x76y\x63"]});}else{$pgisfa="\x63\x6f\x73tR\x31";${"\x47\x4c\x4f\x42A\x4c\x53"}["\x62t\x71\x71w\x75"]="\x64\x75\x72\x61tion\x52\x31";${${"G\x4c\x4fBA\x4c\x53"}["\x62t\x71q\x77\x75"]}=0;${${"G\x4c\x4fB\x41LS"}["\x77\x73v\x70\x76\x6a\x62\x72\x6b"]}=0;${$pgisfa}=0;}if($this->reseller2ID>0){$smwwasxr="\x63\x61\x6cl\x44\x75r\x61\x74\x69\x6fn";$cmmiqumkwl="re\x73\x65\x6c\x6c\x65r\x32\x54i\x6deD\x69\x76\x69\x64\x65\x72";$vmtoeucae="ca\x6cl\x44\x75\x72a\x74\x69\x6f\x6e";$vrfmfynkvk="\x63all\x44\x75r\x61\x74\x69\x6f\x6e";$ipftdj="\x72\x65\x73\x65\x6c\x6ce\x722Time\x44\x69\x76i\x64\x65\x72";$mnhlavpff="\x72\x65\x73\x65\x6c\x6c\x65r\x32Ti\x6de\x44\x69\x76\x69\x64\x65\x72";${"\x47\x4c\x4f\x42ALS"}["bz\x7abi\x69"]="\x63a\x6c\x6c\x44\x75\x72\x61\x74\x69\x6f\x6e";${"GLO\x42\x41L\x53"}["w\x74\x66\x77\x69n"]="\x63all\x72\x61\x74\x65R\x32";${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x64i\x62\x62\x64\x6e\x66"]="co\x73\x74R2";${$cmmiqumkwl}=$this->minuteFlexibilityDivider(${${"\x47\x4cO\x42A\x4cS"}["b\x7azb\x69i"]},$this->reseller2Minuteflexibility,$this->reseller2MinuteflexibilityLimit);$unvkyoe="ca\x6c\x6cC\x6f\x73tR2";${${"\x47\x4cO\x42\x41L\x53"}["x\x66\x63\x62\x66qi\x6d\x79\x63\x72"]}=floor(60*${$smwwasxr}/${$mnhlavpff});${${"G\x4cOB\x41\x4c\x53"}["\x77t\x66w\x69\x6e"]}=$this->rateBlockCallRate($this->reseller2RateChartID,${$vmtoeucae},$this->reseller2CallRate,${$ipftdj});${$unvkyoe}=$this->getCallCostCalcuation(${${"G\x4c\x4fB\x41LS"}["\x74ct\x77\x74\x65\x68\x7ad\x78\x62o"]},$this->reseller2GracePeriod,$this->reseller2MinTime,$this->reseller2Resolution,${${"\x47\x4c\x4fBA\x4cS"}["\x78f\x63b\x66q\x69my\x63r"]});${${"G\x4c\x4f\x42A\x4cS"}["di\x62\x62\x64\x6e\x66"]}=$this->totalReseller2CallCharge(${$vrfmfynkvk},${${"\x47L\x4f\x42\x41L\x53"}["\x7a\x65\x6a\x6f\x66te\x74m\x6e\x64"]});$this->reseller2BalanceUpdate($this->reseller2ID,${${"GL\x4fB\x41\x4cS"}["\x75q\x70\x6e\x67\x63"]});}else{${"\x47L\x4f\x42AL\x53"}["\x66dhb\x67o\x62\x6b"]="\x63\x6f\x73tR2";${${"G\x4c\x4fB\x41L\x53"}["x\x66\x63b\x66\x71\x69\x6d\x79\x63\x72"]}=0;${${"\x47\x4cOBA\x4c\x53"}["\x74\x63\x74\x77\x74\x65\x68\x7adxbo"]}=0;${${"\x47\x4c\x4f\x42\x41\x4cS"}["\x66dh\x62\x67\x6f\x62\x6b"]}=0;}$wjekuydx="\x72e\x73ul\x74I\x6e\x73\x65\x72tC\x61lls";if($this->reseller3ID>0){${"\x47\x4c\x4f\x42\x41\x4cS"}["o\x6a\x6a\x6at\x70\x72\x77\x75"]="re\x73e\x6cle\x72\x33\x54\x69\x6d\x65D\x69\x76\x69der";$nhlssl="\x63\x61l\x6c\x44\x75r\x61\x74\x69o\x6e";${"G\x4c\x4f\x42A\x4cS"}["\x79m\x69h\x78\x72\x63\x79"]="\x63\x6f\x73t\x52\x33";${"\x47\x4c\x4f\x42\x41LS"}["\x79\x6e\x65\x64sh\x64\x74"]="\x64\x75\x72\x61\x74\x69\x6f\x6eR3";${"\x47\x4cO\x42\x41L\x53"}["ab\x70mqe\x6b\x6e"]="\x63\x61\x6c\x6cr\x61t\x65\x52\x33";${"G\x4cOB\x41LS"}["\x75\x64\x68\x69\x6al\x76\x6a"]="\x72e\x73\x65\x6cl\x65r3\x54\x69\x6deDi\x76\x69\x64\x65\x72";${"G\x4cO\x42\x41LS"}["\x62\x6d\x66\x65\x70\x70\x72\x76\x72"]="\x63a\x6cl\x44\x75ra\x74\x69on";$zkkrbc="\x64u\x72at\x69\x6f\x6eR\x33";${${"\x47LOBALS"}["o\x6a\x6a\x6a\x74p\x72\x77\x75"]}=$this->minuteFlexibilityDivider(${${"\x47LOB\x41\x4c\x53"}["h\x71e\x6ads"]},$this->reseller3Minuteflexibility,$this->reseller3MinuteflexibilityLimit);$bkhdbox="\x63\x61\x6c\x6cCo\x73\x74\x52\x33";$sbgglqwdiyg="\x63all\x43\x6f\x73\x74R3";${${"\x47\x4c\x4fBA\x4cS"}["\x79ne\x64\x73\x68\x64\x74"]}=floor(60*${${"\x47\x4cO\x42\x41\x4c\x53"}["b\x6d\x66ep\x70\x72\x76r"]}/${${"\x47\x4cO\x42\x41L\x53"}["d\x70\x78\x77q\x79e\x6a"]});${${"G\x4c\x4fB\x41L\x53"}["\x61b\x70m\x71\x65\x6bn"]}=$this->rateBlockCallRate($this->reseller3RateChartID,${$nhlssl},$this->reseller3CallRate,${${"\x47\x4c\x4fB\x41\x4cS"}["\x75\x64\x68\x69jl\x76\x6a"]});${$bkhdbox}=$this->getCallCostCalcuation(${${"\x47\x4cO\x42\x41\x4cS"}["\x77\x6d\x61\x6e\x72cc\x73q"]},$this->reseller3GracePeriod,$this->reseller3MinTime,$this->reseller3Resolution,${$zkkrbc});${"\x47\x4c\x4fB\x41\x4c\x53"}["\x72\x6abrg\x76z"]="c\x61\x6c\x6cDu\x72\x61tio\x6e";${${"GLO\x42\x41\x4c\x53"}["e\x6d\x73\x77\x67\x77"]}=$this->totalReseller3CallCharge(${${"\x47\x4c\x4f\x42\x41L\x53"}["\x72jb\x72\x67\x76z"]},${$sbgglqwdiyg});$this->reseller3BalanceUpdate($this->reseller3ID,${${"\x47\x4c\x4fBA\x4c\x53"}["ym\x69\x68\x78\x72cy"]});}else{$lcnjxll="\x64\x75\x72\x61t\x69o\x6e\x52\x33";${$lcnjxll}=0;${${"GLO\x42A\x4c\x53"}["\x77m\x61\x6e\x72cc\x73\x71"]}=0;${${"G\x4c\x4f\x42\x41L\x53"}["\x65\x6d\x73\x77g\x77"]}=0;}if($this->reseller4ID>0){${"GL\x4f\x42\x41L\x53"}["\x70e\x74c\x6cy\x74g"]="\x63al\x6cD\x75r\x61\x74\x69\x6f\x6e";${"\x47L\x4f\x42\x41L\x53"}["\x66\x61jm\x62\x75\x72o"]="\x72e\x73\x65ll\x65\x72\x34\x54\x69me\x44\x69\x76\x69d\x65\x72";${"\x47\x4cO\x42AL\x53"}["\x69\x79\x74n\x6e\x68\x71\x78\x73\x72"]="ca\x6cl\x44\x75\x72\x61\x74\x69\x6fn";${"\x47L\x4f\x42\x41\x4c\x53"}["n\x77l\x6c\x6f\x68"]="\x63\x61\x6clD\x75\x72at\x69on";$xaeeqewuekq="\x64\x75\x72a\x74i\x6f\x6e\x52\x34";${"G\x4c\x4f\x42\x41\x4cS"}["f\x66pb\x65\x78w"]="\x63\x61\x6c\x6cCo\x73\x74\x524";${"G\x4cO\x42\x41\x4cS"}["ho\x67\x63a\x66ssy\x7a\x63"]="\x72\x65\x73\x65ll\x65\x72\x34Ti\x6de\x44\x69vi\x64er";${"GL\x4fB\x41\x4c\x53"}["j\x68\x64\x72\x67\x78\x6a\x72\x69\x62\x6f"]="\x63\x61l\x6c\x44ura\x74\x69\x6fn";${${"G\x4cO\x42\x41L\x53"}["\x68\x6f\x67c\x61f\x73\x73\x79\x7a\x63"]}=$this->minuteFlexibilityDivider(${${"GL\x4fB\x41\x4c\x53"}["\x70\x65tc\x6c\x79\x74\x67"]},$this->reseller4Minuteflexibility,$this->reseller4MinuteflexibilityLimit);${"G\x4c\x4f\x42\x41L\x53"}["\x72\x6d\x75\x6a\x65w\x71y\x67\x6fi"]="\x63\x61ll\x72\x61t\x65\x524";${$xaeeqewuekq}=floor(60*${${"GLO\x42A\x4c\x53"}["\x69\x79\x74\x6e\x6e\x68q\x78\x73\x72"]}/${${"\x47\x4cO\x42A\x4c\x53"}["\x66\x61j\x6d\x62\x75\x72\x6f"]});${${"G\x4c\x4f\x42A\x4c\x53"}["\x72\x6d\x75\x6ae\x77\x71\x79\x67\x6f\x69"]}=$this->rateBlockCallRate($this->reseller4RateChartID,${${"\x47\x4cO\x42A\x4c\x53"}["j\x68\x64\x72g\x78\x6ar\x69b\x6f"]},$this->reseller4CallRate,${${"\x47L\x4fB\x41\x4cS"}["g\x63\x66\x70i\x67\x72t"]});${${"\x47L\x4f\x42AL\x53"}["f\x66\x70\x62\x65\x78\x77"]}=$this->getCallCostCalcuation(${${"\x47\x4cO\x42AL\x53"}["\x65\x6d\x65\x74s\x6c\x79j\x68"]},$this->reseller4GracePeriod,$this->reseller4MinTime,$this->reseller4Resolution,${${"G\x4c\x4f\x42ALS"}["vve\x63l\x77\x62"]});${${"\x47LO\x42\x41L\x53"}["\x61\x6d\x72ydp\x77"]}=$this->totalReseller4CallCharge(${${"\x47L\x4f\x42AL\x53"}["\x6e\x77l\x6c\x6fh"]},${${"\x47\x4c\x4fBA\x4c\x53"}["u\x69\x70b\x66\x76\x70\x72\x6ac"]});$this->reseller4BalanceUpdate($this->reseller4ID,${${"\x47\x4c\x4fBA\x4c\x53"}["\x61\x6d\x72yd\x70\x77"]});}else{$csqhuop="\x63a\x6c\x6c\x72at\x65\x52\x34";$cgmevdzb="\x64u\x72a\x74io\x6e\x52\x34";${$cgmevdzb}=0;${$csqhuop}=0;${"\x47\x4cOB\x41\x4cS"}["mq\x6b\x73\x6b\x68p"]="\x63\x6f\x73t\x52\x34";${${"\x47LO\x42\x41\x4c\x53"}["\x6dqk\x73k\x68\x70"]}=0;}if($this->terminationRateID>0){${"\x47\x4c\x4f\x42A\x4cS"}["\x67\x61\x61\x62\x73\x61\x67\x77r"]="\x63a\x6cl\x65d\x6e\x75m\x62e\x72";$this->trunkCallCost($this->terminationRateID,${${"\x47L\x4fB\x41\x4cS"}["gaa\x62sa\x67\x77\x72"]},${${"G\x4c\x4f\x42\x41\x4cS"}["\x68\x71\x65\x6a\x64s"]});${"\x47\x4c\x4f\x42ALS"}["s\x7ai\x6f\x6ahb\x6ae\x70z"]="\x74e\x72\x6d\x69\x6e\x61\x74\x69\x6f\x6e\x43\x6fst";${${"GLOB\x41\x4c\x53"}["u\x78\x71\x6c\x61\x76\x65\x75"]}=$this->trunkCallRate;${${"\x47\x4c\x4fB\x41\x4c\x53"}["s\x7a\x69\x6fj\x68\x62jep\x7a"]}=$this->trunkCallCost;}else{$zvigukimdlyn="\x74\x65r\x6d\x69\x6ea\x74\x69\x6fn\x52at\x65";$elehveprbbyd="\x74\x65\x72mi\x6eat\x69\x6f\x6eCo\x73t";${$zvigukimdlyn}=0;${$elehveprbbyd}=0;}${${"\x47L\x4fB\x41\x4c\x53"}["\x67\x77k\x77y\x67"]}="\x49\x4e\x53\x45\x52\x54\x20\x49\x4e\x54\x4f\x20\x72\x65t\x61\x69\x6c\x5fs\x75cces\x73\x63a\x6c\x6cs\x20(i\x64_ca\x6cl,\x20\x63\x61ll\x65ri\x64, d\x69al_\x6e\x75m\x62e\x72, \x63\x61ll\x73ta\x72\x74,\x20pre\x66ix,\x20\x64\x65s\x63r\x69pt\x69\x6fn,\x20\x69d_cl\x69e\x6e\x74, \x72\x65sel\x6ce\x721_i\x64,\n\t\t\t\t\t\t\x20 \x72e\x73\x65lle\x722_\x69d, resel\x6c\x65\x723\x5fid, r\x65se\x6c\x6c\x65r\x34\x5f\x69\x64,\x20durati\x6f\x6e, \x64u\x72\x61t\x69\x6fn\x5fc, d\x75\x72a\x74i\x6fn\x5f\x72\x31,\x20\x64u\x72\x61ti\x6fn_r\x32, d\x75r\x61\x74i\x6fn\x5fr3, \x64\x75r\x61\x74io\x6e_r\x34,\n\t\t\t\t\t\t\x20 \x63a\x6cl\x72ate\x5fc, c\x61\x6c\x6cr\x61\x74\x65_\x721, c\x61\x6c\x6crat\x65_\x722,\x20\x63\x61ll\x72ate_\x723, \x63\x61\x6c\x6c\x72at\x65\x5fr\x34,\x20cost_c,\x20c\x6fst\x5fr\x31, \x63o\x73t_\x72\x32,\x20c\x6fst\x5f\x723, \x63os\x74_r4, \x69\x64\x5f\x74ru\x6ek,\n\t\t\t\t\t\t \x20\x20\x74\x72\x75nk_\x72ate, tru\x6ek_\x63os\x74)\n\t\t\t\t\t\t\x20 \x56ALUES\x20('$uniqueid', '$callerid\x27, \x27$callednumber\x27, \x27$callstart', \x27$tariff_prefix\x27,\x20\x27$tariff_dec\x27, '$id_client', '$reseller1ID',\n\t\t\t\t\t\t\x20\x20 \x27$reseller2ID',\x20\x27$reseller3ID\x27, \x27$reseller4ID', \x27$cdrduration\x27,\x20'$durationC',\x20'$durationR1\x27,\x20'$durationR2\x27,\x20\x27$durationR3\x27,\n\t\t\t\t\t\t\x20\x20\x20'$durationR4',\x20\x27$callrateC', '$callrateR1\x27, \x27$callrateR2\x27, '$callrateR3',\x20'$callrateR4',\x20'$costC',\x20\x27$costR1\x27, '$costR2', \x27$costR3\x27,\n\t\t\t\t\t\t\x20\x20 \x27$costR4',\x20\x27$id_trunk', \x27$terminationRate\x27,\x20\x27$terminationCost\x27)";${$wjekuydx}=mysql_query(${${"\x47\x4c\x4f\x42\x41L\x53"}["g\x77\x6bw\x79\x67"]});}else{$exkqwjgkm="\x63\x6f\x73\x74\x52\x34";$ldnembw="c\x6fstR\x33";${"\x47\x4c\x4fBA\x4c\x53"}["u\x69\x6asxq\x6b\x6c\x74q"]="\x74\x65r\x6d\x69\x6e\x61t\x69o\x6e\x52\x61\x74\x65";${"\x47LO\x42\x41\x4cS"}["\x61h\x66\x68\x73b\x71"]="te\x72m\x69\x6ea\x74\x69\x6f\x6e\x43\x6fs\x74";${${"\x47\x4c\x4fBA\x4c\x53"}["\x63\x72h\x78\x6fia\x62k"]}=0;${${"\x47\x4c\x4f\x42A\x4c\x53"}["\x68\x69\x68\x79e\x62\x63"]}=0;${"\x47L\x4fBAL\x53"}["\x79\x76ri\x6a\x69\x69"]="c\x6fstR\x32";${${"\x47\x4c\x4f\x42\x41LS"}["\x77e\x78\x6a\x62i\x76\x79\x63"]}=0;${${"\x47\x4c\x4f\x42\x41\x4cS"}["\x79\x76r\x69\x6ai\x69"]}=0;${$ldnembw}=0;${$exkqwjgkm}=0;${${"\x47\x4c\x4fB\x41\x4c\x53"}["u\x69\x6a\x73\x78\x71k\x6c\x74q"]}=0;${${"\x47\x4cO\x42AL\x53"}["\x61\x68\x66\x68\x73b\x71"]}=0;}${${"G\x4c\x4f\x42A\x4c\x53"}["lc\x71\x6c\x72w"]}=1;if(${${"\x47\x4c\x4fB\x41L\x53"}["pp\x77ichy"]}>0){${"G\x4c\x4fB\x41L\x53"}["d\x77\x73\x61yg\x79\x75\x72"]="c\x6f\x73\x74\x52\x34";${${"G\x4cOBA\x4c\x53"}["u\x65\x61\x78\x70wx"]}=${${"G\x4c\x4fB\x41LS"}["\x6cg\x6b\x6c\x72\x71\x65\x70m\x63\x73"]};${"GL\x4f\x42\x41\x4cS"}["\x62\x67k\x6f\x65\x6d\x74n\x62\x6d\x66"]="or\x67\x43\x6f\x73\x74";${"\x47\x4cOB\x41\x4c\x53"}["\x67\x73\x6c\x6f\x6e\x75\x72\x6a\x6e\x67\x78t"]="\x70\x61\x72\x65nt\x52\x65se\x6cl\x65\x72L\x65\x76\x65\x6c";${${"\x47\x4cOBAL\x53"}["\x67\x73\x6c\x6f\x6e\x75\x72\x6a\x6e\x67x\x74"]}=4;${${"GL\x4fB\x41LS"}["bg\x6b\x6f\x65\x6dt\x6e\x62\x6df"]}=${${"G\x4cOBAL\x53"}["\x64\x77s\x61y\x67yu\x72"]};}else{if(${${"G\x4cOB\x41\x4cS"}["y\x6a\x70z\x66\x73\x76\x63l\x65"]}>0){$qtlhkyd="\x72e\x73el\x6c\x65r\x33\x49\x44";$whlpnucbseb="\x63\x6fs\x74\x52\x33";${${"GL\x4f\x42\x41\x4cS"}["\x75\x65axp\x77x"]}=${$qtlhkyd};${"\x47L\x4f\x42\x41\x4cS"}["\x63\x63\x67birne\x7an"]="or\x67\x43ost";${${"\x47\x4c\x4fB\x41L\x53"}["y\x67r\x6b\x78\x6b\x76\x65\x70\x75"]}=3;${${"\x47L\x4f\x42\x41\x4c\x53"}["c\x63\x67b\x69\x72\x6e\x65\x7a\x6e"]}=${$whlpnucbseb};}else{if(${${"\x47L\x4f\x42\x41\x4c\x53"}["\x67p\x62\x78\x6af\x77f\x76o\x79"]}>0){${"G\x4c\x4f\x42\x41L\x53"}["w\x75\x77\x75\x6b\x62nh\x69\x6d"]="reselle\x72\x32ID";${${"\x47L\x4f\x42A\x4cS"}["\x75e\x61\x78p\x77x"]}=${${"\x47L\x4f\x42\x41L\x53"}["w\x75\x77u\x6bbn\x68\x69m"]};${${"GLO\x42\x41\x4c\x53"}["\x79g\x72k\x78\x6bvepu"]}=2;${${"\x47\x4c\x4f\x42\x41\x4cS"}["\x6f\x6fi\x75\x6a\x6cx\x65\x63\x71n"]}=${${"\x47\x4c\x4f\x42\x41LS"}["\x75\x71\x70\x6e\x67c"]};}else{${"G\x4cO\x42\x41\x4cS"}["\x64\x79\x6f\x79\x6ef\x64\x76"]="r\x65s\x65\x6cl\x65\x72\x31\x49D";if(${${"\x47LOB\x41\x4cS"}["\x64\x79\x6fy\x6e\x66\x64\x76"]}>0){$epsvbwakrg="\x72\x65sel\x6c\x65\x721\x49\x44";$gujiltldp="\x63\x6fs\x74\x52\x31";${${"\x47\x4c\x4fBA\x4c\x53"}["\x75\x65a\x78p\x77\x78"]}=${$epsvbwakrg};${${"\x47\x4c\x4f\x42A\x4cS"}["y\x67\x72kxkv\x65p\x75"]}=1;${${"GLO\x42\x41\x4cS"}["\x6f\x6f\x69\x75\x6alx\x65\x63\x71\x6e"]}=${$gujiltldp};}else{$welxxkrd="co\x73\x74C";$leobtlffq="or\x67\x43\x6f\x73\x74";${${"G\x4c\x4f\x42\x41\x4cS"}["\x75\x65\x61xp\x77\x78"]}=-1;${${"\x47\x4c\x4f\x42AL\x53"}["yg\x72\x6b\x78\x6bv\x65\x70\x75"]}=-1;${$leobtlffq}=${$welxxkrd};}}}}${$tmfgvt}="\x49NS\x45R\x54\x20INT\x4f \x73uc\x63\x65s\x73_\x63al\x6cs\x20(c\x61l\x6c_i\x64,\x20\x63\x68a\x6e\x6e\x65\x6c, \x63\x61\x6c\x6c_ty\x70\x65, i\x64_\x63\x6c\x69\x65\x6e\x74, \x6c\x6fg\x69n, src\x69p,\x20\x63\x61\x6c\x6ce\x72id,\x20\x64\x69a\x6c_\x6e\x75\x6db\x65\x72,\x20pd\x64,\x20\x63a\x6c\x6c\x73\x74\x61rt, \x63a\x6c\x6c\x65n\x64, d\x75r\x61tio\x6e, \x69d\x5ft\x61r\x69ff,\x20cal\x6c_\x72a\x74e,\n\t\x74ari\x66f_\x70ref\x69x,\x20t\x61\x72iff\x5f\x64\x65\x63,\x20c\x6f\x73t_\x63\x6c\x69\x65nt, \x63o\x73\x74\x5fr1, \x63\x6fst_\x72\x32, c\x6fs\x74_\x723, cost\x5f\x72\x34, re\x73\x65\x6c\x6ce\x721_\x69\x64, r\x65\x73e\x6cler\x32\x5f\x69\x64,\x20\x72\x65s\x65\x6cler\x33_\x69\x64, r\x65se\x6cl\x65r4\x5fi\x64,\x20\x70a\x72\x65\x6et\x5fr\x65s\x65l\x65\x72,\x20p\x61\x72ent_leve\x6c,\x20\x70\x61\x72\x65nt_\x63o\x73\x74,\n\ti\x64\x5f\x72ese\x6cl\x65\x72, re\x73el\x6c\x65\x72\x5f\x6c\x65v\x65\x6c,\x20\x69\x64_t\x72\x75\x6ek, \x64i\x61\x6ci\x6e\x67\x5fp\x72efi\x78,add_pre\x66i\x78, tr\x75nk\x5fr\x61t\x65,\x20\x74r\x75nk_\x63\x6f\x73\x74,\x20f\x75\x6c\x6c\x63o\x6eta\x63\x74,\x20\x63all_\x73t\x61\x74u\x73)\n\t\x56A\x4cUE\x53 ('$uniqueid\x27, '$channel', \x27$callType\x27,\x20'$id_client\x27, '$login', \x27$srcIP\x27,\x20'$callerid\x27, '$callednumber',\x20'$pdd\x27, \x27$callstart\x27,\x20\x27$callend\x27, \x27$callDuration',\x20'$id_tariff',\n\t\x27$callrateC',\x20'$tariff_prefix\x27,\x20'$tariff_dec\x27, \x27$costC', '$costR1\x27, '$costR2',\x20'$costR3',\x20'$costR4', \x27$reseller1ID', \x27$reseller2ID', '$reseller3ID',\x20\x27$reseller4ID',\n\t'$parentResellerID',\x20\x27$parentResellerLevel\x27,\x20\x27$orgCost\x27, \x27$idReselller\x27,\x20\x27$resellerLevel\x27, \x27$id_trunk\x27, '$dialPrefix\x27,\x27$add_prefix',\x20\x27$terminationRate\x27, '$terminationCost\x27,\x20\x27$fullcontact',\x20\x27$status\x27)";${${"GLO\x42\x41\x4c\x53"}["i\x74\x69\x6e\x65\x72r\x70\x79\x6e\x7a"]}=mysql_query(${${"G\x4c\x4f\x42\x41\x4c\x53"}["ne\x7a\x6e\x6e\x76\x6e\x67\x7am"]});}function getTotalClientCallCost($duration,$callCost){$cglglprkc="c\x6c\x69\x65\x6etC\x6fn\x6e\x65\x63\x74\x69\x6f\x6eFe\x65";$doyykxp="cli\x65\x6e\x74\x44\x69\x73C\x6f\x6en\x65\x63t\x69\x6f\x6eFee";${$cglglprkc}=0;$xysswko="c\x6c\x69e\x6e\x74\x54a\x78F\x65\x65";${$doyykxp}=0;${$xysswko}=0;if($this->clientrConnectionFee>0){$this->clientConnectionFee=$this->clientrConnectionFee;}if($this->clientrConnectionThresholdValue>0){$this->clientConnectionThresholdValue=$this->clientrConnectionThresholdValue;}if($this->clientrDisConnectionFee>0){$this->clientDisConnectionFee=$this->clientrDisConnectionFee;}if($this->clientrDisConnectionThresholdValue>0){$this->clientDisConnectionThresholdValue=$this->clientrDisConnectionThresholdValue;}if($this->clientrTaxFee>0){$this->clientTaxFee=$this->clientrTaxFee;}if(($this->clientConnectionFee>0)AND($this->clientConnectionThresholdValue>0)){$fifosai="\x64\x75r\x61\x74\x69o\x6e";if(${$fifosai}>$this->clientConnectionThresholdValue)${${"G\x4c\x4fB\x41\x4c\x53"}["jc\x69i\x6fc\x69"]}=$this->clientConnectionFee;else${${"G\x4c\x4f\x42\x41\x4c\x53"}["j\x63i\x69\x6fc\x69"]}=0;}else{$oaykbtdpex="\x63\x6c\x69\x65\x6e\x74\x43\x6fn\x6e\x65\x63ti\x6f\x6e\x46e\x65";${$oaykbtdpex}=0;}${"\x47L\x4f\x42\x41\x4c\x53"}["\x6c\x64g\x6f\x61\x78\x72i\x63\x63"]="\x63allC\x6f\x73t";if(($this->clientDisConnectionFee>0)AND($this->clientDisConnectionThresholdValue>0)){$vhyjafn="\x64u\x72\x61\x74\x69\x6f\x6e";${"G\x4c\x4fB\x41LS"}["\x70\x70\x70o\x6cd\x6e\x6c\x74v"]="\x63\x6ci\x65ntD\x69\x73\x43o\x6en\x65\x63\x74\x69o\x6eF\x65\x65";if(${$vhyjafn}>$this->clientDisConnectionThresholdValue)${${"\x47\x4cO\x42\x41\x4c\x53"}["\x79gcj\x6c\x74\x72\x66\x66\x66"]}=$this->clientDisConnectionFee;else${${"\x47L\x4f\x42\x41\x4cS"}["\x70\x70pol\x64\x6elt\x76"]}=0;}else{$hesxhv="c\x6ci\x65\x6e\x74D\x69sC\x6fn\x6e\x65c\x74io\x6e\x46\x65e";${$hesxhv}=0;}if(($this->clientTaxFee>0)AND(${${"G\x4cO\x42\x41\x4c\x53"}["\x6b\x64\x75\x6c\x71\x6e\x6fh"]}>0)){${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["o\x76y\x75j\x70\x6dx\x6fe\x65\x6d"]}=number_format(($this->clientTaxFee*${${"GLO\x42\x41\x4cS"}["\x6b\x64\x75\x6c\x71\x6e\x6fh"]})/100,6,".","");}${${"\x47L\x4f\x42\x41\x4c\x53"}["\x64\x63\x70\x7aa\x75\x6e\x68v\x78o"]}=${${"\x47\x4cOB\x41\x4c\x53"}["\x6ac\x69\x69\x6f\x63\x69"]}+${${"\x47L\x4f\x42\x41\x4c\x53"}["\x79gcj\x6ct\x72\x66\x66f"]}+${${"G\x4cOB\x41\x4c\x53"}["\x6f\x76\x79u\x6ap\x6d\x78oe\x65\x6d"]}+${${"G\x4c\x4f\x42\x41L\x53"}["l\x64\x67\x6f\x61xric\x63"]};return${${"G\x4c\x4f\x42\x41\x4c\x53"}["d\x63\x70z\x61un\x68\x76x\x6f"]};}function totalReseller1CallCharge($duration,$callCost){$ccnvcsfbwb="r\x65\x73\x65ll\x65r\x31\x43on\x6e\x65\x63t\x69o\x6e\x46e\x65";${${"\x47\x4c\x4f\x42AL\x53"}["\x75b\x70p\x61p\x68sy"]}=0;$qhbafk="\x72e\x73el\x6c\x65r1\x44i\x73\x43\x6f\x6e\x6e\x65\x63t\x69\x6fn\x46ee";${${"\x47\x4cOB\x41\x4c\x53"}["\x78y\x70\x74\x69\x73\x77\x75d\x6a"]}=0;${${"GLO\x42\x41LS"}["\x74q\x73\x74m\x6d\x6e\x6b\x76\x63a\x6c"]}=0;if($this->reseller1rConnectionFee>0){$this->reseller1ConnectionFee=$this->reseller1rConnectionFee;}if($this->reseller1rConnectionThresholdValue>0){$this->reseller1ConnectionThresholdValue=$this->reseller1rConnectionThresholdValue;}${"\x47\x4c\x4f\x42A\x4c\x53"}["m\x76\x6eq\x6ef\x71\x67"]="\x63\x61l\x6c\x43o\x73\x74";$wczbwnqinyxb="\x72\x65s\x65\x6cl\x65\x72\x31T\x61\x78Fe\x65";${"\x47\x4cO\x42\x41L\x53"}["\x63hp\x6b\x71\x6aw\x65c"]="\x74\x6f\x74\x61l\x43\x61\x6c\x6cC\x6f\x73\x74";if($this->reseller1rDisConnectionFee>0){$this->reseller1DisConnectionFee=$this->reseller1rDisConnectionFee;}if($this->reseller1rDisConnectionThresholdValue>0){$this->reseller1DisConnectionThresholdValue=$this->reseller1rDisConnectionThresholdValue;}if($this->reseller1rTaxFee>0){$this->reseller1TaxFee=$this->reseller1rTaxFee;}if(($this->reseller1ConnectionFee>0)AND($this->reseller1ConnectionThresholdValue>0)){$bknrqmbm="\x72e\x73\x65l\x6cer\x31C\x6f\x6en\x65\x63t\x69\x6fn\x46\x65e";$scfvfbpoqkws="re\x73e\x6c\x6c\x65r\x31\x43\x6f\x6e\x6e\x65\x63\x74\x69o\x6e\x46\x65\x65";if(${${"\x47\x4cO\x42\x41\x4c\x53"}["\x6a\x69\x71\x74z\x65\x63\x67"]}>$this->reseller1ConnectionThresholdValue)${$scfvfbpoqkws}=$this->reseller1ConnectionFee;else${$bknrqmbm}=0;}else{${${"\x47LO\x42\x41\x4c\x53"}["\x75\x62\x70p\x61\x70\x68\x73y"]}=0;}$prqxuya="to\x74\x61\x6c\x43\x61ll\x43\x6f\x73\x74";if(($this->reseller1DisConnectionFee>0)AND($this->reseller1DisConnectionThresholdValue>0)){${"GL\x4fB\x41LS"}["\x64g\x68\x70\x62\x73\x67\x65d\x74\x70"]="\x64\x75ra\x74i\x6f\x6e";if(${${"GLOBALS"}["\x64\x67\x68\x70\x62\x73\x67\x65\x64t\x70"]}>$this->reseller1DisConnectionThresholdValue)${${"\x47L\x4f\x42\x41\x4c\x53"}["\x78\x79pt\x69s\x77\x75\x64\x6a"]}=$this->reseller1DisConnectionFee;else${${"\x47L\x4fBAL\x53"}["\x78\x79\x70tis\x77ud\x6a"]}=0;}else{$kjsontbic="\x72\x65\x73\x65\x6c\x6ce\x72\x31\x44i\x73Conn\x65\x63t\x69\x6f\x6eFe\x65";${$kjsontbic}=0;}if(($this->reseller1TaxFee>0)AND(${${"\x47\x4c\x4f\x42\x41\x4cS"}["\x6b\x64\x75\x6c\x71\x6e\x6f\x68"]}>0)){${${"\x47\x4c\x4f\x42A\x4c\x53"}["\x74\x71s\x74\x6dm\x6e\x6b\x76\x63\x61l"]}=number_format(($this->reseller1TaxFee*${${"G\x4c\x4fBALS"}["kd\x75l\x71n\x6fh"]})/100,6,"\x2e","");}${${"\x47\x4c\x4f\x42\x41L\x53"}["\x63\x68\x70\x6b\x71j\x77e\x63"]}=${$ccnvcsfbwb}+${$qhbafk}+${$wczbwnqinyxb}+${${"\x47\x4cOB\x41\x4c\x53"}["\x6d\x76n\x71\x6e\x66q\x67"]};return${$prqxuya};}function totalReseller2CallCharge($duration,$callCost){${${"\x47L\x4f\x42\x41LS"}["\x70hcn\x6b\x64\x6cl\x74\x6c\x70"]}=0;${${"\x47\x4c\x4fB\x41\x4cS"}["cx\x72\x70\x6c\x62\x6et\x62\x77\x68"]}=0;${${"\x47\x4cO\x42\x41\x4c\x53"}["\x77\x77\x64\x77\x73\x76\x64lm\x78x\x65"]}=0;if($this->reseller2rConnectionFee>0){$this->reseller2ConnectionFee=$this->reseller2rConnectionFee;}if($this->reseller2rConnectionThresholdValue>0){$this->reseller2ConnectionThresholdValue=$this->reseller2rConnectionThresholdValue;}if($this->reseller2rDisConnectionFee>0){$this->reseller2DisConnectionFee=$this->reseller2rDisConnectionFee;}$xmanubq="\x63a\x6cl\x43o\x73\x74";if($this->reseller2rDisConnectionThresholdValue>0){$this->reseller2DisConnectionThresholdValue=$this->reseller2rDisConnectionThresholdValue;}${"\x47\x4c\x4fB\x41\x4c\x53"}["\x79\x6a\x69\x69\x63\x69\x73n\x6e"]="\x72\x65\x73\x65l\x6ce\x722\x44\x69\x73Conn\x65\x63\x74i\x6f\x6e\x46ee";if($this->reseller2rTaxFee>0){$this->reseller2TaxFee=$this->reseller2rTaxFee;}if(($this->reseller2ConnectionFee>0)AND($this->reseller2ConnectionThresholdValue>0)){${"G\x4c\x4f\x42\x41L\x53"}["\x6f\x62\x75\x6a\x77cjwa"]="\x64\x75\x72a\x74\x69o\x6e";if(${${"\x47L\x4f\x42\x41\x4c\x53"}["\x6f\x62\x75\x6a\x77\x63\x6awa"]}>$this->reseller2ConnectionThresholdValue)${${"G\x4cOB\x41\x4cS"}["\x70\x68\x63\x6e\x6bd\x6cltl\x70"]}=$this->reseller2ConnectionFee;else${${"\x47\x4c\x4f\x42A\x4c\x53"}["\x70\x68\x63\x6e\x6b\x64\x6c\x6ct\x6c\x70"]}=0;}else{${"G\x4c\x4f\x42\x41\x4cS"}["\x6d\x61\x69\x65\x67b\x6c"]="r\x65\x73\x65l\x6c\x65\x72\x32\x43\x6f\x6e\x6eect\x69\x6f\x6eFe\x65";${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x6d\x61i\x65g\x62\x6c"]}=0;}$zsylzblwto="\x72\x65\x73\x65l\x6c\x65\x72\x32Ta\x78\x46\x65e";if(($this->reseller2DisConnectionFee>0)AND($this->reseller2DisConnectionThresholdValue>0)){${"\x47L\x4f\x42\x41L\x53"}["\x72vc\x69\x71\x6fp"]="r\x65\x73\x65l\x6cer\x32D\x69\x73C\x6f\x6e\x6e\x65\x63\x74\x69\x6f\x6e\x46e\x65";$jiplswyu="\x64\x75ra\x74i\x6f\x6e";$anuvdhu="\x72e\x73eller2D\x69\x73\x43o\x6en\x65\x63tio\x6eFe\x65";if(${$jiplswyu}>$this->reseller2DisConnectionThresholdValue)${${"\x47\x4c\x4fBA\x4cS"}["\x72v\x63\x69\x71\x6fp"]}=$this->reseller2DisConnectionFee;else${$anuvdhu}=0;}else{${${"GL\x4f\x42\x41\x4cS"}["c\x78\x72pl\x62\x6et\x62w\x68"]}=0;}if(($this->reseller2TaxFee>0)AND(${$xmanubq}>0)){$amiyypch="\x72\x65\x73e\x6cle\x72\x32Tax\x46\x65e";${$amiyypch}=number_format(($this->reseller2TaxFee*${${"G\x4cOB\x41\x4c\x53"}["\x6bd\x75\x6c\x71\x6e\x6f\x68"]})/100,6,"\x2e","");}${${"\x47\x4c\x4f\x42\x41\x4cS"}["dc\x70z\x61\x75nh\x76\x78o"]}=${${"\x47\x4cO\x42\x41\x4c\x53"}["p\x68cn\x6b\x64\x6clt\x6c\x70"]}+${${"G\x4cO\x42\x41\x4c\x53"}["\x79\x6a\x69\x69\x63is\x6en"]}+${$zsylzblwto}+${${"\x47\x4cO\x42A\x4cS"}["k\x64\x75l\x71n\x6fh"]};return${${"\x47\x4cO\x42A\x4c\x53"}["\x64\x63\x70\x7a\x61\x75n\x68\x76x\x6f"]};}function totalReseller3CallCharge($duration,$callCost){$bnhipnkgcflo="\x72e\x73eller\x33\x43\x6f\x6en\x65\x63\x74io\x6e\x46ee";${$bnhipnkgcflo}=0;${${"\x47\x4c\x4f\x42\x41\x4cS"}["kfgr\x62\x68\x76b\x63c"]}=0;$bydbxrstfr="\x72\x65se\x6cl\x65\x723\x54\x61\x78\x46e\x65";${"\x47\x4cOBA\x4cS"}["z\x69\x77g\x6f\x77\x66h\x69"]="\x63\x61\x6c\x6cC\x6f\x73\x74";${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x68\x64\x7anxb\x7ab\x67"]}=0;$hcxdsnngbbn="\x72\x65selle\x72\x33C\x6f\x6e\x6ee\x63\x74\x69\x6f\x6e\x46\x65\x65";if($this->reseller3rConnectionFee>0){$this->reseller3ConnectionFee=$this->reseller3rConnectionFee;}if($this->reseller3rConnectionThresholdValue>0){$this->reseller3ConnectionThresholdValue=$this->reseller3rConnectionThresholdValue;}if($this->reseller3rDisConnectionFee>0){$this->reseller3DisConnectionFee=$this->reseller3rDisConnectionFee;}if($this->reseller3rDisConnectionThresholdValue>0){$this->reseller3DisConnectionThresholdValue=$this->reseller3rDisConnectionThresholdValue;}if($this->reseller3rTaxFee>0){$this->reseller3TaxFee=$this->reseller3rTaxFee;}if(($this->reseller3ConnectionFee>0)AND($this->reseller3ConnectionThresholdValue>0)){$tpwcczpxpvn="\x72\x65\x73e\x6c\x6ce\x72\x33\x43\x6fn\x6e\x65c\x74io\x6e\x46\x65\x65";${"\x47LOB\x41\x4cS"}["\x77\x6cw\x75\x78\x61l\x66z"]="re\x73\x65\x6cl\x65r\x33C\x6fnnect\x69o\x6eF\x65\x65";${"\x47\x4c\x4f\x42\x41\x4cS"}["y\x72o\x63jn"]="\x64u\x72\x61t\x69on";if(${${"GL\x4fB\x41\x4cS"}["\x79\x72o\x63j\x6e"]}>$this->reseller3ConnectionThresholdValue)${$tpwcczpxpvn}=$this->reseller3ConnectionFee;else${${"\x47\x4cOB\x41L\x53"}["\x77l\x77\x75\x78al\x66\x7a"]}=0;}else{${${"G\x4c\x4f\x42A\x4cS"}["w\x67\x69kx\x6b\x6ddx\x6c"]}=0;}$qyyhkvfkl="\x63\x61\x6c\x6c\x43\x6f\x73\x74";if(($this->reseller3DisConnectionFee>0)AND($this->reseller3DisConnectionThresholdValue>0)){$dktctliugue="\x72\x65s\x65\x6c\x6ce\x723\x44\x69s\x43\x6f\x6e\x6ee\x63\x74i\x6fn\x46\x65\x65";if(${${"\x47\x4cO\x42A\x4cS"}["\x6a\x69qt\x7a\x65\x63\x67"]}>$this->reseller3DisConnectionThresholdValue)${$dktctliugue}=$this->reseller3DisConnectionFee;else${${"\x47L\x4fB\x41L\x53"}["\x6bfg\x72b\x68\x76\x62\x63\x63"]}=0;}else{${${"GL\x4f\x42\x41\x4cS"}["\x6bf\x67r\x62\x68v\x62\x63\x63"]}=0;}if(($this->reseller3TaxFee>0)AND(${${"\x47\x4c\x4f\x42A\x4c\x53"}["zi\x77\x67o\x77\x66hi"]}>0)){$rlsookcu="\x72es\x65\x6cl\x65\x72\x33T\x61\x78\x46ee";${$rlsookcu}=number_format(($this->reseller3TaxFee*${${"\x47\x4c\x4fB\x41\x4c\x53"}["\x6b\x64u\x6cq\x6e\x6f\x68"]})/100,6,"\x2e","");}${${"G\x4cOB\x41LS"}["\x64\x63pzaun\x68\x76\x78\x6f"]}=${$hcxdsnngbbn}+${${"\x47\x4c\x4f\x42A\x4c\x53"}["\x6bfg\x72\x62h\x76b\x63\x63"]}+${$bydbxrstfr}+${$qyyhkvfkl};return${${"\x47\x4cO\x42\x41\x4c\x53"}["\x64cpza\x75\x6ehvx\x6f"]};}function totalReseller4CallCharge($duration,$callCost){${"\x47\x4c\x4f\x42\x41L\x53"}["\x73\x61\x6f\x66\x62\x63\x62"]="\x72e\x73e\x6cler\x34\x43o\x6enect\x69onF\x65e";${${"\x47\x4c\x4f\x42A\x4c\x53"}["s\x61\x6ff\x62\x63\x62"]}=0;${${"GLO\x42\x41\x4c\x53"}["\x6c\x65\x72\x78\x70\x6d\x75\x65\x64\x72"]}=0;${${"\x47L\x4fB\x41LS"}["\x78c\x68i\x63\x64\x7a"]}=0;if($this->reseller4rConnectionFee>0){$this->reseller4ConnectionFee=$this->reseller4rConnectionFee;}if($this->reseller4rConnectionThresholdValue>0){$this->reseller4ConnectionThresholdValue=$this->reseller4rConnectionThresholdValue;}if($this->reseller4rDisConnectionFee>0){$this->reseller4DisConnectionFee=$this->reseller4rDisConnectionFee;}if($this->reseller4rDisConnectionThresholdValue>0){$this->reseller4DisConnectionThresholdValue=$this->reseller4rDisConnectionThresholdValue;}${"\x47\x4cO\x42\x41\x4c\x53"}["\x67\x6e\x71f\x71\x6fb\x67o"]="c\x61llCo\x73\x74";if($this->reseller4rTaxFee>0){$this->reseller4TaxFee=$this->reseller4rTaxFee;}${"G\x4cO\x42A\x4c\x53"}["\x76\x77kx\x65\x6b\x64\x6ax"]="\x72\x65\x73\x65\x6c\x6ce\x72\x34\x43\x6fn\x6ee\x63t\x69o\x6e\x46\x65\x65";if(($this->reseller4ConnectionFee>0)AND($this->reseller4ConnectionThresholdValue>0)){${"\x47L\x4f\x42\x41\x4c\x53"}["\x6enr\x7ae\x74\x72g"]="r\x65\x73\x65\x6cler\x34Co\x6e\x6e\x65ctio\x6e\x46e\x65";if(${${"G\x4c\x4f\x42\x41\x4c\x53"}["\x6ai\x71\x74z\x65c\x67"]}>$this->reseller4ConnectionThresholdValue)${${"\x47\x4cO\x42\x41L\x53"}["\x64\x71\x78n\x70\x73"]}=$this->reseller4ConnectionFee;else${${"\x47L\x4f\x42A\x4cS"}["\x6e\x6er\x7a\x65\x74rg"]}=0;}else{$jxbupjdrhv="\x72e\x73e\x6cle\x72\x34C\x6f\x6ene\x63\x74\x69\x6f\x6e\x46\x65e";${$jxbupjdrhv}=0;}${"\x47\x4c\x4f\x42\x41\x4c\x53"}["p\x79\x74\x6f\x71\x79"]="\x63a\x6cl\x43\x6fs\x74";${"\x47LO\x42\x41\x4c\x53"}["\x76\x71\x65\x79\x63\x69\x70\x71"]="\x72e\x73\x65ll\x65r\x34\x44\x69\x73\x43on\x6e\x65\x63\x74\x69\x6fnF\x65e";if(($this->reseller4DisConnectionFee>0)AND($this->reseller4DisConnectionThresholdValue>0)){$vytznsdhiy="\x72e\x73\x65l\x6c\x65\x72\x34\x44\x69\x73\x43on\x6e\x65\x63\x74\x69\x6f\x6eF\x65\x65";if(${${"\x47\x4cO\x42\x41\x4cS"}["\x6aiqtzecg"]}>$this->reseller4DisConnectionThresholdValue)${$vytznsdhiy}=$this->reseller4DisConnectionFee;else${${"G\x4c\x4fBA\x4c\x53"}["\x6ce\x72x\x70\x6due\x64r"]}=0;}else{${${"\x47LO\x42A\x4c\x53"}["\x6c\x65\x72\x78\x70m\x75e\x64\x72"]}=0;}if(($this->reseller4TaxFee>0)AND(${${"\x47\x4cO\x42\x41L\x53"}["\x67\x6eq\x66q\x6f\x62\x67\x6f"]}>0)){${"\x47L\x4f\x42\x41\x4c\x53"}["a\x64\x78\x63\x6bbn"]="r\x65\x73el\x6ce\x72\x34\x54\x61\x78Fe\x65";${${"\x47\x4c\x4fB\x41\x4c\x53"}["\x61\x64\x78ck\x62n"]}=number_format(($this->reseller4TaxFee*${${"GLO\x42A\x4c\x53"}["\x6bd\x75l\x71n\x6fh"]})/100,6,"\x2e","");}${${"G\x4c\x4f\x42AL\x53"}["\x64\x63\x70\x7a\x61u\x6e\x68vx\x6f"]}=${${"\x47\x4c\x4f\x42\x41\x4cS"}["\x76w\x6b\x78e\x6b\x64j\x78"]}+${${"\x47\x4c\x4f\x42\x41L\x53"}["v\x71\x65y\x63\x69\x70\x71"]}+${${"\x47L\x4f\x42\x41\x4cS"}["xc\x68\x69\x63\x64\x7a"]}+${${"\x47\x4c\x4fB\x41\x4c\x53"}["p\x79\x74\x6f\x71y"]};return${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["d\x63\x70\x7a\x61\x75nhv\x78o"]};}function getCallCostCalcuation($voice_rate=0,$grace_period=0,$minimum_time=0,$resolution=0,$duration=0){${"GLOBAL\x53"}["ut\x78c\x71\x6dx\x6dk\x6bm\x68"]="d\x75\x72\x61t\x69\x6fn";if(${${"G\x4c\x4f\x42AL\x53"}["\x75t\x78\x63\x71\x6dxm\x6b\x6bm\x68"]}>0){$ylamymyxenc="\x67\x72\x61\x63\x65\x5f\x70\x65\x72io\x64";$icpvhrzt="cu\x73\x74\x6f\x6d\x65\x72\x42\x69\x6cl\x43o\x73\x74";$xvmuhmx="d\x75\x72\x61\x74\x69on";$cjlukv="\x6di\x6e\x69\x6du\x6d_t\x69me";$phsftyusvoi="d\x75\x72\x61t\x69on";${$icpvhrzt}=0;${"G\x4c\x4fB\x41\x4cS"}["c\x77b\x66qu\x6d\x70b\x75"]="du\x72\x61\x74\x69o\x6e";${"\x47\x4c\x4fBAL\x53"}["\x79\x68\x6c\x77\x78k"]="\x6d\x69\x6e\x69\x6d\x75m_\x74\x69\x6d\x65";$sibrnloloybl="\x72\x65\x73\x6f\x6cu\x74\x69on";${"G\x4c\x4f\x42A\x4cS"}["y\x69\x6eo\x70\x71\x74\x67\x63j\x6e"]="cu\x73t\x6f\x6d\x65\x72\x42i\x6c\x6c\x43\x6fs\x74";if(${${"\x47\x4c\x4f\x42A\x4c\x53"}["\x63\x6akwd\x68\x76\x6e\x76j\x71"]}==0)${${"G\x4c\x4f\x42\x41\x4c\x53"}["\x63\x6a\x6b\x77\x64\x68v\x6ev\x6a\x71"]}=60;if(${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["hfzk\x77\x6a\x6d\x78"]}==0)${$cjlukv}=${$sibrnloloybl};if(${$xvmuhmx}<${$ylamymyxenc}){${${"\x47\x4cO\x42\x41\x4c\x53"}["a\x65\x6c\x6d\x69\x68\x75\x61\x6blq"]}=0;}elseif(${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x63\x77\x62f\x71um\x70\x62\x75"]}<${${"\x47\x4c\x4f\x42ALS"}["yh\x6c\x77\x78k"]}){${"GL\x4f\x42\x41\x4c\x53"}["\x76\x63\x68gt\x76\x66\x61\x67a"]="\x63u\x73\x74o\x6d\x65\x72\x42\x69l\x6cC\x6fs\x74";${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x78y\x71\x68c\x74\x69z"]="\x70\x72\x65\x53\x65c\x6fn\x64B\x69l\x6c";${${"\x47\x4c\x4fB\x41LS"}["\x64\x63\x73r\x65\x77\x65\x65iz"]}=${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x65\x64\x66e\x69\x73\x76\x70"]}/60;${${"\x47\x4c\x4fB\x41\x4cS"}["\x76c\x68\x67\x74\x76\x66\x61g\x61"]}=${${"\x47L\x4fB\x41\x4c\x53"}["x\x79\x71h\x63ti\x7a"]}*${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x68\x66\x7a\x6b\x77j\x6dx"]};}elseif(${$phsftyusvoi}>=${${"\x47\x4c\x4fBA\x4cS"}["\x68\x66\x7ak\x77\x6a\x6dx"]}){$tgrhgu="to\x74a\x6cB\x69\x6cli\x6eg\x43ycle";${"GL\x4f\x42\x41\x4cS"}["\x77sis\x61u\x73q"]="\x74o\x74\x61lBill\x69\x6e\x67\x43\x79c\x6c\x65";$rqeemjsvl="\x72\x65s\x6f\x6c\x75\x74\x69\x6f\x6e";${"\x47\x4cOB\x41\x4cS"}["\x65kp\x69\x73\x73\x69\x76"]="\x70\x65\x72C\x79\x63l\x65\x42i\x6c\x6c";${"G\x4c\x4f\x42\x41\x4c\x53"}["\x6ev\x70k\x72\x69ml"]="\x64\x75\x72\x61t\x69\x6f\x6e";${${"\x47\x4c\x4f\x42\x41\x4cS"}["uu\x63\x73\x73\x79sjb\x62\x78"]}=(${${"G\x4cO\x42\x41\x4c\x53"}["\x65dfe\x69\x73v\x70"]}/60)*${$rqeemjsvl};${$tgrhgu}=ceil(${${"\x47\x4c\x4f\x42A\x4c\x53"}["\x6e\x76\x70\x6br\x69\x6d\x6c"]}/${${"\x47\x4c\x4f\x42A\x4c\x53"}["\x63\x6a\x6b\x77\x64\x68\x76\x6e\x76\x6aq"]});${${"G\x4cO\x42A\x4c\x53"}["\x61e\x6cm\x69\x68\x75\x61\x6b\x6c\x71"]}=${${"G\x4c\x4f\x42A\x4c\x53"}["ekpi\x73\x73\x69\x76"]}*${${"GL\x4f\x42A\x4c\x53"}["w\x73\x69\x73a\x75sq"]};}return round(${${"GL\x4f\x42\x41\x4c\x53"}["y\x69\x6e\x6f\x70\x71\x74\x67\x63\x6a\x6e"]},5);}else{return 0;}}function clientBalanceUpdate($id,$cost){$ueocmgj="re\x73ult";${${"\x47\x4c\x4f\x42ALS"}["z\x69\x74v\x76r\x6c"]}="\x55PD\x41TE \x63lient\x73\x73i\x70\x20set\x20bala\x6ec\x65 = \x62al\x61n\x63\x65 - \x27$cost\x27\x20\x77h\x65\x72\x65 \x69d \x3d\x20'$id'";${$ueocmgj}=mysql_query(${${"\x47\x4c\x4f\x42\x41L\x53"}["\x7a\x69t\x76vr\x6c"]});}function reseller1BalanceUpdate($id,$cost){${"\x47L\x4f\x42\x41\x4c\x53"}["\x62\x67\x71\x64\x63\x6f\x62\x74q"]="s\x71l";${"\x47\x4cO\x42\x41\x4c\x53"}["ey\x71\x6c\x70\x78xl\x62\x74\x71"]="sql";${${"GLOBA\x4cS"}["\x62\x67\x71d\x63\x6f\x62\x74\x71"]}="\x55P\x44A\x54E res\x65l\x6ce\x72\x731 set b\x61\x6c\x61\x6ece =\x20\x62al\x61n\x63e - \x27$cost\x27 \x77h\x65re \x69\x64\x20=\x20'$id'";${${"\x47L\x4f\x42A\x4c\x53"}["m\x69\x73\x70\x72q\x6a\x77l\x69"]}=mysql_query(${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["e\x79q\x6c\x70xxl\x62\x74\x71"]});}function reseller2BalanceUpdate($id,$cost){$lccjvyfuh="\x73\x71l";${${"GL\x4f\x42AL\x53"}["\x7ait\x76\x76r\x6c"]}="U\x50\x44AT\x45\x20\x72e\x73el\x6c\x65\x72s2\x20se\x74 \x62a\x6ca\x6e\x63\x65 =\x20bal\x61n\x63\x65 - '$cost' wh\x65\x72e \x69d \x3d '$id'";${${"G\x4cO\x42A\x4cS"}["mi\x73p\x72\x71\x6aw\x6c\x69"]}=mysql_query(${$lccjvyfuh});}function reseller3BalanceUpdate($id,$cost){$uhikwinxxu="\x73ql";${$uhikwinxxu}="\x55P\x44\x41\x54E\x20r\x65se\x6cle\x72s3 \x73e\x74\x20ba\x6c\x61\x6e\x63\x65\x20\x3d\x20b\x61l\x61n\x63e - \x27$cost\x27 w\x68\x65re id\x20\x3d '$id'";${${"\x47\x4cO\x42\x41\x4c\x53"}["\x6d\x69s\x70\x72q\x6a\x77l\x69"]}=mysql_query(${${"\x47\x4cOB\x41LS"}["\x7ait\x76v\x72\x6c"]});}function reseller4BalanceUpdate($id,$cost){${"GL\x4f\x42\x41\x4c\x53"}["\x72l\x6c\x69xxj\x75"]="\x73\x71l";$xcdslwxpq="s\x71l";${${"\x47\x4c\x4f\x42A\x4cS"}["\x72\x6cl\x69x\x78ju"]}="UPDA\x54E\x20\x72\x65s\x65l\x6c\x65\x72s4\x20\x73\x65\x74 ba\x6ca\x6e\x63e\x20\x3d b\x61l\x61\x6ece\x20- '$cost\x27\x20\x77\x68\x65\x72e i\x64 = \x27$id\x27";${${"\x47LO\x42\x41\x4c\x53"}["\x6disprq\x6aw\x6ci"]}=mysql_query(${$xcdslwxpq});}function p2pCallSetting($agi){$this->checkP2PRateChart($this->clientRateID,$this->agidnid);$this->clientBillingPrefix=$this->tempBillingPrefix;$this->clientVoiceRate=$this->tempVoiceRate;$this->clientRateMulti=$this->tempRateMulti;$this->clientGracePeriod=$this->tempGracePeriod;$this->clientMinTime=$this->tempMinTime;$this->clientResolution=$this->tempResolution;$this->clientMinuteflexibility=$this->tempMinuteFlexibility;$this->clientMinuteflexibilityLimit=$this->tempMinuteFlexibilityLimit;$this->clientRateChartID=$this->tempRateChartID;$this->clientCallRate=$this->clientVoiceRate*$this->clientRateMulti;if($this->clientResellerLevel==1){$this->reseller1ID=$this->clientResellerID;$this->reseller2ID=-1;$this->reseller3ID=-1;$this->reseller4ID=-1;}elseif($this->clientResellerLevel==2){$this->reseller1ID=-1;$this->reseller2ID=$this->clientResellerID;$this->reseller3ID=-1;$this->reseller4ID=-1;}elseif($this->clientResellerLevel==3){$this->reseller1ID=-1;$this->reseller2ID=-1;$this->reseller3ID=$this->clientResellerID;$this->reseller4ID=-1;}elseif($this->clientResellerLevel==4){$this->reseller1ID=-1;$this->reseller2ID=-1;$this->reseller3ID=-1;$this->reseller4ID=$this->clientResellerID;}else{$this->reseller1ID=-1;$this->reseller2ID=-1;$this->reseller3ID=-1;$this->reseller4ID=-1;}$this->p2pMaxCallDuration();$this->p2pDialPlan(${${"\x47\x4cO\x42\x41\x4c\x53"}["h\x72\x74\x62r\x6d\x6b\x69"]});}function p2pDialPlan($agi){${"\x47LO\x42A\x4c\x53"}["\x71\x68\x6b\x68\x62\x73b\x70\x6b\x75"]="c\x61\x6c\x6c\x44\x75\x72a\x74\x69o\x6e";${"\x47L\x4f\x42ALS"}["\x6a\x78\x6d\x6e\x63\x67quw"]="d\x65s\x74\x69\x6e\x61\x74\x69\x6f\x6e";$tsfgliwqpkew="\x64\x69\x61\x6cr\x65s\x75l\x74";${"G\x4cOB\x41\x4c\x53"}["\x61\x73\x66\x63\x69z\x69\x77ked"]="\x64\x69\x61\x6cpa\x72\x61\x6ds";$nzdiggbhm="\x66\x69r\x73\x74\x44igi\x74C\x61\x6cl\x65dN\x75\x6d\x62e\x72";${"G\x4c\x4fB\x41\x4c\x53"}["\x65\x66\x7a\x74\x65\x6cn\x74\x73\x7am"]="\x6d\x61x\x5fl\x6fn\x67";${"\x47\x4cO\x42\x41L\x53"}["\x70\x71\x6bbn\x72\x6c"]="des\x63\x72i\x70ti\x6fn";${"\x47LO\x42A\x4cS"}["n\x75\x6frksq"]="\x64e\x73tin\x61t\x69\x6f\x6e";$qrnllqk="\x61g\x69";${${"G\x4c\x4fB\x41L\x53"}["e\x66\x7a\x74\x65\x6cn\x74\x73\x7a\x6d"]}=2147483647;$itaakxsvdt="\x63\x61\x6cle\x72\x49D";${"G\x4cO\x42\x41\x4c\x53"}["hzq\x64\x64\x7a\x6f\x68k\x74\x69"]="\x64\x69\x61\x6cst\x61\x74\x75\x73";${"G\x4c\x4fBA\x4c\x53"}["l\x6c\x76\x6d\x6b\x6a\x69\x6e"]="\x74\x61\x72\x67\x65\x74Us\x65r";$yqzqpqg="\x63\x61\x6cl\x65\x72\x49\x44";${${"\x47L\x4f\x42\x41\x4c\x53"}["\x6e\x75\x6f\x72\x6b\x73\x71"]}=$this->agidnid;${$nzdiggbhm}=substr(${${"G\x4cO\x42\x41\x4c\x53"}["jx\x6dn\x63g\x71u\x77"]},0,1);${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x71\x75\x72\x74\x6c\x78\x71\x77h\x7a\x71\x72"]}=$this->clinetMaxCallDuration;${${"\x47\x4cOB\x41L\x53"}["yy\x77g\x75h"]}=${${"\x47L\x4f\x42A\x4c\x53"}["qu\x72t\x6cx\x71\x77\x68\x7a\x71r"]};$agi->set_autohangup(${${"\x47\x4cO\x42\x41\x4c\x53"}["\x79\x79\x77\x67u\x68"]});${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["a\x73\x66c\x69\x7a\x69\x77\x6b\x65\x64"]}=",3\x30|\x48S($timeOut)";${$itaakxsvdt}=$this->callerIDName."<".$this->agiAccountCode."\x3e";$agi->set_callerid(${$yqzqpqg});if(${${"\x47\x4cOBAL\x53"}["qu\x72\x74lx\x71\x77\x68\x7a\x71\x72"]}<$this->clientMinTime){${"\x47L\x4fB\x41\x4c\x53"}["d\x71\x79\x64\x71\x72\x78\x74su"]="d\x65s\x63\x72i\x70t\x69\x6f\x6e";${${"\x47L\x4fBA\x4c\x53"}["d\x71\x79dqrx\x74\x73\x75"]}="Dia\x6c\x20P\x6ca\x6e No \x6d\x6fn\x65\x79 \x74o\x20m\x61ke t\x68\x69s \x63\x61\x6cl";$this->insertFailedCall(${${"\x47L\x4fBA\x4c\x53"}["\x63\x74\x6efoom"]});$agi->hangup();exit();}${${"\x47L\x4f\x42\x41L\x53"}["s\x66\x76s\x64\x78\x6d\x78u\x64"]}=substr($this->agiExtension,3);${${"\x47\x4cO\x42A\x4c\x53"}["\x7aq\x62x\x6cv\x62\x64i\x6b\x6f"]}="\x53\x49P/".${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x6clvm\x6b\x6a\x69n"]}.${${"\x47\x4c\x4fB\x41\x4c\x53"}["\x66\x79\x63\x67\x64\x6f\x69f"]};$this->deleteP2PActiveCall();$this->insertP2PActiveCall();${$tsfgliwqpkew}=$this->run_dial(${$qrnllqk},${${"G\x4cO\x42A\x4cS"}["\x7aqb\x78\x6c\x76\x62\x64\x69\x6bo"]});${${"G\x4c\x4fB\x41\x4c\x53"}["cs\x6a\x62\x61\x67\x6f\x77\x70\x64\x66\x68"]}=$agi->get_variable("AN\x53\x57E\x52\x45\x44TI\x4d\x45");$lqtseyplowm="c\x61ll\x44u\x72a\x74i\x6f\x6e";$this->real_answeredtime=$this->answeredtime=${${"\x47\x4cO\x42\x41\x4c\x53"}["cs\x6a\x62ag\x6f\x77\x70\x64\x66h"]}["d\x61ta"];${${"GLO\x42\x41\x4c\x53"}["\x6e\x61\x79g\x76\x67\x78\x6a"]}=$agi->get_variable("DIALSTA\x54U\x53");$this->dialstatus=${${"\x47\x4c\x4f\x42A\x4cS"}["\x68\x7a\x71\x64\x64\x7a\x6fh\x6bti"]}["data"];switch($this->dialstatus){case"AN\x53W\x45R":${${"G\x4c\x4f\x42A\x4c\x53"}["\x68qe\x6a\x64\x73"]}=$this->answeredtime;$this->billCalculationP2P(${${"\x47L\x4f\x42ALS"}["hqejds"]},$this->dialstatus);$this->deleteP2PActiveCall();break;case"\x42\x55S\x59":case"\x43A\x4e\x43E\x4c":$this->answeredtime=0;${$lqtseyplowm}=$this->answeredtime;$this->billCalculationP2P(${${"G\x4c\x4f\x42\x41LS"}["\x71\x68\x6b\x68b\x73\x62p\x6b\x75"]},$this->dialstatus);$this->deleteP2PActiveCall();break;case"N\x4fA\x4eSWE\x52":case"\x43\x48A\x4e\x55\x4e\x41V\x41\x49L":case"CO\x4e\x47\x45\x53\x54IO\x4e":$this->answeredtime=0;${${"GLO\x42A\x4c\x53"}["\x68\x71\x65j\x64s"]}=$this->answeredtime;$this->billCalculationP2P(${${"G\x4c\x4f\x42A\x4cS"}["\x68qejds"]},$this->dialstatus);$this->deleteP2PActiveCall();break;default:$this->deleteP2PActiveCall();${${"G\x4c\x4f\x42AL\x53"}["\x63t\x6ef\x6f\x6fm"]}="Dial Pl\x61n not \x64\x65fi\x6e\x65";$this->insertFailedCall(${${"G\x4c\x4fB\x41\x4c\x53"}["\x70q\x6b\x62n\x72\x6c"]});$agi->hangup();break;}}function billCalculationP2P($callDuration,$status){$pjknqlw="\x73\x71\x6c\x49n\x73\x65\x72\x74";${"\x47LO\x42A\x4c\x53"}["w\x69e\x6a\x6a\x6c\x73x"]="c\x61\x6c\x6c\x53t\x61\x72\x74\x53\x74\x72";${"\x47LO\x42A\x4c\x53"}["\x78o\x6f\x6dnd\x6f\x74u"]="c\x61llD\x75\x72\x61\x74io\x6e";${"\x47L\x4f\x42\x41LS"}["o\x6au\x78b\x70\x6e\x78\x72\x78"]="\x63\x61l\x6c\x65\x6ed";${${"\x47L\x4f\x42A\x4c\x53"}["\x65\x6f\x71\x65bn\x76\x68g\x74"]}=$this->agiUniqueID;${${"G\x4c\x4fB\x41\x4c\x53"}["\x64\x66\x63c\x6dlv\x70"]}=$this->agiChannel;$gpkueztfv="\x73\x71\x6cIn\x73\x65\x72\x74";$ecbvid="\x63\x61ll\x44\x75\x72a\x74i\x6fn";${${"\x47\x4c\x4fBAL\x53"}["\x70\x76\x71h\x6ak\x64\x70k\x69"]}=$this->agiAccountCode;${${"\x47\x4cO\x42\x41\x4c\x53"}["\x7akw\x65\x6d\x6e\x72f\x6e"]}=$this->agidnid;${${"GL\x4f\x42\x41L\x53"}["\x6ez\x76\x75g\x6e\x73el\x68f"]}=date("Y-\x6d-\x64 \x48:\x69:s");${${"\x47\x4cOB\x41\x4c\x53"}["\x6dfms\x79\x62\x6b"]}=strtotime(${${"\x47\x4c\x4f\x42A\x4c\x53"}["\x6fj\x75x\x62\x70\x6exr\x78"]});${${"\x47\x4c\x4f\x42\x41\x4cS"}["\x68\x73\x78\x72\x6b\x69\x71\x77\x78\x78"]}=${${"\x47\x4c\x4f\x42A\x4cS"}["\x6df\x6ds\x79\x62\x6b"]}-${${"G\x4cO\x42\x41\x4cS"}["x\x6f\x6f\x6dn\x64\x6f\x74u"]};${${"G\x4cO\x42\x41\x4c\x53"}["l\x79\x66\x6d\x62\x74\x63"]}=date("\x59-\x6d-\x64 H:i:\x73",${${"\x47\x4c\x4f\x42\x41\x4cS"}["\x77\x69e\x6a\x6a\x6c\x73\x78"]});${"\x47L\x4f\x42\x41\x4cS"}["\x6f\x65\x76\x63\x70\x78\x6c"]="r\x65\x73\x75\x6c\x74\x49ns\x65\x72t";${${"\x47\x4c\x4f\x42A\x4c\x53"}["\x74\x6f\x63ewd"]}=$this->clientCallRate;${${"G\x4c\x4fB\x41L\x53"}["\x73\x6axku\x73w\x76v"]}=$this->clientResellerID;${${"\x47L\x4f\x42\x41\x4c\x53"}["k\x6ad\x66\x76\x6a\x69q"]}=$this->clientResellerLevel;if(${$ecbvid}>0){${"G\x4cOB\x41\x4c\x53"}["\x69g\x6d\x72\x70kr\x74\x78\x77m"]="c\x6c\x69entCa\x6c\x6cR\x61t\x65";${"GL\x4f\x42\x41\x4c\x53"}["n\x62\x6af\x70w\x70"]="\x63\x6f\x73\x74Cl\x69\x65n\x74";${"\x47\x4cOBA\x4cS"}["p\x79\x6fb\x67\x76qr\x6dn"]="\x63\x61l\x6c\x44u\x72a\x74\x69\x6f\x6e";${${"\x47\x4c\x4f\x42ALS"}["\x6eb\x6a\x66pw\x70"]}=$this->billCalculationP2P(${${"\x47\x4c\x4fBAL\x53"}["\x69\x67m\x72\x70kr\x74x\x77\x6d"]},$this->clientGracePeriod,$this->clientMinTime,$this->clientResolution,${${"G\x4cO\x42\x41\x4cS"}["\x68\x71\x65\x6a\x64\x73"]},$this->clientMinuteflexibility);${${"\x47\x4c\x4f\x42A\x4c\x53"}["q\x65ubd\x6d\x73"]}=$this->totalClientCallCharge(${${"\x47L\x4fBA\x4c\x53"}["p\x79ob\x67\x76q\x72m\x6e"]},${${"GL\x4fB\x41LS"}["\x6a\x72\x67h\x62\x70\x6c\x76\x62\x70a"]});$this->clientBalanceUpdate($this->clientID,${${"\x47L\x4fB\x41\x4c\x53"}["\x71\x65u\x62\x64\x6ds"]});}else${${"\x47LO\x42A\x4c\x53"}["\x71\x65\x75\x62d\x6d\x73"]}=0;${$gpkueztfv}="I\x4eSE\x52T\x20\x49N\x54O \x73uc\x63e\x73s_ca\x6cls_\x702p\x20(\x63\x61l\x6c_\x69\x64, \x63\x68a\x6e\x6eel, \x63\x61\x6cl\x65\x72\x5fi\x64,\x20c\x61l\x6c\x65\x64_\x69d,\x20\x63\x61\x6cl\x73t\x61\x72\x74, c\x61\x6clend,\x20\x64\x75ra\x74\x69on,\x20\x63\x61\x6cl\x5frate, \x72\x65sel\x6cer_id, r\x65selle\x72_le\x76el, \x63a\x6cl_c\x6fst, c\x61l\x6c\x5f\x73ta\x74\x75\x73)\n\tV\x41L\x55\x45\x53 ('$uniqueid', \x27$channel', \x27$accountcode', '$callednumber\x27,\x20\x27$callstart', \x27$callend', \x27$callDuration\x27,\x20\x27$clientCallRate', \x27$resellerID\x27,\x20'$resellerLevel',\x20\x27$clientCallCharge',\x20'$status')";${${"\x47L\x4f\x42\x41\x4c\x53"}["\x6f\x65\x76\x63\x70x\x6c"]}=mysql_query(${$pjknqlw});return mysql_insert_id();}function insertP2PActiveCall(){${"G\x4cOBAL\x53"}["\x67\x6bn\x69inp\x68\x6c\x79\x66"]="\x69\x64\x43\x6ci\x65\x6e\x74";${"\x47\x4c\x4fBA\x4c\x53"}["job\x68\x66k\x6dl\x6f\x66vc"]="\x72\x65\x73\x65\x6c\x6c\x65\x72\x4cev\x65\x6c";${${"\x47\x4c\x4fB\x41L\x53"}["\x71\x6dct\x73\x61gf\x6fl\x68"]}=$this->agiUniqueID;${"G\x4c\x4fB\x41L\x53"}["b\x74ohb\x73\x79"]="a\x63\x63o\x75n\x74c\x6f\x64e";$pbtltbe="\x72\x65se\x6c\x6c\x65\x72ID";${${"G\x4cO\x42\x41\x4cS"}["\x64\x66\x63c\x6d\x6cvp"]}=$this->agiChannel;$gmkgzxbxtb="\x72\x65su\x6c\x74";${${"\x47L\x4fB\x41\x4cS"}["\x67\x6b\x6e\x69\x69\x6e\x70\x68\x6c\x79\x66"]}=$this->clientID;${${"G\x4c\x4f\x42AL\x53"}["\x62toh\x62\x73\x79"]}=$this->agiAccountCode;${${"\x47\x4cOBAL\x53"}["\x7a\x6bw\x65\x6dn\x72\x66\x6e"]}=$this->agidnid;${$pbtltbe}=$this->clientResellerID;${${"\x47LOBA\x4c\x53"}["\x6aob\x68f\x6b\x6dl\x6f\x66\x76\x63"]}=$this->clientResellerLevel;${${"G\x4c\x4f\x42A\x4c\x53"}["\x75h\x63\x69\x66\x71\x6f\x67"]}=date("\x59-m-\x64\x20H:i:s");$fqemnh="\x49\x4e\x53ER\x54\x5f\x41CT\x49\x56\x45\x5f\x43\x41\x4cL\x5f\x51\x55\x45\x52Y";${${"\x47\x4c\x4f\x42A\x4c\x53"}["j\x68\x63l\x74\x6b\x70"]}="I\x4eS\x45RT\x20\x49NT\x4f\x20act\x69\x76\x65\x63\x61lls_p\x32p (\x69d\x5fca\x6c\x6c,\x20\x63han\x6ee\x6c, \x63\x61\x6cl\x65r\x5f\x69d, ca\x6cl\x65d\x5fi\x64,\x20\x69\x64_r\x65\x73\x65\x6c\x6c\x65\x72, r\x65\x73\x65\x6cler_\x6ce\x76e\x6c,\x20\x63\x61\x6c\x6c\x5fsta\x72t)\n\t\tVA\x4cUES\x20(\x27$idCall',\x20\x27$channel\x27,\x20\x27$accountcode',\x20\x27$callednumber\x27,\x20\x27$resellerID',\x20'$resellerLevel\x27, \x27$callStartTime\x27)";${$gmkgzxbxtb}=mysql_query(${$fqemnh});}function deleteP2PActiveCall(){${${"\x47\x4cO\x42\x41\x4c\x53"}["\x6de\x78x\x66\x71"]}=$this->agiUniqueID;${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x71nna\x77\x6ey\x6ey\x69d\x71"]}="\x44\x45\x4cET\x45\x20\x46R\x4fM act\x69\x76e\x63\x61\x6cls\x5fp2\x70\x20\x57\x48\x45RE\x20\x69d_call\x20\x3d '$callID'";${${"\x47\x4c\x4f\x42\x41L\x53"}["\x6d\x69\x73\x70\x72\x71j\x77\x6c\x69"]}=mysql_query(${${"\x47\x4cOB\x41\x4cS"}["\x71nn\x61\x77n\x79\x6e\x79\x69\x64q"]});}function p2pMaxCallDuration(){$dfjvoxsrg="\x6d\x69\x6e\x75t\x65\x73\x46\x6ce\x78ib\x69\x6c\x69\x74\x79";$jfdxkf="c\x6ci\x65\x6e\x74\x43\x61l\x6c\x44ur\x61\x74\x69\x6f\x6e";${$dfjvoxsrg}=$this->clientMinuteflexibility;${${"\x47LO\x42\x41\x4cS"}["\x75t\x62\x6d\x69yi\x6f\x6d\x62g"]}=$this->clientBalance*${${"\x47LOBA\x4cS"}["\x77p\x65\x6e\x67\x73\x70"]}/$this->clientCallRate;$jgiymskrjnee="cli\x65\x6e\x74Bi\x6cl\x43\x79\x63\x6c\x65";${${"\x47\x4cO\x42\x41\x4c\x53"}["ee\x69k\x65\x62o\x78\x63\x75l"]}=floor(${$jfdxkf}/$this->clientResolution);$this->clinetMaxCallDuration=${$jgiymskrjnee}*$this->clientResolution;}function checkP2PRateChart($rateID,$calledNumber){$xlquscpdyvp="\x73\x71\x6c\x52\x61\x74\x65";${${"\x47LO\x42A\x4c\x53"}["\x70\x6fs\x6f\x6e\x73\x71u\x6a"]}="S\x45\x4c\x45\x43\x54\n\t \t\t\t\x20 \x20pre\x66\x69x,\n\t \x20\x20\t\t\t\x20\x20\x20\x64\x65\x73\x63\x72\x69\x70t\x69\x6fn,\n\t \x20\t\t\t\x20\x20 \x76\x6f\x69\x63\x65\x5fr\x61\x74e,\n\t \x20 \t\t\t \x20\x20\x72\x61\x74e_\x6d\x75\x6c\x74,\n\t\x20 \x20\t\t\t\x20 \x20gra\x63e\x5fper\x69o\x64,\n\t\x20 \x20\t\t\t\x20\x20 \x6di\x6e\x69m\x61\x6c_\x74\x69me,\n\t\x20\x20\x20\t\t\t \x20\x20\x72es\x6f\x6cu\x74\x69on,\n\t\x20\x20\x20\t\t\t \x20\x69s_dis\x61b\x6ce,\n\t\t\t\t\x20 \x6d\x69n\x75\x74e\x5ff\x6ce\x78,\n\t\t\t\t\x20 \x6d\x69nute_\x66l\x65\x78_l\x69\x6dit,\n\t\t\t\t \x20 id\n\t\t\t\t \x20\x20\x46\x52O\x4d\x20\x72\x61\x74\x65\x63h\x61r\x74\n\t\x20\x20\x20\t\t\t wh\x65\x72e\x20i\x64\x5fra\x74\x65\x20=\x20\x27$rateID\x27 \x41\x4e\x44\x20LOC\x41T\x45(pr\x65\x66\x69\x78,\x27$calledNumber')=1\n\t\x20 \x20\t\t\t \x20 \x41\x4e\x44\x20prefi\x78\x3d(\x73e\x6ce\x63\x74\x20m\x61\x78(\x70r\x65\x66\x69\x78)\n \x20\x20\x20\x20\x20\x20\t\t\t\x20\x20 \x66ro\x6d r\x61\x74ec\x68a\x72\x74 \x77\x68ere\x20id_ra\x74e\x20=\x20'$rateID\x27 \x41ND \x4cO\x43AT\x45(prefix,'$calledNumber\x27)=1) \x41N\x44\x20vo\x69ce_r\x61\x74\x65\x20> \x30\x20A\x4e\x44\x20\x72\x61\x74e_\x6dult\x20\x3e \x30 \x4c\x49\x4d\x49\x54\x201";$fkdlfknegw="\x72esu\x6c\x74";${${"G\x4c\x4fBALS"}["\x6di\x73\x70r\x71\x6a\x77l\x69"]}=mysql_query(${$xlquscpdyvp});if(mysql_num_rows(${$fkdlfknegw})==1){${"GLOB\x41L\x53"}["\x72\x63t\x6f\x67n\x7a\x78\x68ah"]="\x72ow\x52\x61\x74\x65\x43\x68\x61\x72t";${"G\x4c\x4f\x42\x41\x4c\x53"}["\x76\x6f\x6a\x6dh\x65ed\x72\x6bo\x77"]="\x72\x6f\x77R\x61t\x65Chart";$jnkywri="\x72\x6fwR\x61\x74\x65Ch\x61r\x74";${${"\x47L\x4f\x42\x41LS"}["e\x75r\x6c\x64\x62w\x79waf"]}=mysql_fetch_row(${${"\x47\x4cO\x42\x41\x4c\x53"}["m\x69sp\x72q\x6a\x77\x6ci"]});$qeybxta="ro\x77Ra\x74eC\x68\x61\x72\x74";$this->tempBillingPrefix=${$qeybxta}[0];$bkosysb="\x72o\x77R\x61\x74\x65C\x68\x61\x72t";$this->billingPrefixDescription=${$jnkywri}[1];$this->tempVoiceRate=${${"\x47\x4c\x4f\x42\x41LS"}["r\x63\x74og\x6e\x7axh\x61\x68"]}[2];$eoewydcc="r\x6f\x77\x52\x61\x74\x65\x43\x68\x61\x72\x74";$this->tempRateMulti=${$eoewydcc}[3];$this->tempGracePeriod=${${"G\x4c\x4f\x42\x41L\x53"}["\x65\x75\x72\x6cd\x62w\x79\x77\x61f"]}[4];$this->tempMinTime=${${"\x47L\x4fB\x41\x4cS"}["\x76o\x6am\x68e\x65\x64r\x6b\x6f\x77"]}[5];$this->tempResolution=${${"\x47\x4c\x4fBA\x4c\x53"}["e\x75\x72ld\x62wy\x77a\x66"]}[6];${"G\x4c\x4fBA\x4c\x53"}["w\x77\x64\x68s\x68\x62r\x75y"]="ro\x77\x52a\x74eC\x68a\x72\x74";$this->tempIsDisable=${${"\x47\x4cO\x42ALS"}["\x65\x75rl\x64\x62\x77\x79w\x61f"]}[7];$this->tempMinuteFlexibility=${${"\x47\x4c\x4fBAL\x53"}["w\x77d\x68\x73h\x62\x72\x75\x79"]}[8];$mwwrdoe="row\x52\x61te\x43\x68\x61r\x74";$this->tempMinuteFlexibilityLimit=${$bkosysb}[9];$this->tempRateChartID=${$mwwrdoe}[10];}else{${"G\x4cO\x42\x41\x4c\x53"}["pfn\x79\x65fky\x70hj\x76"]="c\x61l\x6c\x65\x64\x4e\x75\x6d\x62e\x72";$this->tempBillingPrefix=${${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x62\x70\x70\x6dp\x79\x73\x6c\x61\x64"]};$this->billingPrefixDescription=${${"\x47\x4c\x4fBA\x4cS"}["\x70f\x6ey\x65\x66\x6b\x79\x70\x68j\x76"]};$this->tempVoiceRate="0.\x300\x30\x3000\x3001";$this->tempRateMulti=1;$this->tempGracePeriod=1;$this->tempMinTime=1;$this->tempResolution=1;$this->tempIsDisable=0;$this->tempMinuteFlexibility=60;$this->tempMinuteFlexibilityLimit=0;$this->tempRateChartID=0;}}}
?>
Function Calls
| None |
Stats
| MD5 | 7dbf971e52eeb23f23c639745cc11450 |
| Eval Count | 0 |
| Decode Time | 215 ms |