Page MenuHomePhabricator

Main Entities
AG Projects RTC Platforms (Provisioning Guides)

This document describes the entities used in provisioning.

Customer

Customers are entities created in the platform to store names, address, billing and other information. Customers can also have arbitrary attribute/value pairs stored in the properties attribute.

During creation by the server, a unique id and a reseller id is assigned to each customer

Record Assignment

The customer id can be used for assignment of SIP domains, ENUM ranges and DNS zones. The assignment is done by setting the customer id attributes of the record in question.

All SIP accounts inherit the customer id from their parent SIP domain. For example a SIP domain that has customer and reseller attributes set cause all SIP accounts created under this domain to share the same customer and reseller (because the SIP account always belong to a SIP domain). The same concept applies to the ENUM numbers (they belong to ENUM ranges) and DNS records (they belong to DNS zones).

Before deleting a customer, make sure that no records belong to his id.

Reseller

The reseller has the role of grouping multiple customers together. The concept is similar to how the users in a Unix system work, where each user has a unique id and a group id. As opposed to the Unix model, a customer can only belong to a single reseller. Customers having their id equal to the reseller_id are referred as resellers. Also customers that have the impersonate attribute set to the reseller id have the same right as their reseller.

If a reseller is not specified during the creation of a new customer entry, a new reseller id equal to the customer id will be assigned, in fact creating a new Reseller in the system. Only provisioning requests made with admin rights can add a reseller into the system.

Conventions for resellers

A customer that is a reseller (the customer id is equal to reseller id) is allowed to create other customers and records in the platform if the resellerActive attribute of the customer is set to true.

The number of records each reseller is allowed to provision into the platform is controlled by some special properties belonging to the reseller. These special properties are:

  • sip_credit,
  • sip_alias_credit,
  • enum_range_credit,
  • enum_number_credit,
  • dns_zone_credit,
  • email_credit

The same credit convention is valid for customers belonging to a reseller. Each customer may create records within their own credit. The total of all records created by all customers may not exceed the credit of the reseller. The server checks during creation of each record if the quota has not been exceeded.

The following properties controls if the reseller or customer has access to enable access to PSTN for the SIP accounts:

  • pstn_access: can create SIP accounts with PSTN prepaid access
  • prepaid_changes can toggle a SIP account from prepaid to postpaid and vice versa

On CDRTool, to create an account that has access to the records belonging to a specific customer set the Impersonate field of the CDRTool login account to customer_id.reseller_id.

Conventions for the properties

As mentioned before, each customer can have a list of attributed/value pairs attached to them in the properties attribute, this allowing for storage of arbitrary data with each customer. Each attribute has a field called permission. The following rules apply:

  • Properties having permission set to admin can be modified only by the administrator
  • Properties having permission set to reseller can be modified by the administrator and their reseller
  • Properties having other permission can be modified by their customer, their reseller or by the administrator

If the SIP domain of a SIP account belongs to a customer (the customer_id != 0), the pstn_access and prepaid_access properties can be enabled only if the corespondent reseller has these properties set to 1.

Owner

At SIP account, SIP alias and ENUM number level another attribute called *owner* exists. Owner attribute can be used to assign or group individual records like SIP accounts and ENUM numbers to customers in the customer table. For example one customer can have multiple SIP accounts and ENUM numbers if their owner field are set to his customer id.

SOAP/XML functions

  • CustomerPortaddAccount()
  • CustomerPortupdateAccount()
  • CustomerPortdeleteAccount()
  • CustomerPortgetAccount()
  • CustomerPortgetCustomers()
  • CustomerPortgetResellers()
  • CustomerPortsetProperties()
  • CustomerPortgetProperties()

Customer attributes:

<complexType name="CustomerAccount"><sequence>
        <element name="id" nillable="true" type="xsd:integer"/>
        <element name="reseller" nillable="true" type="xsd:integer"/>
        <element name="impersonate" nillable="true" type="xsd:integer"/>
        <element name="username" nillable="true" type="xsd:string"/>
        <element name="password" nillable="true" type="xsd:string"/>
        <element name="firstName" nillable="true" type="xsd:string"/>
        <element name="lastName" nillable="true" type="xsd:string"/>
        <element name="organization" nillable="true" type="xsd:string"/>
        <element name="vatNumber" nillable="true" type="xsd:string"/>
        <element name="email" nillable="true" type="xsd:string"/>
        <element name="web" nillable="true" type="xsd:string"/>
        <element name="tel" nillable="true" type="xsd:string"/>
        <element name="fax" nillable="true" type="xsd:string"/>
        <element name="mobile" nillable="true" type="xsd:string"/>
        <element name="sip" nillable="true" type="xsd:string"/>
        <element name="enum" nillable="true" type="xsd:string"/>
        <element name="address" nillable="true" type="xsd:string"/>
        <element name="postcode" nillable="true" type="xsd:string"/>
        <element name="city" nillable="true" type="xsd:string"/>
        <element name="state" nillable="true" type="xsd:string"/>
        <element name="country" nillable="true" type="xsd:string"/>
        <element name="timezone" nillable="true" type="xsd:string"/>
        <element name="language" nillable="true" type="xsd:string"/>
        <element name="bankAccount" nillable="true" type="xsd:string"/>
        <element name="billingAddress" nillable="true" type="xsd:string"/>
        <element name="billingEmail" nillable="true" type="xsd:string"/>
        <element name="balance" nillable="true" type="xsd:double"/>
        <element name="credit" nillable="true" type="xsd:double"/>
        <element name="companyCode" nillable="true" type="xsd:string"/>
        <element name="resellerActive" nillable="true" type="xsd:boolean"/>
        <element name="changeDate" nillable="true" type="xsd:string"/>
        <element name="properties" nillable="true" type="ngnpro:CustomerPropertyArray"/>
    </sequence>
</complexType>

Graphical client

CDRToolAccountsCustomers

book-general-sip-platform-ngnpro-customers (261×1 px, 54 KB)

Here you can click on the customer id to edit its properties.

Next Steps

Continue by: