Why is SMS Modem POOL 128 Better?
Custom, 128 Ports SMS Modem Pool Exporter China
128-ports SMS modem pool is a telecommunications setup designed to handle a significant volume of Short Message Service (SMS) messages concurrently.
Custom, 128 Ports SMS Modem Pool Exporter China
128-ports SMS modem pool is a telecommunications setup designed to handle a significant volume of Short Message Service (SMS) messages concurrently.
SMS Modem POOL 128 Advantages:
Concurrency:
Allows for the simultaneous processing of a substantial number of SMS messages, enhancing efficiency and reducing processing time.
Scalability:
Offers scalability to accommodate growing communication needs by expanding the number of ports or modem pools.
Bulk Processing:
Well-suited for handling bulk SMS processing requirements, making it cost-effective for businesses engaged in mass messaging.
API Integration:
Supports Application Programming Interface (API) integration, enabling seamless incorporation into existing software or systems.
Web-Based Management:
Often comes with a web-based management interface for easy configuration, monitoring, and management of the SMS modem pool.
Load Balancing:
Incorporates load balancing features to optimize the distribution of SMS traffic across the available ports, ensuring efficient utilization.
Redundancy and Reliability:
Implements redundancy and failover mechanisms to enhance reliability, ensuring continuous SMS messaging even in the event of network issues.
Flexible Deployment:
Provides flexibility in deployment for diverse applications, supporting various industries and sectors.
It's important to note that while SMS modem pools offer numerous advantages, their use should comply with local regulations, and ethical considerations should be taken into account to ensure responsible and legal use.
Building a 128/256 SIM card bank with consumer tech on ...
Building a 128/256 SIM card bank with consumer tech on the cheap
·
Follow
7 min read
·
Sep 8,
--
A SIM pool + SIM bank assembled for less than 600$ . Credit: aliexpress.comAt a point several years prior I was compelled to build an internal company solution for managing multiple SIM cards for receiving SMS codes to our marketing department. Commercial solutions run into thousands easily and a decision was made to go down the economical path. Even though such a solution may be used for sending SMS messages, our case was receiving and routing the messages to our account management platform.
The reason to publish such a document is that a lot of guesswork and reverse engineering has gone into building a working solution. As such it would be magnificent if time on behalf of others might be saved with the findings described.
Commercial vs consumer grade
The principle behind every SIM pool is the same the vendor crams as many embedded(industrial) GSM modems as possible onto a chassis along with antennae and SIM slots. A commercial vendor will add an additional transport layer for routing the incoming SMS messages to an endpoint(HTTP/Database/SMTP) for easier integration. Often times the industrial modems are Wavecom or Siemens modules that expose serial ports for running AT commands and/or voice channels. Commercial solutions pack 16/32 or more such modems in a chassis compounding to a high cost of acquisition.
Consumer grade boards include 1/2/4/8/16 modems in a chassis with only a USB connection exposing the serial ports and very little documentation.
This is a consumer grade SIM pool. Credit : aliexpress.comThe budget-friendly compromise
I did not want to settle for anything less than 128 SIM cards with a budget under $. After searching on aliexpress for a while I stumbled upon what vendors call a SIM bank. This is basically a switch with a dummy SIM card connector that you insert into your real modem slot and it extends the connection to an array of 16 physical slots. The drawback is that it is a switch, not a multiplexer. As such only 1 of the 16 slots in the SIM bank is online for a modem port at a given moment. The SIM bank exposes a serial interface via USB that lets you change the port assignments on demand. As one may guess, the documentation for this is scarce if not obscure. So the compromise is availability. One would have to iterate the slots on the SIM bank and look for activity on every slot. This is easy with a few quirks.
Software
There is a Windows application called SMSCaster that is marked compatible with the SIM pools and possibly the SIM banks. It is on a commercial license and offers a limited feature set. It provided a basic glimpse into how the pool is working but quickly got discarded as a realistic candidate for SMS management.
The wonderful world of FOSS has provided SMSTools3 SMS Server (http://smstools3.kekekasvi.com/). It is configurable and very flexible in terms of managing the modems and the message data. Linux is the platform of choice for me for hosting internal applications. In this instance Raspbian on Raspberry Pi 1 model B+. It was hosted on a RPi 3 initially which I dedicated to another project so switched to the 1 model B+.
I have included a slightly modified smstools3 version in the github.com repo for this project. As noted in the README.md, it only activates a particular alarm handler that sends a request to a backend that a SIM card is successfully checked for messages( even if no new messages have been received )
You would wanna do :
mkdir /home/socks
mkdir /run/smstools/
chown socks /run/smstoolscd /home/socks/
git clone https://github.com/sertys3/sms-receiver.git .
cd smstools3
sudo make && sudo make install
cp /home/socks/smsd.conf /etc/
Hardware
- A Raspberry Pi ( 1 model B+ in my case) with Raspbian installed
- 16-port SIM pool https://www.aliexpress.com/item/.html
- SIM bank https://www.aliexpress.com/item/.html
Drivers
The SIM pool requires a kernel driver that exposes the different modem devices properly. They otherwise show as cdc_acm / usb2serial devices, but communication is not possible.
Get your driver here:
In my case it was :
Software: Drivers Linux 3.6.x and Newer 1D September 29.9 KB
but version C as it was the latest back then. In order to build you have to :
sudo apt-get install build-essential linux-headers screen
decompress the archive, go to the decompressed path and
make && sudo make install
Hopefully that would compile your driver and install it into the modules directory.
The driver is of the CDC class and one would have to blacklist the original cdc_acm driver to make sure this one loads instead :
sudo echo blacklist cdc-acm > /etc/modprobe.d/blacklist-cdc.conf
After a reboot you will find the corresponding ttyXRUSB devices in your /dev/
root@raspberrypi:/# ls /dev/ttyXRUSB*
/dev/ttyXRUSB0 /dev/ttyXRUSB10 /dev/ttyXRUSB12 /dev/ttyXRUSB14 /dev/ttyXRUSB2 /dev/ttyXRUSB4 /dev/ttyXRUSB6 /dev/ttyXRUSB8
/dev/ttyXRUSB1 /dev/ttyXRUSB11 /dev/ttyXRUSB13 /dev/ttyXRUSB15 /dev/ttyXRUSB3 /dev/ttyXRUSB5 /dev/ttyXRUSB7 /dev/ttyXRUSB9
SIM bank switching explained
The SIM bank itself has one USB port to be connected to your host device. It shows up as :
Bus 001 Device 005: ID : Future Technology Devices International, Ltd FT232 Serial (UART) IC
Which is just a serial port exposed on /dev/ttyUSB0. It responds to custom AT commands basically AT+CWSIM to check the device status and AT+SWIT[0116]-[SLOT] to switch a port to the desired slot. I do not even remember where the documentation to that was found but certainly was not easily available.
The published pool_switch_2.pl script iterates over the ports and changes slots every 200 seconds. Keep in mind that switching is dumb and the modems do not receive a notification that the SIM card has effectively changed.
SMSTools3 configuration
[Port1]
#init = AT+CMEE=1
pre_init = no
device = /dev/ttyXRUSB0
init = AT+CPMS=SM
incoming = yes
mode = new
baudrate =
rtscts = yes
cs_convert = yes
report = yes
memory_start = 1
check_memory_method = 1
primary_memory = SM
pin = ignore
check_sim = yes
check_sim_cmd = AT+CUSD=1,*123#,15
check_sim_reset = AT+CFUN=1,1
check_sim_retries = forever
check_sim_wait = 2
device_open_retries = -1
#give_up_on_io_error = no
eventhandler = /home/socks/pool_forward_sms.pl
ignore_unexpected_input = +CME ERROR: 10
detect_unexpected_input = no
#pin =
#pinsleeptime = 2
queues = Port1
This is what port configuration looks like in the bundled smsd.conf. The smsd is spawning threads that run AT commands on the modem devices for each port at regular intervals(configured in the delaytime directive in the global section of smsd.conf [10 seconds in this case] ). Since switching is dumb on the SIM bank we need to make sure every check has a network-registered SIM card. The AT+CPMS=SM command is trying to set the Message Store to SM. But in case the SIM card is not working or freshly switched, the modem returns an error. smsd will try to reset the modem with AT+CFUN=1,1.
The smsd.conf file has a USSD command of *123# that it executes on a SIM card after re-initializing the modem with AT+CFUN=1,1 . This has proven valuable in waking up the SIM cards to receive messages upon reset. Otherwise messages are delivered often times after the 200 seconds checking interval. Put a USSD command that your carrier understands for maximum efficiency.
Putting it all together
Once everything is connected one would need to start the scripts to iterate over the ports and receive the messages. Luckily SMSTools3 is simple to configure. The provided smsd.conf file in the repository lists all 16 ports on the SIM pool yet only 8 are active in our case. If the need arises we may add another 8x16-slot SIM bank and have 256 SIM cards hosted in total.
Theres the peculiarity of installing your perl modules from CPAN for the scripts provided :
perl -MCPAN -e install Device::SerialPort
perl -MCPAN -e install LWP::UserAgent
Then its a matter of doing
/etc/init.d/sms3 start
This may or may not be created by the make install of smstools3. Otherwise start manualy with
smsd -c /etc/smsd.conf
screen /home/socks/pool_switch_2.pl
Now smstools3 should be checking enabled ports for SMS messages every 10 seconds and pool_switch_2.pl will rotate the switch slots every 200 seconds.
In case an SMS is received, it will be handled by pool_forward_sms.pl , which will send a POST request to a web server of your choice. Do not forget to change the $POST_ENDPOINT variable.
Slot fast forward
Since SMS codes are time sensitive, pool_switch_2.pl will look for /run/smstools/[PORT]_next files and switch to the contained slot number upon iteration. The mechanism to write those files in the backend was implemented in our account management platform. So a user expecting an SMS on Port 3, Slot 10 will trigger a check and a /run/smstools/3_next file will be created with string content 10. And within a maximum of 200 seconds his SMS will be pushed back to him and rendered in the interface.
A note on SIM Bank location
The current SIM card location is derived from the values in /run/smstools/ which pool_switch_2.pl updates upon switching.
root@raspberrypi:/home/pi# ls /run/smstools/
1_current 2_current 3_current 4_current 5_current 6_current 7_current 8_current
As such theres a location parameter in the POST request with a string value of [PORT]x[SLOT]. And the ingesting endpoint maps the message to the correct SIM card number based on that parameter.
The alarmhandler script
In the global section of the smsd.conf you will find
#alarmhandler = /home/socks/pool_alarm.pl
which receives all alarms from smsd and looks for a particular one indicating that a check on a SIM card has been successful. It then sends a POST request to an endpoint set in $POST_ENDPOINT in pool_alarm.pl This alarm is only available in the modified smstools3 version bundled.
Once this got deployed to a RPi 1 the script was killing the system with numerous Perl interpretator spawns. So my best man re-wrote it in Go and had it compiled. I would happily share the source to that upon request.
The directive is now commented by default as to ease up initial deployment.
Goal achieved
This is a solution that weve had in production for several years and with a total purchase price of <600$. It clearly may be deemed a success and it would be great to see it replicated. Happy SMSing!
SMS Modem POOL 128 Advantages:
Concurrency:
Allows for the simultaneous processing of a substantial number of SMS messages, enhancing efficiency and reducing processing time.
Scalability:
Offers scalability to accommodate growing communication needs by expanding the number of ports or modem pools.
Bulk Processing:
Well-suited for handling bulk SMS processing requirements, making it cost-effective for businesses engaged in mass messaging.
API Integration:
Supports Application Programming Interface (API) integration, enabling seamless incorporation into existing software or systems.
Web-Based Management:
Often comes with a web-based management interface for easy configuration, monitoring, and management of the SMS modem pool.
Load Balancing:
Incorporates load balancing features to optimize the distribution of SMS traffic across the available ports, ensuring efficient utilization.
Redundancy and Reliability:
Implements redundancy and failover mechanisms to enhance reliability, ensuring continuous SMS messaging even in the event of network issues.
Flexible Deployment:
Provides flexibility in deployment for diverse applications, supporting various industries and sectors.
It's important to note that while SMS modem pools offer numerous advantages, their use should comply with local regulations, and ethical considerations should be taken into account to ensure responsible and legal use.
Building a 128/256 SIM card bank with consumer tech on ...
Building a 128/256 SIM card bank with consumer tech on the cheap
·
Follow
7 min read
·
Sep 8,
--
A SIM pool + SIM bank assembled for less than 600$ . Credit: aliexpress.comAt a point several years prior I was compelled to build an internal company solution for managing multiple SIM cards for receiving SMS codes to our marketing department. Commercial solutions run into thousands easily and a decision was made to go down the economical path. Even though such a solution may be used for sending SMS messages, our case was receiving and routing the messages to our account management platform.
The reason to publish such a document is that a lot of guesswork and reverse engineering has gone into building a working solution. As such it would be magnificent if time on behalf of others might be saved with the findings described.
Commercial vs consumer grade
The principle behind every SIM pool is the same the vendor crams as many embedded(industrial) GSM modems as possible onto a chassis along with antennae and SIM slots. A commercial vendor will add an additional transport layer for routing the incoming SMS messages to an endpoint(HTTP/Database/SMTP) for easier integration. Often times the industrial modems are Wavecom or Siemens modules that expose serial ports for running AT commands and/or voice channels. Commercial solutions pack 16/32 or more such modems in a chassis compounding to a high cost of acquisition.
Consumer grade boards include 1/2/4/8/16 modems in a chassis with only a USB connection exposing the serial ports and very little documentation.
This is a consumer grade SIM pool. Credit : aliexpress.comThe budget-friendly compromise
I did not want to settle for anything less than 128 SIM cards with a budget under $. After searching on aliexpress for a while I stumbled upon what vendors call a SIM bank. This is basically a switch with a dummy SIM card connector that you insert into your real modem slot and it extends the connection to an array of 16 physical slots. The drawback is that it is a switch, not a multiplexer. As such only 1 of the 16 slots in the SIM bank is online for a modem port at a given moment. The SIM bank exposes a serial interface via USB that lets you change the port assignments on demand. As one may guess, the documentation for this is scarce if not obscure. So the compromise is availability. One would have to iterate the slots on the SIM bank and look for activity on every slot. This is easy with a few quirks.
Software
There is a Windows application called SMSCaster that is marked compatible with the SIM pools and possibly the SIM banks. It is on a commercial license and offers a limited feature set. It provided a basic glimpse into how the pool is working but quickly got discarded as a realistic candidate for SMS management.
The wonderful world of FOSS has provided SMSTools3 SMS Server (http://smstools3.kekekasvi.com/). It is configurable and very flexible in terms of managing the modems and the message data. Linux is the platform of choice for me for hosting internal applications. In this instance Raspbian on Raspberry Pi 1 model B+. It was hosted on a RPi 3 initially which I dedicated to another project so switched to the 1 model B+.
I have included a slightly modified smstools3 version in the github.com repo for this project. As noted in the README.md, it only activates a particular alarm handler that sends a request to a backend that a SIM card is successfully checked for messages( even if no new messages have been received )
You would wanna do :
mkdir /home/socks
mkdir /run/smstools/
chown socks /run/smstoolscd /home/socks/
Contact us to discuss your requirements of fxo gateway asterisk. Our experienced sales team can help you identify the options that best suit your needs.
git clone https://github.com/sertys3/sms-receiver.git .
cd smstools3
sudo make && sudo make install
cp /home/socks/smsd.conf /etc/
Hardware
- A Raspberry Pi ( 1 model B+ in my case) with Raspbian installed
- 16-port SIM pool https://www.aliexpress.com/item/.html
- SIM bank https://www.aliexpress.com/item/.html
Drivers
The SIM pool requires a kernel driver that exposes the different modem devices properly. They otherwise show as cdc_acm / usb2serial devices, but communication is not possible.
Get your driver here:
In my case it was :
Software: Drivers Linux 3.6.x and Newer 1D September 29.9 KB
but version C as it was the latest back then. In order to build you have to :
sudo apt-get install build-essential linux-headers screen
decompress the archive, go to the decompressed path and
make && sudo make install
Hopefully that would compile your driver and install it into the modules directory.
The driver is of the CDC class and one would have to blacklist the original cdc_acm driver to make sure this one loads instead :
sudo echo blacklist cdc-acm > /etc/modprobe.d/blacklist-cdc.conf
After a reboot you will find the corresponding ttyXRUSB devices in your /dev/
root@raspberrypi:/# ls /dev/ttyXRUSB*
/dev/ttyXRUSB0 /dev/ttyXRUSB10 /dev/ttyXRUSB12 /dev/ttyXRUSB14 /dev/ttyXRUSB2 /dev/ttyXRUSB4 /dev/ttyXRUSB6 /dev/ttyXRUSB8
/dev/ttyXRUSB1 /dev/ttyXRUSB11 /dev/ttyXRUSB13 /dev/ttyXRUSB15 /dev/ttyXRUSB3 /dev/ttyXRUSB5 /dev/ttyXRUSB7 /dev/ttyXRUSB9
SIM bank switching explained
The SIM bank itself has one USB port to be connected to your host device. It shows up as :
Bus 001 Device 005: ID : Future Technology Devices International, Ltd FT232 Serial (UART) IC
Which is just a serial port exposed on /dev/ttyUSB0. It responds to custom AT commands basically AT+CWSIM to check the device status and AT+SWIT[0116]-[SLOT] to switch a port to the desired slot. I do not even remember where the documentation to that was found but certainly was not easily available.
The published pool_switch_2.pl script iterates over the ports and changes slots every 200 seconds. Keep in mind that switching is dumb and the modems do not receive a notification that the SIM card has effectively changed.
SMSTools3 configuration
[Port1]
#init = AT+CMEE=1
pre_init = no
device = /dev/ttyXRUSB0
init = AT+CPMS=SM
incoming = yes
mode = new
baudrate =
rtscts = yes
cs_convert = yes
report = yes
memory_start = 1
check_memory_method = 1
primary_memory = SM
pin = ignore
check_sim = yes
check_sim_cmd = AT+CUSD=1,*123#,15
check_sim_reset = AT+CFUN=1,1
check_sim_retries = forever
check_sim_wait = 2
device_open_retries = -1
#give_up_on_io_error = no
eventhandler = /home/socks/pool_forward_sms.pl
ignore_unexpected_input = +CME ERROR: 10
detect_unexpected_input = no
#pin =
#pinsleeptime = 2
queues = Port1
This is what port configuration looks like in the bundled smsd.conf. The smsd is spawning threads that run AT commands on the modem devices for each port at regular intervals(configured in the delaytime directive in the global section of smsd.conf [10 seconds in this case] ). Since switching is dumb on the SIM bank we need to make sure every check has a network-registered SIM card. The AT+CPMS=SM command is trying to set the Message Store to SM. But in case the SIM card is not working or freshly switched, the modem returns an error. smsd will try to reset the modem with AT+CFUN=1,1.
The smsd.conf file has a USSD command of *123# that it executes on a SIM card after re-initializing the modem with AT+CFUN=1,1 . This has proven valuable in waking up the SIM cards to receive messages upon reset. Otherwise messages are delivered often times after the 200 seconds checking interval. Put a USSD command that your carrier understands for maximum efficiency.
Putting it all together
Once everything is connected one would need to start the scripts to iterate over the ports and receive the messages. Luckily SMSTools3 is simple to configure. The provided smsd.conf file in the repository lists all 16 ports on the SIM pool yet only 8 are active in our case. If the need arises we may add another 8x16-slot SIM bank and have 256 SIM cards hosted in total.
Theres the peculiarity of installing your perl modules from CPAN for the scripts provided :
perl -MCPAN -e install Device::SerialPort
perl -MCPAN -e install LWP::UserAgent
Then its a matter of doing
/etc/init.d/sms3 start
This may or may not be created by the make install of smstools3. Otherwise start manualy with
smsd -c /etc/smsd.conf
screen /home/socks/pool_switch_2.pl
Now smstools3 should be checking enabled ports for SMS messages every 10 seconds and pool_switch_2.pl will rotate the switch slots every 200 seconds.
In case an SMS is received, it will be handled by pool_forward_sms.pl , which will send a POST request to a web server of your choice. Do not forget to change the $POST_ENDPOINT variable.
Slot fast forward
Since SMS codes are time sensitive, pool_switch_2.pl will look for /run/smstools/[PORT]_next files and switch to the contained slot number upon iteration. The mechanism to write those files in the backend was implemented in our account management platform. So a user expecting an SMS on Port 3, Slot 10 will trigger a check and a /run/smstools/3_next file will be created with string content 10. And within a maximum of 200 seconds his SMS will be pushed back to him and rendered in the interface.
A note on SIM Bank location
The current SIM card location is derived from the values in /run/smstools/ which pool_switch_2.pl updates upon switching.
root@raspberrypi:/home/pi# ls /run/smstools/
1_current 2_current 3_current 4_current 5_current 6_current 7_current 8_current
As such theres a location parameter in the POST request with a string value of [PORT]x[SLOT]. And the ingesting endpoint maps the message to the correct SIM card number based on that parameter.
The alarmhandler script
In the global section of the smsd.conf you will find
#alarmhandler = /home/socks/pool_alarm.pl
which receives all alarms from smsd and looks for a particular one indicating that a check on a SIM card has been successful. It then sends a POST request to an endpoint set in $POST_ENDPOINT in pool_alarm.pl This alarm is only available in the modified smstools3 version bundled.
Once this got deployed to a RPi 1 the script was killing the system with numerous Perl interpretator spawns. So my best man re-wrote it in Go and had it compiled. I would happily share the source to that upon request.
The directive is now commented by default as to ease up initial deployment.
Goal achieved
This is a solution that weve had in production for several years and with a total purchase price of <600$. It clearly may be deemed a success and it would be great to see it replicated. Happy SMSing!
If you want to learn more, please visit our website 8 port gsm.
- Previous: What is a VoIP Gateway and How Does it Work?
- Next: None
- 0