Configuring Subscription Renewal Application

Pre Readings

  1. Step By Step Guide to Deploy Charging Gateway

Pre Requisite of Deployment

Linux
Java-1.6
Php-mysql -5.1

Windows
Mysql-connector-net-5.2.5

Package Structure

Following is the package structure of Subscription Renewal Application:

Linux

  1. Subscription.jar
  2. config.cfg

Windows

  1. Subscription.exe
  2. Subscription.exe.config
  3. log4net.dll
  4. log4net.xml
  5. logfile.txt

Directory structure

Linux
/ismp/test/cgw/Subscription
Or
/ismp/production/cgw/Subscription

Windows
D: ismpProductionCGWRenewSubscription
Or
D: ismptestCGWRenewSubscription

Deployment Steps

  1. Place all package elements in one folder and copy that folder & deploy in defined directory structured folder
  2. Make changes in required configuration files

Configure Subscription Renewal

Changes in configuration file

In Linux:
Change the configuration in config.cfg file. Here is a sample of this file:

Description of each key and some possible values:

Key Name Description Example Key Values
SuscriptionDbConnStr Connection string to CGW database server = localhost;database =cgw;user id = root;password =mysqlpass;
CGWHost IP of the machine where CGW application is running Localhost
CGWPort Port number at which CGW listen to incoming request 3440
SLEEP_SECONDS How long wait between 2 pi 1
HTTP_CONNECTION_TIMEOUT How long wait for http response 4000
ChargingUrl Called URL to Charge http://localhost/Charging.php?MSISDN=%param1%ServiceID=%param2%
ApplicationId ID of renew application Renewal
ServiceIDSuffix Renewal
ApplicationPassword Password of renew application vsdp
CommandId Command ID for specific charging SPECIFIC_CHARGE
NotifyUserEnable To enable user Notification 0
LogEnable Determines whether charging log will be written in the log file (at the same folder). 1: to write log
0: not to write log
ChargingInterface Name of charging component. Not important. CGW
RenewAdditionalCondition To add any condition while checking the Renewal Subscribers Ex:Sg.subscriptiongroupid=”voicechatweekly” to renew only Voice chat Weekly Subscriber
NotifyUserEnable To notify user before renewal 1 for enable
NumberOfThreads How many thread will run Like “10”
TimeSlabEnable Time base Renew enable 1
SlabStartTime When Renew Start 00:00
SlabEndTime When Renew Stop 23:59
CGW_SUCCESS_CODE 2001
TimeZone Time Zone Asia/Dhaka

In Windows
Change the configuration in Subscription.exe.config file. Here is a sample of this file:

Description of each key and some possible values:

Key Name Description Example Key Values
SuscriptionDbConnStr Connection string to CGW database server = localhost;database =cgw;user id = root;password =nopass;
CGWHost IP of the machine where CGW application is running Localhost
CGWPort Port number at which CGW listen to incoming request 3440
ApplicationId ID of renew application Renewal
ApplicationPassword Password of renew application Nopass
TransactionPrefix A value which will be used to generate transaction id for each request. 3678: for BL
2002: for GP
CommandId Command ID for specific charging SPECIFIC_CHARGE
SleepPeriod Interval (in milliseconds) between two consecutive batch database operations 1000
LogEnable Determines whether charging log will be written in the log file (at the same folder). 1: to write log
0: not to write log
ChargingInterface Name of charging component. Not important. CGW
ChargingUrl Not important
ServiceIDSuffix This value is appended to the service id defined for the subscription group Renewal
RenewAdditionalCondition To add any condition while checking the Renewal Subscribers Ex:Sg.subscriptiongroupid=”voicechatweekly” to renew only Voice chat Weekly Subscriber
RenewPickupNo How many user will pick at once by one thread Like “100”
NotifyUserEnable To notify user before renewal 1 for enable
NumberOfThreads How many thread will run Like “10”
ClientSettingsProvider.ServiceUri
FailedResultCodes Renew Application will try to Renew if get result codes except mention in this field 4241, 5241
StateSwitchNotification After renewal Notification Enable 1 for nable
DelayLogPrintThreshold Acceptable time limit for notification in Console to get a renewal done like :3000
NumberOfPreRenewalThreads How many threads will run to notify for prerenewal. Ex: 5
PreRenwalNotificationStart Time when start PreRenewal notification EX: value=”10,02,10″
Means: 10:02:10 AM
PreRenwalNotificationEnd Time when stop PreRenewal notification EX: value=”18,02,10″
Means: 06:02:10 PM

Configuring Notification during Renewal

            Pre Renewal Notification

  1. Set “NotifyUserEnable 1” in Subscription.exe.config
  1. Go to cgw database,Table : subscriptiongroup
  2. From this table In RenewNotificationDays we can set days before when Renewnotification will be sent for notify user.
  3. And set the URL in RenewNotificationURL field by which CGW will call SMSGW to send notification.

Following is an example of this table

Post Renewal Notification

  1. To notify user after Successful renewal set “StateSwitchNotification 1” in Subcription.exe.config
  2. Go to  cgw database, table : statewisemsg
  3. Here NotificationStatus could be Active or Inactive.
  4. Here Active subscriber will get sms through corresponding URL
  5. And set URL in URL fieAld by which CGW will call SMSGW to send notification sms.
  6. Set the Notification text in Msg field
  7. Also set service name in SubscriptionGroupID field for which subscription base service Notification will send

Following is an example of this table

Configuring Result Codes

There are some Vendor specific Result Codes which are acceptable failure codes. For this, renewal is failed and for other result codes, renewal is again taken place.

Example: Suppose operator provide “4241, 5241” as Failed Codes. And set these value in config file under “FailedResultCodes” field. If renew application got failed with above mentioned code, then Renew application will not try to renew again for this number, otherwise renewal is again taken place.

How to Run Subscription Renewal

From Linux console

  1. Go to /ismp/production/cgw/Subscription

Or /ismp/test/cgw/Subscription

  1. Run in terminal

java –jar subscription.jar

  1. Press Enter

Check process

  1. Type ps –ef|grep subscription.jar command in linux console.
  2. Following output will shown:

# ps -ef | grep subscription.jar
root     22354 28650 78 Apr30 pts/10   3-07:53:32 java -jar subscription.jar
root     29960 29816  0 17:07 pts/2    00:00:00 grep  subscription.jar

Here Green line shows that subscription is running

From Webmin

    1. Configure Custom button as like as below

  1. Click Start Renew Application

Check process

  1. Click Status check of Renew Application
  2. Output will be

From Windows console

  1. Go to following location

D: ismpTestCGWRenewSubscription
Or, D: ismpProductionCGWRenewSubscription

  1. By double click the subscription.exe

Check process

  1. From windows Task manager we can easily find out the Subscription application status.

From AppMonitor

    1. Configure Subscription Renewal Application in AppMonitor as follows:

  1. Click Start

Note: At first Run INRequester and CGW Application, then run SubscriptionRenewal Application.
If we start Subscription application before start CGW and INRequester then renew will failed because subscription will send renew request to CGW and CGW send this request to IN through IN requester.

Further Readings

  1. Content, Subscription and Differential Charging
  2. Integrating Services with Subscription Renewal
  3. How to configure AppMonitor to run an Application
[feather_share size="24" show="twitter, google_plus, facebook, linkedin, mail " hide="reddit, pinterest, tumblr"]

We love to hear from you