forked from public/public
plugin infobip-hlr
This commit is contained in:
parent
700b84d327
commit
27bcde240d
1 changed files with 23 additions and 0 deletions
23
plugins/infobip-hlr/infobip-hlr.pl
Normal file
23
plugins/infobip-hlr/infobip-hlr.pl
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
# Fields described here:
|
||||||
|
# https://www.infobip.com/docs/essentials/api-essentials/smpp-specification
|
||||||
|
|
||||||
|
sub before_dlr {
|
||||||
|
my ($request, $response) = @_;
|
||||||
|
my $dlrinfo = ${$request}{dlrinfo};
|
||||||
|
|
||||||
|
return 0 if $dlrinfo->{sourceaddr} ne 'HLR';
|
||||||
|
|
||||||
|
my $mccmnc = $dlrinfo->{'0x1416'};
|
||||||
|
my %info = (
|
||||||
|
mcc => substr($mccmnc, 0, 3),
|
||||||
|
mnc => substr($mccmnc, 3),
|
||||||
|
);
|
||||||
|
|
||||||
|
my $imsi = $dlrinfo->{'0x1403'};
|
||||||
|
$info{imsi} = $imsi if (defined($imsi));
|
||||||
|
|
||||||
|
$response->{dlrinfo} = \%info;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue