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; +} +