Skip to content
Markus Neuhold edited this page Sep 27, 2015 · 3 revisions

The PIS component the middleware of the smsgateway includes two main features.

  • Communication with WIS (rest based web services)
  • Communication with PID (websocket connection)

Overview

A graphical overview of components involved...

Communication with PID

On startup PIS sets up a websocket server and waits for connections opened by one ore more PID. For communication between PID and PIS we use a encrypted JSON structure, called protocol in the following.
Whenever a connection is established by a PID first the protocol version is checked. If it's not supported by PIS the connection is closed with giving the reason back to the PID. If the protocol fits the action requested by a PID is processed. The following actions are supported by the protocol on PIS.

Provides action register

For each modem in the registration request form PID a new routing-id (UUID) is set. Then PIS is trying to register at any configured WIS. If this works the PIS will return the registration status and the routing-id to the PID by calling the register action there. If not the PIS is closing the connection to PID with giving the reason.

Provides action status

This action is for handiling the response for a specific SMS message send. Whenever a SMS message was forwarded to PID, PIS is polling the sending status for a period of time (maxwaitpid) in order to give WIS a qualified response on the SMS message sending request. See also communication with WIS below.

Provides action heartbeat

In here the heartbeat send by PID for each modem registerd is taken and forwarded to the WIS. WIS response is given back to PID by calling the heartbeat action there. See also communication with WIS below.

Communication with WIS

The PIS provides the sendsms interface to WIS. And is calling managemodem and heartbeat interface on WIS.

Provides interface sendsms

WIS is only sending sendsms requests for specific modems. So first the websocket connection to the requested modem is set. Then the SMS message is forwared to PID. And the status for the SMS message send request is polled for a period of time (maxwaitpid) on PID. Depending on the status or time passed a http response 200 or 500 is send to WIS.

Calls interface managemodem

This WIS interface is called whenever a connection form PID to PIS is established or closed.

Calls interface heartbeat

This WIS interface is called when PIS is forwarding the heartbeat from PID. After that the http response code is send back to PIS.

Configuration

For a quick run on a single host environment you don't have to change the configuration. For production use and/or if you want to change things see the configuration help in the smsgateway wiki.