通过 SMPP 发送短信
如何通过 SMPP 直接发送短信?我的提供商提供了 SMPP 接口来发送短信,我如何连接到它?是否有任何库或示例可以指导我如何使用 SMPP 发送?也许使用 PHP?还是C#?
How do I send SMS directly via SMPP? My provider provides an SMPP interface to send SMS, how do I connect it to it? Are there any libraries or examples that can educate me on using SMPP to send? Perhaps using PHP? or C#?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
我建议 SMPP 使用 Kannel,但有几个问题。
谁是您的聚合器?他们应该为此提供一些帮助。
我知道 OpenMarket 使用多种 SDK 语言支持 SMPP 和 HTTP
I would suggest Kannel for SMPP but a couple of questions.
Who is your Aggregator? They should offer some assistance for this.
I know OpenMarket does SMPP as well as HTTP with a multiple SDK languages
Devshock 组件很酷...我猜他们在某个时候发布了源代码?
我相信我仍然拥有那个。
但编写自己的 smpp 库并不难...
SMPP 3.4 规范相当简单。
您基本上要做三件事:
高效
Ola,如果您仍然需要,可以给我发邮件。
干杯。
编辑
一些提供商,例如我使用的提供商(高科技信息系统)还为您提供一个 http 网关,您可以通过该网关发布您的流量。
您可能会寻求将其作为 SMPP 的替代方案。
我见过的 SMPP 的一个缺点是网络连接不稳定,导致频繁断开连接。
HTTP 网关选项不会受到此影响,而且速度也一样快。
Devshock component was cool... they released the source i guess at some point?
I believe i still have that.
but writing your own smpp lib is not that hard...
SMPP 3.4 spec is fairly straight forward.
You are basically doing 3 things:
efficient
Ola, you can drop me a mail if you still need this.
Cheers.
EDIT
Some Provider, like the one i use (High Tech InfoSystems) also provide you a http gateway through which you may post your traffic
You may seek that as an alternative to SMPP.
One downside i have seen experienced with SMPP, is frequent disconnects is your Network connection is shaky.
The HTTP gateway options does not suffer from this and is just as fast too.
下面是在 C# 中使用 smpp 协议的简单示例代码。
顺便说一句,ardan studio dll 在数据编码和解码方面存在一些问题。
TON 和 NP? 在 ardan studio dll 中是静态的,所以我们更改了它,然后使用了这段代码,否则它可以工作,但你不能使用不同的字符集。
Here is the simple example code using smpp protocol in C#.
By the way ardan studio dll has some issue about data encoding and decoding.
TON and NPİ is given static in ardan studio dll so we changed it then we used this code otherwise it works but you can't use different char set.
我使用 Kannel 进行 SMPP,将 kannel 连接到 smpp 服务器: 链接。
这是我的 kannel.conf:
发送短信:
I use a Kannel for SMPP, connect kannel to a smpp server: link.
This is my kannel.conf:
Send SMS:
如果您熟悉Perl,则可以使用Net::SMPP或 Jasmin(内置于 Python)。这些都经过了相当多的测试和使用。
You can use Net::SMPP if you are familiar with Perl or Jasmin (built in Python). Those are pretty tested and used.
有一个用 Java 编写的 Logica SMPP 项目,可以帮助您了解这一问题。除此之外,SMPP 维基百科页面上有一个项目列表,可以达到类似的目的。
There's the Logica SMPP project, written in Java, that could educate you on the matter. Other than that, there's a list of projects on the SMPP Wikipedia page that could fill a similar purpose.
我已经使用 DevShock 的客户端库几年了,但该公司似乎已经从我的视野中消失了。
谷歌很快就找到了这个:
http://www.inetlab.ru /Products/ALT.SMS.SmppClient.aspx。
看起来很简单,并且附带了 C# 和 VB.Net 示例以及一些不错的文档。
希望有帮助。
I've used a client library from DevShock for a few years, but the company seems to have disappeared from view.
A quick Google turned up this one though:
http://www.inetlab.ru/Products/ALT.SMS.SmppClient.aspx.
Seems straightforward enough, and comes with both C# and VB.Net examples as well as some decent documentation.
Hope that helps.
我认为最好的选择是 jsmpp lib。它有很好的例子,许多低级的事情发生在幕后,你可以专注于你的业务逻辑。
jsmpp 主网站
I think that the best choise is jsmpp lib. It have good examples and many low level thing happen behind the scenes and you can focus on your business logic.
jsmpp home site