Documentation: http://mobile.vianett.com/files/javadoc/
<%@page contentType="text/html" import="no.vianett.sms.component.SmsTransceiver,no.vianett.sms.Sms,no.vianett.sms.log.SmsSinkLogger" %>
<html>
<head>
<title>JSP with SMS</title>
</head>
<body>
<%
SmsTransceiver transceiver = SmsTransceiver.getInstance();
// Initialise SMS transceiver if this hasn't been done before.
if( !transceiver.isInitialized() )
{
String smsHost = "cpa.vianett.no";
String smsPort = "31337";
String smsUsername = "username";
String smsPassword = "password";
transceiver.initialize( smsHost, Integer.parseInt( smsPort ), smsUsername, smsPassword, new SmsSinkLogger() ); // No logging.
}
// Send SMS
Sms sms = new Sms();
sms.setId( 1234 ); // This ID number should be generated by the application.
sms.setSender( "1963" );
sms.setRecipient( "4799887766" );
sms.setMessage( "test" );
transceiver.send( sms );
%>
SMS enqued for sending.
</body>
</html>