Configuring SIP accounts on Twilio

While the Pinephone technically made a phone call, I updated and haven’t been able to make a subsequent call. I have a need for stable phone line able to make touchtones, for phone system navigation. I hate it, but that’s the state of calls these days.

I need it for everything except personal. When folks call my number it actually routes via Jingle protocol to a client of my choice, such as Conversations or Snikket (both on Android, which I have on a tablet), which I can then answer. I may place calls in this same manner, and use my XMPP client to send SMS messages. I believe Dino, a desktop app, will also be able to use the A/V stack as the other clients, and any client might include a dialer at some point.

But I’m not going to wait for that, because I need this last year, so I’m gonna hack up a VoIP solution involving a SIP account leased from Twilio, and a compatible handset that connects directly to wifi, as I don’t have any routing hardware to plug in cables.

The handset is a Grandstream WP810 Cordless Wi-Fi IP Phone.

Here’s what I believe I need to do to make this work:

  • lease a SIP number from Twilio
  • configure SIP account for common usage
  • use SIP account credentials on WP810

Let’s see how it works!

I’ve gotten an outgoing SIP trunk configured I think. But I’m unable to make out outgoing call from the WP810. I’ll need to test with a different device/app to see which is the issue…

I did it! Wow, that was not easy. But I just made a call to @susan on the WP810, connected to a portable wifi spot, to a PTSN number!

I’ll document this, but it will require going through the errors I got; I didn’t know there were errors until I got an email from Twilio this morning. Their web console is a lot.

I need to attend some other tasks, but I’ll get into the configuration in a bit. :slight_smile:

I got an email from Twilio saying there were errors. That was great, because there had been no other indication of a failure, so there wasn’t much to go on.

A link to get the last 24 hours of errors is Twilio | Login.

Here are the errors and my responses.

Error - 32101 SIP: Invalid phone number

SIP: Invalid phone number: The called number is not correctly formatted.

The numbers I were trying to call were not E.164 formatted, which requires a + (plus) at the beginning of the number, before the country code.

I don’t know how to type that on the T9 keyboard on the WP810. But I do know how to add numbers to the device via the web interface, so I did that.

Future goal: figure out how to type + on the WP810.

Changing that in the contacts and calling a number then gave me a new error. Yay!

Error - 32100 Trial accounts can only call verified caller IDs.

SIP: Trial accounts can only call verified caller IDs: Trial accounts can only call verified caller IDs.

Ah, this is so folks don’t spam others on trial accounts. A verified number is one you verify you own, so you may use it for testing purposes. Which was a conundrum for me, because I didn’t know if I could get it working so I didn’t want to upgrade, but I also didn’t have a number I could verify to test it.

Then I recalled there was a testing number! If I could make that call, then I’d know it worked, and would upgrade to a paid account (which I would use).

The test number is +14154758378, and calling it fortunately gave me a different error message! Now we’re getting somewhere!

Error - 32204 Invalid Caller ID

SIP: ‘From’ phone number not verified: The caller-ID wp810 is unverified. SIP Trunking terminating calls to PSTN must use a valid Caller ID in the From Field. A Valid Caller ID is either a DID you have purchased from Twilio or a verified Caller ID.

Oh wow, this took me a while to figure out, I thought it wasn’t gonna work, because I’ve go no damn idea how to set the Caller ID on the WP810.

Fortunately just searched the user guide PDF for the word “FROM” until I got some description of how “Caller ID Display” is configured, and was able to figure out I would use the E.164 number associated with my SIP trunk (leased from Twilio) as the SIP User ID, and the login credential in Authenticate ID, which would put the appropriate data in the FROM field for the request.

Screenshot_2021-05-10 Account 1

And boom, it worked!

First I called the test number and it worked, and then I called @susan and while the connection was not the best (my wifi spot is on an over-saturated part of the mobile network), it called and worked fine, and I now have a working touch-tone phone for a dollar and some change a month.

:sunglasses:

1 Like

Here’s the irony of this setup: I can’t make calls from home.

If I walk down the street with my wifi spot and my handset, I can make calls fine. But not at home. Ha!

One thing at a time…