Moving my phone numbers from Google Hangouts/Voice to an SIP/XMPP Service
A few months ago, I got a notice stating Google Hangouts would stop handling SMS/Voice. In 2012 I transfered my primary phone number to Google Voice before leaving the country, so I could still send texts and keep my American number. At the time, it cost $20 to transfer a number to Google Voice. Eventually Voice was deprecated and Google moved their customers’ phone numbers into Hangouts. Now they’re moving everything back to Voice apparently, in their never ending confusingly labeled and hopelessly broken suite of communication tools. Rather than wait for Google to finally put their telephony products out of their misery1, I decided to port the two phone numbers I had on Google over to another service. After some experimenting and trials with various providers, I decided to go with jmp.chat which allows for both Session Initiation Protocol (SIP) for voice calls and XMPP for texts/MMS.
Twilio Sucks
At first, I was looking at moving all my phone numbers to services on Twilio. I found a blog posts for setting up SIP, however the instructions were complex and quite old2. I was able to get basic voice/SIP working, but not reliably. Twilio also enforces 2-factor authentication after initial account setup, but only allows for SMS 2FA. Since I intended to port my phone into Twilio, I would have rather used another form of 2FA such as an OTP Secret. Twilio may support other 2FA, but I couldn’t get past the login screen without giving them a phone number.
Twilio seems insanely complex for those without a strong background in telecommunications software development. I also realized I would need to do a considerable amount of coding and testing if I wanted to get SMS/MMS messages working with my existing matrix server. Finally, Twilio broke their contract with Parler, showing that they were complicit in the new dangerous era of corporate censorship. I realized they are not a company I would want to purchase services from, and decided to look at other options.
jmp.chat
Jmp.chat is a service that has more batteries included. It provides a gateway to connect phone numbers to SIP for voice and XMPP for texts and media. I like this model as it lets me bring my own self-hosted XMPP server and SIP software or hardware devices. I started by using a number provider by jmp.chat and testing it against my own XMPP server. Once I was satisfied that text, media and voice worked as expected, I ported both of my phone numbers from Google Voice.
Jmp.chat charges $34.99 (USD) per year for their services. Google charged me $3 per Google voice number in order to unlock and port them. The porting process is fairly straight forward.
Voice/SIP
Most stock Android phone dialer applications support VoIP phone numbers via SIP. On my Sony Phone, these options can be found under Settings > Calls > Calling Accounts
. Here I can add SIP accounts, and setup my device to ask which phone number I want to use for each call. The UI also indicates if the SIP connection is working correctly to receive calls. In the following screen shots, you can see how one of my SIP accounts is setup correctly and one indicates it cannot authenticate (in this case, due to using the wrong password).
SIP is a standard found in many software telephony services and hardware devices. I can setup the same SIP accounts in Linphone, an open source VoIP software option. When a phone call is made to one of my registered numbers, it will ring both my Android phone setup with SIP and my software Linphone. The first device I answer with will be used for the voice session. The only tricky part of using Linphone with jmp.chat are the account settings. Through some trial and error, I discovered that the SIP address should be set to sip:+15555555555@jmp.bwapp.bwsip.io
(replacing the 555 with your actual phone number) and the SIP Server address should be <sip:jmp.bwapp.bwsip.io;transport=udp>
.
(userid)~40(xmpp server host)
. Jmp.chat reached out to me to say having multiple SIP clients connected and listening for calls isn't officially supported, and is not guaranteed to always work. They also support voice via XMPP as well, if you don't want to use a separate SIP client.(Updated: 2021.06.01)There are many hardware devices that support multiple SIP accounts as well. Sometimes these can be found on eBay from businesses who are getting rid of old hardware, allowing you to setup a physical VoIP phone in addition to software phones and mobile devices.
Sync Contacts from CardDav to XMPP
Several years ago I stopped using Google Calendar and Contacts. I migrated to Radicale, an open source CardDav/CalDav server that I host myself. This puts me in full control of my contacts and schedule without relying on services from Google, Apple or others. On my Android device, I disable Google syncing and instead, I use DAVx5 to synchronize calendars and contacts to Radicale. This works fine for linking contacts to incoming or outgoing SIP calls, but for SMS, I need to sync my CardDav contacts with my XMPP roster. That way I can see all my contacts using the open source XMPP client Conversations on my phone.
There is a vCard specification for XMPP, but I’m using an XMPP to SMS gateway from jmp.chat. All SMS messages would go through the special gateway transport @cheogram.com
. Rather than modify my existing contacts to add an XMPP field, I wrote a python script to sync my contacts to my XMPP roster, adding in the correct gateway. It’s configured with some very simply YAML:
carddav: url: https://cal.example.net/battlepenguin/Contacts.vcf/ username: yourusername password: S0m3pa33w0rD xmpp: jid: sms@xmpp.example.org password: Sup3rS3c4e7Pa33w0rDee sync: number_type: cell number_prefix: "+1" gateway_domain: cheogram.com
It’s easily runnable via Docker using environment variables:
docker run --rm -it \ -e CARDDAV_URL=https://example.com/djsumdog/Contacts.vcf/ \ -e CARDDAV_USERNAME=djsumdog \ -e CARDDAV_PASSWORD=s0mepa33w0rd \ -e XMPP_JID=myphone@xmpp.example.net \ -e XMPP_PASSWORD=p1rates \ -e SYNC_NUMBER_TYPE=cell \ -e SYNC_NUMBER_PREFIX=+1 battlepenguin/dav-xmpp-sync --verbose --dry-run sync
The docker image can also use a configuration file mounted from a volume:
docker run --rm -it -v $PWD/config.yaml:/app/config.yaml battlepenguin/dav-xmpp-sync --verbose --dry-run sync
It can also be run directly by checking out the source from git:
git clone https://gitlab.com/djsumdog/dav-xmpp-sync.git cd dav-xmpp-sync pip3 install --user -r requirements.txt python3 sync.py --dry-run --config config.yaml sync
Running the script directly will give colored output.
Thoughts about jmp.chat
There are some things to keep in mind about jmp.chat:
- Service is still in beta
- You cannot set your own SIP password. They are three words long and auto-generated.
- Most of jmp.chat’s backends are open source services if I ever want to attempt to host telephony myself.
- Jmp.chat only allows for 120 minutes for SIP calls per month.
- Unlimited incoming SMS/MMS
- Service intends to be in beta until at least the summer of 2021
- Customer support is over XMPP Chat and, so far, has been very good
- Phone numbers can take up to a week to port
Closing Thoughts
Google Hangouts/Voice was the last major service which kept me logged into Google. After testing out and porting my numbers to jmp.chat, I logged out of my Google account and deleted all my Google and YouTube cookies on my web browser. I hope jmp.chat continues to grow into a viable service. Considering how confusing Google’s messaging services are, how they’ve destroyed e-mail reliability, and how they tend to kill off most of their products1, I feel pretty good about moving one more thing away from their ecosystem.
-
Killed By Google. Retrieved 25 May 2021. ↩ ↩2
-
Register a SIP Phone Directly to Twilio and Make and Receive Calls. Klein. Twilio Blog. 28 Feb 2019. ↩