Hi,
What is the destination of the message where the failure occurs? Is it a
wrong or an empty phone number. If so, when you will try to send it again,
of course you will receive the same error. What if you ommit that message
and go to next message?
What I did in your case, is:
1. I store the message with an initial state (say -1)
2. I try to send the message three times (first failure -> status =1;
Second failure -> status =2; Third failure -> status =3)
3. If the message is sent, status would be 0
4. On failure, I remove gateways and add them again to the service. I
restart the service.
5. On the next loop, I try to send messages with status != 0 and less
then 3
This way, you are sure to continue sending even if the error persists :)
With failure trace, it is very important to check binding response on the
next service restart. And yes, you have to restart service and re-add
gateways because of this part of the SmppSession class:
catch (PDUException e) {
logger.error("Failed sending bind command", e);
throw new IOException("Failed sending bind since some
string parameter area invalid", e);
} catch (NegativeResponseException e) {
String message = "Receive negative bind response";
logger.error(message, e);
close();
throw new IOException(message, e);
} catch (InvalidResponseException e) {
String message = "Receive invalid response of bind";
logger.error(message, e);
close();
throw new IOException(message, e);
} catch (ResponseTimeoutException e) {
String message = "Waiting bind response take time
to long";
logger.error(message, e);
close();
throw new IOException(message, e);
} catch (IOException e) {
logger.error("IO Error occur", e);
close();
throw e;
}
The close method is in AbstratctSmppSession:
public void close() {
SessionContext ctx = sessionContext();
if (!ctx.getSessionState().equals(SessionState.CLOSED)) {
ctx.close();
try {
connection().close();
} catch (IOException e) {
}
}
}
That my point of view and I'll be happy if anyone from the team can correct
me if I'm wrong :)
Le jeudi 12 septembre 2013 18:38:59 UTC+1, Hugo Cabral a écrit :
>
> Hi there,
>
> Im using SMSLib .NET and im trying to achieve something really simple but
> without success.
>
>
>
> Im trying to send a few messages (10 messages, in wich first 3 numbers are
> correct, other 3 are incorrect and last 4 are correct).
>
>
>
> Im doing this so i can implement a project with a loop everytime a message
> fails. I updte the list of senders removing the failed number.
>
>
>
> The reason i'm dois this is because everytime i'm sending 500+ messages
> with SendMessage() and one message fails, all messages after also fail. The
> getFailureCause() outputs GATEWAY_FAILURE in the first message fail and
> NO_ROUTE is all other.
>
>
>
> But im having problem restarting the whole message delivery process. I
> trying stop the service and start it again, stoping com1 and start it
> again, gateway.stop and .start, without success. Im always getting erros
> like conection reset by peer or impossible to stop server while running,
> etc.
>
>
>
> Can you tell me what i can do to restart the gateway so the loop wont
> break?
>
>
>
> Thanks in advance. Best regards.
>
> *Hugo Cabral*
>
--
You received this message because you are subscribed to the Google Groups
"SMSLib Discussion Group" group.
To view this discussion on the web visit
https://groups.google.com/d/msgid/smslib/1f993a2b-e2b8-4d11-87ce-caa662f86a9a%40googlegroups.com.