2014-01-13 21 views
1

如何在使用SMSLib(JSMPPGateway)連接到SMPP服務器時指定「編號計劃指示符」。在SMSLib中指定「編號計劃指示符」JSMPPGateway

這是我目前JSMPPGateway初始化:

gateway = new JSMPPGateway(systemId, ip, port, new BindAttributes(username, password, "smpp_1", BindType.TRANSCEIVER)); 

的問題是,我無法連接到網關:

IOException: java.io.IOException: 
Receive negative bind response: Negative response 0000000f found 

我的提供商(SMPP服務器的所有者)告訴我沒有使用正確的編號計劃指示器。 如何設置該參數?

回答

1
Set the values of NPI,TON values specified by SMSC in Address params. 

例:

網關=新JSMPPGateway(的systenId,IP,端口,新BindAttributes(用戶名,密碼, 「smpp_1」,BindType.TRANSCEIVER,新的地址(Address.TypeOfNumber.INTERNATIONAL,地址.NumberingPlanIndicator.NATIONAL)));

+0

哪裏有報價?因爲我的JSMPPConstructor不會接受第四個參數,BindAttributes – sports

+0

Thanks !,也沒有這樣做:gateway.setSourceAddress(new Address(TypeOfNumber.UNKNOWN,NumberingPlanIndicator.ISDN)); – sports