custom regx for asterisk
Posted: 21 Oct 2014, 06:30
hi team,
Here is the regx i made but its not working. I have to block the ip and the logs line is
[2014-07-05 20:19:45] NOTICE[27008][C-00001ac7] chan_sip.c: Call from '' (37.8.5.217:12242) to extension '011972547851891' rejected because extension not found in context 'my_context'.
IP i have to block is 37.8.5.217
The regx i have written is
if (($lgfile eq $config{CUSTOM1_LOG}) and ($line =~ /\[\S+\s+\S+\] NOTICE\[\S+\] chan_sip\.c\: Call from '' '(\S+\s?\S+)' to extension '(\S+)\:\d+' \ rejected because extension not found in context 'my_context'/)) {
return ("Bad Call: $1",$2,"INVALIDASTREQUEST","1","1");
}
Here is the regx i made but its not working. I have to block the ip and the logs line is
[2014-07-05 20:19:45] NOTICE[27008][C-00001ac7] chan_sip.c: Call from '' (37.8.5.217:12242) to extension '011972547851891' rejected because extension not found in context 'my_context'.
IP i have to block is 37.8.5.217
The regx i have written is
if (($lgfile eq $config{CUSTOM1_LOG}) and ($line =~ /\[\S+\s+\S+\] NOTICE\[\S+\] chan_sip\.c\: Call from '' '(\S+\s?\S+)' to extension '(\S+)\:\d+' \ rejected because extension not found in context 'my_context'/)) {
return ("Bad Call: $1",$2,"INVALIDASTREQUEST","1","1");
}