From e458f15bf25b6409539bc33b21fe4ca623daedba Mon Sep 17 00:00:00 2001 From: Daniel Brahneborg Date: Wed, 26 Mar 2025 10:31:57 +0100 Subject: [PATCH] plugin smpp-custom --- plugins/smpp-custom/README.md | 7 +++++++ plugins/smpp-custom/smpp-custom.pl | 7 +++++++ 2 files changed, 14 insertions(+) create mode 100644 plugins/smpp-custom/README.md create mode 100644 plugins/smpp-custom/smpp-custom.pl diff --git a/plugins/smpp-custom/README.md b/plugins/smpp-custom/README.md new file mode 100644 index 0000000..6315164 --- /dev/null +++ b/plugins/smpp-custom/README.md @@ -0,0 +1,7 @@ +# Custom options over SMPP + +Some operators want additional information sent as the custom TLVs between 0x1400 and 0xFFFF. +One way to do this is to add a `before_send()` plugin to the connector. +Such a plugin, as the one shown here, would set the `$sms->{SMPPOPTION}` to a string in the format `key:hexvalue`, where `hexvalue` is the hex encoded version of the value. +If multiple values need to be sent, `$sms->{SMPPOPTION}` can instead be set to an array of such strings. + diff --git a/plugins/smpp-custom/smpp-custom.pl b/plugins/smpp-custom/smpp-custom.pl new file mode 100644 index 0000000..9825e21 --- /dev/null +++ b/plugins/smpp-custom/smpp-custom.pl @@ -0,0 +1,7 @@ +sub before_send { + my ($request, $response) = @_; + my $sms = ${$request}{qe}; + $sms->{SMPPOPTION} = "0x1400:" . unpack("H*","Value"); + return 0; +} +