Speed dial to post to url. Part of my Google voice 2014 workaround.
giqcass:
It's probably a longshot Getting Obi to support this but I have a partial work around that functions now and will continue to function after the XMPP cut off. This trick requires the Obi device to call a url. It would not require users to share their passwords either. This ability to "call" a predefined url could also be used with other peoples Hacks to generate a callback as well.
I'm not talking about dialing an ip address with sip. Instead the Obi opens a url similar to the way a browser would. It would work in a fashion similar to my dynamic DNS hack. In my testing it all works so far but I need to fine tune the code. I would also need OBi to allow us to opem a url by dialing a number. I envision a speed dial.
The very basics of how this works.
Set up a Google Call widget. Under the options set the widget so the call goes directly to voicemail. Plug the secret key into a small form that will post automatically when it's called.
When the form is called you will receive a call that connects you to your own voicemail.
Now you can listen to your voicemail and dial outgoing calls for free.
I would also like to find a way to host the form on the actual Obi. I think I might be able to do that with the OBi202. I am testing code hosted on a USB drive on my Obi202 right now.
Using this trick you could also set up speed dials for other Google Voice users that would connect without going through your voicemail to place the call.
This would also help support services that provide callback. It's a little complicated now but I'm simplifying it as we speak.
giqcass:
I have made the fist OBi initiated call. I have not yet been able to host the code on the Obi and make it work but when I host a PHP version of the code on a free webserver it works.
After I uploaded the code to the webserver I was able to paste that code into my obi just like I did for the Dynamic DNS hack. I set the interval to 120 seconds for the sake of testing and the Obi initiated a Google Voice callback to my phone on schedule. This connected me to my voicemail and I was able to place an outgoing call as expected.
If Obi would add the ability to post to a url by dialing a code this will workå
sdb-:
Clever!
I have not looked at using the google widget.
Is your PHP code downloadable or short enough to post? (after obscuring your info)
giqcass:
It's not really my code. I just re-purposed the code someone else wrote for a tutorial. Only 2 variables must be set. I'm playing with an alternate technique as well. It's going to be more difficult but it will work better when finished. It will also use an http request but it allows you to dial any number without going through voicemail first.
Primary code came from here.
http://www.html-form-guide.com/php-form/php-form-submit.html
This article helped me with the variables.
http://razvangavril.com/web-development/custom-google-voice-widget/
I still don't have a version that will work when hosted on the Obi via usb drive. The Obi can activate the code when hosted on a free web host by using a http request. I have tested this code hosted on 000webhost.com.
Code:
<?php
//Replace the following two Variables.
$GoogleVoiceKey = 'a3d34f94jf94jfj98f1da53jfiejgkej12710aa2'; //This comes from the GV widget
$CallBackNumber = '15555551212'; //This is the number Google should call.
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
//Leave this stuff alone don't make any changes below
//unless you know what you are doing.
//This script will allow you to place a call
//from Google voice to another number.
//it uses the secret key from the Google call widget.
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
//create array of data to be posted
$post_data['buttonId'] = $GoogleVoiceKey;
$post_data['callerNumber'] = $CallBackNumber;
$post_data['name'] = 'Me';
$post_data['showCallerNumber'] = '1';
//traverse array and prepare data for posting (key1=value1)
foreach ( $post_data as $key => $value) {
$post_items[] = $key . '=' . $value;
}
//create the final string to be posted using implode()
$post_string = implode ('&', $post_items);
//create cURL connection
$curl_connection =
curl_init('https://clients4.google.com/voice/embed/webButtonConnect');
//set options
curl_setopt($curl_connection, CURLOPT_FRESH_CONNECT, 1);
curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($curl_connection, CURLOPT_USERAGENT,
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");
curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false);
//curl_setopt($curl_connection, CURLOPT_FOLLOWLOCATION, true);
//set data to be posted
curl_setopt($curl_connection, CURLOPT_POSTFIELDS, $post_string);
//perform our request
$result = curl_exec($curl_connection);
//show information regarding the request
print_r(curl_getinfo($curl_connection));
echo curl_errno($curl_connection) . '-' .
curl_error($curl_connection);
//close the connection
curl_close($curl_connection);
?>
giqcass:
I'm done playing with solution number 1. If anyone would like to test is then go ahead and try this live test version. You need to supply your own secret key from a Google Voice widget.
I can think of a few creative ways to use this but the more complex version will be more versatile.
Replace "YOUR-SECRET-KEY" with the one from the widget and the number with your telephone number or the number of someone you want to call. I would give them a heads up first before you call them. It will call them and ask them to press 1 to connect with you. Caller ID will show
Quote
Mountain Vie CA 16502651193
http://gvtest.site88.net/?key=YOUR-SECRET-KEY&callback=15554441212&name=optional
This article will help you find the key. The key looks something like this. 4563a8e24f4009bcaf7122437e2f9bc0b15c192e
New code below.
Code:
<?php
echo 'This is a GV callback test page.<BR>';
echo 'You must provide your secret key and callback number.<BR>';
echo 'Add it to the url like this.<BR>';
echo '?key=YOUR-RANDOM-SECRET-KEY-FROM-WIDGET&callback=15552221212&name=OPTIONAL<BR><BR><BR>';
//
//////////////////////////////////////////////////////////
//There are 2 way to pass the variables.
//
//Option 1 - In the URL
// http://www.yourdomain.com/ObigvTest.php?key=YOUR-RANDOM-SECRET-KEY-FROM-WIDGET&callback=15552221212&name=OPTIONAL
//
//Option 2 - Replace the following two Variables.
$GoogleVoiceKey = 'YOUR RANDOM SECRET KEY FROM WIDGET';
$CallBackNumber = '15552221212'; //This is the number Google should call.
//This variable is optional
$Name = 'Google Voice';
//////////////////////////////////////////////////////////
//Leave this stuff alone don't make any changes below
//unless you know what you are doing.
//Any variable included in the url will replace variables
//defined in option 2.
//This script will allow you to place a call
//from Google voice to another number.
//it uses the secret key from the Google call widget.
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
///If variables are in the url then override pre defined variables
$Key = htmlspecialchars($_GET["key"]) ;
$CallBack = htmlspecialchars($_GET["callback"]) ;
$Name = htmlspecialchars($_GET["name"]) ;
if ($Key != null)
$GoogleVoiceKey = $Key;
if ($CallBack != null)
$CallBackNumber = $CallBack;
if ($Name != null)
$GvName = $Name;
echo $GoogleVoiceKey . ' ' . $CallBackNumber . ' ' . $Key . ' ' . $CallBack ;
//create array of data to be posted
$post_data['buttonId'] = $GoogleVoiceKey;
$post_data['callerNumber'] = $CallBackNumber;
$post_data['name'] = '$GvName';
$post_data['showCallerNumber'] = '1';
//traverse array and prepare data for posting (key1=value1)
foreach ( $post_data as $key => $value) {
$post_items[] = $key . '=' . $value;
}
//create the final string to be posted using implode()
$post_string = implode ('&', $post_items);
//create cURL connection
if ($Key != null) {
$GoogleVoiceKey = $Key;
$curl_connection =
curl_init('https://clients4.google.com/voice/embed/webButtonConnect');
}
//set options
curl_setopt($curl_connection, CURLOPT_FRESH_CONNECT, 1);
curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($curl_connection, CURLOPT_USERAGENT,
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");
curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false);
//curl_setopt($curl_connection, CURLOPT_FOLLOWLOCATION, true);
//set data to be posted
curl_setopt($curl_connection, CURLOPT_POSTFIELDS, $post_string);
//perform our request
$result = curl_exec($curl_connection);
//show information regarding the request
print_r(curl_getinfo($curl_connection));
echo curl_errno($curl_connection) . '-' .
curl_error($curl_connection);
//close the connection
curl_close($curl_connection);
?>
Navigation
[0] Message Index
[#] Next page