+=head2 api_update_account
+
+Accepts I<$i_account> and I<$svc_phone>. Updates the account
+specified by I<$i_account> with the current values of I<$svc_phone>
+(currently only updates account_id.)
+Always returns empty. Retrieve error messages using L</api_error>.
+
+=cut
+
+sub api_update_account {
+ my ($self,$i_account,$svc_phone) = @_;
+ my $newid = $self->portaone_account_id($svc_phone);
+ unless ($newid) {
+ $self->{'__portaone_error'} = "Error loading account id during update_account";
+ return;
+ }
+ my $updated_account = $self->api_call('Account','update_account',{
+ 'account_info' => {
+ 'i_account' => $i_account,
+ 'id' => $newid,
+ 'i_product' => $self->option('product_id'),
+ 'h323_password' => $svc_phone->sip_password,
+ },
+ },'i_account');
+ return if $self->api_error;
+ $self->{'__portaone_error'} = "Account updated, but account id mismatch detected"
+ unless $updated_account eq $i_account; # should never happen
+ return;
+}
+