ESME Handover
ESME Handover
ESME Handover
1.0
Handover Document
1.0
Table of Contents
Table of Contents.................................................................................................................2 1 Overview...........................................................................................................................3 2 Network Architecture ...................................................................................................3 3. Flow Description..............................................................................................................5 3.1 Flow from IN to Rule Engine (at Airtel)...................................................................5 3.2 Flow from IN to USSD-GATEWAY (at Airtel)........................................................6 3.3 Flow from USSD-GATEWAY to Rule Engine(at AIRTEL and TATA) .................6 34 Flow from Rule Engine to USSD-GATEWAY(at AIRTEL and TATA)...................8 3.5 Flow from USSD Gateway to USSD Gateway (at TATA).......................................9 4. Scripts............................................................................................................................10 4.1 AIRTEL...................................................................................................................10 4.1.1 /root/scripts/system_status.sh............................................................................10 4.1.2 /root/ESME/rm_logs.sh....................................................................................11 4.1.3 /root/scripts/Handle_HA.sh..............................................................................11 4.2.1 /home/tata/scripts/system_status.sh.................................................................12 4.2.2 /home/tata/scripts/rm_logs.sh...........................................................................13 4.1.3 /home/tata/scripts/Monitor.sh...........................................................................13 5. Deployment Sites...........................................................................................................15 5.1 AIRTEL...................................................................................................................16 5.2 TATA......................................................................................................................17 6. Cron Entries...................................................................................................................19 6.1 AIRTEL...................................................................................................................19 6.2 TATA.......................................................................................................................19 7. Logs and Alarms............................................................................................................21 8. Configuration Details.....................................................................................................22 8.1 Logging....................................................................................................................22 8.2 SMPP Account.........................................................................................................22 8.3 IN Connectivity........................................................................................................22 8.4 Gateway Connectivity..............................................................................................22 8.5 Rule Engine Connectivity........................................................................................23 8.6 DND.........................................................................................................................23 8.7 Load Management...................................................................................................24 9. Dos and Dont...............................................................................................................25
1 Overview
ESME (Extended Short Message Entity) is one of the modules in PCN product. It act as an intermediate node between Rule Engine and USSD Gateway. It exposes SMPP interface to USSD Gateway and IN for external traffic and XML interface to Rule Engine. It maintains transaction information in session for every XML send to Rule Engine other than to terminate session.
2 Network Architecture
ESME can be used in two differect Network Architetures. Network Architecture is dependent on the fact external session request to PCN is received over SMPP or MAP protocol. When external traffic is send to PCN using SMPP protocol,ESME exposes SMPP interface for IN to send SMPP PDU over TCP/IP.
SS7 Signalling IN
ESME
SS7 Signalling
When external traffic is send to PCN using MAP protocol, USSD Gateway receives and send the new session request to ESME on SMPP protocol. Hence, ESME interacts only to USSD Gateway on SMPP protocol over TCP/IP for new session requests.
ESME
3. Flow Description
ESME has 3 major threads(SMPP-Server, SMPP-Client and XML-receiver) which perform the major tasks. Each thread receives PDU/message from one socket connection, perform necessary operations and send it to other socket connection.
RULE Engine
SMPP Worker
SMPP Server
USSD Gateway
SMPP Sender
SMPP Worker
SMPP Server
SMPP worker for further processing. SMPP-Worker finds whether it is first request in session or other than first or last. If it is first request in session, it checks has timeout limit for Rule Engine Id received reached or is it in uploaded DND list? If not, it converts SMPP PDU structure into XML with request type IN and send it to Rule Engine. It maintains session for the request send to Rule Engine. This condition is met only in TATA. If it is other than first and last request in session, it converts SMPP PDU structure into XML with request type MID and send it to Rule Engine. It maintains session for the request send to Rule Engine. If it is last request in session, it converts SMPP PDU structure into XML with request type TR and send it to Rule Engine. It does not maintain session for the request send to Rule Engine.
RULE Engine
SMPP Worker
RULE Engine
XML string TCP/IP XML Receiver
XML Worker
Session Info
SMPP Receiver Response PDU SMPP PDU TCP/IP SMPP PDU TCP/IP
USSD Gateway
4. Scripts
4.1 AIRTEL
4.1.1 /root/scripts/system_status.sh
#!/bin/bash echo '<--------------------------------------------------------------------------------------------->' echo 'DATE-----TIME' date Prints current date and time echo 'CPU STATUS' top -n 1 -b | grep java top -n 1 -b | grep Tasks top -n 1 -b | grep Cpu top -n 1 -b | grep Mem top -n 1 -b | grep Swap top -n 1 -b | grep ESME top -n 1 -b | grep USSD Prints current status of CPU, Memory and modules running on system echo echo 'DISC STATUS' df k Prints current disc occupancy echo '<--------------------------------------------------------------------------------------------->' netstat -an | grep 5050 Prints currently connected IPs from IN and their socket status echo '<--------------------------------------------------------------------------------------------->' netstat -an | grep 415 Prints current socket status with Rule Engine echo '<--------------------------------------------------------------------------------------------->' netstat -an | grep 2050 Prints current socket status with Gateway
echo '<--------------------------------------------------------------------------------------------->' echo "Stack Stats" cd /opt/dialogic . ./../../root/GATEWAYSCRIPTING/USSDGATEWAY/Env.ini echo './gctload -t1' ./gctload -t1 Prints current status of meesages on septel stack echo '<--------------------------------------------------------------------------------------------->' echo './gctload -t2' ./gctload -t2 Prints current message in queues of septel stack echo '<--------------------------------------------------------------------------------------------->'
4.1.2 /root/ESME/rm_logs.sh
#!/bin/bash cd /var/PCN_ESME_LOG/ echo Deleting Log files older than 1 hrs echo `date` find * -cmin +4000 -exec rm {} \; Delete logs older than 4000 minutes from /var/PCN_ESME_LOG
4.1.3 /root/scripts/Handle_HA.sh
cd /root/scripts pgrep -x ESME_PCN > esme.txt Get process id of ESME_PCN in esme.txt if [[ -s esme.txt ]] then echo "ESME is up and running....." else echo `date` echo "ESME is down." pgrep -x ESME_PCN|xargs kill -9 cd /root/ESME/
4.2 TATA
4.2.1 /home/tata/scripts/system_status.sh
#!/bin/bash echo '<--------------------------------------------------------------------------------------------->' echo 'DATE-----TIME' date Prints current date and time echo 'CPU STATUS' top -n 1 -b | grep Tasks top -n 1 -b | grep Cpu top -n 1 -b | grep Mem top -n 1 -b | grep Swap top -n 1 -b | grep ESME top -n 1 -b | grep USSD Prints current status of CPU, Memory and modules running on system echo echo 'DISC STATUS' df k Prints current disc occupancy echo '<--------------------------------------------------------------------------------------------->' echo "RAM STATUS" free echo '<--------------------------------------------------------------------------------------------->' netstat -an | grep 9000 Prints currently connected IPs from IN and their socket status echo '<--------------------------------------------------------------------------------------------->' netstat -an | grep 400 Prints current socket status with Rule Engine
echo '<--------------------------------------------------------------------------------------------->' netstat -an | grep 2052 Prints current socket status with Gateway echo '<--------------------------------------------------------------------------------------------->' echo "Stack Stats" cd /opt/dialogic . ./../../root/GATEWAYSCRIPTING/USSDGATEWAY/Env.ini echo './gctload -t1' ./gctload -t1 Prints current status of meesages on septel stack echo '<--------------------------------------------------------------------------------------------->' echo './gctload -t2' ./gctload -t2 Prints current message in queues of septel stack echo '<--------------------------------------------------------------------------------------------->'
4.2.2 /home/tata/scripts/rm_logs.sh
#!/bin/bash cd /mysql/logs/ESME_LOG echo Deleting Log files older than 1 hrs echo `date` find * -cmin +2880 -exec rm {} \; Delete logs older than 2880 minutes from /mysql/logs/ESME_LOG
4.1.3 /home/tata/scripts/Monitor.sh
cd /home/tata/scripts pgrep -x ESME > esme.txt Get process id of ESME in esme.txt if [[ -s esme.txt ]] then
echo "ESME is up and running....." else echo `date` echo "ESME is down." pgrep -x ESME|xargs kill -9 cd /home/tata/ESME_PCN/ . ./Env.ini ./ESME & Start ESME if it is not running fi
5. Deployment Sites
5.1 AIRTEL
Steps to connect 1. Connect Mohali: IP 117.99.128.54 user putty password - echo@one97 2. Redirect Delhi from Mohali : IP - 10.2.29.67 user puttyuser password secured! 197 3. Reditrect Application server from Mohali: IP 10.31.33.142 user root password redhat ESME is deployed at location /root/ESME/ . Its configuration file config.txt and PcnInstanceConfig.properties at location /root/ESME Log location /var/PCN_ESME_LOG/ DND file validator location is /root/DND_VALIDATOR/ DND file location is /root/DND_FILES Steps to validate ./validateFile f DNDfileName Error message will be displayed if validation error is found in DND file.
5.2 TATA
Steps to connect 1. Connect : IP 182.156.191.39 or 182.156.191.40 user tata password - tata@197 2. Redirect or ssh from IP mentioned above: (App-1) IP - 182.156.191.20 user tata password tata@197 3. Redirect or ssh from IP mentioned above: (App-2) IP - 182.156.191.17 user tata password tata@197 ESME is deployed at location /home/tata/ESME_PCN. Its configuration file config.txt at /home/tata/ESME_PCN and PcnInstancesConfig.properties at /home/tata/COMMON/conf/. Log location /mysql/logs/ESME_LOG/ ESME is deployed at location /root/ESME/ . Its configuration file config.txt and PcnInstanceConfig.properties at location /root/ESME DND file validator location is /home/tata/DND_VALIDATOR/
DND file location is /home/tata/DND_FILES Steps to validate ./validateFile f DNDfileName Error message will be displayed if validation error is found in DND file. Steps to run cd /home/tata/ESME_PCN . Envi.ini nohup ./ESME & It can be done from root access only.
6. Cron Entries
6.1 AIRTEL
* * * * * /root/scripts/system_status.sh >> /root/scripts/system_status.log * * */1 * * /root/ESME/rm_logs.sh 1>>/root/ESME/rm_logs.log 2>>/root/ESME/rm_logs.log * * * * * /root/scripts/Handle_HA.sh >> /root/scripts/HA.log 2>>/root/scripts/HA.log
6.2 TATA
* * * * * /home/tata/scripts/Monitor.sh >> /home/tata/scripts/Monitor.log * */2 * * * /home/tata/scripts/rm_logs.sh >> /home/tata/scripts/rm_log.log * * * * * /home/tata/scripts/system_status.sh >> /home/tata/scripts/system_status.log
3.
Cumulative Counts These are printed half hourly in latest Alarm log file displayCounters:: IP[10.124.157.17] total Received from IP[754469] send to Engine[674935] directly Send to Gateway[904] dnd Applied to Numbers[78630] total Timeout from Engine[15] total Dropped[0] Above mention log dispalys traffic counters for IP that initaite new session request displayCounters:: EngineId[0] total Send to engine [104776] total Received from engine [104776] directly Send to Gateway[0] total Timeout from engine[3] no Of TimeOut in minutes[0] Above mention log dispalys traffic counters for rule engines Response Time from Rule Engine MSISDN [9029547177] response time 0 Above mentioned log in latest ESME log file displays the response time taken by Rule Engine for msisdn
4.
5.
Way to check MSISDN notifcation is received at ESME grep MSISDN in latest ESME log file or the file made at that point of time
8. Configuration Details
8.1 Logging
TRACE_LEVEL o 1 error mode o 2 PDU mode o 3 DEBUG mode o 4 GENERIC LOG_FILE Location of logging file ALARM_LOG_FILE Location of alarm log file
8.3 IN Connectivity
IN_SERVER_PORT Port at which ESME binds and IN tries to connect MAX_IN_CONNECTIONS Maximum number of socket connections allowed to IN SELF_IP IP at which ESME binds and IN tries to connect
8.6 DND
IS_DND_FEATURE o 1 DND feature is on o 0 DND feature is off IS_PARSING_ON o 1 If short message received is to be parsed for patterns o 0 Short message received is not be parsed DND_CHARACTER If this character is found at the end of short message received, then number is treated as DND number (optional parameter) DND_TOKEN Token that separates two DND numbers in DND file DND_MSISDN_LENGTH Length of MSISDN in DND file DND_FILE Folder where DND files are kept
DND_RELOAD_TIME Time at which DND file should be re-loaded into the system IS_CALL_DURATION o 0 Call duration pattern is not necessary in short message o 1 - Call duration pattern is necessary in short message CALL_CHARGE_MSG_FORMAT_X X call charge format, $LASTCALLCOST is necessary variable to be present in this format BALANCE_MSG_FORMAT_X X balance format, $NEWBALANCE is necessary variable to be present in this format CALL_DURATION_MSG_FORMAT_X X call duration format, $LASTCALLDURATION is necessary variable to be present in this format OUTPUT_CALL_CHARGE_MSG_FORMAT Output format of call charge if parsing is enabled OUTPUT_BALANCE_MSG_FORMAT Output format of balance if parsing is enabled OUTPUT_CALL_DURATION_MSG_FORMAT Output format of call duration if parsing is enabled