本文整理汇总了Java中org.smslib.smpp.jsmpp.JSMPPGateway类的典型用法代码示例。如果您正苦于以下问题:Java JSMPPGateway类的具体用法?Java JSMPPGateway怎么用?Java JSMPPGateway使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JSMPPGateway类属于org.smslib.smpp.jsmpp包,在下文中一共展示了JSMPPGateway类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doIt
import org.smslib.smpp.jsmpp.JSMPPGateway; //导入依赖的package包/类
public void doIt() throws Exception
{
System.out.println("Example: Send/Receive message through SMPP using JSMPP.");
System.out.println(Library.getLibraryDescription());
System.out.println("Version: " + Library.getLibraryVersion());
JSMPPGateway gateway = new JSMPPGateway("smppcon", "localhost", 2715, new BindAttributes("smppclient1", "password", "cp", BindType.TRANSCEIVER));
Service.getInstance().addGateway(gateway);
Service.getInstance().setInboundMessageNotification(new InboundNotification());
Service.getInstance().setGatewayStatusNotification(new GatewayStatusNotification());
Service.getInstance().setOutboundMessageNotification(new OutboundNotification());
Service.getInstance().startService();
// Send a message.
OutboundMessage msg = new OutboundMessage("+967712831950", "Hello from SMSLib and JSMPP");
// Request Delivery Report
msg.setStatusReport(true);
Service.getInstance().sendMessage(msg);
System.out.println(msg);
System.out.println("Now Sleeping - Hit <enter> to terminate.");
System.in.read();
Service.getInstance().stopService();
}
示例2: doIt
import org.smslib.smpp.jsmpp.JSMPPGateway; //导入依赖的package包/类
public void doIt() throws Exception
{
System.out.println("Example: Receive messages through SMPP using JSMPP.");
System.out.println(Library.getLibraryDescription());
System.out.println("Version: " + Library.getLibraryVersion());
JSMPPGateway gateway = new JSMPPGateway("smppcon", "localhost", 2715, new BindAttributes("smppclient1", "password", "cp", BindType.RECEIVER));
Service.getInstance().setInboundMessageNotification(new InboundNotification());
Service.getInstance().addGateway(gateway);
Service.getInstance().setGatewayStatusNotification(new GatewayStatusNotification());
Service.getInstance().startService();
System.out.println("Now Sleeping - Hit <enter> to terminate.");
System.in.read();
Service.getInstance().stopService();
}
示例3: createSMPPGatewayConfig
import org.smslib.smpp.jsmpp.JSMPPGateway; //导入依赖的package包/类
public AGateway createSMPPGatewayConfig( SMPPGatewayConfig config )
{
AGateway gateway = new JSMPPGateway( config.getName(), config.getAddress(), config.getPort(),
new BindAttributes( config.getUsername(), config.getPassword(), "cp", BindType.TRANSCEIVER ) );
gateway.setInbound( true );
gateway.setOutbound( true );
return gateway;
}