简体   繁体   English

SMS API通信的简单要点

[英]Simple Point on SMS API Communications

I am a web developer, and I am confused. 我是一名Web开发人员,我很困惑。

Trying to make use of sprint.com's SNPP Server , snpp.messaging.sprint.com. 尝试使用sprint.com的SNPP服务器 snpp.messaging.sprint.com。

I look up SNPP in 40 different places. 我在40个不同的地方查找SNPP。 It says its simple. 它说的很简单。 It says you connect on Port 444. Simple. 它说您在端口444上连接。很简单。

Here's Sprint's super clear, authoritative 8 page document on the subject. 这是Sprint关于该主题的超清晰,权威的8页文档。

In this SO answer , David Brown explains how this is very simple and (almost) exactly how to do it. 在这个SO答案中 ,David Brown解释了这是多么简单,以及(几乎)确切地是如何做到的。

So... my only question is... how do I connect? 所以...我唯一的问题是...如何连接?

Maybe i'm being totally dumb... but can I connect via a web request to that port? 也许我完全傻了……但是我可以通过Web请求连接到该端口吗? Do I use a particular HTTP verb? 我是否使用特定的HTTP动词? Or is it some lower lever request that I have to make from my web server? 还是我必须从Web服务器上提出一些更低要求的要求?

I feel very dumb but i'm actually quite stumped. 我感觉很傻,但实际上我很沮丧。

You'll have to open a TCP socket to port 444. How to do that depends on the language you're using, for example: fsockopen in PHP, the socket module in Python or system.net.sockets.socket in .net. 您必须打开一个到端口444的TCP套接字。具体方法取决于您使用的语言,例如:PHP中的fsockopen ,Python中的socket模块或.net中的system.net.sockets.socket Then you proceed to send the lines from the response, ending each with a line feed ( \\n ). 然后,您继续发送响应中的行,并以换行符( \\n )结尾。 If you'd like, you can play with the protocol without having to program a client using Telnet in Windows or netcat in Linux/Unix. 如果愿意,您可以使用该协议,而不必在Windows中使用Telnet或在Linux / Unix中使用netcat来编程客户端。 Just run the program with server/port as arguments, depending on which you use separated by a colon ( : ), as in the original post, or a whitespace. 只是服务器/端口运行该程序的参数,这取决于您使用一个冒号分隔( : ),如在原岗位或空白。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM