You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by hanusto <ha...@gmail.com> on 2014/10/28 13:40:02 UTC

SMPP component and problem with valid period (relative) and data message

Hello,

I have two questions for SMPP camel component:

1) how to set valid period as relative ? It can be defined in absolute time
format or relative time format if you provide it as String as specified in
chapter 7.1.1 in the smpp specification v3.4. in format "000001000000000R"
as one day: 

exchange.getIn().setHeader(SmppConstants.VALIDITY_PERIOD,
constant("000001000000000R"));

but in packet trace I see deafult value because this format is incorrect,
probably, but exactly based upon specification. Maybe bug?

2) I would like to send push sms (m-notification-ind PDU type). As content
of message (exchange.getIn().setBody()) I am sending byte array as whole
message with UDHI segment. Data coding schema is "Octet unspecified (8-bit
binary) (0x04)". Problem is that SMPP component calculates length of message
and EsmClass is configured in right way only if length is greater than 140
number of bytes.

In SmppSubmitSmCommand:
            template.setEsmClass(new ESMClass(MessageMode.DEFAULT,
                    MessageType.DEFAULT,
                    GSMSpecificFeature.UDHI).value());

I think that message size is not related to UDHI and therefore why is
splitted and after that if segments is more than one, EmsClass with UDHI is
configured properly?

Please, is here any solution how to send m-notification-ind PDU type? As hot
fix I checkout SMPP camel component and use custom modification of this
behaviour.

Thanks,
Tomas



--
View this message in context: http://camel.465427.n5.nabble.com/SMPP-component-and-problem-with-valid-period-relative-and-data-message-tp5758217.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: SMPP component and problem with valid period (relative) and data message

Posted by hanusto <ha...@gmail.com>.
Hi Christian,

I know how this camel component uses jsmpp library, but in fact it looks
like bug in jsmpp library because the only way to set the date is as
absolute. Or have you tried it? e.g.: 000001000000000R - it is right value.

Tomas



--
View this message in context: http://camel.465427.n5.nabble.com/SMPP-component-and-problem-with-valid-period-relative-and-data-message-tp5758217p5758440.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: SMPP component and problem with valid period (relative) and data message

Posted by Christian Müller <ch...@gmail.com>.
For your first question, have a look at [1]. This is how we pass the value
to the jsmpp library.

[1]
https://git-wip-us.apache.org/repos/asf?p=camel.git;a=blob;f=components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppSubmitSmCommand.java;h=ac5f4f1e8531f8603509a9f72eb67283ae10e8ac;hb=HEAD

Best,

Christian
-----------------

Software Integration Specialist

Apache Member
V.P. Apache Camel | Apache Camel PMC Member | Apache Camel committer
Apache Incubator PMC Member

https://www.linkedin.com/pub/christian-mueller/11/551/642

On Tue, Oct 28, 2014 at 1:40 PM, hanusto <ha...@gmail.com> wrote:

> Hello,
>
> I have two questions for SMPP camel component:
>
> 1) how to set valid period as relative ? It can be defined in absolute time
> format or relative time format if you provide it as String as specified in
> chapter 7.1.1 in the smpp specification v3.4. in format "000001000000000R"
> as one day:
>
> exchange.getIn().setHeader(SmppConstants.VALIDITY_PERIOD,
> constant("000001000000000R"));
>
> but in packet trace I see deafult value because this format is incorrect,
> probably, but exactly based upon specification. Maybe bug?
>
> 2) I would like to send push sms (m-notification-ind PDU type). As content
> of message (exchange.getIn().setBody()) I am sending byte array as whole
> message with UDHI segment. Data coding schema is "Octet unspecified (8-bit
> binary) (0x04)". Problem is that SMPP component calculates length of
> message
> and EsmClass is configured in right way only if length is greater than 140
> number of bytes.
>
> In SmppSubmitSmCommand:
>             template.setEsmClass(new ESMClass(MessageMode.DEFAULT,
>                     MessageType.DEFAULT,
>                     GSMSpecificFeature.UDHI).value());
>
> I think that message size is not related to UDHI and therefore why is
> splitted and after that if segments is more than one, EmsClass with UDHI is
> configured properly?
>
> Please, is here any solution how to send m-notification-ind PDU type? As
> hot
> fix I checkout SMPP camel component and use custom modification of this
> behaviour.
>
> Thanks,
> Tomas
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/SMPP-component-and-problem-with-valid-period-relative-and-data-message-tp5758217.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: SMPP component and problem with valid period (relative) and data message

Posted by hanusto <ha...@gmail.com>.
Hi Willem,

I hope I sets message header correctly, same way as DataConfig and so on and
data config is ok. I know this link, but problem is that smpp component adds
ESM message class with GSMSpecificFeature.UDHI only and only if content of
message data will be splitted into more messages (Concatenated short
messages), please check [1]. But my message is M-Notification-Ind (MMS -
push SMS), so this is EMS message, no text and therefore I need to configure
EMS class properly without depending on the size of the message.

Quick fix is add custom ESM class with UDHI flag and this override default
esm class.

    protected SubmitSm[] createSubmitSm(Exchange exchange) {
        byte[] shortMessage = getShortMessage(exchange.getIn());
        SubmitSm template = createSubmitSmTemplate(exchange);
        SmppSplitter splitter = createSplitter(exchange.getIn());
        byte[][] segments = splitter.split(shortMessage);
        // multipart message
        //TODO (thanus, 28.10.14, TASK: DT-23) custom fix for UDHI (ESM
class)
        final ESMClass esmClass =
exchange.getIn().getHeader(SmppConstants.ESM_CLASS, ESMClass.class);
        if (esmClass != null) {
            template.setEsmClass(esmClass.value());
        } else {
            if (segments.length > 1) {
                template.setEsmClass(new ESMClass(MessageMode.DEFAULT,
                        MessageType.DEFAULT,
                        GSMSpecificFeature.UDHI).value());
            }
        }
        SubmitSm[] submitSms = new SubmitSm[segments.length];
        for (int i = 0; i < segments.length; i++) {
            SubmitSm submitSm = SmppUtils.copySubmitSm(template);
            submitSm.setShortMessage(segments[i]);
            submitSms[i] = submitSm;
        }
        return submitSms;
    }

[1] http://en.wikipedia.org/wiki/User_Data_Header



--
View this message in context: http://camel.465427.n5.nabble.com/SMPP-component-and-problem-with-valid-period-relative-and-data-message-tp5758217p5758441.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: SMPP component and problem with valid period (relative) and data message

Posted by Willem Jiang <wi...@gmail.com>.
For Q1, I just checked the camel-smpp code, it just pass the message header setting to 
Maybe you doesn’t set the header rightly. Please take a look at this[1]

For Q2, please fill feel to create JIRA[2] and submit you patch for it.

[1]http://camel.apache.org/using-getin-or-getout-methods-on-exchange.html
[2]http://issues.apache.org/jira/browse/CAMEL

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On October 28, 2014 at 9:09:32 PM, hanusto (hanusto@gmail.com) wrote:
> Hello,
>  
> I have two questions for SMPP camel component:
>  
> 1) how to set valid period as relative ? It can be defined in absolute time
> format or relative time format if you provide it as String as specified in
> chapter 7.1.1 in the smpp specification v3.4. in format "000001000000000R"
> as one day:
>  
> exchange.getIn().setHeader(SmppConstants.VALIDITY_PERIOD,
> constant("000001000000000R"));
>  
> but in packet trace I see deafult value because this format is incorrect,
> probably, but exactly based upon specification. Maybe bug?
>  
> 2) I would like to send push sms (m-notification-ind PDU type). As content
> of message (exchange.getIn().setBody()) I am sending byte array as whole
> message with UDHI segment. Data coding schema is "Octet unspecified (8-bit
> binary) (0x04)". Problem is that SMPP component calculates length of message
> and EsmClass is configured in right way only if length is greater than 140
> number of bytes.
>  
> In SmppSubmitSmCommand:
> template.setEsmClass(new ESMClass(MessageMode.DEFAULT,
> MessageType.DEFAULT,
> GSMSpecificFeature.UDHI).value());
>  
> I think that message size is not related to UDHI and therefore why is
> splitted and after that if segments is more than one, EmsClass with UDHI is
> configured properly?
>  
> Please, is here any solution how to send m-notification-ind PDU type? As hot
> fix I checkout SMPP camel component and use custom modification of this
> behaviour.
>  
> Thanks,
> Tomas
>  
>  
>  
> --
> View this message in context: http://camel.465427.n5.nabble.com/SMPP-component-and-problem-with-valid-period-relative-and-data-message-tp5758217.html  
> Sent from the Camel - Users mailing list archive at Nabble.com.
>