I'm going to dig into this guy's script and attempt to figure out what he's doing. Looks like it's written in perl and I'm not too familiar with that language.
Google Voice Command Line Script | 0xdecafbad.com
looks like he seems to have gotten it to work, now just to figure out how
Quote:
To cancel a call placed through the web (or this script)
./googlevoice.pl cancel
|
Quote:
###
# Cancel a call
###
sub cancelcall {
$cookiejar = HTTP::Cookies->new();
$rnr_se = auth($cookiejar);
if (!defined $rnr_se) {
return;
} else {
my ($url, $client, $request, $response, $postdata);
$client = LWP::UserAgent->new();
$client->agent('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.11) Gecko/2009060308 Ubuntu/9.04 (jaunty) Firefox/3.0.11');
$client->timeout(30);
$client->cookie_jar($cookiejar);
$url = 'https://www.google.com/voice/call/cancel/';
$postdata = "outgoingNumber=undefined&forwardingNumber=undefined&cancelType=C2C&_rnr_se=$rnr_se";
$request = HTTP::Request->new(POST => $url);
$request->content_type('application/x-www-form-urlencoded');
$request->content($postdata);
$response = $client->request($request);
if ($response->is_success) {
print "Call cancelled\n";
} else {
print "Could not cancel the call ".$response->status_line."\n";
}
}
return;
}
|