Can it be used to send sms via smpp?
Closed this issue · 1 comments
Hello. Can it be used to send sms via smpp?
My code following:
for (creds <- List(("asdf", "asdf12"))) {
val client = actorSystem.actorOf(SmppClient.props(SmppClientConfig(new InetSocketAddress("10.200.112.10", 2775)), {
case d: DeliverSm =>
println(s"Incoming message $d")
DeliverSmResp(CommandStatus.ESME_ROK, d.sequenceNumber, None)
}))
client ! Bind(creds._1, creds._2)
val f = client ? SendMessage("this is message", Did("5555"), Did("+996555121212"), Option[DataCodingScheme](DataCodingScheme.Latin1))
f.mapTo[SendMessageAck].onComplete { ack =>
println("f on complete.")
println(ack)
}
(client ? SendMessage("hahahaa", Did("5555"), Did("+996555121212"))) onComplete { x =>
println("client sending message completed.")
println(x)
}
(client ? SendRawPdu(EnquireLink)) onComplete { x =>
println("client sending raw pdu completed.")
println(x)
}
}
I got following error.
C:>java -jar something.jar
[DEBUG] [11/18/2014 16:38:18.224] [main] [EventStream(akka://demo)] logger log1-
Logging$DefaultLogger started
[DEBUG] [11/18/2014 16:38:18.224] [main] [EventStream(akka://demo)] Default Logg
ers started
[DEBUG] [11/18/2014 16:38:18.271] [demo-akka.actor.default-dispatcher-3] [akka:/
/demo/user/$a] Connecting to server at /10.230.16.10:2885
[ERROR] [11/18/2014 16:38:18.287] [demo-akka.actor.default-dispatcher-3] [ActorS
ystem(demo)] Uncaught error from thread [demo-akka.actor.default-dispatcher-3]
scala.NotImplementedError: an implementation is missing
at scala.Predef$.$qmark$qmark$qmark(Predef.scala:252)
at akkasmpp.Demo$$anonfun$3$$anon$1.receive(Demo.scala:87)
at akka.actor.ActorCell.newActor(ActorCell.scala:533)
at akka.actor.ActorCell.create(ActorCell.scala:553)
at akka.actor.ActorCell.invokeAll$1(ActorCell.scala:431)
at akka.actor.ActorCell.systemInvoke(ActorCell.scala:453)
at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:262)
at akka.dispatch.Mailbox.run(Mailbox.scala:218)
at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(Abst
ractDispatcher.scala:385)
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool
.java:1339)
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:19
79)
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThre
ad.java:107)
[DEBUG] [11/18/2014 16:38:18.349] [demo-akka.actor.default-dispatcher-6] [akka:/
/demo/system/IO-TCP/selectors/$a/0] Attempting connection to [/10.230.16.10:2885
]
[DEBUG] [11/18/2014 16:38:18.349] [demo-akka.actor.default-dispatcher-4] [akka:/
/demo/system/IO-TCP/selectors/$a/0] Connection established to [/10.230.16.10:288
5]
[DEBUG] [11/18/2014 16:38:18.349] [demo-akka.actor.default-dispatcher-2] [akka:/
/demo/user/$a] Connection established to server at /10.230.16.10:2885
[INFO] [11/18/2014 16:38:18.396] [demo-akka.actor.default-dispatcher-2] [akka://
demo/user/$a] Making bind request BindTransceiver(1,dkrb,y547b2,,52,Internationa
l,E164)
[INFO] [11/18/2014 16:38:18.474] [demo-akka.actor.default-dispatcher-2] [akka://
demo/deadLetters] Message [akkasmpp.protocol.BindTransceiverResp] from Actor[akk
a://demo/user/$a#-1626091220] to Actor[akka://demo/deadLetters] was not delivere
d. [1] dead letters encountered. This logging can be turned off or adjusted with
configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-durin
g-shutdown'.
[INFO] [11/18/2014 16:38:18.474] [demo-akka.actor.default-dispatcher-6] [akka://
demo/user/$a] Bound: BindTransceiverResp(ESME_ROK,1,Some(dkrb),None)
[INFO] [11/18/2014 16:38:18.521] [demo-akka.actor.default-dispatcher-6] [akka://
demo/user/$a] Sending message SubmitSm(2,,International,E164,+996558047694,Inter
national,E164,9898,EsmClass(Default,NormalMessage,Features.ValueSet()),52,Level0
,NullTime,NullTime,RegisteredDelivery(NoneRequested,NoneRequested,NotRequested),
false,SmscDefaultAlphabet,0,15,<OctetString: 74686973206973206D657373616765>,Lis
t())
[INFO] [11/18/2014 16:38:18.521] [demo-akka.actor.default-dispatcher-6] [akka://
demo/user/$a] Sending message SubmitSm(3,,International,E164,+996558047694,Inter
national,E164,9898,EsmClass(Default,NormalMessage,Features.ValueSet()),52,Level0
,NullTime,NullTime,RegisteredDelivery(NoneRequested,NoneRequested,NotRequested),
false,SmscDefaultAlphabet,0,7,<OctetString: 68616861686161>,List())
[DEBUG] [11/18/2014 16:38:18.521] [demo-akka.actor.default-dispatcher-6] [akka:/
/demo/user/$a] sending raw pdu EnquireLink(4)
[DEBUG] [11/18/2014 16:38:18.568] [demo-akka.actor.default-dispatcher-9] [akka:/
/demo/user/$a] Incoming SubmitSmResp EnquireLinkResp(4)
client sending raw pdu completed.
Success(EnquireLinkResp(4))
[DEBUG] [11/18/2014 16:38:18.568] [demo-akka.actor.default-dispatcher-7] [akka:/
/demo/user/$a] Incoming SubmitSmResp SubmitSmResp(ESME_RINVDSTADR,2,None)
[DEBUG] [11/18/2014 16:38:18.568] [demo-akka.actor.default-dispatcher-7] [akka:/
/demo/user/$a] Incoming SubmitSmResp SubmitSmResp(ESME_RINVDSTADR,3,None)
f on complete.
Success(SendMessageAck(List((ESME_RINVDSTADR,None))))
client sending message completed.
Success(SendMessageAck(List((ESME_RINVDSTADR,None))))
What is wrong???
It looks like you got back an error from the server, ESME_RINVDSTADR
which means invalid source address.