X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2FClientAPI%2FSignup.pm;h=ec45e79a208bc4f1eaf0c0838d38adf10b1a48c8;hp=d6f5f1418a4e5242f4f6322c06d2eae8161cb7b9;hb=19f051397b95490022d043001819963726055eb0;hpb=a893d5a9e7532f2da810047f6aa423a8cc0ef4b7 diff --git a/FS/FS/ClientAPI/Signup.pm b/FS/FS/ClientAPI/Signup.pm index d6f5f1418..ec45e79a2 100644 --- a/FS/FS/ClientAPI/Signup.pm +++ b/FS/FS/ClientAPI/Signup.pm @@ -451,6 +451,9 @@ sub new_customer { unless $packet->{'popnum'} || !scalar(qsearch('svc_acct_pop',{} )); } + elsif ( $svc_x eq 'svc_pbx' ) { + #possibly some validation will be needed + } my $agentnum; if ( exists $packet->{'session_id'} ) { @@ -585,18 +588,23 @@ sub new_customer { } $svc->child_objects( \@acct_snarf ); - push @svc, $svc; } elsif ( $svc_x eq 'svc_phone' ) { - my $svc = new FS::svc_phone ( { + push @svc, new FS::svc_phone ( { 'svcpart' => $svcpart, map { $_ => $packet->{$_} } qw( countrycode phonenum sip_password pin ), } ); - push @svc, $svc; + } elsif ( $svc_x eq 'svc_pbx' ) { + push @svc, new FS::svc_pbx ( { + 'svcpart' => $svcpart, + map { $_ => $packet->{$_} } + qw( id title ), + } ); + } else { die "unknown signup service $svc_x"; } @@ -722,14 +730,20 @@ sub new_customer { my %return = ( 'error' => '', 'signup_service' => $svc_x, + 'svcnum' => $svc[0]->svcnum, + 'custnum' => $cust_main->custnum, ); if ( $svc_x eq 'svc_acct' ) { $return{$_} = $svc[0]->$_() for qw( username _password ); } elsif ( $svc_x eq 'svc_phone' ) { $return{$_} = $svc[0]->$_() for qw( countrycode phonenum sip_password pin ); + } elsif ( $svc_x eq 'svc_pbx' ) { + #$return{$_} = $svc[0]->$_() for qw( ) #nothing yet } else { - die "unknown signup service $svc_x"; + return { 'error' => "configuration error: unknown signup service $svc_x" }; + #die "unknown signup service $svc_x"; + # return an error that's visible to someone somewhere } return \%return;