为什么要这样做?这是一个过于复杂的过程,并且有可用的 MMSC 网关是有原因的。您只使用 GPRS 部分来建立 PPP 连接,然后其余的事情通过 IP 发生。
我强烈建议您为此使用网关,并且不要手动执行此操作。
为了建立PPP连接:
-
AT+CGDCONT? 这应该以您所在的上下文响应。这意味着您已准备好附加/连接。
-
AT+CGATT=1(连接你的调制解调器)
-
AT+CGDATA=?(查看什么是数据模式)
-
AT+CGACT=1(激活你的连接)
现在您使用的是 PPP,然后您可以使用您的提供商使用的任何方式通过调制解调器进行通话。它可以是从直接 HTTP 到 MMSE 协议的任何内容。
例如,这里是一个完整的 HTTP 脚本。首先,我们需要设置调制解调器和连接信息。所有这些命令都应该从调制解调器得到OK 的响应。
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
接下来,我们准备消息:
> 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
这当然是特定于我使用的调制解调器的。您的结果可能会有所不同。我可以告诉你,这是徒劳的练习。如果您想实际发送彩信,请选择合适的提供商。