【问题标题】:CloudHopper Server sending MO to connected clientCloudHopper 服务器向连接的客户端发送 MO
【发布时间】:2014-06-18 15:54:40
【问题描述】:

我有一个项目,我们正在使用 ArdanStudios smppclient 连接到 SMPPServer。我们可以将消息发送到 SMPP 服务器,然后将它们传递到手机。当手机回复或发送到简码时,我们会收到收到的消息事件,但消息文本是空白的。

我们在内部使用 CloudHopper 来模拟 SMPP 服务器,我想确认我们在接收消息时没有问题,但我想不出一种方法来模拟从发送的 MO(移动发起)消息Cloudhopper 服务器连接到我们连接的 ArdanClient。有什么想法吗?

【问题讨论】:

    标签: java smpp


    【解决方案1】:

    一位朋友有两个问题。我建议你分手。对于第一个,基本上你必须覆盖类 DefaultSmppSessionHandler 的 firePduRequestReceived 方法:

      @Override
    public PduResponse firePduRequestReceived(PduRequest pduRequest) {
    
        PduResponse response = pduRequest.createResponse();
    
        if (pduRequest.getCommandId() == SmppConstants.CMD_ID_DELIVER_SM) {
           processMO(pduRequest);
        }        
        return response;
    }
    
    private void processsMO(PduRequest request){
        DeliverSm mo = (DeliverSm) request;
        int length = mo.getShortMessageLength();
        Address sourceAddr = mo.getSourceAddress();
        Address destAddr = mo.getDestAddress();
        byte[] shortMessage = mo.getShortMessage();
        String sms= new String(shortMessage);
    
        //Do Something....
    
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-09-29
      • 2011-11-28
      • 1970-01-01
      相关资源
      最近更新 更多