VoipBuster / Voipcheap .API

Status
Not open for further replies.

jvwelzen

Joined
Jun 9, 2008
Messages
8
Reaction score
0
I found an .api for voipbuster on the astriks forum

I was wondering if it is possible to use it with 3cx below is the scipt

on astriks you can call 301 for example en then hear your balance of your voipbuster account

here is the script

<?php
function encryptString($string) {
for($i=0; $i < strlen($string); $i++) {
if(is_numeric($string[$i])) {
if($string[$i] < "5")
$string[$i]= $string[$i] + 5;
else
$string[$i]= $string[$i] - 5;
}
}
return str_rot13($string);
}

// Set username and password

$username = encryptString($login);
$password = encryptString($pass);



$LOGINURL = ('https://myaccount.voipcheap.com/clx/index.php?part=plogin&username=' . $username . '&password=' . $password);
$CREDITURL = 'https://myaccount.voipcheap.com/clx/buy_credit.php';
$user_agent = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"; // <- nieuw!!!!

//curl init
$ch = curl_init();
// SET 1st REQUEST
curl_setopt($ch, CURLOPT_URL, $LOGINURL);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); // <-nieuw!!!!
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($ch, CURLOPT_HEADER, 1);
//curl_setopt($ch, CURLOPT_USERAGENT, $user_agent); // <- nieuw!!!!
//curl_setopt($ch, CURLOPT_COOKIEJAR, $cookies);
curl_setopt($ch, CURLOPT_COOKIEJAR, '/tmp/cookie.txt');


// EXECUTE 1st REQUEST (FORM LOGIN)
$store = curl_exec ($ch);
//echo $store; //Only for debug

// SET 2nd REQUEST
curl_setopt($ch, CURLOPT_URL, $CREDITURL);

// EXECUTE 2nd REQUEST (CREDITURL)
$content = curl_exec ($ch);

// CLOSE CURL
curl_close ($ch);

//echo $content; //Only for debug
//we gaan eventjes knippen in de ruwe source code van de returnwaarde
//bestudeer de html source en alles wordt duidelijk
$start = strpos($content,'balanceid'); //bepaal start van balanceid
$start1 = strpos($content,'Freedays remaining:'); //bepaal start van balanceid
$deelstring = substr($content,$start+14,26); //kopieer het begin van het bedrag de string naar een tussen waarde
$deelstring1 = substr($content,$start1+26,10); //kopieer het begin van het bedrag de string naar een tussen waarde
//print $deelstring; //Only for debug
$einde = strpos($deelstring,'<'); //einde van het bedrag is waar de afsluit tag begint
$einde1 = strpos($deelstring1,'<'); //einde van het bedrag is waar de afsluit tag begint
$bedrag = substr($deelstring,0,$einde);
$bedrag1 = substr($deelstring1,0,$einde1);
//echo "$content";


print $bedrag;
echo " Euro ";
echo "<br><br>";
If ($bedrag1 == NULL){
echo '0';
echo " Dagen ";
} else {
print $bedrag1;
echo " Dagen ";
}

?>
 
for me, 3cx don't permit to call a script
 
Status
Not open for further replies.

Forum statistics

Threads
111,886
Messages
589,560
Members
164,750
Latest member
KasunJay