本文整理匯總了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;
}