{"id":28963849,"url":"https://github.com/crowdcode-de/lbds-sms-gateway","last_synced_at":"2025-06-24T04:12:46.015Z","repository":{"id":45234892,"uuid":"442755854","full_name":"crowdcode-de/lbds-sms-gateway","owner":"crowdcode-de","description":"LBDS SMS Gateway provider implementations","archived":false,"fork":false,"pushed_at":"2022-02-01T16:51:05.000Z","size":51,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-03-26T12:20:11.467Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/crowdcode-de.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-12-29T11:46:20.000Z","updated_at":"2024-03-26T12:20:11.468Z","dependencies_parsed_at":"2022-08-04T13:00:19.882Z","dependency_job_id":null,"html_url":"https://github.com/crowdcode-de/lbds-sms-gateway","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/crowdcode-de/lbds-sms-gateway","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crowdcode-de%2Flbds-sms-gateway","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crowdcode-de%2Flbds-sms-gateway/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crowdcode-de%2Flbds-sms-gateway/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crowdcode-de%2Flbds-sms-gateway/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crowdcode-de","download_url":"https://codeload.github.com/crowdcode-de/lbds-sms-gateway/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crowdcode-de%2Flbds-sms-gateway/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261601525,"owners_count":23183099,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-24T04:12:45.104Z","updated_at":"2025-06-24T04:12:45.990Z","avatar_url":"https://github.com/crowdcode-de.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SMS Integration for LBDS\n\n## General Prerequisites\n\n* you must be familiar with Spring and Bean injection\n* your components must be located within on sibling package to the existing implementation\n* you should be familiar with Spring Configuration\n\n## General Procedure\n\nTo have an integration of another SMS Provider into LBDS Backend, two lanes have to be considered.\nThe outbound lane is the implementation of sending an SMS. The inbound or incoming lane is the\nimplementation of how to receive a SMS.\n\n## Implementation\n\n### The implementation of sending and receiving a SMS from a certain provider\n\nTo send a SMS, the implementor has to provide an implementation plus a configuration.\n\nThe current implementation relies on an API driven approach. This means, we assume that the backend\nwill make use of a HTTP endpoint to send all data. See LinkMobilityGatewayService for an example \nimplementation\n\n#### Outbound Implementation\n\nFirst, implement the outbound sending component:\n\n```\n@Service\n@Slf4j\npublic class LinkMobilityGatewayService implements SmsGatewayInterface {\n\n```\n\n#### Inbound Implementation\n\nReceiving a SMS is done via callback. The provider will call our service endpoint to handover\nthe SMS data making use of their own data structures. Their data structure will be placed into\nthe implementation package. See LinkMobilitySms for an example. Since this is an endpoint activated\nfrom outside and being enabled by configuration you will have all freedom you need to unmarshal the\nproviders message; there is no specifiv interface from LBDS side necessary to be implemented.\n\nWhen receiving the SMS, the primary function of the controller is to transform it into a LbdsSms object\n(see model/LbdsSms.java for details).\n\n```\n\n@Slf4j\n@RestController\n@RequiredArgsConstructor\npublic class LinkmobilitySmsReceiverController {\n\n    private final LbdsMessageAcceptor lbdsMessageAcceptor;\n\n    private final LinkMobilityGatewayService linkMobilityGatewayService;\n\n    @Value(\"${logging.payload}\")\n    private final boolean loggingpayload = false;\n\n    @GetMapping(\"/smsreceive\")\n    public ResponseEntity receiveSms(LinkedMobilitySms linkedMobilitySms) throws IOException {\n\n        try {\n            //List\u003cLbdsSms\u003e response = linkMobilityGatewayService.receiveSMSResponse(servletRequest);\n            log.debug(linkedMobilitySms.getBody() + \" \" + linkedMobilitySms.getFrom() + \" \" + linkedMobilitySms.getTo());\n            LbdsSms lbdsSms = linkMobilityGatewayService.mapLinkMobiltySmsToLbdsSms(linkedMobilitySms);\n\n            lbdsMessageAcceptor.acceptMessage(lbdsSms);\n            log.debug(\"SUCCESSFULLY PROCESSED | \"+linkedMobilitySms.getBody() + \" \" + linkedMobilitySms.getFrom() + \" \" + linkedMobilitySms.getTo());\n\n        } catch (Exception e) {\n            log.error(\"FAILED TO PROCESS | \"+linkedMobilitySms.getBody() + \" \" + linkedMobilitySms.getFrom() + \" \" + linkedMobilitySms.getTo());\n            return ResponseEntity.internalServerError().build();\n        }\n        return ResponseEntity.ok().build();\n    }\n    \n```\nYour component has to map the message to a LbdsSms object and hand it over to the message acceptor.\nThis is a component injected from LBDS Backend. From there, LBDS will take care of the message processing.\n\n#### Configuration\n\nA LBDS backend only can run one provider at the same time since there is no routing information (which message would\ngo to which provider) present in the system. It will be configured using Spring configuration\n\n```\n@Configuration\n@ComponentScan\n@ConditionalOnProperty(prefix=\"sormas.sms\", name = \"provider\", havingValue = \"link-mobility\")\npublic class LinkMobilityConfig {\n\n\n}\n```\n\nTo enable your implementation, after the new version of the sms gateway library has been added to the\nservice, the only thing you need to do is enabling it inside the configuration\n\n```\nsormas.sms.provider=link-mobility\n```\n\n#### Example Configuration\n\nTo have my-custom-provider enabled, your config would look like this\n\n```\n@Configuration\n@ComponentScan\n@ConditionalOnProperty(prefix=\"sormas.sms\", name = \"provider\", havingValue = \"my-custom-provider\")\npublic class MyCustomProviderConfig {\n\n\n}\n```\nand the lbds backend config would have this\n\n```\nsormas.sms.provider=my-custom-provider\n```\n\nWhat happens here is:\n\n* The ConditionalOnProperty will match your my-custom-provider\n* This will enable a ComponentScan on your package and Gateway plus ReceiverController will be found\n* The components will be instantiated by LBDS and injected into the containers\n* Also, the LbdsMessageAcceptor Implementation will be injected into your receiver intertwining both\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrowdcode-de%2Flbds-sms-gateway","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrowdcode-de%2Flbds-sms-gateway","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrowdcode-de%2Flbds-sms-gateway/lists"}