npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

sms-forward

v1.0.12

Published

Auto-forward incoming SMS from one mobile phone number to another phone number using a Huawei mobile broadband device (dongles, wingles)

Downloads

11

Readme

sms-forward

npm version

Auto-forward incoming SMS from one mobile phone number to another phone number using a Huawei mobile broadband device (dongles, wingles).

Description

This Node.js module forwards incoming SMS from one mobile phone number (e.g. personal) to another one (e.g. work). The typical use case is someone equipped with a professional mobile phone, who wants to keep his/her personal phone number separate from work number, but does not want to carry both phones all the time.

This module acts as a "limited" SMS gateway: source phone number SIM (e.g. personal) is placed into a Huawei mobile broadband device which offers SMS APIs. The module scans incoming SMS and forwards them to a target phone number (e.g. work).

The detailed workflow is as follows:

  1. Scans for unread SMS in Inbox
  2. For each unread SMS:
    • Optionally lookup AddressBook to fetch sender fullname
    • Forward SMS to target phone number
    • Mark SMS as read

Prerequisites

  • Source phone number SIM dedicated for SMS forwarding
  • Huawei Mobile Broadband device. This has been tested with a (old) E355 model and a (new) E3372 model. If you are using another model, it would be great if you could report it
  • Always-on Linux/Mac computer/Raspberry Pi which executes this Node.js module
  • Node.js installed on previously mentioned computer

Installation

  1. npm install -g sms-forward
  2. copy and rename config.json.sample to config.json
  3. edit and save config.json accordingly (see Configuration section)
  4. node index.js

Configuration

config.json file shall contains the following keys/values:

| Key | Default | Description | | --- | --- | --- | | sms_target_number | N/A | The phone number to which SMSs are forwarded. This shall be prefixed with international number (e.g. +33) and MUST NOT CONTAIN ANY WHITESPACES. e.g. "+33612345678| | sms_scan_frequency | N/A | SMS forwarding scan frequency in seconds. i.e. how often messages to be forwarded shall be checked. e.g. "30" (seconds) | | huawei_modem_ip | N/A | The Huawei Modem's IP. e.g. "192.168.1.1"| | huawei_modem_login | N/A | Optional - The Huawei Modem's login. e.g. "admin". Some Huawei dongles require a login/password authentication (e.g. E355), others do not (e.g. E3372)| | huawei_modem_password | N/A | Optional - The Huawei Modem's login's password. e.g. "admin"| | messages_retention_days | N/A | Optional - Messages older than provided days will be deleted in order to free up messages space (which is limited on Huawei devices). e.g. "30" (days)| | disconnect_data | N/A | Optional - If set to true, turn off dongle connection. Usefull if dongle is solely used for SMS forwarding purposes. Under MacOS, Dongle connection is set top priority (above Ethernet/Wi-Fi), in order to prevent computer from draining Modem's data plan, set parameter to true| | macos_address_book_db_path | N/A | Optional - needed for message's originator's name resolution. Path of your MacOS AddressBook to resolve message's originator's name from phone number. You can find a list of databases by running the following command in a terminal: find ~/Library/Application\ Support/AddressBook/ -name "AddressBook-v22.abcddb" -exec ls -rtlah {} +, pick the last one in the list.| | country | N/A | Optional - needed for message's originator's name resolution. Your 2-letters ISO 3166-2 code country. e.g. "FR" for France, "GB" for United Kingdom.

Configuration sample:

{
	"sms_target_number": "+33612345678",
	"sms_scan_frequency": 30,
	"huawei_modem_ip": "192.168.1.1",
	"huawei_modem_login": "admin",
	"huawei_modem_password": "admin",
	"messages_retention_days" : 30,
	"macos_address_book_db_path": "/Users/<MY_USER>/Library/Application Support/AddressBook//Sources/DE540B1E-A3CF-4655-B1F6-6DDC0B42CD5F/AddressBook-v22.abcddb",
	"country": "FR"
}

Limitations

  1. MMS (pictures/videos attached) are not supported (only SMS are supported).
  2. Source phone number' SIM is dedicated for SMS forwarding ("stuck" into the Huawei modem, i.e. you cannot use it on another phone). This can be overcome if your telco operator offers Multi-SIM: simply order additional SIMs attached to the same phone number.
  3. Cannot directly reply to forwarded SMS as the message's originator's phone number has been replaced with the fowarding source phone number. However, forwarded SMS mentions originator's number which can be used to quickly send a message to her/him (e.g. on iPhones, simply click on phone number to send a message).
  4. Forwarded message does not mention message's originator's name but only phone number. This can be problematic to identify the sender. This can be overcome with the included optional feature which resolves originator's name with phone number from macOS Contacts App (if you happen to run the module on a Mac). Developers (help needed) may extend this feature to other Contacts repositories (e.g. Google, Outlook, etc.).

Why?

Incoming calls (voice) can easily be redirected by activating Call Forwarding. i.e. all incoming calls (voice) are systematically forwarded to another mobile. This completely covers my use case, because the transfer will happen no matter if the phone is OFF or the SIM not connected to cellular network.

SMS, however, is a different story. No telco operator (that I know of) offers a SMS Forwarding feature (the equivalent of Call Forwarding for SMS).

There are some options out there but none of them completely meets my requirements:

  • Dual SIM would the job, but iPhones (which I happen to own) do not support such feature
  • A very limited set of telco operators, such as Kyivstar offers SMS Forward feature, however both phone numbers must be contracted with the same operator.
  • For iPhone, SMS and iMessages can be forwarded using Apple Continuity feature to other iDevices, provided they are connected with the same Apple ID and they are switched ON. That implies an always powered iPhone dedicated to the sole purpose of SMS forwarding, which is something I am not happy with.
  • For Android, apps such as SMS Forwarder are supposed to the job. But I highly suspect they have the same limitation than above (source phone must be always ON). Plus I do not own an Android phone.

References

This module heavily relies on the material found in the following links: