api:sip:account:move
Table of Contents
API : SIP Account Move to another customer
Introduction
This request moves a standalone SIP account (SIP trunk) to another customer, like the MVNO move. Only Telecom X staff can do it.
The account keeps its id, numbers, settings, credentials and default number, and its history follows it to the new customer:
- The numbers move to the new customer. Their name and listing in phone books are kept; the user (employee) and the number's own address (addressOverride) are removed, as they belong to the old customer. If the new customer has another reseller, the numbers' own number rent product is removed too.
- Portings of the account (also ongoing in-portings) move to the new customer and its reseller.
- CDR, usage statistics and voicemail messages of the account move to the new customer - the whole history, like the MVNO move. The usage counters of the current month move as well.
- Address - the account gets the address given in the request, which is used for emergency calls (112).
- Rate plan - the one given in the request, or else the new customer's rate plan inheriting from the same master plan as the current one (the cheapest one valid for use). A pending rate plan change (newRatePlan) is dropped.
- Billing customer - kept only if it is also a billing customer of the new customer. A campaign the account is on is dropped if the new customer has another reseller.
- Billing - there is no credit or charge. The period already invoiced stays on the old customer's invoice; the next period is invoiced to the new customer.
- The routing (SBC) and the realtime state are updated at once.
Both customers get a change log entry (Transferred to new customer and Transferred from other customer, with the account as it was before the move) and a SIP_ACCOUNT_UPDATED realtime event.
The account cannot move when:
- it is a hosted PBX trunk (pbx set) - its numbers are part of the customer's PBX,
- the same things stop a deletion: other SIP accounts are included in it (are its children), it is the default voice account of the customer's hosted PBX, or one of its numbers is used on a hosted PBX (as the PBX default number, an extension's direct number or presence caller ID, or on a TRUNK item),
- mobile (MVNO) accounts are routed through it,
- it is included in another SIP account (parentSipAccount is set),
- a deletion is scheduled (deleteDate is set) - cancel it first,
- one of its numbers is being ported out.
Request
| URL | https://api.telecomx.dk/sip/ACCOUNT_ID/move | ||
|---|---|---|---|
| Method | POST | ||
| Access level | RESELLER_ADMIN or ADMIN (Telecom X staff). | ||
| Param | ACCOUNT_ID | Id of the SIP account (24 hex-char string) | |
| Body | customer | Id | Id of the customer to move the account to. Must be active and another customer than the account's own. |
| address | Id | Id of one of the new customer's addresses - used for emergency calls (112). | |
| ratePlan | Id | [optional] Id of the new customer's SIP rate plan. If omitted or null, the new customer's rate plan inheriting from the same master plan as the current one is used. |
|
Request body example
{ customer: '1234567890ABCDEF12345679', address: '1234567890ABCDEF1234567A' }
Response
The moved SIP account, in the same format as Get, but without registerExpire and lastSeen.
Errors
| Error code | Message | Description |
|---|---|---|
| 403 | access_denied | Insufficient access level - also when the new customer does not exist, is deleted or lacks the SIP feature |
| 404 | id | SIP account not found |
| 404 | customer, address | Missing (check: required) |
| 409 | pbx | Only a standalone SIP account can move to another customer - a hosted PBX trunk cannot (check: pbx) |
| 409 | customer | The customer is not active (check: not_active) |
| 409 | customer | The SIP account already belongs to the customer (check: same_customer) |
| 409 | parentSipAccount | The SIP account can not be deleted, because it is the parent of N SIP accounts. |
| 409 | _id | Cannot delete the default voice account on the customers PBX |
| 409 | numbers | One or more numbers are used by hosted PBX |
| 409 | sipAccount | N mobile accounts are routed through the SIP account - unlink them first (check: mobiles) |
| 409 | parentSipAccount | The SIP account is included in another SIP account - remove that first (check: included) |
| 409 | deleteDate | The SIP account is scheduled for deletion - cancel the deletion first |
| 409 | numbers[E.164Number] | The number is being ported out - the SIP account cannot move until the porting is done (check: porting_out) |
| 409 | id | The SIP account changed while moving it - please try again (check: changed) |
| 422 | address | The address does not belong to the customer |
| 422 | ratePlan | The customer has no rate plan matching the current one, or the current rate plan has no master plan - choose a rate plan (check: no_match) |
| 422 | ratePlan | The rate plan is not valid for the customer |
| 422 | id, customer, address, ratePlan | Invalid ObjectId |
| 500 | internal_error | <Unspecified> |
api/sip/account/move.txt · Last modified: by Telecom X AI