test.java

388 views
Skip to first unread message

brandon li

unread,
May 15, 2012, 8:51:12 PM5/15/12
to Google Voice Java

This is a very newbie question: looks like the test.java doesn't have
a test to call phone, correct?
Is there any sample code to call a phone?

Thanks!
Brandon

Samir Faci

unread,
May 15, 2012, 9:43:21 PM5/15/12
to google-v...@googlegroups.com
http://code.google.com/p/google-voice-java/wiki/GettingStarted That
shows you an example
of how to place a phone call.

Keep in mind that google voice will only connect two valid numbers.
So each time you place a
'call', it calls you and calls your party then connects the two numbers.

something like this should work.

--------------

//Note I'm using the maven branch.. I'm not sure if there are any API
differences.
try {
Voice voice = new Voice(username, pass);
voice.call("123-456-7890", "123-457-8900", "cell" );
} catch (IOException e) {
e.printStackTrace();
}

--
Samir Faci
> --
> You received this message because you are subscribed to the Google Groups "Google Voice Java" group.
> To post to this group, send email to google-v...@googlegroups.com.
> To unsubscribe from this group, send email to google-voice-j...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/google-voice-java?hl=en.
>



--
Samir Faci
*insert title*
fortune | cowsay -f /usr/share/cows/tux.cow

Sent from my non-iphone laptop.

brandon li

unread,
May 18, 2012, 7:28:00 PM5/18/12
to google-v...@googlegroups.com
Thanks Samir for the response!

I am doing tests with the read-only version. 

Firstly, I got the error code 500:  Server returned HTTP response code: 500 for URL: https://www.google.com/voice/b/0/call/connect/

Then with some tests, I noticed that it seems to work if I remove the phone type like:

 voice.call("123-456-7890", "123-457-8900", "cel" );

Here "It works" means that I got a call back from google voice saying I didn't have enough credit to make the call.

Does the above result sound correct to you?

Thanks!
Brandon

Samir Faci

unread,
May 18, 2012, 7:41:49 PM5/18/12
to google-v...@googlegroups.com
I'm not sure what you mean by the read-only version.

If you got a call back that's a pretty good sign though. Also, if you have
access to a US phone number.. google voice should connect US phone numbers.
it shouldn't be using any credit.

--
Samir Faci
Reply all
Reply to author
Forward
0 new messages