Resource icon

TUTORIAL Send SMS Messages with VoIP.ms 2020-10-2 UPDATE

No permission to download

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
wardmundy submitted a new resource:

Send SMS Messages with VoIP.ms - This tutorial will show you how to send SMS messages from PIAF CLI using VoIP.ms.

Here's a quick-and-dirty command line script to send SMS messages using a VoIP.ms DID that is SMS-capable and SMS-enabled.

Download the code here.

Prerequisites:

1. VoIP.ms account with at least one DID that is SMS-capable (cellphone icon appears beside the DID number).

2. SMS-capable DID has been enabled for SMS use. Also configure SMS messaging with a destination email and/or forwarding SMS number to receive replies from the SMS messages you generate.

3. VoIP.ms API has been enabled...

Read more about this resource...
 
Last edited:

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
lgaetz: Thanks. Fixed the typo.

VoIP.ms account names are email addresses. That is all that's meant by "email format" for your account name.
 

mikeybs

New Member
Joined
Mar 12, 2014
Messages
6
Reaction score
0
I am unable to get this working. The output of the script contains the entire content of class.voipms.php. No SMS message is sent. Error messages are generated if I use bad arguments:
ERROR: SMS number must be 10 digits.

SYNTAX: ./voipms-sms.php smsnumber "sms message"
I enabled voip.ms API, enabled SMS on my desired DID, I created an API password. I am using my email address associated with my voip.ms account and the API password I created.
Any ideas?
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
Works fine for me.

In class.voipms.php, you should have:
Code:
    var $api_username  = '[email protected]';
    var $api_password  = 'yourAPIpassword';

And in voipms-sms.php, you should have:
Code:
// This must be your actual VoIP.ms number that supports SMS
$SMSsender="8435551212";

Then send away:
Code:
# This must be a valid number that can receive SMS messages
./voipms-sms.php 8085551212 "Here is a test message"
 

mikeybs

New Member
Joined
Mar 12, 2014
Messages
6
Reaction score
0
That is exactly what I've done.... There is no useful output at all. The output is the content of class.voipms.php
there is no error message or anything like that....
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
What's the platform on which you are trying to use this??
 

mikeybs

New Member
Joined
Mar 12, 2014
Messages
6
Reaction score
0
not sure what you mean... do you mean the output of the script?
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
correct...

CMDoN2oWoAA-nmW.jpg
 

mikeybs

New Member
Joined
Mar 12, 2014
Messages
6
Reaction score
0
I am not running PBXinaflash, there is no status command. I am running stock centos7 with freepbx installed manually.
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
I am not running PBXinaflash, there is no status command. I am running stock centos7 with freepbx installed manually.


Oh. Sorry we only support the PIAF and Incredible PBX platforms. You might look through one of the Incredible PBX install scripts to see what package(s) you may be missing or contact voip.ms support and see if they have any suggestions.
 

lifespeed

Member
Joined
Sep 25, 2010
Messages
287
Reaction score
0
I am running PIAF 1.7.5.5 Asterisk 1.8.3.2. Am I hopelessly out of date to try to implement SMS? I have significant (to me anyway) customization to port over were I to upgrade.
 

bond007

New Member
Joined
Nov 2, 2016
Messages
6
Reaction score
2
I had what seems to be the same issue. Script runs but no SMS was sent. After I added the stream_context option it got the API to connect to voip.ms.

Ward may want to add links to this and my other reply in the main thread for the script so folks are aware they may need to modify things slightly depending on their installation.

Code:
  /*******************************************\
     *  VoIPms - SoapClient / SoapCall
    \*******************************************/
    var $soap_client;
    function soapClient(){
        $this->soap_client = new SoapClient(null, array(
                'location'      => "https://voip.ms/api/v1/server.php",
                'uri'           => "urn://voip.ms",
                'soap_version'  => SOAP_1_2,
                'trace'         => 1,
                'stream_context'=> stream_context_create(array('ssl'=> array('ve
rify_peer'=>false,'verify_peer_name'=>false)))
            )
        );
    }
 

Members online

No members online now.

Forum statistics

Threads
25,778
Messages
167,504
Members
19,198
Latest member
serhii
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