如何通过连接到Linux计算机的GSM/GPRS调制解调器发送MMS? [英] How can I send an MMS via a GSM/GPRS modem connected to a linux computer?
问题描述
我有一个目录,其中包含50个小于300kb的图像文件(.jpg).此文件应作为MMS附加,并使用GSM/GPRS调制解调器从Linux计算机发送.我需要弄清楚如何打包MMS并能够将其发送到Linux计算机上的手机或电子邮件.另外请注意,我希望能够使用GSM/GPRS调制解调器发送MMS消息,而不是通过clickatell或其他一些Web服务发送消息.我也不想使用功能强大的MMSC网关,例如NowSMS(无论如何都是Windows)或MBuni.请帮助我找到可以通过命令行使用的任何Linux工具/任何编译源代码/任何易于使用的方法.
I have a directory which contain say 50 image files (.jpg) each less than 300kb. This files should be attached as MMS and send from Linux computer using GSM/GPRS modem. I need to work out how to package a MMS and able to send it to a mobile phone or email from linux computer. Also please note that I want to be able to send the MMS message using my GSM/GPRS modem - NOT via clickatell or some other web service. I also do NOT want to be using a full blown MMSC gateway such as NowSMS (which is windows anyway) or MBuni. Please help me to find any Linux tool which can be worked through command line / any compile source code / any method which is easy to use.
预先感谢您的专业知识
推荐答案
为什么要这样做?这是一个过于复杂的过程,并且存在MMSC网关可用的原因.您只需要使用GPRS部分来建立PPP连接,然后其余的事情就会通过IP发生.
Why do you want to do this? Its an overly complicated process and there is a reason there are MMSC gateways available. You only use the GPRS part to establish a PPP connection, then the rest of the stuff happens over IP.
我强烈建议,您为此使用网关,并且不要手动执行此操作.
I strongly suggest you use a gateway for this, and don't do this manually.
为了建立PPP连接:
-
AT+CGDCONT?
这应该以您所处的上下文为响应.这意味着您已经准备好连接/连接. -
AT+CGATT=1
(连接调制解调器) -
AT+CGDATA=?
(检查什么是数据模式) -
AT+CGACT=1
(激活您的连接)
AT+CGDCONT?
This should respond with the context you are on. This means you are ready to attach/connect.AT+CGATT=1
(attach your modem)AT+CGDATA=?
(check what is the data mode)AT+CGACT=1
(activate your connection)
现在您使用的是PPP,然后您可以使用提供商使用的任何设备通过调制解调器进行通话.从直接HTTP到MMSE协议,什么都可以.
Now you are on PPP, and then you talk over the modem using whatever your provider is using. It could be anything from direct HTTP to MMSE protocol.
例如,这是一个完整的HTTP抄本.首先,我们需要设置调制解调器和连接信息.所有这些命令应从调制解调器获得OK
的响应.
For example, here is a complete transcript over HTTP. First, we need to setup the modem and connection information. All these commands should get a response of OK
from the modem.
AT+CMMSINIT # Initialize the MMS method
AT+CMMSCURL="some.url.com" # the MMS center URL
AT+CMMSCID=1 # Set bearer
AT+CMMSPROTO="1.1.1.1",8080 # MMS Proxy information
AT+SAPBR=3,1,"Contype","GPRS" # How you are sending
AT+SAPBR=3,1,"APN","foobar" # Set the APN
AT+SAPBR=1,1 # Activate the bearer context
接下来,我们准备消息:
Next, we prepare the message:
> AT+CMMSEDIT=1 # Enter edit mode
OK
> AT+CMMSDOWN="PIC",54321,30000 # Download a pic that is 54321 bytes
# and set the latency
# for the download to 30000 ms
CONNECT # This means, ready to receive data
# so send your file
OK # Data received
> AT+CMMSRECP="123456789" # Set the recipient
OK
> AT+CMMSVIEW # View your message
(your message)
OK
> AT+CMMSSEND # Send the message
OK # Message sent
> AT+CMMSEDIT=0 # Exit edit mode, and clear the buffer
OK
这当然是我所使用的调制解调器专用的.您的结果可能会有所不同.我可以告诉你,这是徒劳的.如果您想实际发送彩信,请选择适当的提供商.
This of course, is specific to the modem that I was using. Your results may vary. I can tell you that this is an exercise in futility. Go with a proper provider if you want to actually send MMS messages.
这篇关于如何通过连接到Linux计算机的GSM/GPRS调制解调器发送MMS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!