簡體   English   中英

Android 設備無法接收來自 SMPPGW 的消息

[英]Android Device cannot receive message from SMPPGW

我已經實現了一個使用 Cloud Hopper 發送短信的功能。

public static SubmitSmResp sendShortMessage(String sourceAddress, byte[] textBytes, String destinationAddress) {
    SubmitSmResp submitResponse = null;
    try {

        // set encoding for sending SMS
        submit.setDataCoding(SmppConstants.DATA_CODING_JIS);

        submit.setShortMessage(textBytes);
        submit.setSourceAddress(new Address((byte) 0x05, (byte) 0x01, sourceAddress));
        submit.setDestAddress(new Address((byte) 0x01, (byte) 0x01, destinationAddress));

        // submit message to SMSC for delivery with a timeout of 10000ms
        submitResponse = session.submit(submit, 10000);
        if (submitResponse.getCommandStatus() == SmppConstants.STATUS_OK) {
            System.out.println("SMS submitted, message id {}" + submitResponse.getMessageId());
        } else {
            throw new IllegalStateException(submitResponse.getResultMessage());
        }
    } catch (RecoverablePduException | UnrecoverablePduException | SmppTimeoutException |
            SmppChannelException | InterruptedException e) {
        throw new IllegalStateException(e);
    } catch (Exception e) {
        e.printStackTrace();
    }
    return submitResponse;
}

但是當我將我的 sim 卡插入 ios 設備時,我可以收到來自 smppgw 的消息。 然后我將我的 sim 卡插入 android 設備,submitResponse.getCommandStatus() == SmppConstants.STATUS_OK 是 TRUE,但我無法接收我的短信。 最后,我將我的 sim 卡插回我的 ios 設備,當我從 android 設備發送時收到消息。 有誰知道如何解決這個問題?

這聽起來不像是 SMPP 客戶端問題。 我的意思是,只要您在發送 submit_sm 時收到狀態為 OK 的 submit_sm_resp,就意味着該消息已被 SMSC/SMPPGW 接受。 聽起來更像是 SMSC 問題或終端問題,因為問題在於從 SMSC 到終端的交付。

一個簡單的解釋可能是 Android 終端有一些問題/缺少信號/未注冊到網絡,這就是 SMSC 不發送短信的原因。 更換終端后,sim就在線,SMSC發送之前的短信

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM