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:

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:

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>