EMG integration with Hypermedia SMS Pro Server

Hypermedia SMS Pro Server is a software package that enables control over Hypermedia SMS Gateway Pro hardware.

For improved integration between Hypermedia and EMG 7, two customizations have been made:

  • Include Hypermedia queue size when checking if queue is full in EMG billing plugin (“billing.pl”)
  • Custom connectors which use Hypermedia http api to send message and receive delivery reports

This is also a good example of perl implementations of DLL connectors.

Enabling Hypermedia queue size check

In order for the EMG billing plugin to check the queue size in Hypermedia, the keyword NOTE needs to be added to the connector on the following format:

NOTE=HM:myPassword:http://192.168.0.1/cb/sms_http.php

If present, EMG will sum up the queue size for the connector in EMG with the queue size in the referenced Hypermedia server and check the result towards the max queue size.

Custom HTTP API connectors

Two custom connectors are implemented as perl DLL connectors.

  • One connector perl script for sending messages via HTTP API, hm-send.pl
  • One connector perl script for processing delivery reports from Hypermedia via HTTP API, hm-dlr.pl

Sending via HTTP API

The sending connector perl script will use the following HTTP API parameters:

ParameterComments
server_passwordRead from connector keyword “NOTE”
numberEMG destaddr (destination address)
msgMessage, hex encoded
unicode0 for GSM 7-bit messages, 1 for Unicode (UCS2) messages
msg_idEMG message id, used to match delivery reports

It requires the same “NOTE” keyword as used above.

The connector will also respect the EMG and Hypermedia queue sizes via billing plugin as described above.

Sample config in server.cfg

CONNECTOR hm-send <
ADDRESS=http://192.168.0.1/cb/sms_http.php
INSTANCES=1
PROTOCOL=DLL
TYPE=OUTGOING
NOTE=HM:smsec:http://192.168.0.1/cb/sms_http.php
LIBRARY=hm-send.pl
NODLR=1
>

Receiving DLRs via HTTP API

The Hypermedia is configured to send delivery reports (notifications) via HTTP.

Sample config in server.cfg

CONNECTOR hm-dlr-in <
ADDRESS=0.0.0.0:8080
INSTANCES=5
PROTOCOL=HTTP
TYPE=INCOMING
URLHANDLER=/hm-dlr:hm-dlr.pl:handle_dlr
ALLOW_INJECT_DLR=1
>

The url to enter in Hypermedia would be:

http://emghost:8080/hm-dlr