C# Класс SIPSorcery.Entities.CustomerAccountDataLayer

Показать файл Открыть проект

Открытые методы

Метод Описание
Add ( CustomerAccount customerAccount ) : void

Adds a new customer account.

CheckAccountCode ( string owner, string accountCode ) : CustomerAccount

Checks the account code is valid and if not will also check the account number.

Get ( string owner, string accountNumber ) : CustomerAccount
GetBalance ( string accountCode ) : decimal
GetRate ( string owner, string rateCode, string destination, int ratePlan ) : Rate

This method acts as a call rate lookup engine. It's very basic and simply matches the call destination based on the record that has the longest matching prefix.

GetRtccCustomer ( string owner, string accountNumber ) : SIPSorcery.SIP.App.RtccCustomerAccount
GetRtccRate ( string owner, string rateCode, string destination, int ratePlan ) : SIPSorcery.SIP.App.RtccRate
IsAccountCodeInUse ( string accountCode, string updatingID ) : bool

Checks whether the account code is already in use for the system.

IsAccountNameInUse ( string owner, string accountName, string updatingID ) : bool

Checks whether the account name is already in use for this owner.

IsAccountNumberInUse ( string owner, string accountNumber, string updatingID ) : bool

Checks whether the account number is already in use for this owner.

ReserveCredit ( int seconds, string rtccID ) : bool

This method attempts to reserve a chunk of credit for to allow a call to continue.

ReserveInitialCredit ( string accountCode, string rateID, SIPCDR cdr, int &initialSeconds ) : decimal

This method attempts to reserve a the initial amount of credit for a call.

ReturnUnusedCredit ( string rtccID ) : decimal

This method should be called once a billable call has been completed. It will calculate the final cost of the call and return any usused credit back to the customer account.

SetCDRIsHangingUp ( string rtccID ) : void
Update ( CustomerAccount customerAccount ) : void

Updates an existing customer account.

UpdateRealTimeCallControlCDRID ( string oldCDRID, SIPCDR newCDR ) : void

Приватные методы

Метод Описание
CheckUniqueFields ( CustomerAccount customerAccount ) : void

Описание методов

Add() публичный Метод

Adds a new customer account.
public Add ( CustomerAccount customerAccount ) : void
customerAccount CustomerAccount The customer account to add.
Результат void

CheckAccountCode() публичный Метод

Checks the account code is valid and if not will also check the account number.
public CheckAccountCode ( string owner, string accountCode ) : CustomerAccount
owner string The owner of the customer accounts to check.
accountCode string
Результат CustomerAccount

Get() публичный Метод

public Get ( string owner, string accountNumber ) : CustomerAccount
owner string
accountNumber string
Результат CustomerAccount

GetBalance() публичный Метод

public GetBalance ( string accountCode ) : decimal
accountCode string
Результат decimal

GetRate() публичный Метод

This method acts as a call rate lookup engine. It's very basic and simply matches the call destination based on the record that has the longest matching prefix.
public GetRate ( string owner, string rateCode, string destination, int ratePlan ) : Rate
owner string The owner the call rate lookup is for.
rateCode string The rate code for the call. If specified and a matching rate is found it will /// take precedence over the destination.
destination string The call desintation the rate lookup is for.
ratePlan int
Результат Rate

GetRtccCustomer() публичный Метод

public GetRtccCustomer ( string owner, string accountNumber ) : SIPSorcery.SIP.App.RtccCustomerAccount
owner string
accountNumber string
Результат SIPSorcery.SIP.App.RtccCustomerAccount

GetRtccRate() публичный Метод

public GetRtccRate ( string owner, string rateCode, string destination, int ratePlan ) : SIPSorcery.SIP.App.RtccRate
owner string
rateCode string
destination string
ratePlan int
Результат SIPSorcery.SIP.App.RtccRate

IsAccountCodeInUse() публичный Метод

Checks whether the account code is already in use for the system.
public IsAccountCodeInUse ( string accountCode, string updatingID ) : bool
accountCode string The account code to check.
updatingID string An optional parameter that can be supplied when the check is being made for an account /// that is being updated and in which case this ID is for the record being updated.
Результат bool

IsAccountNameInUse() публичный Метод

Checks whether the account name is already in use for this owner.
public IsAccountNameInUse ( string owner, string accountName, string updatingID ) : bool
owner string The owner of the customer accounts to check.
accountName string The account name to check.
updatingID string An optional parameter that can be supplied when the check is being made for an account /// that is being updated and in which case this ID is for the record being updated.
Результат bool

IsAccountNumberInUse() публичный Метод

Checks whether the account number is already in use for this owner.
public IsAccountNumberInUse ( string owner, string accountNumber, string updatingID ) : bool
owner string The owner of the customer accounts to check.
accountNumber string The account number to check.
updatingID string An optional parameter that can be supplied when the check is being made for an account /// that is being updated and in which case this ID is for the record being updated.
Результат bool

ReserveCredit() публичный Метод

This method attempts to reserve a chunk of credit for to allow a call to continue.
public ReserveCredit ( int seconds, string rtccID ) : bool
seconds int The number of seconds the reservation is being requested for.
rtccID string
Результат bool

ReserveInitialCredit() публичный Метод

This method attempts to reserve a the initial amount of credit for a call.
public ReserveInitialCredit ( string accountCode, string rateID, SIPCDR cdr, int &initialSeconds ) : decimal
accountCode string The accountCode the credit should be reserved against.
rateID string
cdr SIPSorcery.SIP.SIPCDR
initialSeconds int IF the reservation is successful this parameter will hold the number of seconds that were reserved for the initial reservation.
Результат decimal

ReturnUnusedCredit() публичный Метод

This method should be called once a billable call has been completed. It will calculate the final cost of the call and return any usused credit back to the customer account.
public ReturnUnusedCredit ( string rtccID ) : decimal
rtccID string
Результат decimal

SetCDRIsHangingUp() публичный Метод

public SetCDRIsHangingUp ( string rtccID ) : void
rtccID string
Результат void

Update() публичный Метод

Updates an existing customer account.
public Update ( CustomerAccount customerAccount ) : void
customerAccount CustomerAccount The customer account to update.
Результат void

UpdateRealTimeCallControlCDRID() публичный Метод

public UpdateRealTimeCallControlCDRID ( string oldCDRID, SIPCDR newCDR ) : void
oldCDRID string
newCDR SIPSorcery.SIP.SIPCDR
Результат void