-->

Build an own SMS Gateway [closed]

2020-05-14 08:04发布

问题:

We run a remote system and would like the servers to be able to alert us to their status via SMS. Is it possible to setup our own SMS gateway (or our own GSM network) so we DO NOT have to pay for an SMS provider?

Is this possible? if so, please let us know what are the required hardwares and how we get started..

I'm sure this is possible, because when the operator A want to send an SMS to the operator B, it do not pay any cent to the operator B. also, there are ton of online services like: Atompark.com, clickatell, ...etc

please Note: we know how to build an sms gateway using Linux system, a Modem GSM and a valid SIM, but we are looking a way that we do not have to pay any cent for sending sms messages...

回答1:

Here's How It Works

You >>> Forwarding Aggregator >>> SMS Aggregator >>> Mobile Operator >>> Mobile Company >>> Your Customer

3 Major Parties Are Involved in the Whole Process:

1. Mobile Operators: They Manage SMSC (Short Message Service Centers). AT&T, Sprint/NEXTEL, T-Mobile USA, U.S.Cellular and Verizon Wireless are few of the major mobile operators in the whole world. They have deep connections with all major mobile phone companies. Most of them have 800 to 950 telecommunication/mobile companies in their pannel. All of your messages came to them via SMS Aggregators and they forward them to reciever's Mobile Company which send it to receiver in the end.

Cost of becoming a Mobile Operator: Billion Dollar Business if not Trillion.

2. SMS Aggregators: mBlox, air2web and motricity are few of them. They have deep connections with Mobile operators.

Cost of becoming SMS Aggregator: in Millions

3. Forwarding Aggregators/SMS Gateways: Clickatell, Twilio and esendex and few others are providing SMS Gateway APIs and most of the developers are using Clickatell to integrate its SMS API with their app. They charge different rates for different countries (NO FIXED RATE FOR ALL COUNTRIES). It would cost you rougly around $600-$700 for 100,000 messages (internationally).

Cost of becoming Forwarding Aggregator: May be in Millions

Bottom Line: I'm working on a FREE solution but till today there are no FREE reliable solution in the whole world to send Bulk Messages for FREE internationally. So stop wasting your time on searching for a FREE solution. You have to come up with a new technology in order to achive this.

Though there are many options to send Bulk messages within your country for FREE or by spending little money but you simply can't achieve this if you're planning to send messages internationally.

Usually I avoid adding comments in any forum but this man really forced me to put my legs in. Here's what he commented: "Can we own an SMSC with a small private GSM network?"



回答2:

You can use a raspberry pi or Orange pi with a Dongle.Then we can use AT commands.

We can connect the dongle and check whether It is connecting as a right mode using this command.

sudo lsusb 

Then we can use python code execute AT commands..

sending sms we can use this code

def sendsms(number,text):
    ser.flushInput()
    ser.flushOutput()
    ser.write('AT+CMGF=1\r\n')
    sleep(1)
    ser.write('AT+CMGS="%s"\r\n' % number)
    sleep(1)
    ser.write('%s' % text)
    sleep(1)
    ser.write(ascii.ctrl('z'))
    sleep(1)
    ser.flushInput()
    ser.flushOutput()
    print "Text: %s  \nhas been sent to: %s" %(text,number)

read unread sms

def read_unread_sms():
ser.write('AT+CMGF=1\r\n')
sleep(2)
ser.write('AT+CMGL="ALL"\r\n')
sleep(5)
a = ser.readlines()
z=[]
y=[]
for x in a:
    if x.startswith('+CMGL:'):
        r=a.index(x)
        t=r+1
        z.append(r)
        z.append(t)
for x in z:
    y.append(a[x])
##Following line changed modem back to PDU mode
ser.write('AT+CMGF=0\r\n')
return y 

we can use "logger" for if you want create a logger file for the sms gateway.If you want to send the unread message to api, we can use "request" module for that.



回答3:

Aside from any operator provided email-to-sms system there is no "free" way to do this.

A want to send an SMS to the operator B, it do not pay any cent to the operator B

This is balanced by the fact that B will not pay A for messages going in the other direction. Internationally they often do pay SMS interconnect fees.

... setup our own SMS gateway

Yes, but you need access to an SMSC on a GSM network to send the messages either directly or via a device with a SIM, thats what you pay for.

or our own GSM network

Not practically, no.



回答4:

While there are no free ways to send proper text messages, you might be better off buying an GSM module for a server (usb in racks would not be ideal, but there should be proper hw expansion buses). You would query the module itself rather then relying on a 3rd party middle server to send those messages, saving a notable portion of money.

Though I have not realized this per se, I created this plan for sending text messages for a service of mine. It was by far the cheapest option.