From 8cdf79a65375d9040516369ae1a9769739143060 Mon Sep 17 00:00:00 2001 From: Kirill Solomko Date: Wed, 20 Jun 2018 16:19:09 +0200 Subject: [PATCH] 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 d40e74dc1dd8a94bdac70a5f30f7d8967b7eed88) --- vmnotify | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/vmnotify b/vmnotify index b40a0fa..e76d235 100755 --- a/vmnotify +++ b/vmnotify @@ -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');