{"id":17127441,"url":"https://github.com/ashtum/smpp","last_synced_at":"2025-04-13T06:34:19.969Z","repository":{"id":65578813,"uuid":"586227538","full_name":"ashtum/smpp","owner":"ashtum","description":"A C++ implementation of SMPP protocol on Boost.Asio","archived":false,"fork":false,"pushed_at":"2024-11-28T11:11:01.000Z","size":92,"stargazers_count":12,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-26T23:04:51.867Z","etag":null,"topics":["boost-asio","coroutines","cpp","smpp","smpp-client","smpp-server"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ashtum.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2023-01-07T11:54:17.000Z","updated_at":"2024-12-25T22:35:39.000Z","dependencies_parsed_at":"2023-02-12T14:46:48.346Z","dependency_job_id":null,"html_url":"https://github.com/ashtum/smpp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashtum%2Fsmpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashtum%2Fsmpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashtum%2Fsmpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashtum%2Fsmpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ashtum","download_url":"https://codeload.github.com/ashtum/smpp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248674706,"owners_count":21143760,"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":["boost-asio","coroutines","cpp","smpp","smpp-client","smpp-server"],"created_at":"2024-10-14T19:04:40.447Z","updated_at":"2025-04-13T06:34:19.945Z","avatar_url":"https://github.com/ashtum.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"## What is the SMPP?\n\n**SMPP** is an Asio-based implementation of the SMPP protocol for the transfer of short message data between External Short Messaging Entities (ESMEs), Routing Entities (REs), and Short Message Service Center (SMSC).\n\n### Quick usage\n\nYou can start with examples in the [example directory](example).\n\n#### Asio universal asynchronous model\nThis library is written using Asio's composed operation and conforms to Asio universal asynchronous model, \nwhich means it can be used with callbacks, coroutines, futures, Boost.Fiber and any other form of completion tokens.\n```C++\n// C++20's coroutines\nauto sequence_number = co_await session.async_send(submit_sm);\n\n// Callbacks\nsession.async_send(submit_sm, [](auto ec,auto sequence_number){});\n\n// Futures\nauto fut = co_await session.async_send(submit_sm, asio::use_future);\n```\n\n#### Client and Server use the same `smpp::session`\nA client connects a TCP socket to the server and constructs a `smpp::session`:\n```C++\nauto socket = asio::ip::tcp::socket{ executor };\n\nco_await socket.async_connect({ asio::ip::tcp::v4(), 2775 });\n\nauto session = smpp::session{ std::move(socket) };\n```\n\nA server accepts a TCP socket and constructs a `smpp::session`:\n```C++\nauto acceptor = asio::ip::tcp::acceptor(executor, { asio::ip::tcp::v4(), 2775 });\n\nfor (;;)\n{\n  auto socket = co_await acceptor.async_accept();\n  auto session = smpp::session{ std::move(socket) };\n  //...\n}\n```\n\n#### Overloads for sending requests and responses\nSending a request completes with a `sequence_number` which can be used to map the received responses on the arrival.\n```C++\nauto sequence_number = co_await session.async_send(submit_sm);\n```\n\nSending a response needs the `sequence_number` and `command_status`.\n```C++\nco_await session.async_send(submit_sm_resp, sequence_number, smpp::command_status::rok);\n```\n\n#### Enquire_link operation is handled by `smpp::session`\nEnquire_link message can be sent by either the ESME or SMSC and is used to provide a confidence check of the communication path between the two parties, as long as there is an active `async_receive` operation, it would send and receive enquire_link messages and keep the session alive, so there is no need for user intervention.   \nThe interval for the enquire_link operation can be passed to the constructor of `smpp::session` which has a default value of 60 seconds.\n```C++\nsession::session(asio::ip::tcp::socket socket, std::chrono::seconds enquire_link_interval)\n```\n\n#### All the PDUs are aggregates\nBeing an aggregate made it easy to construct, copy, move and compare PDUs.  \nFor example, this is what the `cancel_sm` PDU looks like:\n```C++\nstruct cancel_sm\n{\n  static constexpr auto command_id{ smpp::command_id::cancel_sm };\n\n  std::string service_type{};\n  std::string message_id{};\n  smpp::ton source_addr_ton{ ton::unknown };\n  smpp::npi source_addr_npi{ npi::unknown };\n  std::string source_addr{};\n  smpp::ton dest_addr_ton{ ton::unknown };\n  smpp::npi dest_addr_npi{ npi::unknown };\n  std::string dest_addr{};\n\n  bool operator==(const cancel_sm\u0026) const = default;\n};\n```\n\nWe can use C++20's designated initializer with all of the PDUs:\n```C++\nauto bind_transceiver = smpp::bind_transceiver{\n  .system_id = \"Example\",\n  .password = \"******\",\n  .addr_ton = smpp::ton::national,\n  .addr_npi = smpp::npi::internet\n};\n```\n\n#### Optional tag–length–value (TLV) parameters are stored in `smpp::oparam`\nIf a PDU contains TLV parameters, they will be stored in `oparam` member variable, you can use this member variable to access and manipulate TLV parameters:\n```C++\nauto deliver_sm = smpp::deliver_sm{ /*...*/ };\n\ndeliver_sm.oparam.set_as_string(smpp::oparam_tag::dest_subaddress, \"123456789\");\ndeliver_sm.oparam.set_as_enum_u8(smpp::oparam_tag::message_state, smpp::message_state::expired);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashtum%2Fsmpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fashtum%2Fsmpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashtum%2Fsmpp/lists"}