Skip to content

Building My DID Station

AI Disclaimer

I didn’t write this post with AI tools but the reason I was able to iterate so rapidly on this app is because I leaned on DeepSeek V4.1 Flash 1017. The app went from a concept to MVP in 2 weeks off and on writing and testing. I don’t think people should vibecode internet-facing apps and I consider this project more thoroughly written than that.

Intro

You know the feeling when a load bearing tool fails. Inbox takes too long to load. You get a missed notification for a conversation you wanted to have.

I could be referencing the Outlook/Exchange outage from last week but I’m not. I’m thinking about my experience using free apps on a VoIP phone plan while searching for a job and fielding recruiter texts and calls.

Why VoIP?

It’s great having a phone provider that lets you just block numbers for free. It’s also great having an app and web interface, even for voicemail.

I have been using Google Voice since the early days. Back 15 years ago it didn’t even support pictures. It was a great way to tie a phone number to an app instead of your cellphone. Change carriers? I did. Never had to port my number because people had my Google Voice number.

Then last year I went really far to leave traditional cellphone service. No more Verizon. Minimize the cost and data exposure to only the mobile data I’m going to use and continue to only give the number to organizations who refuse to accept a Voice over IP number like Google Voice.

Then things changed and I became more aware of / became less comfortable with why Google’s products are free. Long story short I wanted to get out of their ecosystem as much as I could.

So voip.ms came along, I ported my number out, and got new ones too.

Living with VoIP.ms

Onboarding was a bit of an uphill battle. Buy a phone number for $1.10 a month but it’s not clear out of the box how to hook it up to voicemail, or an app to check text messages, or an app to make and receive phone calls. In fact, you need to learn a bit of telephony jargon to even know what to look for in compatible apps.

I had some experience setting up a VoIP number with another provider 10 years prior. I even used one of those Cisco desk phones at the time. So I was able to piece together a solution out of a handful of free apps and digging through the docs to set up a subaccount for each number.

VoIP.ms Softphone

After using the official app for a bit I decided against it. Despite lofty goals in the product description it just wasn’t reliable enough at registering to handle incoming and outgoing calls.

https://play.google.com/store/apps/details?id=ms.voip.softphone.android&hl=en

Linphone

Linphone runs their own service but out of the alternatives I tested it was the best soft phone option for connecting to my voip.ms numbers. It has a background service that brings it up after a phone reboot and you can answer calls even on a locked phone, like you would expect for a normal phone.

https://github.com/BelledonneCommunications/linphone-android

VoIP.ms SMS

Finally, an app that would show SMS messages that came in while Linphone was disconnected.

https://github.com/michaelkourlas/voipms-sms-client

Where 3rd Party Apps Fell Apart

First, Linphone. It doesn’t reliably notify you of text messages that came in while it was disconnected. That’s inherent in the SIP-only design, a connection-oriented standard for live calls. No complaints about the soft phone voice part, but it would sporadically notify me about text messages I was already using another app for and there’s no way to turn that off.

Second, VoIP.ms SMS. It’s somewhat abandoned, has a handful of critical bugs, and the author has made it clear through his contributing policy that he would prefer not to work together.

So, given the constraints that Linphone is purposefully SIP-only and the API-only VoIP.ms SMS app author doesn’t welcome collaboration, I started a greenfield project.

My DID Station

What’s with the name? A DID (Direct Inward Dialing) is what VoIP providers call a phone number. You pay a monthly fee for the line (DID) and then hook it up to either a flat rate plan, a consumption-based plan, or send it straight to voicemail.

So I built my DID station. I looked into the different framework options. The nature of the app would require some Kotlin no matter which framework I used so I chose to write a native app directly. No WebView just for the sake of a WebView. We’re not building a cross-platform app with a common backend like other apps I’ve written. We are calling a vendor’s API directly in a way convenient for the end user and building an android service robust enough it will continue to function as a phone through android doze mode.

App Architecture

The VoIP.ms API provides text messages, media messages (MMS), and voicemails. It also supports retrieving the full credentials required to make and receive SIP calls.

The APIs aren’t particularly fast so it was important to design the app with that in mind.

  • Caching lists of phone calls and text messages and voicemails we already know about so the app loads quickly
  • Registering the SIP connection immediately upon opening, only checking for rotated credentials if the connection fails
  • Standard text message conversation behavior like showing that a message is still being sent and showing if it has been delivered

To support that we need a message store, a deduplication process, and async-safe behavior. We also need database migrations as the schema matures to support the store.

Design limits added for privacy and expediency

Messages and voicemails are polled. I built a VoIP.ms to ntfy relay to support real-time message delivery notification but in testing it was found to be unnecessary. If you’re in a conversation you can swipe and drag to refresh. If you’re outside of a conversation the check every 15 minutes is enough for everything except critical alerts.

For users who need notified of text messages right away, whether for work or family reasons, I plan on publishing and wiring in the option for their own self-hosted notification relay. I didn’t like that other implementations of the relay saw the full content of every user’s text messages. That’s why this app is polling-first and 100% works without the relay.

Google Play services have also been completely excluded from the app and my initial plan is to only make it available on GitHub and f-droid. That leads to the need for the self-hosted relay mentioned above but only if the 15 minute recurring sync schedule isn’t fast enough for you.

The voice call part of the app holds a SIP connection open to stay registered for incoming calls so I’ll look into whether a signal on that connection can trigger the text message part to poll sooner. It would ideally eliminate the need for the relay in cases where a user is registered for a voice connection.

Common features missing in the MVP

  • My DID Station does not have a concept of Contacts yet. Every message or call or voicemail is only connected to the number VoIP.ms has on file.
  • No multi-call / call waiting support yet
  • VoIP.ms API does not support group text messages

Untested

  • Bluetooth headsets

How Can I Get The App?

Github https://github.com/bennett-elder/mydidstation/releases

F-droid (pending)

VoIP.ms Service

I am told using this referral link will give both you and I $10 credit towards their services but that could change. Worth a try.

https://voip.ms/en/invite/NTAzMDA2