TIPS SMS Messaging with Google Voice

localnation

New Member
Joined
Apr 29, 2011
Messages
19
Reaction score
0
This is the initial beta release of my PHP script for sending Google Voice SMS messages from a PIAF (Purple) (The Incredible PBX) server. Thanks to Nerd Uno for converting this script to a PIAF/FreePBX Module!

To install:
SSH or login locally to your PIAF server as root and issue the following commands:
cd /
wget http://pbxinaflash.net/source/sms/sms.tgz
tar zxvf sms.tgz
amportal restart
service httpd restart

Then you need to do two things:

(1) Edit /var/www/html/sms/index.php and add your Google Voice username and password credentials.
(2) Open the FreePBX GUI and go to Module Admin. Scroll down to the Third Party Addons section at the bottom and click on SMS Messaging. Then choose Install. Reload FreePBX when prompted.

SMS Messaging now will appear as an option on the Tools menu under Third Party Addons. You still will be prompted for your username and password (e.g. maint : password).

This script gives you a very simple webpage with two text boxes and some simple instructions. The first text box is for your list of phone numbers to send your SMS message to. The numbers should be separated by spaces, commas, or newlines and in the format NXXNXXXXXX. The second box is for your message, and will be truncated at 160 characters.

As I said, this is a very early beta version :yikes: of the script and does not include database access, or Javascript input verification.

Future versions will include MySQLi access, and a more user-friendly UI.

Please respond with any feature requests for future versions.
 

localnation

New Member
Joined
Apr 29, 2011
Messages
19
Reaction score
0
First Post Fixed, file uploaded

Really? Where?!?
:1eyeb:
Ok, edited first post... I blame IE9. It really screws up the forum (I actually have to switch it back to IE8 mode in developer tools to post here!)... or it could just be my forgetfulness...

I'll go with the later. anyways.. file is now attached, happy SMSing!
 

lowno

Guru
Joined
Feb 18, 2009
Messages
125
Reaction score
8
Thanks for this.

I did just try it out, but the sms was not sent. I did not add the security since the server is behind my firewall and only I use it. I put my credentials for my google voice account as instructed.

I am running PIAF 1.8 with incredible pbx. the 1755 build. Installed 3 weeks ago in proxmox.
 

localnation

New Member
Joined
Apr 29, 2011
Messages
19
Reaction score
0
Troubleshooting SMS Web Interface

Thanks for this.

I did just try it out, but the sms was not sent. I did not add the security since the server is behind my firewall and only I use it. I put my credentials for my google voice account as instructed.

I am running PIAF 1.8 with incredible pbx. the 1755 build. Installed 3 weeks ago in proxmox.

Try this:
SSH to your server (or connect locally).
type the following command:
/usr/bin/gvoice -e [email protected] -p YoUrPaSsWoRd send_sms NXXNXXXXXX Test Message

where NXXNXXXXXX is the SMS number to send to and see if you get the SMS on your cell phone.
 

lowno

Guru
Joined
Feb 18, 2009
Messages
125
Reaction score
8
Works via command line.

Now in the script where I place those variables, I have left the " is this correct?

UPDATE: read you instructions again, and got the answer. So I do have it configured correctly, not a newbie, but it's not working for me.
 

localnation

New Member
Joined
Apr 29, 2011
Messages
19
Reaction score
0
Works via command line.

Now in the script where I place those variables, I have left the " is this correct?

UPDATE: read you instructions again, and got the answer. So I do have it configured correctly, not a newbie, but it's not working for me.

This works on my system, so I'm not sure where the difference comes in. If you want to check what is being passed to the command line, add the following line right after the line that starts with $output .= "Sending message ..."
$output .= $runcommand . "<br>";

When you submit the form, it should give you a command line for each number you added in the first box.
 

Linetux

Guru
Joined
Oct 5, 2008
Messages
541
Reaction score
1
Doesn't work for me, either.

Code:
Message: Are you ready to die?

Sending message to: 4073996468
/usr/bin/gvoice -e [email protected] -p yeahright send_sms 4075551212 Are you ready to die? &

I note that there are no double quotes around the message.... when I send via command line, I use quotes and it comes across correctly.
 

lowno

Guru
Joined
Feb 18, 2009
Messages
125
Reaction score
8
The output is the same, except at the end of the string there is an &.

Still not working. Can send via the command line just fine with and without the & at the end.
 

localnation

New Member
Joined
Apr 29, 2011
Messages
19
Reaction score
0
Try replacing the $runcommand = ... line with the following:
Code:
     $runcommand = '/usr/bin/gvoice -e "' . $gvoiceuser . '" -p "' . $gvoicepass . '" send_sms "' . $phonenumber . '" "' . $message . '" &';
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
Slightly Enhanced Version

I've tidied this up a little (very little) to make it compatible with FreePBX. I've also changed the directory name to "sms" to comport with our existing naming scheme for directories.

If you'd like to try it, do the following after logging into your server as root:


cd /
wget http://pbxinaflash.net/source/sms/sms.tgz
tar zxvf sms.tgz
amportal restart
service httpd restart


Then you need to do two things:

(1) Edit /var/www/html/sms/index.php and add your Google Voice username and password credentials.

(2) Open the FreePBX GUI and go to Module Admin. Scroll down to the Third Party Addons section at the bottom and click on SMS Messaging. Then choose Install. Reload FreePBX when prompted.

SMS Messaging now will appear as an option on the Tools menu under Third Party Addons. You still will be prompted for your username and password (e.g. maint:password).
 

lowno

Guru
Joined
Feb 18, 2009
Messages
125
Reaction score
8
I used what Ward posted and it works now. Thanks everyone.
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
The thanks all goes to you! We really appreciate your creation. Great job!!!

:party::party::party::party:
 
Joined
Apr 17, 2009
Messages
829
Reaction score
9
just as an FYI... I also was only able to do this from a command line. however once I looked closer at the code. the
$runcommand = '/usr/bin/gvoice -e ' . $gvoiceuser . ' -p ' . $gvoicepass . ' send_sms ' . $phonenumber . " " . $message . ' &';
$output .= "Sending message to: $phonenumber<br>\n";
was separated on either 2 or three lines. once it was all put onto one line like it should be. all is well.

thanks for the great idea and "APP"!

Now if there is a way to poll the received text messages on a page.... ;) :crazy: Or to work with scheduling app..... :D


Thanks again
 

localnation

New Member
Joined
Apr 29, 2011
Messages
19
Reaction score
0
I'll have to look into those ideas for v3 or so... Recieving SMS is definately looking into. There are WAY too many companies out there charging WAY too much money for mass SMS services. If we can get PIAF to do it out of the box... :eek:

And I have no clue how those lines got separated. They're not that way in the file, and I'm glad you got it to work for you. The module should definately work for you, and if not, let me know and I'll troubleshoot and get it fixed ASAP.
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
It was saved as a DOS file. The version in the one I posted has been converted.
 

rossiv

Guru
Joined
Oct 26, 2008
Messages
2,624
Reaction score
139
This one?
Code:
cd /
wget [URL]http://pbxinaflash.net/source/sms/sms.tgz[/URL]
tar zxvf sms.tgz
amportal restart
service httpd restart
That's what I installed.
 

drmurdoch

Member
Joined
May 26, 2008
Messages
576
Reaction score
11
I'll have to look into those ideas for v3 or so... Recieving SMS is definately looking into. There are WAY too many companies out there charging WAY too much money for mass SMS services. If we can get PIAF to do it out of the box... :eek:

Like Red Oxygen ?

The premium cost for SMS Text Messaging was to have a Dedicated SMS Text Messaging number for sending. I believe it costs $99/month to have a dedicated SMS number.

I tried to use the COM API for Skype to send SMS, but you were not able to specify a sender name ! The Skype COM API is broken.

I wish Google Voice was in Canada !
 

Members online

Forum statistics

Threads
25,782
Messages
167,509
Members
19,202
Latest member
pbxnewguy
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top