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 NameDescriptionExample Key Values
SuscriptionDbConnStrConnection string to CGW databaseserver = localhost;database =cgw;user id = root;password =mysqlpass;
CGWHostIP of the machine where CGW application is runningLocalhost
CGWPortPort number at which CGW listen to incoming request3440
SLEEP_SECONDSHow long wait between 2 pi1
HTTP_CONNECTION_TIMEOUTHow long wait for http response4000
ChargingUrlCalled URL to Chargehttp://localhost/Charging.php?MSISDN=%param1%ServiceID=%param2%
ApplicationIdID of renew applicationRenewal
ServiceIDSuffixRenewal
ApplicationPasswordPassword of renew applicationvsdp
CommandIdCommand ID for specific chargingSPECIFIC_CHARGE
NotifyUserEnableTo enable user Notification0
LogEnableDetermines whether charging log will be written in the log file (at the same folder).1: to write log
0: not to write log
ChargingInterfaceName of charging component. Not important.CGW
RenewAdditionalConditionTo add any condition while checking the Renewal SubscribersEx:Sg.subscriptiongroupid=”voicechatweekly” to renew only Voice chat Weekly Subscriber
NotifyUserEnableTo notify user before renewal1 for enable
NumberOfThreadsHow many thread will runLike “10”
TimeSlabEnableTime base Renew enable1
SlabStartTimeWhen Renew Start00:00
SlabEndTimeWhen Renew Stop23:59
CGW_SUCCESS_CODE2001
TimeZoneTime ZoneAsia/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 NameDescription Example Key Values
SuscriptionDbConnStrConnection string to CGW databaseserver = localhost;database =cgw;user id = root;password =nopass;
CGWHostIP of the machine where CGW application is runningLocalhost
CGWPortPort number at which CGW listen to incoming request3440
ApplicationIdID of renew applicationRenewal
ApplicationPasswordPassword of renew applicationNopass
TransactionPrefixA value which will be used to generate transaction id for each request.3678: for BL
2002: for GP
CommandIdCommand ID for specific chargingSPECIFIC_CHARGE
SleepPeriodInterval (in milliseconds) between two consecutive batch database operations1000
LogEnableDetermines whether charging log will be written in the log file (at the same folder).1: to write log
0: not to write log
ChargingInterfaceName of charging component. Not important.CGW
ChargingUrlNot important
ServiceIDSuffixThis value is appended to the service id defined for the subscription groupRenewal
RenewAdditionalCondition To add any condition while checking the Renewal SubscribersEx:Sg.subscriptiongroupid=”voicechatweekly” to renew only Voice chat Weekly Subscriber
RenewPickupNo How many user will pick at once by one threadLike “100”
NotifyUserEnable To notify user before renewal1 for enable
NumberOfThreads How many thread will runLike “10”
ClientSettingsProvider.ServiceUri
FailedResultCodes Renew Application will try to Renew if get result codes except mention in this field4241, 5241
StateSwitchNotification After renewal Notification Enable1 for nable
DelayLogPrintThreshold Acceptable time limit for notification in Console to get a renewal donelike :3000
NumberOfPreRenewalThreads How many threads will run to notify for prerenewal.Ex: 5
PreRenwalNotificationStart Time when start PreRenewal notificationEX: value=”10,02,10″
Means: 10:02:10 AM
PreRenwalNotificationEnd Time when stop PreRenewal notificationEX: 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
twittergoogle_plusFacebooklinkedinmail

We love to hear from you