camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christian Mueller (Confluence)" <conflue...@apache.org>
Subject [CONF] Apache Camel > SMPP
Date Sun, 25 Aug 2013 14:33:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/en/2176/1/1/_/styles/combined.css?spaceKey=CAMEL&amp;forWysiwyg=true" type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://cwiki.apache.org/confluence/display/CAMEL/SMPP">SMPP</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~muellerc">Christian Mueller</a>
    </h4>
        <br/>
                         <h4>Changes (1)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >| {{CamelSmppOptionalParameters}} | {{Map&lt;String, String&gt;}} | *Deprecated and will be removed in Camel 2.13.0/3.0.0*\\ <br>*From Camel 2.11.1 onwards only for DataSm* The optional parameters which are returned from the SMSC by sending the message. | <br></td></tr>
            <tr><td class="diff-changed-lines" >| {{CamelSmppOptionalParameter}} | {{Map&lt;Short, Object&gt;}} | *From Camel <span class="diff-added-words"style="background-color: #dfd;">2.10.7,</span> 2.11.2 onwards only for DataSm* The optional parameter which are returned from the SMSC by sending the message. The key is the {{Short}} code for the optional parameter. The value is converted in the following way: <br></td></tr>
            <tr><td class="diff-unchanged" >{{org.jsmpp.bean.OptionalParameter.COctetString}} -&gt; {{String}}\\ <br>{{org.jsmpp.bean.OptionalParameter.OctetString}} -&gt; {{byte[]}}\\ <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <h2><a name="SMPP-SMPPComponent"></a>SMPP Component</h2>
<p><b>Available as of Camel 2.2</b></p>

<p>This component provides access to an SMSC (Short Message Service Center) over the <a href="http://smsforum.net/SMPP_v3_4_Issue1_2.zip" class="external-link" rel="nofollow">SMPP</a> protocol to send and receive SMS. The <a href="http://code.google.com/p/jsmpp/" class="external-link" rel="nofollow">JSMPP</a> is used.</p>

<p><b>Starting with Camel 2.9</b>, you are also able to execute ReplaceSm, QuerySm, SubmitMulti, CancelSm and DataSm. </p>

<p>Maven users will need to add the following dependency to their <tt>pom.xml</tt> for this component:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Default; brush: xml; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
&lt;dependency&gt;
    &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
    &lt;artifactId&gt;camel-smpp&lt;/artifactId&gt;
    &lt;version&gt;x.x.x&lt;/version&gt;
    &lt;!-- use the same version as your Camel core version --&gt;
&lt;/dependency&gt;
</pre>
</div></div>

<h3><a name="SMPP-URIformat"></a>URI format</h3>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Default; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
smpp://[username@]hostname[:port][?options]
smpps://[username@]hostname[:port][?options]
</pre>
</div></div>

<p>If no <b>username</b> is provided, then Camel will provide the default value <tt>smppclient</tt>.<br/>
If no <b>port</b> number is provided, then Camel will provide the default value <tt>2775</tt>.<br/>
<b>Camel 2.3:</b> If the protocol name is "smpps", camel-smpp with try to use SSLSocket to init a connection to the server.</p>

<p>You can append query options to the URI in the following format, <tt>?option=value&amp;option=value&amp;...</tt></p>

<h3><a name="SMPP-URIOptions"></a>URI Options</h3>

<div class="confluenceTableSmall"><div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Name </th>
<th class='confluenceTh'> Default Value </th>
<th class='confluenceTh'> Description </th>
</tr>
<tr>
<td class='confluenceTd'> <tt>password</tt> </td>
<td class='confluenceTd'> <tt>password</tt> </td>
<td class='confluenceTd'> Specifies the password to use to log in to the SMSC. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>systemType</tt> </td>
<td class='confluenceTd'> <tt>cp</tt> </td>
<td class='confluenceTd'> This parameter is used to categorize the type of ESME (External Short Message Entity) that is binding to the SMSC (max. 13 characters). </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>dataCoding</tt> </td>
<td class='confluenceTd'> <tt>0</tt> </td>
<td class='confluenceTd'> <b>Camel 2.11</b> Defines the data coding according the SMPP 3.4 specification, section 5.2.19. (Prior to <b>Camel 2.9</b>, this option is also supported.) Example data encodings are:<br class="atl-forced-newline" />
<tt>0</tt>: SMSC Default Alphabet<br class="atl-forced-newline" />
<tt>3</tt>: Latin 1 (ISO-8859-1)<br class="atl-forced-newline" />
<tt>4</tt>: Octet unspecified (8-bit binary)<br class="atl-forced-newline" />
<tt>8</tt>: UCS2 (ISO/IEC-10646)<br class="atl-forced-newline" />
<tt>13</tt>: Extended Kanji JIS(X 0212-1990)</td>
</tr>
<tr>
<td class='confluenceTd'> <tt>alphabet</tt> </td>
<td class='confluenceTd'> <tt>0</tt> </td>
<td class='confluenceTd'> <b>Camel 2.5</b> Defines encoding of data according the SMPP 3.4 specification, section 5.2.19. This option is mapped to <a href="http://code.google.com/p/jsmpp/source/browse/tags/2.1.0/src/java/main/org/jsmpp/bean/Alphabet.java" class="external-link" rel="nofollow"><tt>Alphabet.java</tt></a> and used to create the <tt>byte[]</tt> which is send to the SMSC. Example alphabets are:<br class="atl-forced-newline" />
<tt>0</tt>: SMSC Default Alphabet<br class="atl-forced-newline" />
<tt>4</tt>: 8 bit Alphabet<br class="atl-forced-newline" />
<tt>8</tt>: UCS2 Alphabet</td>
</tr>
<tr>
<td class='confluenceTd'> <tt>encoding</tt> </td>
<td class='confluenceTd'> <tt>ISO-8859-1</tt> </td>
<td class='confluenceTd'> <b>only for SubmitSm, ReplaceSm and SubmitMulti</b> Defines the encoding scheme of the short message user data. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>enquireLinkTimer</tt> </td>
<td class='confluenceTd'> <tt>5000</tt> </td>
<td class='confluenceTd'> Defines the interval in milliseconds between the confidence checks. The confidence check is used to test the communication path between an ESME and an SMSC. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>transactionTimer</tt> </td>
<td class='confluenceTd'> <tt>10000</tt> </td>
<td class='confluenceTd'> Defines the maximum period of inactivity allowed after a transaction, after which an SMPP entity may assume that the session is no longer active. This timer may be active on either communicating SMPP entity (i.e. SMSC or ESME). </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>initialReconnectDelay</tt> </td>
<td class='confluenceTd'> <tt>5000</tt> </td>
<td class='confluenceTd'> Defines the initial delay in milliseconds after the consumer/producer tries to reconnect to the SMSC, after the connection was lost. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>reconnectDelay</tt> </td>
<td class='confluenceTd'> <tt>5000</tt> </td>
<td class='confluenceTd'> Defines the interval in milliseconds between the reconnect attempts, if the connection to the SMSC was lost and the previous was not succeed. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>registeredDelivery</tt> </td>
<td class='confluenceTd'> <tt>1</tt> </td>
<td class='confluenceTd'> <b>only for SubmitSm, ReplaceSm, SubmitMulti and DataSm</b> Is used to request an SMSC delivery receipt and/or SME originated acknowledgements. The following values are defined:<br class="atl-forced-newline" />
<tt>0</tt>: No SMSC delivery receipt requested.<br class="atl-forced-newline" />
<tt>1</tt>: SMSC delivery receipt requested where final delivery outcome is success or failure.<br class="atl-forced-newline" />
<tt>2</tt>: SMSC delivery receipt requested where the final delivery outcome is delivery failure. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>serviceType</tt> </td>
<td class='confluenceTd'> <tt>CMT</tt> </td>
<td class='confluenceTd'> The service type parameter can be used to indicate the SMS Application service associated with the message. The following generic service_types are defined:<br class="atl-forced-newline" />
<tt>CMT</tt>: Cellular Messaging<br class="atl-forced-newline" />
<tt>CPT</tt>: Cellular Paging<br class="atl-forced-newline" />
<tt>VMN</tt>: Voice Mail Notification<br class="atl-forced-newline" />
<tt>VMA</tt>: Voice Mail Alerting<br class="atl-forced-newline" />
<tt>WAP</tt>: Wireless Application Protocol<br class="atl-forced-newline" />
<tt>USSD</tt>: Unstructured Supplementary Services Data </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>sourceAddr</tt> </td>
<td class='confluenceTd'> <tt>1616</tt> </td>
<td class='confluenceTd'> Defines the address of SME (Short Message Entity) which originated this message. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>destAddr</tt> </td>
<td class='confluenceTd'> <tt>1717</tt> </td>
<td class='confluenceTd'> <b>only for SubmitSm, SubmitMulti, CancelSm and DataSm</b> Defines the destination SME address. For mobile terminated messages, this is the directory number of the recipient MS. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>sourceAddrTon</tt> </td>
<td class='confluenceTd'> <tt>0</tt> </td>
<td class='confluenceTd'> Defines the type of number (TON) to be used in the SME originator address parameters. The following TON values are defined:<br class="atl-forced-newline" />
<tt>0</tt>: Unknown<br class="atl-forced-newline" />
<tt>1</tt>: International<br class="atl-forced-newline" />
<tt>2</tt>: National<br class="atl-forced-newline" />
<tt>3</tt>: Network Specific<br class="atl-forced-newline" />
<tt>4</tt>: Subscriber Number<br class="atl-forced-newline" />
<tt>5</tt>: Alphanumeric<br class="atl-forced-newline" />
<tt>6</tt>: Abbreviated </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>destAddrTon</tt> </td>
<td class='confluenceTd'> <tt>0</tt> </td>
<td class='confluenceTd'> <b>only for SubmitSm, SubmitMulti, CancelSm and DataSm</b> Defines the type of number (TON) to be used in the SME destination address parameters. Same as the <tt>sourceAddrTon</tt> values defined above.</td>
</tr>
<tr>
<td class='confluenceTd'> <tt>sourceAddrNpi</tt> </td>
<td class='confluenceTd'> <tt>0</tt> </td>
<td class='confluenceTd'> Defines the numeric plan indicator (NPI) to be used in the SME originator address parameters. The following NPI values are defined: <br class="atl-forced-newline" />
<tt>0</tt>: Unknown<br class="atl-forced-newline" />
<tt>1</tt>: ISDN (E163/E164)<br class="atl-forced-newline" />
<tt>2</tt>: Data (X.121)<br class="atl-forced-newline" />
<tt>3</tt>: Telex (F.69)<br class="atl-forced-newline" />
<tt>6</tt>: Land Mobile (E.212)<br class="atl-forced-newline" />
<tt>8</tt>: National<br class="atl-forced-newline" />
<tt>9</tt>: Private<br class="atl-forced-newline" />
<tt>10</tt>: ERMES<br class="atl-forced-newline" />
<tt>13</tt>: Internet (IP)<br class="atl-forced-newline" />
<tt>18</tt>: WAP Client Id (to be defined by WAP Forum) </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>destAddrNpi</tt> </td>
<td class='confluenceTd'> <tt>0</tt> </td>
<td class='confluenceTd'> <b>only for SubmitSm, SubmitMulti, CancelSm and DataSm</b> Defines the numeric plan indicator (NPI) to be used in the SME destination address parameters. Same as the <tt>sourceAddrNpi</tt> values defined above.</td>
</tr>
<tr>
<td class='confluenceTd'> <tt>priorityFlag</tt> </td>
<td class='confluenceTd'> <tt>1</tt> </td>
<td class='confluenceTd'> <b>only for SubmitSm and SubmitMulti</b> Allows the originating SME to assign a priority level to the short message. Four Priority Levels are supported:<br class="atl-forced-newline" />
<tt>0</tt>: Level 0 (lowest) priority<br class="atl-forced-newline" />
<tt>1</tt>: Level 1 priority<br class="atl-forced-newline" />
<tt>2</tt>: Level 2 priority<br class="atl-forced-newline" />
<tt>3</tt>: Level 3 (highest) priority </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>replaceIfPresentFlag</tt> </td>
<td class='confluenceTd'> <tt>0</tt> </td>
<td class='confluenceTd'> <b>only for SubmitSm and SubmitMulti</b> Used to request the SMSC to replace a previously submitted message, that is still pending delivery. The SMSC will replace an existing message provided that the source address, destination address and service type match the same fields in the new message. The following replace if present flag values are defined: <br class="atl-forced-newline" />
<tt>0</tt>: Don't replace<br class="atl-forced-newline" />
<tt>1</tt>: Replace </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>typeOfNumber</tt> </td>
<td class='confluenceTd'> <tt>0</tt> </td>
<td class='confluenceTd'> Defines the type of number (TON) to be used in the SME. Use the <tt>sourceAddrTon</tt> values defined above. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>numberingPlanIndicator</tt> </td>
<td class='confluenceTd'> <tt>0</tt> </td>
<td class='confluenceTd'> Defines the numeric plan indicator (NPI) to be used in the SME. Use the <tt>sourceAddrNpi</tt> values defined above.</td>
</tr>
<tr>
<td class='confluenceTd'> <tt>lazySessionCreation</tt> </td>
<td class='confluenceTd'> <tt>false</tt> </td>
<td class='confluenceTd'> <b>Camel 2.8 onwards</b> Sessions can be lazily created to avoid exceptions, if the SMSC is not available when the Camel producer is started.<br class="atl-forced-newline" />
<b>Camel 2.11 onwards</b> Camel will check the in message headers 'CamelSmppSystemId' and 'CamelSmppPassword' of the first exchange. If they are present, Camel will use these data to connect to the SMSC. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>httpProxyHost</tt> </td>
<td class='confluenceTd'> <tt>null</tt> </td>
<td class='confluenceTd'> <b>Camel 2.9.1:</b> If you need to tunnel SMPP through a HTTP proxy, set this attribute to the hostname or ip address of your HTTP proxy. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>httpProxyPort</tt> </td>
<td class='confluenceTd'> <tt>3128</tt> </td>
<td class='confluenceTd'> <b>Camel 2.9.1:</b> If you need to tunnel SMPP through a HTTP proxy, set this attribute to the port of your HTTP proxy. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>httpProxyUsername</tt> </td>
<td class='confluenceTd'> <tt>null</tt> </td>
<td class='confluenceTd'> <b>Camel 2.9.1:</b> If your HTTP proxy requires basic authentication, set this attribute to the username required for your HTTP proxy. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>httpProxyPassword</tt> </td>
<td class='confluenceTd'> <tt>null</tt> </td>
<td class='confluenceTd'> <b>Camel 2.9.1:</b> If your HTTP proxy requires basic authentication, set this attribute to the password required for your HTTP proxy. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>sessionStateListener</tt> </td>
<td class='confluenceTd'> <tt>null</tt> </td>
<td class='confluenceTd'> <b>Camel 2.9.3:</b> You can refer to a <tt>org.jsmpp.session.SessionStateListener</tt> in the <tt>Registry</tt> to receive callbacks when the session state changed. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>addressRange</tt> </td>
<td class='confluenceTd'> <tt>""</tt> </td>
<td class='confluenceTd'> <b>Camel 2.11:</b> You can specify the address range for the <tt>SmppConsumer</tt> as defined in section 5.2.7 of the SMPP 3.4 specification. The <tt>SmppConsumer</tt> will receive messages only from SMSC's which target an address (MSISDN or IP address) within this range. </td>
</tr>
</tbody></table>
</div>
</div>

<p>You can have as many of these options as you like.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Default; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
smpp://smppclient@localhost:2775?password=password&amp;enquireLinkTimer=3000&amp;transactionTimer=5000&amp;systemType=consumer
</pre>
</div></div>


<h3><a name="SMPP-ProducerMessageHeaders"></a>Producer Message Headers</h3>

<p>The following message headers can be used to affect the behavior of the SMPP producer</p>
<div class="confluenceTableSmall"><div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Header </th>
<th class='confluenceTh'> Type </th>
<th class='confluenceTh'> Description </th>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelSmppDestAddr</tt> </td>
<td class='confluenceTd'> <tt>List</tt>/<tt>String</tt> </td>
<td class='confluenceTd'> <b>only for SubmitSm, SubmitMulti, CancelSm and DataSm</b> Defines the destination SME address(es). For mobile terminated messages, this is the directory number of the recipient MS. Is must be a <tt>List&lt;String&gt;</tt> for SubmitMulti and a <tt>String</tt> otherwise. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelSmppDestAddrTon</tt> </td>
<td class='confluenceTd'> <tt>Byte</tt> </td>
<td class='confluenceTd'> <b>only for SubmitSm, SubmitMulti, CancelSm and DataSm</b> Defines the type of number (TON) to be used in the SME destination address parameters. Use the <tt>sourceAddrTon</tt> URI option values defined above. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelSmppDestAddrNpi</tt> </td>
<td class='confluenceTd'> <tt>Byte</tt> </td>
<td class='confluenceTd'> <b>only for SubmitSm, SubmitMulti, CancelSm and DataSm</b> Defines the numeric plan indicator (NPI) to be used in the SME destination address parameters. Use the URI option <tt>sourceAddrNpi</tt> values defined above.</td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelSmppSourceAddr</tt> </td>
<td class='confluenceTd'> <tt>String</tt> </td>
<td class='confluenceTd'> Defines the address of SME (Short Message Entity) which originated this message. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelSmppSourceAddrTon</tt> </td>
<td class='confluenceTd'> <tt>Byte</tt> </td>
<td class='confluenceTd'> Defines the type of number (TON) to be used in the SME originator address parameters. Use the <tt>sourceAddrTon</tt> URI option values defined above. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelSmppSourceAddrNpi</tt> </td>
<td class='confluenceTd'> <tt>Byte</tt> </td>
<td class='confluenceTd'> Defines the numeric plan indicator (NPI) to be used in the SME originator address parameters. Use the URI option <tt>sourceAddrNpi</tt> values defined above.</td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelSmppServiceType</tt> </td>
<td class='confluenceTd'> <tt>String</tt> </td>
<td class='confluenceTd'> The service type parameter can be used to indicate the SMS Application service associated with the message. Use the URI option <tt>serviceType</tt> settings above.</td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelSmppRegisteredDelivery</tt> </td>
<td class='confluenceTd'> <tt>Byte</tt> </td>
<td class='confluenceTd'> <b>only for SubmitSm, ReplaceSm, SubmitMulti and DataSm</b> Is used to request an SMSC delivery receipt and/or SME originated acknowledgements. Use the URI option <tt>registeredDelivery</tt> settings above. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelSmppPriorityFlag</tt> </td>
<td class='confluenceTd'> <tt>Byte</tt> </td>
<td class='confluenceTd'> <b>only for SubmitSm and SubmitMulti</b> Allows the originating SME to assign a priority level to the short message. Use the URI option <tt>priorityFlag</tt> settings above.</td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelSmppScheduleDeliveryTime</tt> </td>
<td class='confluenceTd'> <tt>Date</tt> </td>
<td class='confluenceTd'> <b>only for SubmitSm, SubmitMulti and ReplaceSm</b> This parameter specifies the scheduled time at which the message delivery should be first attempted. It defines either the absolute date and time or relative time from the current SMSC time at which delivery of this message will be attempted by the SMSC. It can be specified in either absolute time format or relative time format. The encoding of a time format is specified in chapter 7.1.1. in the smpp specification v3.4. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelSmppValidityPeriod</tt> </td>
<td class='confluenceTd'> <tt>String</tt>/<tt>Date</tt> </td>
<td class='confluenceTd'> <b>only for SubmitSm, SubmitMulti and ReplaceSm</b> The validity period parameter indicates the SMSC expiration time, after which the message should be discarded if not delivered to the destination. If it's provided as <tt>Date</tt>, it's interpreted as absolute time. <b>Camel 2.9.1 onwards:</b> It can be defined in absolute time format or relative time format if you provide it as <tt>String</tt> as specified in chapter 7.1.1 in the smpp specification v3.4. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelSmppReplaceIfPresentFlag</tt> </td>
<td class='confluenceTd'> <tt>Byte</tt> </td>
<td class='confluenceTd'> <b>only for SubmitSm and SubmitMulti</b> The replace if present flag parameter is used to request the SMSC to replace a previously submitted message, that is still pending delivery. The SMSC will replace an existing message provided that the source address, destination address and service type match the same fields in the new message. The following values are defined: <br class="atl-forced-newline" />
<tt>0</tt>: Don't replace<br class="atl-forced-newline" />
<tt>1</tt>: Replace </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelSmppAlphabet</tt> / <tt>CamelSmppDataCoding</tt> </td>
<td class='confluenceTd'> <tt>Byte</tt> </td>
<td class='confluenceTd'> <b>Camel 2.5</b> <b>For SubmitSm, SubmitMulti and ReplaceSm</b> (Prior to <b>Camel 2.9</b> use <tt>CamelSmppDataCoding</tt> instead of <tt>CamelSmppAlphabet</tt>.) The data coding according to the SMPP 3.4 specification, section 5.2.19.  Use the URI option <tt>alphabet</tt> settings above. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelSmppOptionalParameters</tt> </td>
<td class='confluenceTd'> <tt>Map&lt;String, String&gt;</tt> </td>
<td class='confluenceTd'> <b>Deprecated and will be removed in Camel 2.13.0/3.0.0</b><br class="atl-forced-newline" />
<b>Camel 2.10.5 and 2.11.1 onwards and only for SubmitSm, SubmitMulti and DataSm</b> The optional parameters send back by the SMSC. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelSmppOptionalParameter</tt> </td>
<td class='confluenceTd'> <tt>Map&lt;Short, Object&gt;</tt> </td>
<td class='confluenceTd'> <b>Camel 2.10.7 and 2.11.2 onwards and only for SubmitSm, SubmitMulti and DataSm</b> The optional parameter which are send to the SMSC. The value is converted in the following way:<br class="atl-forced-newline" />
<tt>String</tt> -&gt; <tt>org.jsmpp.bean.OptionalParameter.COctetString</tt><br class="atl-forced-newline" />
<tt>byte[]</tt> -&gt; <tt>org.jsmpp.bean.OptionalParameter.OctetString</tt><br class="atl-forced-newline" />
<tt>Byte</tt> -&gt; <tt>org.jsmpp.bean.OptionalParameter.Byte</tt><br class="atl-forced-newline" />
<tt>Integer</tt> -&gt; <tt>org.jsmpp.bean.OptionalParameter.Int</tt><br class="atl-forced-newline" />
<tt>Short</tt> -&gt; <tt>org.jsmpp.bean.OptionalParameter.Short</tt><br class="atl-forced-newline" />
<tt>null</tt> -&gt; <tt>org.jsmpp.bean.OptionalParameter.Null</tt> </td>
</tr>
</tbody></table>
</div>
</div>

<p>The following message headers are used by the SMPP producer to set the response from the SMSC in the message header</p>
<div class="confluenceTableSmall"><div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Header </th>
<th class='confluenceTh'> Type </th>
<th class='confluenceTh'> Description </th>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelSmppId</tt> </td>
<td class='confluenceTd'> <tt>List&lt;String&gt;</tt>/<tt>String</tt> </td>
<td class='confluenceTd'> The id to identify the submitted short message(s) for later use. <b>From Camel 2.9.0</b>: In case of a ReplaceSm, QuerySm, CancelSm and DataSm this header vaule is a <tt>String</tt>. In case of a SubmitSm or SubmitMultiSm this header vaule is a <tt>List&lt;String&gt;</tt>. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelSmppSentMessageCount</tt> </td>
<td class='confluenceTd'> <tt>Integer</tt> </td>
<td class='confluenceTd'> <b>From Camel 2.9 onwards only for SubmitSm and SubmitMultiSm</b> The total number of messages which has been sent. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelSmppError</tt> </td>
<td class='confluenceTd'> <tt>Map&lt;String, List&lt;Map&lt;String, Object&gt;&gt;&gt;</tt> </td>
<td class='confluenceTd'> <b>From Camel 2.9 onwards only for SubmitMultiSm</b> The errors which occurred by sending the short message(s) the form <tt>Map&lt;String, List&lt;Map&lt;String, Object&gt;&gt;&gt;</tt> (messageID : (destAddr : address, error : errorCode)). </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelSmppOptionalParameters</tt> </td>
<td class='confluenceTd'> <tt>Map&lt;String, String&gt;</tt> </td>
<td class='confluenceTd'> <b>Deprecated and will be removed in Camel 2.13.0/3.0.0</b><br class="atl-forced-newline" />
<b>From Camel 2.11.1 onwards only for DataSm</b> The optional parameters which are returned from the SMSC by sending the message. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelSmppOptionalParameter</tt> </td>
<td class='confluenceTd'> <tt>Map&lt;Short, Object&gt;</tt> </td>
<td class='confluenceTd'> <b>From Camel 2.10.7, 2.11.2 onwards only for DataSm</b> The optional parameter which are returned from the SMSC by sending the message. The key is the <tt>Short</tt> code for the optional parameter. The value is converted in the following way:<br class="atl-forced-newline" />
<tt>org.jsmpp.bean.OptionalParameter.COctetString</tt> -&gt; <tt>String</tt><br class="atl-forced-newline" />
<tt>org.jsmpp.bean.OptionalParameter.OctetString</tt> -&gt; <tt>byte[]</tt><br class="atl-forced-newline" />
<tt>org.jsmpp.bean.OptionalParameter.Byte</tt> -&gt; <tt>Byte</tt><br class="atl-forced-newline" />
<tt>org.jsmpp.bean.OptionalParameter.Int</tt> -&gt; <tt>Integer</tt><br class="atl-forced-newline" />
<tt>org.jsmpp.bean.OptionalParameter.Short</tt> -&gt; <tt>Short</tt><br class="atl-forced-newline" />
<tt>org.jsmpp.bean.OptionalParameter.Null</tt> -&gt; <tt>null</tt> </td>
</tr>
</tbody></table>
</div>
</div>

<h3><a name="SMPP-ConsumerMessageHeaders"></a>Consumer Message Headers</h3>

<p>The following message headers are used by the SMPP consumer to set the request data from the SMSC in the message header</p>
<div class="confluenceTableSmall"><div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Header </th>
<th class='confluenceTh'> Type </th>
<th class='confluenceTh'> Description </th>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelSmppSequenceNumber</tt> </td>
<td class='confluenceTd'> <tt>Integer</tt> </td>
<td class='confluenceTd'> <b>only for AlertNotification, DeliverSm and DataSm</b> A sequence number allows a response PDU to be correlated with a request PDU. The associated SMPP response PDU must preserve this field. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelSmppCommandId</tt> </td>
<td class='confluenceTd'> <tt>Integer</tt> </td>
<td class='confluenceTd'> <b>only for AlertNotification, DeliverSm and DataSm</b> The command id field identifies the particular SMPP PDU. For the complete list of defined values see chapter 5.1.2.1 in the smpp specification v3.4. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelSmppSourceAddr</tt> </td>
<td class='confluenceTd'> <tt>String</tt> </td>
<td class='confluenceTd'> <b>only for AlertNotification, DeliverSm and DataSm</b> Defines the address of SME (Short Message Entity) which originated this message. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelSmppSourceAddrNpi</tt> </td>
<td class='confluenceTd'> <tt>Byte</tt> </td>
<td class='confluenceTd'> <b>only for AlertNotification and DataSm</b> Defines the numeric plan indicator (NPI) to be used in the SME originator address parameters. Use the URI option <tt>sourceAddrNpi</tt> values defined above.</td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelSmppSourceAddrTon</tt> </td>
<td class='confluenceTd'> <tt>Byte</tt> </td>
<td class='confluenceTd'> <b>only for AlertNotification and DataSm</b> Defines the type of number (TON) to be used in the SME originator address parameters. Use the <tt>sourceAddrTon</tt> URI option values defined above. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelSmppEsmeAddr</tt> </td>
<td class='confluenceTd'> <tt>String</tt> </td>
<td class='confluenceTd'> <b>only for AlertNotification</b> Defines the destination ESME address. For mobile terminated messages, this is the directory number of the recipient MS. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelSmppEsmeAddrNpi</tt> </td>
<td class='confluenceTd'> <tt>Byte</tt> </td>
<td class='confluenceTd'> <b>only for AlertNotification</b> Defines the numeric plan indicator (NPI) to be used in the ESME originator address parameters. Use the URI option <tt>sourceAddrNpi</tt> values defined above.</td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelSmppEsmeAddrTon</tt> </td>
<td class='confluenceTd'> <tt>Byte</tt> </td>
<td class='confluenceTd'> <b>only for AlertNotification</b> Defines the type of number (TON) to be used in the ESME originator address parameters. Use the <tt>sourceAddrTon</tt> URI option values defined above. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelSmppId</tt> </td>
<td class='confluenceTd'> <tt>String</tt> </td>
<td class='confluenceTd'> <b>only for smsc DeliveryReceipt and DataSm</b> The message ID allocated to the message by the SMSC when originally submitted. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelSmppDelivered</tt> </td>
<td class='confluenceTd'> <tt>Integer</tt> </td>
<td class='confluenceTd'> <b>only for smsc DeliveryReceipt</b> Number of short messages delivered. This is only relevant where the original message was submitted to a distribution list.The value is padded with leading zeros if necessary. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelSmppDoneDate</tt> </td>
<td class='confluenceTd'> <tt>Date</tt> </td>
<td class='confluenceTd'> <b>only for smsc DeliveryReceipt</b> The time and date at which the short message reached it's final state. The format is as follows: YYMMDDhhmm. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelSmppFinalStatus</tt> </td>
<td class='confluenceTd'> <tt>DeliveryReceiptState</tt> </td>
<td class='confluenceTd'> <b>only for smsc DeliveryReceipt:</b> The final status of the message. The following values are defined:<br class="atl-forced-newline" />
<tt>DELIVRD</tt>: Message is delivered to destination<br class="atl-forced-newline" />
<tt>EXPIRED</tt>: Message validity period has expired.<br class="atl-forced-newline" />
<tt>DELETED</tt>: Message has been deleted.<br class="atl-forced-newline" />
<tt>UNDELIV</tt>: Message is undeliverable<br class="atl-forced-newline" />
<tt>ACCEPTD</tt>: Message is in accepted state (i.e. has been manually read on behalf of the subscriber by customer service)<br class="atl-forced-newline" />
<tt>UNKNOWN</tt>: Message is in invalid state<br class="atl-forced-newline" />
<tt>REJECTD</tt>: Message is in a rejected state </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelSmppCommandStatus</tt> </td>
<td class='confluenceTd'> <tt>Integer</tt> </td>
<td class='confluenceTd'> <b>only for DataSm</b> The Command status of the message. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelSmppError</tt> </td>
<td class='confluenceTd'> <tt>String</tt> </td>
<td class='confluenceTd'> <b>only for smsc DeliveryReceipt</b> Where appropriate this may hold a Network specific error code or an SMSC error code for the attempted delivery of the message. These errors are Network or SMSC specific and are not included here. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelSmppSubmitDate</tt> </td>
<td class='confluenceTd'> <tt>Date</tt> </td>
<td class='confluenceTd'> <b>only for smsc DeliveryReceipt</b> The time and date at which the short message was submitted. In the case of a message which has been replaced, this is the date that the original message was replaced. The format is as follows: YYMMDDhhmm. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelSmppSubmitted</tt> </td>
<td class='confluenceTd'> <tt>Integer</tt> </td>
<td class='confluenceTd'> <b>only for smsc DeliveryReceipt</b> Number of short messages originally submitted. This is only relevant when the original message was submitted to a distribution list.The value is padded with leading zeros if necessary. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelSmppDestAddr</tt> </td>
<td class='confluenceTd'> <tt>String</tt> </td>
<td class='confluenceTd'> <b>only for DeliverSm and DataSm:</b> Defines the destination SME address. For mobile terminated messages, this is the directory number of the recipient MS. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelSmppScheduleDeliveryTime</tt> </td>
<td class='confluenceTd'> <tt>String</tt> </td>
<td class='confluenceTd'> <b>only for DeliverSm:</b> This parameter specifies the scheduled time at which the message delivery should be first attempted. It defines either the absolute date and time or relative time from the current SMSC time at which delivery of this message will be attempted by the SMSC. It can be specified in either absolute time format or relative time format. The encoding of a time	format is specified in Section 7.1.1. in the smpp specification v3.4. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelSmppValidityPeriod</tt> </td>
<td class='confluenceTd'> <tt>String</tt> </td>
<td class='confluenceTd'> <b>only for DeliverSm</b> The validity period parameter indicates the SMSC expiration time, after which the message should be discarded if not delivered to the destination. It can be defined in absolute time format or relative time format. The encoding of absolute and relative time format is specified in Section 7.1.1 in the smpp specification v3.4. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelSmppServiceType</tt> </td>
<td class='confluenceTd'> <tt>String</tt> </td>
<td class='confluenceTd'> <b>only for DeliverSm and DataSm</b> The service type parameter indicates the SMS Application service associated with the message. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelSmppRegisteredDelivery</tt> </td>
<td class='confluenceTd'> <tt>Byte</tt> </td>
<td class='confluenceTd'> <b>only for DataSm</b> Is used to request an delivery receipt and/or SME originated acknowledgements. Same values as in Producer header list above.  </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelSmppDestAddrNpi</tt> </td>
<td class='confluenceTd'> <tt>Byte</tt> </td>
<td class='confluenceTd'> <b>only for DataSm</b> Defines the numeric plan indicator (NPI) in the destination address parameters. Use the URI option <tt>sourceAddrNpi</tt> values defined above.</td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelSmppDestAddrTon</tt> </td>
<td class='confluenceTd'> <tt>Byte</tt> </td>
<td class='confluenceTd'> <b>only for DataSm</b> Defines the type of number (TON) in the destination address parameters. Use the <tt>sourceAddrTon</tt> URI option values defined above. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelSmppMessageType</tt> </td>
<td class='confluenceTd'> <tt>String</tt> </td>
<td class='confluenceTd'> <b>Camel 2.6 onwards</b>: Identifies the type of an incoming message:<br class="atl-forced-newline" />
<tt>AlertNotification</tt>: an SMSC alert notification<br class="atl-forced-newline" />
<tt>DataSm</tt>: an SMSC data short message<br class="atl-forced-newline" />
<tt>DeliveryReceipt</tt>: an SMSC delivery receipt<br class="atl-forced-newline" />
<tt>DeliverSm</tt>: an SMSC deliver short message </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelSmppOptionalParameters</tt> </td>
<td class='confluenceTd'> <tt>Map&lt;String, Object&gt;</tt> </td>
<td class='confluenceTd'> <b>Deprecated and will be removed in Camel 2.13.0/3.0.0</b><br class="atl-forced-newline" />
<b>Camel 2.10.5 onwards and only for DeliverSm</b> The optional parameters send back by the SMSC. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelSmppOptionalParameter</tt> </td>
<td class='confluenceTd'> <tt>Map&lt;Short, Object&gt;</tt> </td>
<td class='confluenceTd'> <b>Camel 2.10.7, 2.11.2 onwards and only for DeliverSm</b> The optional parameters send back by the SMSC. The key is the <tt>Short</tt> code for the optional parameter. The value is converted in the following way:<br class="atl-forced-newline" />
<tt>org.jsmpp.bean.OptionalParameter.COctetString</tt> -&gt; <tt>String</tt><br class="atl-forced-newline" />
<tt>org.jsmpp.bean.OptionalParameter.OctetString</tt> -&gt; <tt>byte[]</tt><br class="atl-forced-newline" />
<tt>org.jsmpp.bean.OptionalParameter.Byte</tt> -&gt; <tt>Byte</tt><br class="atl-forced-newline" />
<tt>org.jsmpp.bean.OptionalParameter.Int</tt> -&gt; <tt>Integer</tt><br class="atl-forced-newline" />
<tt>org.jsmpp.bean.OptionalParameter.Short</tt> -&gt; <tt>Short</tt><br class="atl-forced-newline" />
<tt>org.jsmpp.bean.OptionalParameter.Null</tt> -&gt; <tt>null</tt> </td>
</tr>
</tbody></table>
</div>
</div>

<div class='panelMacro'><table class='tipMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/confluence/images/icons/emoticons/check.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b>JSMPP library</b><br />See the documentation of the <a href="http://code.google.com/p/jsmpp/" class="external-link" rel="nofollow">JSMPP Library</a> for more details about the underlying library.</td></tr></table></div>


<h3><a name="SMPP-Exceptionhandling"></a>Exception handling</h3>
<p>This component supports the general Camel exception handling capabilities.<br/>
<b>Camel 2.8 onwards</b>: When the SMPP consumer receives a <tt>DeliverSm</tt> or <tt>DataSm</tt> short message and the processing of these messages fails, you can also throw a <tt>ProcessRequestException</tt> instead of handle the failure. In this case, this exception is forwarded to the underlying <a href="http://code.google.com/p/jsmpp/" class="external-link" rel="nofollow">JSMPP library</a> which will return the included error code to the SMSC. This feature is useful to e.g. instruct the SMSC to resend the short message at a later time. This could be done with the following lines of code:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Default; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
from("smpp://smppclient@localhost:2775?password=password&amp;enquireLinkTimer=3000&amp;transactionTimer=5000&amp;systemType=consumer")
  .doTry()
    .to("bean:dao?method=updateSmsState")
  .doCatch(Exception.class)
    .throwException(new ProcessRequestException("update of sms state failed", 100))
  .end();
</pre>
</div></div>

<p>Please refer to the <a href="http://smsforum.net/SMPP_v3_4_Issue1_2.zip" class="external-link" rel="nofollow">SMPP specification</a> for the complete list of error codes and their meanings.</p>

<h3><a name="SMPP-Samples"></a>Samples</h3>

<p>A route which sends an SMS using the Java DSL:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Default; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
from("direct:start")
  .to("smpp://smppclient@localhost:2775?
      password=password&amp;enquireLinkTimer=3000&amp;transactionTimer=5000&amp;systemType=producer");
</pre>
</div></div>

<p>A route which sends an SMS using the Spring XML DSL:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Default; brush: xml; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
&lt;route&gt;
  &lt;from uri="direct:start"/&gt;
  &lt;to uri="smpp://smppclient@localhost:2775?
           password=password&amp;amp;enquireLinkTimer=3000&amp;amp;transactionTimer=5000&amp;amp;systemType=producer"/&gt;
&lt;/route&gt;
</pre>
</div></div>

<p>A route which receives an SMS using the Java DSL:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Default; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
from("smpp://smppclient@localhost:2775?password=password&amp;enquireLinkTimer=3000&amp;transactionTimer=5000&amp;systemType=consumer")
  .to("bean:foo");
</pre>
</div></div>

<p>A route which receives an SMS using the Spring XML DSL:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Default; brush: xml; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
  &lt;route&gt;
     &lt;from uri="smpp://smppclient@localhost:2775?
                password=password&amp;amp;enquireLinkTimer=3000&amp;amp;transactionTimer=5000&amp;amp;systemType=consumer"/&gt;
     &lt;to uri="bean:foo"/&gt;
  &lt;/route&gt;
</pre>
</div></div>

<div class='panelMacro'><table class='tipMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/confluence/images/icons/emoticons/check.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b>SMSC simulator</b><br />If you need an SMSC simulator for your test, you can use the simulator provided by <a href="http://opensmpp.logica.com/CommonPart/Download/download2.html#simulator" class="external-link" rel="nofollow">Logica</a>.</td></tr></table></div>

<h3><a name="SMPP-Debuglogging"></a>Debug logging</h3>

<p>This component has log level <b>DEBUG</b>, which can be helpful in debugging problems. If you use log4j, you can add the following line to your configuration:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Default; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
log4j.logger.org.apache.camel.component.smpp=DEBUG
</pre>
</div></div>


<h3><a name="SMPP-SeeAlso"></a>See Also</h3>
<ul>
	<li><a href="/confluence/display/CAMEL/Configuring+Camel" title="Configuring Camel">Configuring Camel</a></li>
	<li><a href="/confluence/display/CAMEL/Component" title="Component">Component</a></li>
	<li><a href="/confluence/display/CAMEL/Endpoint" title="Endpoint">Endpoint</a></li>
	<li><a href="/confluence/display/CAMEL/Getting+Started" title="Getting Started">Getting Started</a></li>
</ul>

    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;" class="grey">
                        <a href="https://cwiki.apache.org/confluence/users/removespacenotification.action?spaceKey=CAMEL">Stop watching space</a>
            <span style="padding: 0px 5px;">|</span>
                <a href="https://cwiki.apache.org/confluence/users/editmyemailsettings.action">Change email notification preferences</a>
</div>
        <a href="https://cwiki.apache.org/confluence/display/CAMEL/SMPP">View Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=9012014&revisedVersion=46&originalVersion=45">View Changes</a>
                |
        <a href="https://cwiki.apache.org/confluence/display/CAMEL/SMPP?showComments=true&amp;showCommentArea=true#addcomment">Add Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message