plugin smpp-custom

This commit is contained in:
Daniel Brahneborg 2025-03-26 10:31:57 +01:00
parent 032ea2a894
commit e458f15bf2
2 changed files with 14 additions and 0 deletions

View file

@ -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.

View file

@ -0,0 +1,7 @@
sub before_send {
my ($request, $response) = @_;
my $sms = ${$request}{qe};
$sms->{SMPPOPTION} = "0x1400:" . unpack("H*","Value");
return 0;
}