TT#39048 send_ext_notify(): fix typo, remove trailing slash

* callee typo caused external notifies using
      macro patterns not being send correctly
    * remove a trailing slash from the url if there are macro
      matches

Change-Id: Ib737cb09ca9836c3ea949e03d6ee5678ce1ea6e9
(cherry picked from commit d40e74dc1d)
changes/26/22126/1
Kirill Solomko 8 years ago
parent 98fabbbf2a
commit 8cdf79a653

@ -164,15 +164,19 @@ sub send_ext_notify {
prefix => 'voicemail',
suffix => 'notify',
caller => $data{from},
caleee => $data{user},
callee => $data{user},
callid => $data{callid},
token => '',
);
my $mm = 0;
foreach my $v (qw(prefix suffix caller callee callid token)) {
my $t = $url_ph{$v} ? $url_ph{$v}."/" : "";
$url =~ s/\$\{$v\}/$t/g;
if ($url =~ s/\$\{$v\}/$t/g) {
$mm = 1;
}
}
$url = substr($url, 0, -1) if $mm;
my $ua = new LWP::UserAgent;
$ua->agent('NGCP vmnotify 1.0');

Loading…
Cancel
Save