public class SendAndReceiveSMSExample extends Object implements OutboundMessageGatewayListener, InboundMessageGatewayListener
Constructor and Description |
---|
SendAndReceiveSMSExample() |
Modifier and Type | Method and Description |
---|---|
void |
inboundMessageEvent(InboundMessageEvent inboundMessageEvent)
Is called when a new inbound message is delivered
|
static void |
main(String[] args)
Parse parameters or asking user for information.
|
void |
outboundMessageEvent(OutboundMessageEvent event)
Is called when a outbound message is delivered or expired time for
delivering
|
void |
send(String port,
String text,
String number,
String service)
Create and setup the gateway to the outgoing sending messages
|
public void send(String port, String text, String number, String service) throws IOException, GatewayException, InterruptedException
port
- port where is modemtext
- text of messagenumber
- destination numberservice
- number of SMS serviceGatewayException
IOException
InterruptedException
public void outboundMessageEvent(OutboundMessageEvent event)
outboundMessageEvent
in interface OutboundMessageGatewayListener
public void inboundMessageEvent(InboundMessageEvent inboundMessageEvent)
inboundMessageEvent
in interface InboundMessageGatewayListener
public static void main(String[] args) throws GatewayException, IOException, InterruptedException
args
- GatewayException
IOException
InterruptedException
Copyright © 2015–2016 jSMS4Pi. All rights reserved.