*/
private void sendSingle(SMSMessage message) throws MessageException{
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Sending message using sendSingle");
}
final SubmitSM request;
try {
String theMessage = message.getMessage();
request = new SubmitSM();
// set values
request.setServiceType(SMSCSvcType);
request.setSourceAddr(SMSCSvcAddr);
request.setReplaceIfPresentFlag((byte) 0x00);
request.setShortMessage(theMessage);
request.setEsmClass((byte) 0x00);
request.setProtocolId((byte) 0x00);
request.setPriorityFlag((byte) 0x00);
request.setRegisteredDelivery((byte) 0x00);
request.setDataCoding((byte) 0x00);
request.setSmDefaultMsgId((byte) 0x00);
// send the request
request.assignSequenceNumber(false);
} catch (Exception e) {
final String messageKey = "message-submit-failure";
LOGGER.warn(messageKey);
throw new MessageException(localizer.format(messageKey), e);
}
int numberOfDestinations = message.getDestinationCount();
final List failedRecipients = new LinkedList();
// if we have multiple message destinations we need to send it
// multiple times as single messages
for (int i = 0; i < numberOfDestinations; i++) {
try {
request.setDestAddr(new Address(message.getDestination(i)));
if(LOGGER.isDebugEnabled()) {
LOGGER.debug("Submit request " + request.debugString());
}
// Get a session from the pool and attempt to send the message.
boolean submitted = false;
SubmitSMResp response = null;