Active Topics

 


Reply
Thread Tools
Posts: 93 | Thanked: 13 times | Joined on Nov 2010
#1
I use google voice alot to ring my n900. However as a prepaid tmo customer i need to save my minutes as much as possible. So i need GV to forward the call to my SIP # on N900 whenever im in Wifi and sip is up otherwise i need GV to forward the call to my TMO #.

With the current system i can not do that (i.e. check the SIP first and if its down try the TMO # via GV). So i have the following idea. Not sure if its worth to try. However i have no knowledge writing scripts in N900.

Here are the steps.

1. N900 should send a HTTP GET or POST request to a given address whenever SIP/IM account is getting up or down. (or within regular intervals). Ex. www.myserver.php?sip=1 (when sip is up) or sip=0 when its down.

2. I can write a program in PHP to get the request and change my GV forwarding option according to the sip=1/0 status.

Ex. Say im in WiFi an my Sip is up. Then my N900 should send www.myserver.php?sip=1 and my PHP script on the server grab it and set the GV to farward the call to my SIP no and vise versa.

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

I can manage to write the PHP scrip to manage GV forwarding option according to the GET/POST request.

If somebody can help to write a script to send the SIP/IM status (plus WiFi name if possible to check where you are, home or office additionally) via HTTP request it would be great.

Hope the story is clear and any idea appreciated.
 
Posts: 356 | Thanked: 123 times | Joined on Dec 2008
#2
I have a bash script that does this. I set it up as a queen beecon widget that runs every time my n900 connects to a network. When it sees that it is connected to a specific wifi network it enables my sip account, changes my forwarding options in google voice, and disables the cell phone part of my phone (to save battery).

The only issue is that it uses my data connection to change my forwarding options after I leave my house, but as long as you click on the queen beecon before you leave, it would work.

Let me know if this doesn't make sense, or if you want me to post the script.
 

The Following User Says Thank You to xur17 For This Useful Post:
Posts: 93 | Thanked: 13 times | Joined on Nov 2010
#3
Originally Posted by xur17 View Post
I have a bash script that does this. I set it up as a queen beecon widget that runs every time my n900 connects to a network. When it sees that it is connected to a specific wifi network it enables my sip account, changes my forwarding options in google voice, and disables the cell phone part of my phone (to save battery).

The only issue is that it uses my data connection to change my forwarding options after I leave my house, but as long as you click on the queen beecon before you leave, it would work.

Let me know if this doesn't make sense, or if you want me to post the script.
Yes, please give me the code to try.
 
Posts: 93 | Thanked: 13 times | Joined on Nov 2010
#4
Also is there anyway to check if a SIP account is up or down online?
 
Posts: 356 | Thanked: 123 times | Joined on Dec 2008
#5
Here you go. I tried to comment it, but I haven't released it before now, so let me know if you have questions:

gv_toggle_phones_public.sh

account_status.py

These both should go in the same directory. You will have to change some settings in the first script, but you shouldn't have to change anything int he second script.
 
Posts: 93 | Thanked: 13 times | Joined on Nov 2010
#6
Originally Posted by xur17 View Post
Here you go. I tried to comment it, but I haven't released it before now, so let me know if you have questions:

gv_toggle_phones_public.sh

account_status.py

These both should go in the same directory. You will have to change some settings in the first script, but you shouldn't have to change anything int he second script.
Thank you. How can i run a python script on N900?. How can i install Python runtime?. Sorry for being a noob at N900 scripting.
 
Posts: 356 | Thanked: 123 times | Joined on Dec 2008
#7
Originally Posted by rosh View Post
Thank you. How can i run a python script on N900? How can i install Python runtime?. Sorry for being a noob at N900 scripting.
I'm not sure if python is installed by default, otherwise yes you will need it. You can check if you have python is installed by opening the terminal, typing python, hitting enter, and seeing if it says it doesn't exist.

You only need to run the .sh script (it calls the python script).
 
Reply


 
Forum Jump


All times are GMT. The time now is 14:13.