Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1890308
  • 博文数量: 606
  • 博客积分: 9991
  • 博客等级: 中将
  • 技术积分: 5725
  • 用 户 组: 普通用户
  • 注册时间: 2008-07-17 19:07
文章分类

全部博文(606)

文章存档

2011年(10)

2010年(67)

2009年(155)

2008年(386)

分类:

2009-04-23 18:29:09

问题:
    使用cmpp发送信息到客户端手机时,客户端回复该短信时,在服务器端可以获取到客户端手机号码等信息,但不能辨别出客户端具体回复的是哪一条信息
 
解决方法:
    通常发短信的方法,其中
    CMPPSubmitMessage submitMsg = new CMPPSubmitMessage(pk_Total,
      pk_Number, registered_Delivery, msg_Level, service_Id,
      fee_UserType, fee_Terminal_Id, tp_Pid, tp_Udhi, msg_Fmt,
      msg_Src, fee_Type, fee_Code, valid_Time, at_Time,
      src_Terminal_Id, dest_Terminal_Id, msg_Content, reserve);
  src_Terminal_Id:SP的服务代码或前缀, 为服务代码的长号码,网关将该号码完整的填到
                SMPP协议相应的destination_address字段,该号码最终在用户手机
                上显示为短消息的主叫号
服务端可以获取到客户端回复短信时的src_Terminal_Id;在src_Terminal_Id字段添加一个唯一的值,
那么,在用户手机上显示的主叫号就是Terminal+某一唯一值;当用户回复信息时,会把该号码发送到服务器到,这样,服务器端就能知道具体的回复信息对应哪一条发送信息。
具体做法:
// 用户手机上显示为短消息的主叫号码
  // src_Terminal_Id=src_Terminal_Id+"001";
  // 初始化提交信息
  CMPPSubmitMessage submitMsg = new CMPPSubmitMessage(pk_Total,
    pk_Number, registered_Delivery, msg_Level, service_Id,
    fee_UserType, fee_Terminal_Id, tp_Pid, tp_Udhi, msg_Fmt,
    msg_Src, fee_Type, fee_Code, valid_Time, at_Time,
    src_Terminal_Id + src_Ter_suf, dest_Terminal_Id, msg_Content, reserve);
..................
阅读(2093) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~