當前位置: 首頁>>代碼示例>>Java>>正文


Java JSMPPGateway類代碼示例

本文整理匯總了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();
}
 
開發者ID:tdelenikas,項目名稱:smslib-v3,代碼行數:22,代碼來源:SendReceiveMessage.java

示例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();
}
 
開發者ID:tdelenikas,項目名稱:smslib-v3,代碼行數:15,代碼來源:ReceiveMessage.java

示例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;
}
 
開發者ID:ehatle,項目名稱:AgileAlligators,代碼行數:9,代碼來源:GateWayFactory.java


注:本文中的org.smslib.smpp.jsmpp.JSMPPGateway類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。