X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fsvc_phone.pm;h=118748ea20926528aa4fe01924e415d6780dcbf3;hp=e8b0d0a71899d4512c5a3602c11e1716fa1ffa9e;hb=1e14c5a832bbedde3dafa13fe9bd984b75a424db;hpb=0e845fa6f04733d82ea8ca092c7778aef773ab5d diff --git a/FS/FS/svc_phone.pm b/FS/FS/svc_phone.pm index e8b0d0a71..118748ea2 100644 --- a/FS/FS/svc_phone.pm +++ b/FS/FS/svc_phone.pm @@ -503,7 +503,16 @@ sub check { $self->countrycode(1) unless $self->countrycode; - unless ( length($self->sip_password) ) { + unless ( length($self->pin) ) { + my $random_pin = $conf->config('svc_phone-random_pin'); + if ( $random_pin =~ /^\d+$/ ) { + $self->pin( + join('', map int(rand(10)), 0..($random_pin-1)) + ); + } + } + + unless ( length($self->sip_password) ) { # option for this? $self->sip_password( join('', map $pw_set[ int(rand $#pw_set) ], (0..16) )