Documentation

Services

How it works


GnGSmS is based on four concepts:


 

Services

Services are used to open and maintain network connections. while the the standard package includes several services like "SMPP Binder" , "HTTP Server" and "Datasource", you can created your own services as well
SMPP binderSMPP Binder To receive SMSs over SMPP protocol.
HTTP ServerHTTP Server To receive SMSs over HTTP protocol.
Data SourceData source To connect to database engines
TimerTimer To fire actions at specific time , or to fire actions periodically
Custom Services You can also create your own custom services by extending Service class

 

Request Context

A context variable is referred to using this format: ${variable}.

Some context variables are create at the moment the message is received:

  • SERVICE: the name of the service that received this message
  • FROM : The number/name of the sender
  • TO : The number/name of the recipient
  • TEXT : The sms text
  • KEYWORD : the first word in the sms text
  • TEXTNOKW: The sms text without the keyword
  • ARG0,ARG1,ARG2 .. : The sms text without keywords splitted into multiple values

For example, consider a message was at mobile#98765432 from #012345678, saying "reg John Smith", let us assume also it was recieved by an HTTP service named myservice
These request variables are created by default:

  • ${SERVICE}=myservice
  • ${FROM}=012345678
  • ${TO}=98765432
  • ${TEXT}=reg John Smith
  • ${KEYWORD}=reg
  • ${TEXTNOKW}=John Smith
  • ${ARG0}=John
  • ${ARG1}=Smith

 

Action Tree

Use the action tree is where you create and customize your application behaviour.

An action is an activity which is executed against the received message, several types of actions are available, below you find a list of the currently available actions, just to give an example an action could be the sending of an SMS or an email, it can also be executing a database query.

As mentioned above, a request context is created and attached to every sms received, this request is passed to the action at the root of the tree

Each action in the tree has an expression, this expression can be evaluated to true/false, in case of a "true" the action is executed, otherwise the action is skipped. An action with empty expression is always executed.

An action also have access to the request variables, it can read, update and create context variables.
In the previous example to reply back to the sender, you should use a "sender Action" with these parameters:
From = ${TO} = 98765432
To = ${FROM} = 012345678
TEXT = Hi ${ARG0} welcome to GNGSMS. = Hi John welcome to GNGSMS.

After the action is finished it hands the request to the next action in the tree, and so on.

In the standard package there are several types of actions:

SMS Sender TTo receive SMSs over SMPP protocol.
Wap Push To receive SMSs over HTTP protocol.
SQL To connect to database engines
SQL Iterator You can also create your own custom services by extending Service class
Email  
Group  
Conditional  
Jump  
Exit  
Loop  
Break  
Random  
Sleep  
Audio  
OS Command  
You can also create your custom action by extending the Action classs
//TODO add link to action specifications and javadocs

 

Gateways

To send out messages using the Sender action (see Actions tree section), you need to create a gateway.

Gateways are there to save the time of entering the connection details with every sender action in the actions tree.

Gateways are used to send messages.
  • SMPP gateway
As with the services and actions you can create custom gateways by extending the Gateway class
//TODO add link to gateway specifications and javadocs