View Single Post
Old 09/10/2009, 06:42 AM   #907 (permalink)
johnsongrantr
Member
 
johnsongrantr's Avatar
 
Join Date: Aug 2009
Location: Indianapolis
Posts: 54
Likes Received: 0
Thanks: 9
Thanked 7 Times in 5 Posts
Default

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;
}

Last edited by johnsongrantr; 09/10/2009 at 07:25 AM. Reason: fixed spelling of perl and added chuck of script that applies
johnsongrantr is offline   Reply With Quote