use of com.zx.sms.connect.manager.ServerEndpoint in project SMSGate by Lihuanghe.
the class SGIPSessionConnectedHandler method createTestReq.
@Override
protected BaseMessage createTestReq(String content) {
final SgipEndpointEntity finalentity = (SgipEndpointEntity) getEndpointEntity();
String sms = "【费用提醒】尊敬的客户,截止2018年2月1日17时";
if (finalentity instanceof ServerEndpoint) {
SgipDeliverRequestMessage sgipmsg = new SgipDeliverRequestMessage();
sgipmsg.setUsernumber("13800138000");
sgipmsg.setSpnumber("10086");
sgipmsg.setMsgContent(sms);
return sgipmsg;
} else {
SgipSubmitRequestMessage requestMessage = new SgipSubmitRequestMessage();
requestMessage.setSpnumber("10086");
requestMessage.setUsernumber("13800138000");
requestMessage.setMsgContent(sms);
requestMessage.setReportflag((short) 0);
return requestMessage;
}
}
use of com.zx.sms.connect.manager.ServerEndpoint in project SMSGate by Lihuanghe.
the class SMGPSessionConnectedHandler method createTestReq.
@Override
protected BaseMessage createTestReq(String content) {
final EndpointEntity finalentity = getEndpointEntity();
if (finalentity instanceof ServerEndpoint) {
SMGPDeliverMessage pdu = new SMGPDeliverMessage();
pdu.setDestTermId("10086");
pdu.setMsgContent(content);
pdu.setSrcTermId("13800138000");
return pdu;
} else {
SMGPSubmitMessage pdu = new SMGPSubmitMessage();
pdu.setSrcTermId("10086");
pdu.setDestTermIdArray("13800138000");
pdu.setMsgContent(content);
return pdu;
}
}
use of com.zx.sms.connect.manager.ServerEndpoint in project SMSGate by Lihuanghe.
the class SMPPSessionConnectedHandler method createTestReq.
@Override
protected BaseMessage createTestReq(String str) {
final EndpointEntity finalentity = getEndpointEntity();
// String content = "£$¥èéùì@";
if (finalentity instanceof ServerEndpoint) {
DeliverSm pdu = new DeliverSm();
pdu.setSourceAddress(new Address((byte) 0, (byte) 0, "13800138000"));
pdu.setDestAddress(new Address((byte) 0, (byte) 0, "10086"));
// pdu.setSmsMsg(new SmsTextMessage(content,SmsDcs.getGeneralDataCodingDcs(SmsAlphabet.GSM,SmsMsgClass.CLASS_UNKNOWN)));
pdu.setSmsMsg(str);
return pdu;
} else {
SubmitSm pdu = new SubmitSm();
pdu.setRegisteredDelivery((byte) 0);
pdu.setSourceAddress(new Address((byte) 0, (byte) 0, "10086"));
pdu.setDestAddress(new Address((byte) 0, (byte) 0, "13800138000"));
// pdu.setSmsMsg(new SmsTextMessage(content,SmsDcs.getGeneralDataCodingDcs(SmsAlphabet.GSM,SmsMsgClass.CLASS_UNKNOWN)));
pdu.setSmsMsg(str);
return pdu;
}
}
use of com.zx.sms.connect.manager.ServerEndpoint in project SMSGate by Lihuanghe.
the class CMPPSessionConnectedHandler method createTestReq.
@Override
protected BaseMessage createTestReq(String content) {
final EndpointEntity finalentity = getEndpointEntity();
if (finalentity instanceof ServerEndpoint) {
CmppDeliverRequestMessage msg = new CmppDeliverRequestMessage();
msg.setDestId(String.valueOf(System.nanoTime()));
msg.setLinkid("0000");
msg.setMsgContent(content);
msg.setMsgId(new MsgId());
msg.setServiceid("10086");
msg.setSrcterminalId(String.valueOf(System.nanoTime()));
msg.setSrcterminalType((short) 1);
return msg;
} else {
CmppSubmitRequestMessage msg = new CmppSubmitRequestMessage();
msg.setDestterminalId(String.valueOf(System.nanoTime()));
msg.setSrcId(String.valueOf(System.nanoTime()));
msg.setLinkID("0000");
msg.setMsgContent(content);
msg.setRegisteredDelivery((short) 0);
msg.setServiceId("10086");
return msg;
}
}
use of com.zx.sms.connect.manager.ServerEndpoint in project SMSGate by Lihuanghe.
the class ConnState method printOne.
private String printOne(EndpointEntity e) {
StringBuilder sb = new StringBuilder();
EndpointConnector econn = e.getSingletonConnector();
if (econn == null)
return "";
Channel[] carr = econn.getallChannel();
if (carr != null && carr.length > 0) {
for (int i = 0; i < carr.length; i++) {
Channel ch = carr[i];
SessionStateManager ssm = (SessionStateManager) ch.pipeline().get("sessionStateManager");
sb.append("\tch[");
sb.append(ch.localAddress().toString());
if (e instanceof ServerEndpoint) {
sb.append("<-");
} else {
sb.append("->");
}
sb.append(ch.remoteAddress().toString() + "]");
sb.append("\tWaitting-resp=").append(ssm.getWaittingResp());
sb.append("\tWriteCount=").append(ssm.getWriteCount());
sb.append("\tReadCount=").append(ssm.getReadCount());
sb.append("\n");
}
}
return sb.toString();
}
Aggregations