选择显示字体大小

sms开发-使用at指令

15:39:05 rx:
ok

15:39:07 tx:at+cmgl=0
15:39:07 rx:at+cmgl=0
15:39:07 rx:
+cmgl: 5,0,,52

15:39:07
rx:07914408020033f40407d0b1582c0600000030525183920028d43708
2e7fd3cb633a888e2e83ee6f399b0c32cbdf6d10b96c0fcfe9617afaed76b95c
15:39:07 rx:
ok

使用工具对上述收到的sms进行解码后,可得到如下的解释:

iei: 00
length: 00
message ref: 00
status: 00
sc address length: 07
sc address type: 91
type of number: international
numbering plan identifier: e.164
sc address: 44802000334
message type indicator: 04
message type: sms-deliver / sms-deliver report
more messages to send: no
status report indication: no
reply path: no
originating address length: 07
originating address type: d0
type of number: alphanumeric
numbering plan identifier: unknown
originating address: 1b85c260
decoded: 1111
protocol identifier: default
data coding scheme: gsm default alphabet
sc timestamp: 00305251839200
decoded: 00/03/25 15:38:29
time zone: gmt+0.00h
user data length: 28
decimal: 40
message: to protect the world from devastation

于是我们知道这条sms消息的第一部分是:07914408020033f4

07是跟在服务中心地址内的字节数;
91是ton/npi。ton/npi遵守international/e.164标准,指在号码前需加‘+’号;此外还可有其他数值,但91最常用到。
44080200033f4是所使用的服务中心地址,由于位置上略有处理,实际号码应为:
44802000334f(字母f意指长度减1),这就是服务中心的准确地址(号码)。

下一单元是: 04
这是文件头字节(header byte, 是一种bitmask)。将每个字节设为1时,有如下含义:

10000000
回复路径(reply path):移动电话可循发送sms消息的短消息中心进行回复(但并非所有smsc都会这样设置)。

01000000
tp-udh - 带有用户数据文件头。

00100000
tp-status-report-indication - 发送状态报告给发信人,表示消息收到。

00010000
00001000
此两类在正常的移动终接短消息(mt,mobile terminated sms)中不会使用。

00000100
tp-more messages to send - smsc内再无新消息发送给该移动电话。

00000010
00000001
最后两个位数表示消息种类 - 10指是移动终接短消息(mt),01指移动起始短消息(mo,mobile originated sms)。

所以"04"指此条消息是正常的移动终接短消息,smsc内再无新消息发送给该手机。


 


关键字 本文所属关键字

相关 与本文相关文章

分类 所有文章关键字导航

源码编程相关

Java   Asp   PHP   .Net   XML   C/C++   CGI   VB   Jsp   J2ee   J2se   J2me   EJB   Servlet   Tomcat   Resin   Struts   Weblogic   Eclipse   ANT   GUI   JMS   Web servise   IDEA   Webphere   Hibernate   Spring   Jboss   Applet   Swing   Socket   Javamail   Perl   Ajax   P2P   安全   模式   框架   测试   开源   游戏

SQL数据库相关

My-SQL   Ms-SQL   Access   DB2   Oracle   Sybase   SQLserver   索引   存储过程   加密   数据库   分页   视图  

手机无线相关

3G   Wap   CDMA   GRPS   GSM   IVR   彩信   短信   无线   增值业务

网页设计制作相关

HTML   CSS   网页配色   网页特效   Javascript   VBscript   Dreamweaver   Frontpage   JS   Web   网站设计

网站建设推广相关

建站经验   网站优化   网站排名   推广   Alexa

操作系统/服务器相关

Windows XP   Windows 2000   Windows 2003   Windows Me   Windows 9.x   Linux   UNIX   注册表   操作系统   服务器   应用服务器

图形图像多媒体相关

Photoshop   Fireworks   Flash   Coreldraw   Illustrator   Freehand   Photoimpact   多媒体   图形图像

标准 网站致力的规范

Valid CSS!

无不良内容,无不良广告,无恶意代码

Valid XHTML 1.0 Transitional

creativecommons