X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fsvc_phone.pm;h=118748ea20926528aa4fe01924e415d6780dcbf3;hb=ea3ce8d7f076e7fecff4be7ae63bc413adb0adf5;hp=e3d18e092be5fa15721053f241340387b9e47aec;hpb=e00d9e8daa1129a9430304b43689781fd86949eb;p=freeside.git diff --git a/FS/FS/svc_phone.pm b/FS/FS/svc_phone.pm index e3d18e092..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) ) @@ -658,6 +667,10 @@ on inbound processing status. =item default_prefix => "XXX": Also accept the phone number of the service prepended with the chosen prefix. +=item begin, end: Start and end of a date range, as unix timestamp. + +=item cdrtypenum: Only return CDRs with this type number. + =item disable_src => 1: Only match on "charged_party", not "src". =item by_svcnum: not supported for svc_phone @@ -696,6 +709,10 @@ sub get_cdrs { $hash{'freesidestatus'} = $options{'status'} if exists($options{'status'}); } + + if ($options{'cdrtypenum'}) { + $hash{'cdrtypenum'} = $options{'cdrtypenum'}; + } my $for_update = $options{'for_update'} ? 'FOR UPDATE' : '';