diff options
author | Marcello Coutinho <marcellocoutinho@gmail.com> | 2013-09-30 17:42:24 -0300 |
---|---|---|
committer | Marcello Coutinho <marcellocoutinho@gmail.com> | 2013-09-30 17:42:24 -0300 |
commit | b2a425218d3937418ec01727aa91af2c1238e281 (patch) | |
tree | 62de962139bda21862696ce9e1b77115c4f88935 /config/asterisk/asterisk.inc | |
parent | 3f0126010248f1282e874df7a57bcfe8b18f41a9 (diff) | |
download | pfsense-packages-b2a425218d3937418ec01727aa91af2c1238e281.tar.gz pfsense-packages-b2a425218d3937418ec01727aa91af2c1238e281.tar.bz2 pfsense-packages-b2a425218d3937418ec01727aa91af2c1238e281.zip |
asterisk -more preg_match fixes
Diffstat (limited to 'config/asterisk/asterisk.inc')
-rw-r--r-- | config/asterisk/asterisk.inc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/config/asterisk/asterisk.inc b/config/asterisk/asterisk.inc index f524fece..07d3d923 100644 --- a/config/asterisk/asterisk.inc +++ b/config/asterisk/asterisk.inc @@ -338,14 +338,14 @@ EOF; $script_file=file_get_contents($script); //strenghten a couple of security settings, and predefine codecs in the default SIP configuration if (strpos($script_file,'pfSense') === false) { //first check if already added... - $pattern[0]=';allowguest'; + $pattern[0]='/;allowguest\S+/'; $replace[0]='allowguest=no ;by pfSense ;'; - $pattern[1]=';alwaysauthreject'; + $pattern[1]='/;alwaysauthreject/'; $replace[1]='alwaysauthreject=yes ;by pfSense ;'; - $pattern[2]='; jbenable'; + $pattern[2]='/; jbenable/'; $replace[2]='jbenable=yes ;by pfSense ;'; - $pattern[3]='[general]'; - $replace[3]='[general]\n;The following general settings usually work on pfSense boxes (note: please do not remove this comment line).\ndisallow=all ;by pfSense\nallow=g729\nallow=ulaw\nallow=alaw\n\n'; + $pattern[3]='/(First disallow all codecs)/'; + $replace[3]="$1\n;The following general settings usually work on pfSense boxes (note: please do not remove this comment line).\ndisallow=all ;by pfSense\nallow=g729\nallow=gsm\nallow=ulaw\nallow=alaw\n\n"; $script_file=preg_replace($pattern,$replace,$script_file); file_put_contents($script, $script_file, LOCK_EX); } |