Quantcast
Channel: Telestax Docs Online
Viewing all articles
Browse latest Browse all 94

Restcomm – Sending SMS to an SMPP Endpoint

$
0
0

This tutorial will show how to configure Restcomm to allow messages from any SMPP endpoint through the Telscale SMSC gateway.

 

Requirements

  • Latest Restcomm version
  • Latest Telscale SMSC Gateway
  • You must understand how to Install and run Restcomm and Telscale SMSC Gateway (Install and Start SMSC Gateway)

Step 1 – Configure Restcomm to Use SMPP

Edit the file  $RESTCOMM_HOME//standalone/deployments/restcomm.war/WEB-INF/conf/restcomm.xml

Go to the tag smpp and configure the section as follows:

  • <peerip>192.168.1.3</peerip> – This is the IP address of the Telscale SMSC Gateway
  • sourceAddressMap=”7777″ – This is a simple map used by Restcomm when sending outbound SMS to an SMPP endpoint
  • destinationAddressMap=”6666″– This is the address of the SMPP destination endpoint listening at the address 6666
  • tonNpiValue=”1″ – This used for outbound messages
  • Save and exit the file
  • The changes should be similar to the example below

<!--by default activateSmppConnection is set to false -->

    <smpp class="org.mobicents.servlet.restcomm.smpp.SmppService" activateSmppConnection ="true">
        <connections>
            <connection activateAddressMapping="false" sourceAddressMap="7777" destinationAddressMap="6666" tonNpiValue="1">
				<!-- Name must be unique for each connection -->
				<name>RestcommSmpp</name>
				<systemid>RestcommSmpp</systemid>
				<peerip>192.168.1.3</peerip>
				<peerport>2776</peerport>
				<bindtype>TRANSCEIVER</bindtype>
				<!-- These are optional params -->
				<password>RestcommSmpp</password>
				<systemtype>sms</systemtype>
				<!-- byte value for interface version 0x34 is 3.4, 0x33 is 3.3 and 0x50 
					is 5.0 -->
				<interfaceversion>0x34</interfaceversion>
				<ton>-1</ton>
				<npi>-1</npi>
				<range></range>
				<!-- Default value is 1. The window size is the amount of unacknowledged 
					requests that are permitted to be outstanding/unacknowledged at any given 
					time. If more requests are added, the underlying stack will throw an exception. -->
				<windowsize>1</windowsize>
				<!-- Default value is 60000 milli seconds. This parameter is used to 
					specify the time to wait until a slot opens up in the 'sendWindow'. -->
				<windowwaittimeout>60000</windowwaittimeout>
				<!-- BIND request must be sent within configured timeout in ms -->
				<connecttimeout>10000</connecttimeout>
				<!-- Set the amount of time to wait for an endpoint to respond to a request 
					before it expires. Defaults to disabled (-1). -->
				<requestexpirytimeout>30000</requestexpirytimeout>
				<!-- Sets the amount of time between executions of monitoring the window 
					for requests that expire. It's recommended that this generally either matches 
					or is half the value of requestExpiryTimeout. Therefore, at worst a request 
					would could take up 1.5X the requestExpiryTimeout to clear out. -->
				<windowmonitorinterval>15000</windowmonitorinterval>
				<logbytes>true</logbytes>
				<countersenabled>true</countersenabled>
				<!-- Default value is 30000 milli seconds. When SMPP connects to a remote 
					server, it sends an 'ENQUIRE_LINK' after every configured enquire-link-delay. 
					If no response received for 3 consecutive requests, connection will be killed 
					and attempted to connect again -->
				<enquirelinkdelay>30000</enquirelinkdelay>
			</connection>
			

		</connections>
	</smpp>

 

Step 2 – Configure ESME on the Telscale SMSC Gateway Server

  • Edit the file $SMSC_HOME/server/simulator/data/SmppManagement_esme.xml
  • Append the ESME configuration below to the SmppManagement_esme.xml

<esme name="RestcommSmpp" clusterName="RestcommSmpp" systemId="RestcommSmpp" password="RestcommSmpp" host="-1" port="-1" networkId="0" rateLimitPerSecond="0" rateLimitPerMinute="0" rateLimitPerHour="0" rateLimitPerDay="0" smppBindType="TRANSCEIVER" smppSessionType="SERVER" started="true" smppVersion="3.4" systemType="" ton="-1" npi="-1" addressRange="" windowSize="1" connectTimeout="10000" requestExpiryTimeout="-1" windowMonitorInterval="-1" windowWaitTimeout="60000" countersEnabled="true" enquireLinkDelay="30000" chargingEnabled="false" sourceTon="-1" sourceNpi="-1" sourceAddressRange="7777" routingTon="-1" routingNpi="-1" routingAddressRange="7777" useSsl="false" keyManagerFactoryAlgorithm="SunX509" keyStoreType="JKS" maxCertPathLength="-1" needClientAuth="false" protocol="TLS" sslSessionCacheSize="0" sslSessionTimeout="0" trustManagerFactoryAlgorithm="PKIX" trustStoreType="JKS" wantClientAuth="false" allowRenegotiate="true" enableCRLDP="false" sessionCachingEnabled="true" trustAll="true" validateCerts="false" validatePeerCerts="false"/>

  •  The SmppManagement_esme.xml file should now contain 2 esme configurations named respectively “test” and “RestcommSmpp
  • Save and exit the file SmppManagement_esme.xml file

Step 3 – Start Telscale SMSC Gateway

  • Make sure the Cassandra DB is already started and configured as explained HERE
  • Start the Telscale SMSC gateway as follows :  $SMSC_HOME/bin/run.sh -b 192.168.1.3 -c simulator
  • Open your web browser and go to the url : http://192.168.1.3:8080/smsc-management/

Enter the default credentials as follows:

  • username : admin
  • passwood : admin

On the left side pane of the screen, click on ESMEs. This will show the 2 ESMEs configured in the SmppManagement_esme.xml as explained in Step 2. See the screenshot below:

restcomm-smpp-esme-config

Step 4 – Start Restcomm and the Media Server

  • Start media server by running the command  :  $RESTCOMM_HOME/mediaserver/bin/run.sh -b 192.168.1.3
  • Start Restcomm by running the command below:
  • $RESTCOMM_HOME/bin/standalone.sh -b 192.168.1.3 -Djboss.socket.binding.port-offset=100

 Note

We are using an offset to avoid port conflict as Restcomm and the Telscale SMSC are running on the same machine


 

If Restcomm is successfully started, you should see the following in the console

10:43:37,136 INFO [org.mobicents.servlet.restcomm.smpp.SmppService] (RestComm-akka.actor.default-dispatcher-5) checking if to use SMPP connection set to : true
10:43:37,140 INFO  [org.mobicents.servlet.restcomm.telephony.proxy.ProxyManagerProxy] (ServerService Thread Pool -- 54) ProxyManagerProxy sip servlet initialized. Will proceed to create ProxyManager
10:43:37,147 INFO  [org.mobicents.servlet.restcomm.smpp.SmppService] (RestComm-akka.actor.default-dispatcher-4) creating new SMPP connection Smpp [name=RestcommSmpp, systemId=RestcommSmpp, peerIp=192.168.1.3, peerPort=2776, smppBindType=TRANSCEIVER, password=RestcommSmpp, systemType=sms, interfaceVersion=52, address=null, connectTimeout=10000, windowSize=1, windowWaitTimeout=60000, requestExpiryTimeout=30000, windowMonitorInterval=15000, countersEnabled=true, logBytes=true, enquireLinkDelay=30000]

In the Telscale SMSC gateway console, you will see the following:

New channel from [192.168.1.3:60966]
10:44:07,530 INFO  [UnboundSmppSession] (SmppManagement.UnboundSession.192.168.1.3:60966) received PDU: (bind_transceiver: 0x0000002F 0x00000009 0x00000000 0x00000001) (body: systemId [RestcommSmpp] password [RestcommSmpp] systemType [] interfaceVersion [0x34] addressRange (0x00 0x00 [])) (opts: )
10:44:07,560 INFO  [DefaultSmppServerHandler] (SmppManagement.UnboundSession.192.168.1.3:60966) Session created: Name=RestcommSmpp SysemId=RestcommSmpp

 Step 5 – Start the SMPP Simulator

  • Start the SMPP simulator as follows : $SMSC_HOME/tools/TelScale-smpp-simulator/bin/run.sh
  • Click on the button : Configure
  • In the “SMPP General Parameters” window, delete the “6666” in the “Esme Address Range Field
  • Click on the button “Ok” to validate the changes (Screenshot below)

smsc-simulator

Click on the button “Run test” – In the window, click on the button “Start a session”. Make sure the session is successfully started

restcomm-smsc-simulator2

 Step  6 – Send an SMS from a SIP Phone through Restcomm to the SMPP endpoint

  • Start any SIP phone of you choice that is capable of sending SMS.
  • Send an SMS to the following address : sip:smpp@192.168.1.3:5180 (See screenshot below)

 Note

The default Restcomm port is 5080, but we are using 5180 because we started Restcomm using an offset of 100

  • If you know the SMPP endpoint address, you may also send an SMS using the format : smpp6666@Restcomm_IP:Port
  • Restcomm will bypass the parameter destinationAddressMap=”6666″ in the restcomm.xml and use the destination address 6666. This allows you to send an SMS on the fly to any SMPP endpoint as long as you have the destination addresss

 

restcomm-smsc-simulator3

If the message is successfully sent, you will see the result in the SMPP endpoint (Screenshot below)

restcomm-smsc-simulator4

 Step 7 – Sending Messages from SMPP Endpoint to Restcomm.

  • Open your web browser and go to the url //192.168.1.3:8180
  • Note: The url is using an offset of the port. The default port is 8080
  • Click on the tab “Visual Designer”
  • Login to the Visual Designer and choose the SMS button to create an SMS project

restcom-smpp1

Create an SMS project similar to the one in the screenshot below:

restcomm-smpp2

  •  Save the project
  • Go to the Management GUI and attach a number to the newly created SMS application
  • Our SMPP endpoint will send Messages to the address 7777.
  • Create the number 7777 and attach it to the SMS application (Screenshot below)

restcomm-smpp3

  •  Send a message from the SMPP simulator to Restcomm using the
  • Click the “Configure data for a message submitting”

restcomm-smpp4

In the SMPP message parameters window

  • Change the “Destination address” to 7777
  • Change the “Messaging mode” to datagramm
  • Leave the rest as default and press the button OK to validate your changes

 

restcomm-smpp5

  • Press the button “Submit a message”  to send the SMPP message to Restcomm
  • To see the result, go to the Restcomm Management GUI =>Logs => Messages

restcomm-smpp6

 

 

 

The post Restcomm – Sending SMS to an SMPP Endpoint appeared first on Telestax Docs Online.


Viewing all articles
Browse latest Browse all 94

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>