Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add changes related to new SMPP inbound endpoint UI schema #1090

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -18,72 +18,80 @@ The following diagram shows the overall solution we are going to build. The SMSC

2. Create a sequence to process the message. In this example, we will just log the message for simplicity, but in a real-world use case, this can be any message mediation.

```xml
<?xml version="1.0" encoding="UTF-8"?>
<sequence xmlns="http://ws.apache.org/ns/synapse" name="request" onError="fault">
<log level="custom">
<property xmlns:ns="http://org.apache.synapse/xsd"
name="MessageId"
expression="get-property('SMPP_MessageId')"/>
<property xmlns:ns="http://org.apache.synapse/xsd"
name="SourceAddress"
expression="get-property('SMPP_SourceAddress')"/>
<property xmlns:ns="http://org.apache.synapse/xsd"
name="DataCoding"
expression="get-property('SMPP_DataCoding')"/>
<property xmlns:ns="http://org.apache.synapse/xsd"
name="ScheduleDeliveryTime"
expression="get-property('SMPP_ScheduleDeliveryTime')"/>
<property xmlns:ns="http://org.apache.synapse/xsd"
name="SequenceNumber"
expression="get-property('SMPP_SequenceNumber')"/>
<property xmlns:ns="http://org.apache.synapse/xsd"
name="ServiceType"
expression="get-property('SMPP_ServiceType')"/>
</log>
<log level="full"/>
</sequence>
```
3. Click `+` button next to `Inbound Endpoints` and select `Custom` to add a new **custom inbound endpoint**.
<img src="{{base_path}}/assets/img/integrate/connectors/smpp-create-new-inbound-endpoint.png" title="Creating custom inbound endpoint" width="800" alt="Creating custom inbound endpoint" style="border:1px solid black"/>
<br/>
4. Configure the custom inbound endpoint as shown below and click `Create`.
<img src="{{base_path}}/assets/img/integrate/connectors/smpp-config-endpoint-1.png" title="Configure custom inbound endpoint 1" width="600" alt="Configure custom inbound endpoint 1" style="border:1px solid black"/>
<img src="{{base_path}}/assets/img/integrate/connectors/smpp-config-endpoint-2.png" title="Configure custom inbound endpoint 2" width="600" alt="Configure custom inbound endpoint 2" style="border:1px solid black"/>

The source view of the created inbound endpoint is shown below.
```xml
<?xml version="1.0" encoding="UTF-8"?>
<inboundEndpoint xmlns="http://ws.apache.org/ns/synapse"
name="SMPP"
sequence="request"
onError="fault"
class="org.wso2.carbon.inbound.smpp.SMPPListeningConsumer"
suspend="false">
<parameters>
<parameter name="inbound.behavior">eventBased</parameter>
<parameter name="sequential">true</parameter>
<parameter name="coordination">true</parameter>
<parameter name="port">2775</parameter>
<parameter name="addressNpi">UNKNOWN</parameter>
<parameter name="host">localhost</parameter>
<parameter name="reconnectInterval">3000</parameter>
<parameter name="addressTon">UNKNOWN</parameter>
<parameter name="systemType">CPT</parameter>
<parameter name="retryCount">-1</parameter>
<parameter name="bindType">BIND_RX</parameter>
<parameter name="addressRange">null</parameter>
<parameter name="systemId">kasun</parameter>
<parameter name="password">kasun</parameter>
<parameter name="exponentialFactor">5</parameter>
<parameter name="maximumBackoffTime">10000</parameter>
</parameters>
</inboundEndpoint>
```
```xml
<?xml version="1.0" encoding="UTF-8"?>
<sequence xmlns="http://ws.apache.org/ns/synapse" name="request" onError="fault">
<log level="custom">
<property xmlns:ns="http://org.apache.synapse/xsd"
name="MessageId"
expression="get-property('SMPP_MessageId')"/>
<property xmlns:ns="http://org.apache.synapse/xsd"
name="SourceAddress"
expression="get-property('SMPP_SourceAddress')"/>
<property xmlns:ns="http://org.apache.synapse/xsd"
name="DataCoding"
expression="get-property('SMPP_DataCoding')"/>
<property xmlns:ns="http://org.apache.synapse/xsd"
name="ScheduleDeliveryTime"
expression="get-property('SMPP_ScheduleDeliveryTime')"/>
<property xmlns:ns="http://org.apache.synapse/xsd"
name="SequenceNumber"
expression="get-property('SMPP_SequenceNumber')"/>
<property xmlns:ns="http://org.apache.synapse/xsd"
name="ServiceType"
expression="get-property('SMPP_ServiceType')"/>
</log>
<log level="full"/>
</sequence>
```

> **Note**: To configure the `systemId` and `password` parameter value, please use the steps given under the topic `Configure the SMSC (Short Message Service Center) simulator` in the [Setting up the SMPP Connector ]({{base_path}}/reference/connectors/smpp-connector/smpp-connector-configuration/) documentation.
> - **systemId** : username to access the SMSC
> - **password** : password to access the SMSC
3. Click `+` button next to `Inbound Endpoints` and select `SMPP` to add a new **SMPP inbound endpoint**.

<img src="{{base_path}}/assets/img/integrate/connectors/smpp-create-new-inbound-endpoint.png" title="Creating smpp inbound endpoint" width="1000" alt="Creating smpp inbound endpoint" style="border:1px solid black"/>
<br/>

4. Configure the SMPP inbound endpoint as shown below and click `Create`.

<img src="{{base_path}}/assets/img/integrate/connectors/smpp-config-endpoint-1.png" title="Configure SMPP inbound endpoint 1" width="1000" alt="Configure SMPP inbound endpoint 1" style="border:1px solid black"/>
<br/>

!!! Note
When creating the SMPP inbound endpoint you have two options in defining the injecting sequence and error sequence.
<br/>- **Automatic** : Click the checkbox *Automatically generate sequence*
<br/>- **Manual** : You can select already defined sequences as injecting and error sequences.

<img src="{{base_path}}/assets/img/integrate/connectors/smpp-injecting-and-error-sequence.png" title="Configure SMPP inbound endpoint Injecting and Error Sequences" width="600" alt="Configure SMPP inbound endpoint Injecting and Error Sequences" style="border:1px solid black"/>

The source view of the created inbound endpoint is shown below.

```xml
<?xml version="1.0" encoding="UTF-8"?>
<inboundEndpoint name="SMPP" class="org.wso2.carbon.inbound.smpp.SMPPListeningConsumer" sequence="request" onError="fault" suspend="false">
<parameters xmlns="http://ws.apache.org/ns/synapse">
<parameter name="inbound.behavior">eventBased</parameter>
<parameter name="sequential">true</parameter>
<parameter name="coordination">true</parameter>
<parameter name="host">localhost</parameter>
<parameter name="port">2775</parameter>
<parameter name="systemId">pavel</parameter>
<parameter name="password">wpsd</parameter>
<parameter name="bindType">BIND_RX</parameter>
<parameter name="addressTon">UNKNOWN</parameter>
<parameter name="addressNpi">UNKNOWN</parameter>
<parameter name="enquireLinkTimer">10000</parameter>
<parameter name="transactionTimer">200</parameter>
<parameter name="reconnectInterval">1000</parameter>
<parameter name="retryCount">3</parameter>
<parameter name="exponentialFactor">5</parameter>
<parameter name="maximumBackoffTime">10000</parameter>
</parameters>
</inboundEndpoint>
```

!!! Note
To configure the `systemId` and `password` parameter value, please use the steps given under the topic `Configure the SMSC (Short Message Service Center) simulator` in the [Setting up the SMPP Connector ]({{base_path}}/reference/connectors/smpp-connector/smpp-connector-configuration/) documentation.
<br/>- **systemId** : username to access the SMSC
<br/>- **password** : password to access the SMSC

## Export integration logic as a CApp

Expand All @@ -105,7 +113,12 @@ You can download the ZIP file and extract the contents to get the project code.
1. Navigate to the [connector store](https://store.wso2.com/store/assets/esbconnector/list) and search for `SMPP Connector`. Click on `SMPP Inbound Endpoint` and download the .jar file by clicking on `Download Inbound Endpoint`. Copy this .jar file into **PRODUCT-HOME/lib** folder.

2. Download [jsmpp-2.1.0-RELEASE.jar](https://mvnrepository.com/artifact/com.googlecode.jsmpp/jsmpp/2.1.0-RELEASE) and [asyncretry-jdk7-0.0.6.jar](https://mvnrepository.com/artifact/com.nurkiewicz.asyncretry/asyncretry-jdk7/0.0.6) copy inside **PRODUCT-HOME/lib** folder.


!!! Tip
Alternatively for deployment step 1 and 2, MI for VS Code has provided the capability of copying jars to **PRODUCT-HOME/lib** folder while exporting the capp. You can copy necessary jars to **deployment/libs** folder under project explorer view.

<img src="{{base_path}}/assets/img/integrate/connectors/copy-libs-via-vscode.png" title="Copy libs with VS Code" width="400" alt="Copy libs with VS Code" style="border:1px solid black"/>

3. Copy the exported carbon application to the **PRODUCT-HOME/repository/deployment/server/carbonapps** folder.

4. [Start the integration server]({{base_path}}/get-started/quick-start-guide/#start-the-micro-integrator).
Expand Down