问题
I am trying to build a system in which I have terminal nodes capable of sending/receiving SMS messages over a GSM network. I now need to construct a server solution which would send SMS messages acting as a gateway between a webserver holding my business logic and the clients (nodes). The communication is both ways. I've read something about complete SMS server solutions (that act as a GSM gateway, possibly), but they turn out to be too expensive. I've thought about attaching a mobile phone to my server (and then using some APIs), but it may be that my server will go to a data-center whereby I cannot attach anything in this way. I do not expect to have too many messages (like 100 per day/both ways). And I do not plan to have too many clients too (less than 100). Here I'm asking for a general system solution (e.g. best practice).
回答1:
There are three basic alternatives for building such an SMS server:
1) Attach mobile phones or USB GSM sticks to the server and use these for SMS communicaton. Limitations are
Limited volumes (however your 100 SMS/day should be fine).
Possibly rather unreliable due to consumer hardware (e.g. phone/stick firmware is not built for 24x7 operation, you may need to reset devices regularly; most mobile phones require a battery in order to function, batteries wear out).
Possibly not placable in data centers, due to RF rules and mobile network coverage.
Mobile number scheme limited to SIM MSISDN.
2) Connect the SMS to a network operators SMS gateway. Network operators use these exactly for this scenario: bulk SMS communication. These are proprietary and usually talk an "easier" to digest message transport protocol. Limitations:
You are bound to the network operator, connection-wise and protocol-wise.
Possibly delays in communication since the gateway might do store-and-forward.
Depending on pricing scheme might make sense only for high volumes.
3) Connect the SMS server to the mobile operators SS7 network, adding it as a network element. Limitations:
Complex implementation. Requires dedicated hardware (an SS7 interface card) and drivers to be programmed.
Requires non-trivial network integration with network operator including extensive testing.
Requires an E1/T1 line (or bigger, or SIGTRAN) for connection this is typically a data center thing, but not available in every data center.
Expensive, in terms of pricing scheme and operation.
Assuming I understand your requirements, for your case I would go for option 1) and place the SMS server where it has good coverage, i.e. not necessarily in the data center. Sell it as a head-end for the server infrastructure. If putting it in the data center is a must, then go to option 2) and check out your mobile network operators SMS wholesale offerings.
回答2:
I use smstools package in Linux to receive, parse SMS messages. In the configuration file, you point to an external script which receives 2 arguments (e.g. RECEIVED path-to-sms-file). I parse the SMSs using perl. Other option is Alamo SMS gateway, but I had many issues with it.
来源:https://stackoverflow.com/questions/5056903/what-are-the-best-practices-for-building-an-sms-server