You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by viezz <vi...@gmail.com> on 2011/04/29 19:54:38 UTC

SMPP How to receive delivery receipt from smsc as producer?

hello, 

I'm new to camel and smpp, currently I'm working on a project that requires
smpp to send and receive sms from an smsc, i'm making a simulation using
smsc from logica.

i was using camel-smpp as a producer to send messaage to smsc, here is my
routing:

 from("file:data/inbox").process(messageProcessor)
               
.to("smpp://pavel@localhost:6006?password=wpsd&enquireLinkTimer=3000&transactionTimer=5000&systemType=producer").process(deliveryReceiptProcessor)

it will consume file from data/inbox folder, parse it's content (with the
first processor) and compose as sms and send to smsc. I've succeeded this
far, and then i realized that smsc was sending delivery receipt a few moment
after sending submit_sm_resp (which contain messageId assigned by smsc),
there's some information i need from this delivery receipt like message
status and delivered time. so i was using the second processor to process
this delivery receipt, but it can't receive it, it only receive
submit_sm_resp as i mentioned above, and then I read camel doc that camel
automatically bind as transmitter to smsc when set as producer, and so it
can only receipve resp from smsc. 

is there someway to receive that delivery receipt as a producer?
i tried to set both producer and consumer, the routing look like this:

 from("file:data/inbox").process(messageProcessor)
               
.to("smpp://pavel@localhost:6006?password=wpsd&enquireLinkTimer=3000&transactionTimer=5000&systemType=producer")
.from("smpp://pavel@localhost:6006?password=wpsd&enquireLinkTimer=3000&transactionTimer=5000&systemType=producer").process(deliveryReceiptProcessor) 

but it doesn't work, I notice there's two smpp session connected to smsc (as
transmitter and another as receiver), when the producer send message, the
smsc reply with submit_sm_resp and also sending delivery receipt, but none
of those endpoint receive that.

am i doing wrong? how i supposed to set the routing?


ps:sorry if my english is bad 
--
View this message in context: http://camel.465427.n5.nabble.com/SMPP-How-to-receive-delivery-receipt-from-smsc-as-producer-tp4359338p4359338.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: SMPP How to receive delivery receipt from smsc as producer?

Posted by AlexNastin <ca...@mail.ru>.
Hello. Could you share code and messageProcessor deliveryReceiptProcessor?
And then I have not come submit_sm_resp.
ps: sorry if my english is very bad



--
View this message in context: http://camel.465427.n5.nabble.com/SMPP-How-to-receive-delivery-receipt-from-smsc-as-producer-tp4359338p5768239.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: SMPP How to receive delivery receipt from smsc as producer?

Posted by AlexNastin <ca...@mail.ru>.
Hello. Не могли бы вы поделиться кодом messageProcessor и
deliveryReceiptProcessor? А то у меня не приходит submit_sm_resp. 
ps:sorry if my english is very bad 



--
View this message in context: http://camel.465427.n5.nabble.com/SMPP-How-to-receive-delivery-receipt-from-smsc-as-producer-tp4359338p5768238.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: SMPP How to receive delivery receipt from smsc as producer?

Posted by viezz <vi...@gmail.com>.
I'm sorry my phone was broken for a week so i don't receive any emails, and it's been a while since i used camel smpp.

Sent from my iPhone

> On 7 Jul 2014, at 05.15 PM, "baMufu [via Camel]" <ml...@n5.nabble.com> wrote:
> 
>  
> baMufu wrote
> Who would u mind sharing your code on how u managed to get response from the SMSC. Below is my code. 
>             from("test-jms:queue:test.queue").process(new Processor() {             
> 
>             public void process(Exchange e) { 
>             
>               System.out.println("Received id for exchange: "+e.getIn().getMessageId()); 
>               String body = e.getIn().getBody(String.class); 
>               System.out.println("Received exchange: " +body); 
>              e.getIn().setHeader("CamelSmppRegisteredDelivery",new Byte("1")); 
>               //e.getIn().setHeader("CamelSmppDestAddr",listNum.pop()); 
>               e.getIn().setBody("New Data. This it it. "); 
>             } 
>         }).to("smpp://smppclient1@localhost:2775?password=password&enquireLinkTimer=3000&transactionTimer=5000" 
>                + "&systemType=producer"); 
>             
>          from("smpp://smppclient1@localhost:2775?password=password&enquireLinkTimer=3000&transactionTimer=5000" 
>               + "&systemType=consumer").to("file://C:/test"); 
>           
>             } 
>             
>         });
> The LOOPBACK service of the simulator did the magic. 
> 
> If you reply to this email, your message will be added to the discussion below:
> http://camel.465427.n5.nabble.com/SMPP-How-to-receive-delivery-receipt-from-smsc-as-producer-tp4359338p5753462.html
> To unsubscribe from SMPP How to receive delivery receipt from smsc as producer?, click here.
> NAML




--
View this message in context: http://camel.465427.n5.nabble.com/SMPP-How-to-receive-delivery-receipt-from-smsc-as-producer-tp4359338p5753463.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: SMPP How to receive delivery receipt from smsc as producer?

Posted by baMufu <si...@gmail.com>.
 
baMufu wrote
> Who would u mind sharing your code on how u managed to get response from
> the SMSC. Below is my code.
>             from("test-jms:queue:test.queue").process(new Processor() {             
> 
>             public void process(Exchange e) {
>             
>               System.out.println("Received id for exchange:
> "+e.getIn().getMessageId());
>               String body = e.getIn().getBody(String.class);
>               System.out.println("Received exchange: " +body); 
>              e.getIn().setHeader("CamelSmppRegisteredDelivery",new
> Byte("1"));
>               //e.getIn().setHeader("CamelSmppDestAddr",listNum.pop());
>               e.getIn().setBody("New Data. This it it. ");
>             }
>        
> }).to("smpp://smppclient1@localhost:2775?password=password&enquireLinkTimer=3000&transactionTimer=5000"
>                + "&systemType=producer");
>            
>         
> from("smpp://smppclient1@localhost:2775?password=password&enquireLinkTimer=3000&transactionTimer=5000"
>               + "&systemType=consumer").to("file://C:/test");
>           
>             }
>             
>         });

The LOOPBACK service of the simulator did the magic.



--
View this message in context: http://camel.465427.n5.nabble.com/SMPP-How-to-receive-delivery-receipt-from-smsc-as-producer-tp4359338p5753462.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: SMPP How to receive delivery receipt from smsc as producer?

Posted by baMufu <si...@gmail.com>.
Who would u mind sharing your code on how u managed to get response from the
SMSC. Below is my code.
            from("test-jms:queue:test.queue").process(new Processor() {             

            public void process(Exchange e) {
            
              System.out.println("Received id for exchange:
"+e.getIn().getMessageId());
              String body = e.getIn().getBody(String.class);
              System.out.println("Received exchange: " +body); 
             e.getIn().setHeader("CamelSmppRegisteredDelivery",new
Byte("1"));
              //e.getIn().setHeader("CamelSmppDestAddr",listNum.pop());
              e.getIn().setBody("New Data. This it it. ");
            }
       
}).to("smpp://smppclient1@localhost:2775?password=password&enquireLinkTimer=3000&transactionTimer=5000"
               + "&systemType=producer");
           
        
from("smpp://smppclient1@localhost:2775?password=password&enquireLinkTimer=3000&transactionTimer=5000"
              + "&systemType=consumer").to("file://C:/test");
          
            }
            
        });



--
View this message in context: http://camel.465427.n5.nabble.com/SMPP-How-to-receive-delivery-receipt-from-smsc-as-producer-tp4359338p5752938.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: SMPP How to receive delivery receipt from smsc as producer?

Posted by viezz <vi...@gmail.com>.
I finally receive the deliversm and delivery receipt after I use simulator
from selenium, i'm using my last route and the consumer received both
deliversm and delivery receipt.

looks like the problem wasn't the routing or smpp library, but the smsc from
logica, because once I've tried using smsc from selenium, everything works
fine. 

thank you for your support Christian, I really appreciated it.--
View this message in context: http://camel.465427.n5.nabble.com/SMPP-How-to-receive-delivery-receipt-from-smsc-as-producer-tp4359338p4363977.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: SMPP How to receive delivery receipt from smsc as producer?

Posted by Christian Müller <ch...@gmail.com>.
I updated the SmppComponentIntegrationTest [1] to also check the received
message type and it is a DeliveryReceipt, as expected. You are able to run
this test on your box? I have no idea why it should not work on your box...
I assume you use the default configuration for the Logica SMPPSim.

[1] http://svn.apache.org/viewvc?view=revision&revision=1098184

Christian

Re: SMPP How to receive delivery receipt from smsc as producer?

Posted by viezz <vi...@gmail.com>.
hello Christian,

thank you for your reply, but I'm still experiencing the same problem, I
don't know if I'm still not quite understand about camel routing, but I've
changed my routing after I read the source from you given link.

here's my new route:

from("file:data/inbox").process(messageProcessor)
 .to("smpp://pavel@localhost
:6006?password=wpsd&enquireLinkTimer=3000&transactionTimer=5000&systemType=producer");

from("smpp://pavel@localhost
:6006?password=wpsd&enquireLinkTimer=3000&transactionTimer=5000&systemType=consumer").process(deliveryReceiptProcessor) 

(smsc is running on localhost port 6006)

but still I can't receive the delivery receipt from smsc, it can only
receipt submit_sm_resp. 
the second route doesn't receive anything from smsc, first I thought that
smsc will send the delivery receipt and my application will receive it from
the second route, but it didn't. 

I can see in the log that it make two different smpp session to smsc, one as
producer and another as consumer, but the smsc seems to be sending the
delivery receipt to the first smpp session (the producer), because it was
the one sending the submit_sm to smsc. 

from the documentation I read there are some headers from smpp consumer that
can can be used to request data from smsc, but i didn't know how to do it
since the smpp consumer bind as receiver to smsc, so it can only receive
message. 


--
View this message in context: http://camel.465427.n5.nabble.com/SMPP-How-to-receive-delivery-receipt-from-smsc-as-producer-tp4359338p4360614.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: SMPP How to receive delivery receipt from smsc as producer?

Posted by Christian Müller <ch...@gmail.com>.
Hello viezz!

You need a ';' between your 'to()' and 'from()' statement. I also recommend
to use different systemType values to differentiate between the producer and
consumer (as in the test from the link). This link should be helpful for you
[1].

[1]
https://svn.apache.org/repos/asf/camel/trunk/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/integration/SmppComponentIntegrationTest.java

Cheers,
Christian

On Fri, Apr 29, 2011 at 7:54 PM, viezz <vi...@gmail.com> wrote:

> hello,
>
> I'm new to camel and smpp, currently I'm working on a project that requires
> smpp to send and receive sms from an smsc, i'm making a simulation using
> smsc from logica.
>
> i was using camel-smpp as a producer to send messaage to smsc, here is my
> routing:
>
>  from("file:data/inbox").process(messageProcessor)
>
> .to("smpp://pavel@localhost
> :6006?password=wpsd&enquireLinkTimer=3000&transactionTimer=5000&systemType=producer").process(deliveryReceiptProcessor)
>
> it will consume file from data/inbox folder, parse it's content (with the
> first processor) and compose as sms and send to smsc. I've succeeded this
> far, and then i realized that smsc was sending delivery receipt a few
> moment
> after sending submit_sm_resp (which contain messageId assigned by smsc),
> there's some information i need from this delivery receipt like message
> status and delivered time. so i was using the second processor to process
> this delivery receipt, but it can't receive it, it only receive
> submit_sm_resp as i mentioned above, and then I read camel doc that camel
> automatically bind as transmitter to smsc when set as producer, and so it
> can only receipve resp from smsc.
>
> is there someway to receive that delivery receipt as a producer?
> i tried to set both producer and consumer, the routing look like this:
>
>  from("file:data/inbox").process(messageProcessor)
>
> .to("smpp://pavel@localhost
> :6006?password=wpsd&enquireLinkTimer=3000&transactionTimer=5000&systemType=producer")
> .from("smpp://pavel@localhost
> :6006?password=wpsd&enquireLinkTimer=3000&transactionTimer=5000&systemType=producer").process(deliveryReceiptProcessor)
>
> but it doesn't work, I notice there's two smpp session connected to smsc
> (as
> transmitter and another as receiver), when the producer send message, the
> smsc reply with submit_sm_resp and also sending delivery receipt, but none
> of those endpoint receive that.
>
> am i doing wrong? how i supposed to set the routing?
>
>
> ps:sorry if my english is bad
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/SMPP-How-to-receive-delivery-receipt-from-smsc-as-producer-tp4359338p4359338.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: SMPP How to receive delivery receipt from smsc as producer?

Posted by AlexNastin <ca...@mail.ru>.
Hello. Could you share code and messageProcessor deliveryReceiptProcessor?
And then I have not come submit_sm_resp. 
ps: sorry if my english is very bad 

and there is an exception after sending an SMS to smsc. ( 
smsc gets my sms, a few seconds there is an exception in my application) 

WARN : org.apache.camel.component.smpp.SmppConsumer - Cannot create
exchange. This exception will be ignored.. Caused by:
[java.lang.IllegalArgumentException - No tag for: 5123] 
java.lang.IllegalArgumentException: No tag for: 5123 
        at
org.jsmpp.bean.OptionalParameter$Tag.valueOf(OptionalParameter.java:308) 
        at
org.apache.camel.component.smpp.SmppBinding.createOptionalParameterByName(SmppBinding.java:161) 
        at
org.apache.camel.component.smpp.SmppBinding.createSmppMessage(SmppBinding.java:112) 
        at
org.apache.camel.component.smpp.SmppEndpoint.createOnAcceptDeliverSmExchange(SmppEndpoint.java:123) 
        at
org.apache.camel.component.smpp.SmppEndpoint.createOnAcceptDeliverSmExchange(SmppEndpoint.java:107) 
        at
org.apache.camel.component.smpp.MessageReceiverListenerImpl.onAcceptDeliverSm(MessageReceiverListenerImpl.java:70) 
        at
org.jsmpp.session.SMPPSession.fireAcceptDeliverSm(SMPPSession.java:445) 
        at org.jsmpp.session.SMPPSession.access$400(SMPPSession.java:92) 
        at
org.jsmpp.session.SMPPSession$ResponseHandlerImpl.processDeliverSm(SMPPSession.java:462) 
        at
org.jsmpp.session.state.SMPPSessionBoundRX.processDeliverSm0(SMPPSessionBoundRX.java:109) 
        at
org.jsmpp.session.state.SMPPSessionBoundRX.processDeliverSm(SMPPSessionBoundRX.java:51) 
        at org.jsmpp.session.PDUProcessTask.run(PDUProcessTask.java:81) 
        at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 
        at java.lang.Thread.run(Thread.java:745) 




--
View this message in context: http://camel.465427.n5.nabble.com/SMPP-How-to-receive-delivery-receipt-from-smsc-as-producer-tp4359338p5768241.html
Sent from the Camel - Users mailing list archive at Nabble.com.