SMS Service Configuration (docker)

Bahmni/sms-service image runs the functionality for Bahmni SMS service. The image is built and published using Github Actions from sms-service repository.

Environment Configurations

Variable Name

Description

Variable Name

Description

SMS_SERVICE_IMAGE_TAG

This value specifies which image version needs to be used for appointments service. List of tags can be found at bahmni/sms-service - Tags.

SMS_TOKEN

This value points to the token being used for sending SMS. One can set this value if they’ve valid tokens generated to access the SMS provider’s API.

More details about the service provider being used in Bahmni is available down the page

SMS_ORIGINATOR

This value specifies the originator which is used for configuring the SMS header. One can specify the brand name to this value if they have registered originator.

SMS_OPENMRS_HOST

This value specifies the host name of the OpenMRS application

SMS_OPENMRS_PORT

This value specifies the port number of the OpenMRS application

Starting SMS service

For SMS service, there is an application profile sms in docker which can be used to bring up the SMS service.

# From bahmni-lite/ or bahmni-standard/ subfolder, # execute this command to bring up sms-service docker compose --profile sms up -d

Currently SMS service is being used in Registration and Appointments module in Bahmni.

To know how to configure sending SMS in registration module, refer here and for appointments module, refer here

Development on SMS service

When you want to develop on SMS service code, follow the below steps.

  1. Clone the sms-service repository in your local machine.

  2. Follow the instructions in the README of the repository to install the required tools and dependencies.

  3. Build the project as instructed in the README and build the docker image using docker compose build

  4. Start / Recreate sms-service by doing docker-compose up -d sms-service

  5. For every change you make, build the sms-service code and image recreate the sms-service container, then the changes will reflect on the next trigger of SMS

 

One can write their own implementation of SMS with preferable SMS providers and by exposing the API, it can be used in any of the Bahmni repositories for sending SMS.

sms-service is a reference implementation which uses D7 SMS service provider for sending SMS. If anyone wants to use different SMS service providers, then they can fork out sms-service repository and write their own implementation of the interfaces with the preferred service providers.

SMS API Overview :

We are currently using D7 SMS API for sending sms in Bahmni. The functionality is implemented in the repo sms-service. If sms-service is up and running, then we will be able to send sms.

Prerequisite: A paid account in D7 networks and an authorization token needs to be generated.

 

D7 SMS - https://d7networks.com/

  • For India D7 has two solutions one is the International in this route we have configured by default for all new customers in India which does not require the DLT registration and the price will be at 0.04$ per SMS.

  • On the other hand, if we want to configure the price at 0.003$ per SMS which is a Domestic route the customer needs to complete the DLT registration and be required to share the DLT registered details as per the TRAI regulations. We can also configure the originator (sender address) if we register on DLT.

  • It will accept 700 characters in SMS text and 1 SMS will be considered as 160 characters. Please find the character wise SMS details below.

Note: Trial account will have free credits worth 0.2$ which allows sending around 6 sms

 

Working:

Sample JSON for D7 SMS

 

The Bahmni documentation is licensed under Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)