With the demise of Circlenet, I've moved my primary outgoing (termination) provider over to AnveoDirect (AD). The more experienced of you probably know all what follows, but I was pinged a couple times so I thought I'd share my learnings.
I've had a home-office DID with AD for a couple of years (used mainly for teleconference calls hosted on my PBX). It's been reliable, and cheap (19c per month; 0.4 cpm incoming). For the sake of simplicity (and laziness), I mostly had it forwarded to another provider's SIP URI.
But since I now need a more complete solution with AD - incoming, outgoing and SMS -, I've had to make some adjustments. Most of what I describe below is on the AD portal or in other threads, or based on some PM advice I received from other DSLreports contributors (thanks folks!).
1) Incoming SMS - perhaps the most important learning - when setting up a dedicated SMS server, I found that that the IP that the SMS messages comes from is not listed anywhere on the AD portal (http://anveodirect.com/about/faq), or elsewhere. If you want to lock down your firewall, you also need to accept connections from 169.48.232.147(/32).
I discovered this during experimentation with a dedicated Amazon EC2 server set up to only do AD SMS - I firewalled off all other incoming connections, except those listed on the AD portal. But did not receive any SMS messages until I looked at the firewall log and found this additional IP.
I don't get a lot of SMS' on these numbers, but one of the numbers on AD does sometimes get SMS from service providers, so I wanted to be able to receive these. After some experimenting, I got this working on an Amazon EC2 server (the freebie version). In order to have SMS forwarded to you, you set up a php to use the sendmail (postfix) function (from this thread: http://www.dslreports.com/forum/r28661865-Anveo-Problems-receiving-SMS-via-Anveo). I was going to respond in that thread, but it veered sorta off topic.
After figuring out how to get SMS to work on the EC2 architecture, I turned a spare RaspberryPi3 into a webserver, with sendmail/postfix. Because I had to open port 80 in my firewall, I locked down the allowed incoming IP addresses solely to those listed on the AD portal *plus* the SMS IP listed above.
I wanted to watch the Pi for a couple of weeks before switching over from the EC2 version. So far there is no intrusion into the Pi (iptables and the usual security applied), so I will probably switch soon.
Here's the smscallback.php code that goes either in the HTML or the CGI-BIN folder (depending on your version/setup) - from the thread above:
X<?php $deliverto = "YOUR-EMAIL@YOUR-DOMAIN.COM"; $from = $_REQUEST['from']; $to = $_REQUEST['to']; $message = $_REQUEST['message']; $subject="SMS Message from $from to $to"; $comment="Incoming AnveoDirect SMS Message\n\n FROM: $from\n\nTO: $to\n\nMSG: $message\n\n"; mail("$deliverto", "$subject", "$comment", "$from"); ?>
It took me awhile to sort out the missing PHP tags and exactly which folder this needed to be located in. Note: properly written PHP files are not readable on the internet so your email shouldn't be harvestable.
2) Outgoing calls - AD does not support SIP registration for outgoing calls, but rather uses IP authentication. I'm on a cable modem with dynamic IP assignment, though my IP has been stable for at least 6 months. However, termination from AD is via IP, and there is a chance it could change at some point (power loss, etc).
My setup includes a PBX, so I have failover to other providers supporting SIP registration, but I'm on AD for the pricing ;).
After a bit of searching and experimenting, I modified a script I found on the internet (I will update an attribution if I can find the specific source), and added it as a cron job to check the IP hourly, and to send an email if it changes:
X#!/bin/bashNOWIPADDR="/home/pi/scripts/nowipaddr"GETIPADDR="dig +short myip.opendns.com @resolver1.opendns.com"LOG="/home/pi/scripts/ip.log"timestamp=$( date +%T )curDate=$( date +"%m-%d-%y" ) if [ -f $NOWIPADDR ]; then if [[ `$GETIPADDR` = $(< $NOWIPADDR) ]]; then echo $curDate $timestamp " IP address check: " $(< $NOWIPADDR) >> $LOG else $GETIPADDR > $NOWIPADDR echo "The global IP has changed. The new IP is below; you should check Anveo settings." | mail -s "Public IP Change - check VOIP settings" youremail@yourdomain.ext < $NOWIPADDRfielse curl $GETIPADDR > $NOWIPADDR echo "The global IP has changed. The new IP is below; you must check Anveo settings for outgoing calls" | mail -s "Public IP Change - check VOIP settings" fromemail@fromdomain.ext < $NOWIPADDRfi
I am told that some flavors of FPBX have this built-in, so YMMV in terms of needing this.
2a) I've opened one of my free tickets to see if the AD "Authorized IP Addresses" list could be made to take FQDN, because I use Namecheap's domain services along with the DDNS settings on my router to maintain a subdomain which points to my IP (generally for VPN use).
3) Outgoing SMS - can be done in a web browser with the format:
X https://www.anveo.com/api/v1.asp?apikey=YOUR-API-KEY&action=sms&from=YOUR-AD-DID&destination=OUTGOING-PHONE-NUMBER-INCLUDING-COUNTRY-CODE&message=Thanks%20for%20your%20message.%20See%20you%20soon.
I made a crude HTML form that concatenates the fields, but I'm trying to create an Android app that will do the same. Assistance welcomed ;)
4) LIDB - after experimenting, I found it most effective to do this from the CLI on the RaspberryPi3, because you can get a file with the disposition of the request. It's actually very simple, and amazingly quick (updated lookups for major providers - Verizon and AT&T started showing up about 9 hours after I submitted my request).
The code I used is:
Xcurl -g "https://www.anveo.com/api/v2.asp?userkey=YOUR-API-KEY&action=DID.CNAM.UPDATE¶m[E164]=YOUR-DID-INCLUDING-COUNTRY-CODE¶m[ACCOUNT_NUMBER]=YOUR-ACCOUNT-NUMBER¶m[CNAM]=DESIRED-NAME" -o filename-for-output.txt
There was some disagreement in several threads whether the the "percent-symbol20" or a space would work in the name field, but the "percent-symbol20" for sure inserts a space in the LIDB name.
5) Incoming calls - as I noted above, I took the lazy way for the first year-plus, forwarding to another providers' SIP URI. This works well in general, getting me CID, filtering and the like.
But in the spirit of getting all things working, I found that by allowing IPs from the IPs listed on the AD portal (http://anveodirect.com/about/faq), I can get calls to come directly to my PBX.
Interestingly, FQDNs can be used for this setting: my primary SIP URI is $[E164]$@my-namecheap-subdomain.mymaindomain.com.
Of course, this means I need to set up my PBX to do all the filtering, ring groups, etc., that I have setup on the other provider... so I got lazy again, after proving I could make it work - went back to forwarding to another providers' SIP URI.
Hope this helps someone sorting through the same issues. If I make any additional changes or tweaks, I'll update.
Cheers,
*TIL = Today I Learned, with apologies to Reddit for appropriation.
↧