FOOD FOR THOUGHT BulkVS.com -- Great Origination/Termination/TF rates!

If you want to play with BulkVS SMS and you have a public-facing web server, create a subdirectory called bulkvs-sms and then put this into an index.php file in that directory with your $deliverto email address:
Code:
<?php

// Syntax for delivery from bulkvs.com SMS Forwarding Service: http://yourdomain.org/sms-bulkvs/index.php?from=$[from]$&to=$[to]$&message=$[message]$

  $deliverto = "[email protected]";
//  $deliverto = "[email protected]";
  $from = htmlspecialchars($_REQUEST['from']);
  $to = htmlspecialchars($_REQUEST['to']);
  $message = htmlspecialchars($_REQUEST['message']);
  $subject="SMS Message from $from to $to";
  $comment="SMS Message\n\nFROM: $from\n\nTO: $to\n\nMSG: $message\n\n";
  mail("$deliverto", "$subject", "$comment", "$from");
  echo "OK";
?>

Under the SMS tab in your BulkVS portal, set the SMS Provisioning URL to: http://yourdomain.org/bulkvs-sms/index.php. Then enable SMS on your DID, and you're all set.
 
@wardmundy : I wrote my script a while back and have been using it actively. I also detect the sms gateway address as a simple precaution against spoofing. It also allows me to figure out which sms gateway ip addresses to whitelist.
I also have a subject line which is easy to parse by email filtering engines as the sms messages get further processed by the far end system. The code is self explanatory and easy to manipulate.

My script is as follows (sorry I don't know how to format it as "code" so I simply cut and paste it here):

<?php
// Let's determine the IP address of the gateway which rallied this SMS to our server:
// whether ip is from share internet
if (!empty($_SERVER['HTTP_CLIENT_IP']))
{
$ip_address = $_SERVER['HTTP_CLIENT_IP'];
}
// whether ip is from proxy
elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
{
$ip_address = $_SERVER['HTTP_X_FORWARDED_FOR'];
}
// whether ip is from remote address
else
{
$ip_address = $_SERVER['REMOTE_ADDR'];
}

$email_headers = "From: <your sms gateway email address here>";
$email_to = "<your destination email address here>";
$email_subject = "SMS_GWIP:".$ip_address."_FR:".$_GET['from']."_TO:".$_GET['to'];
$email_text = $_GET['message'];
mail($email_to,$email_subject,$email_text,$email_headers);
echo "OK";
?>

I am a bit disappointed though, because as short code sms do not work on voip, most useful sms messages can't be received (like verification codes sent from financial institutions, paypal, even google). So far I think I only got one site with two factor authentication work.
 
That could certainly save me some coffee money by moving my DID's from voip.ms (7 of them, for personal use, maybe I have a problem I don't know, + 3 more @ DryVoip. LoL). But, some questions:
1. Do they present any CID you send them? IE:CID of a DID you own, but is not hosted by them?
1B. Follow up to 1, on an Inbound call to a ring group, that forwards external to another number, what CID is displayed, original caller, or BulkVS DID?
2. Canadian users: Is Name & Number included in the Invite like other Canadian carriers, or do I have to do CNAM dips (blah)?
 
That could certainly save me some coffee money by moving my DID's from voip.ms (7 of them, for personal use, maybe I have a problem I don't know, + 3 more @ DryVoip. LoL). But, some questions:
1. Do they present any CID you send them? IE:CID of a DID you own, but is not hosted by them?
1B. Follow up to 1, on an Inbound call to a ring group, that forwards external to another number, what CID is displayed, original caller, or BulkVS DID?
2. Canadian users: Is Name & Number included in the Invite like other Canadian carriers, or do I have to do CNAM dips (blah)?
1. They do accept the CID you send them whether the DID is theirs or not (but that could change with shaken/stir implementation required by the FCC.)
1B. Inbound call carries the CID forward to outbound external number.
2. I don't know. I'm in the USA.
 
Canadian users: Is Name & Number included in the Invite like other Canadian carriers, or do I have to do CNAM dips (blah)?

So Canada respects what is sent through on the CallerID from asterisk? I think some of that happens in the USA already, but that sure would be nice.
 
So Canada respects what is sent through on the CallerID from asterisk?
Yup, that is my experience. If I call my parents from "my spot" on the couch, my parents see my name & number, if she calls hers, they see her name & number. And if I slip up and forget to fill in the Outbound CID on an extension, they'll see the Internal ext name. ;)
 
Here is a simple BASH script to send SMS messages through BulkVS. You'll need to add your BulkVS DID and API credentials at the top of the script.
Code:
from="18005551212"
apikey="aaabbbccc"
apisecret="dddeeefff"

if [ -z "$1" ]; then
echo 'Syntax: send-sms-bulkvs 18005551212 "Your SMS message"'
exit
fi
if [ -z "$2" ]; then
echo 'Syntax: send-sms-bulkvs 18005551212 "Your SMS message"'
exit
fi

to=$1
msg=$2

curl --header "Content-Type: application/json" --request POST --data \
'{"apikey":"'"$apikey"'","apisecret":"'"$apisecret"'","from":"'"$from"'","to":"'"$to"'","message":"'"$msg"'"}' \
https://portal.bulkvs.com/sendSMS
 
It would be nice if they handled MMS as well, and also did off-net SMS.
 
Just one other note - they still have some trouble with interconnect in Canada - a few calls are not completing (circuit busy) because the connection between Telus AND Bell (one of the ILEC's) and the carrier they are using in Canada (whom I can't figure out yet but suspect is probably Iristel or Fibernetics) doesn't have enough capacity. I think I'm going to raise another ticket.

Yes so Telus to Iristel is choking from time to time, it's on Telus though (Iristel says they're only at 70% capacity). They're fighting with each other. Any other Canadians lurking - FYI. Iristel is a well regarded SIP wholesale carrier in Canada.
 
For the rest of you calling Canada on how it works up here:
Rogers and VOIP carriers respect what you send through Asterisk. I haven't been able to test but my guess is Cogeco and Shaw do too, ie - the CLEC crew and tier 2 carriers do.
Bell and Telus certainly do not (ie the ILEC's, like in the US, do whatever the hell they like).
All calls to bulkvs get a CNAM dip and the name comes in the SIP invite - it's part of their pricing. So you pay a fraction of a cent extra on every call for the lookups. So configure Caller ID Superfecta if you're using it to use Trunk provided and that should be all you need.
 
All calls to bulkvs get a CNAM dip and the name comes in the SIP invite - it's part of their pricing. So you pay a fraction of a cent extra on every call for the lookups. So configure Caller ID Superfecta if you're using it to use Trunk provided and that should be all you need.

Are you saying that all DID's with bulkvs automatically do a dip and you are charged for that? (note: don't use them for inbound yet) - most allow you to turn on/off that feature for obvious reasons (why pay for a dip if I know the number).
 
Are you saying that all DID's with bulkvs automatically do a dip and you are charged for that? (note: don't use them for inbound yet) - most allow you to turn on/off that feature for obvious reasons (why pay for a dip if I know the number).

Yes, that's exactly what I'm saying . . . and what they advised me as well when I signed up. The rates are so cheap it doesn't matter.
 
so i made the script from Ward's example above and run it and I get a message saying message accepted for delivery and no sms shows up. Similarly, I run the script for checking for email and forwarding it on and no messages are forwarded to my email at that time.
 
Can you otherwise send emails from your server? Have you checked your SPAM folder? Have you enabled SMS on your DID?

If SMS messages never show up, you'd need to open a ticket with BulkVS and let them take a look at what's going on at their end.
 
Last edited:
@krzykat I've noticed on Skyetel that if you call Asterisk to Asterisk on-net with them, the Asterisk caller-id is transmitted rather than the database dip. From what I've tested, BulkVS does not send the Asterisk caller-id on-net or not.
 
Here is a simple BASH script to send SMS messages through BulkVS. You'll need to add your BulkVS DID and API credentials at the top of the script.
Code:
from="18005551212"
apikey="aaabbbccc"
apisecret="dddeeefff"

if [ -z "$1" ]; then
echo 'Syntax: send-sms-bulkvs 18005551212 "Your SMS message"'
exit
fi
if [ -z "$2" ]; then
echo 'Syntax: send-sms-bulkvs 18005551212 "Your SMS message"'
exit
fi

to=$1
msg=$2

curl --header "Content-Type: application/json" --request POST --data \
'{"apikey":"'"$apikey"'","apisecret":"'"$apisecret"'","from":"'"$from"'","to":"'"$to"'","message":"'"$msg"'"}' \
https://portal.bulkvs.com/sendSMS

I've written a php script that fetches any email from a designated (drop-)mailbox, check the subject line for "from_phone", "to_phone" and "sms_text", and if all three exist use the curl php function send the sms out, then delete the email message. It mostly works but the php imap function(s) used to access an imap mail account seem to be buggy at least in php5.
Anyone has some experience with php imap, either in php5 or php7 and email fetching+parsing?
 
Can you otherwise send emails from your server? Have you checked your SPAM folder? Have you enabled SMS on your DID?

If SMS messages never show up, you'd need to open a ticket with BulkVS and let them take a look at what's going on at their end.
Ward, I can send emails from the server just fine. Call notifications, daily cdr, voice mail all arrive just fine.
I will check with bulkvs. Their tech support has been super responsive to my porting and setup questions so far.

Thanks for the code as well.
 
Ward, I can send emails from the server just fine. Call notifications, daily cdr, voice mail all arrive just fine.
I will check with bulkvs. Their tech support has been super responsive to my porting and setup questions so far.

Thanks for the code as well.
Ward - bulkvs tells me that vitelity has not fully released the number which I ported over to bulkvs, so I raised that issue with vitelity but no response as yet. Thanks again for the code. I am learning a lot by reading your code.
 

Members online

Forum statistics

Threads
26,724
Messages
174,628
Members
20,286
Latest member
lluis.riera
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.
Back
Top