diff options
-rw-r--r-- | FS/FS/Conf.pm | 11 | ||||
-rw-r--r-- | FS/FS/svc_phone.pm | 8 |
2 files changed, 18 insertions, 1 deletions
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index ee69889fa..2d7990906 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -4766,6 +4766,17 @@ and customer address. Include units.', }, { + 'key' => 'svc_phone-radius-password', + 'section' => 'telephony', + 'description' => 'Password when exporting svc_phone records to RADIUS', + 'type' => 'select', + 'select_hash' => [ + '' => 'Use default from svc_phone-radius-default_password config', + 'countrycode_phonenum' => 'Phone number (with country code)', + ], + }, + + { 'key' => 'svc_phone-radius-default_password', 'section' => 'telephony', 'description' => 'Default password when exporting svc_phone records to RADIUS', diff --git a/FS/FS/svc_phone.pm b/FS/FS/svc_phone.pm index ed0ec0929..4b7638a69 100644 --- a/FS/FS/svc_phone.pm +++ b/FS/FS/svc_phone.pm @@ -652,7 +652,13 @@ sub radius_check { my $conf = new FS::Conf; - $check{'User-Password'} = $conf->config('svc_phone-radius-default_password'); + my $password; + if ( $conf->config('svc_phone-radius-password') eq 'countrycode_phonenum' ) { + $password = $self->countrycode. $self->phonenum; + } else { + $password = $conf->config('svc_phone-radius-default_password'); + } + $check{'User-Password'} = $password; %check; } |