C# Class SIPSorcery.Entities.CustomerAccountDataLayer

Afficher le fichier Open project: sipsorcery/sipsorcery

Méthodes publiques

Méthode Description
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

Private Methods

Méthode Description
CheckUniqueFields ( CustomerAccount customerAccount ) : void

Method Details

Add() public méthode

Adds a new customer account.
public Add ( CustomerAccount customerAccount ) : void
customerAccount CustomerAccount The customer account to add.
Résultat void

CheckAccountCode() public méthode

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
Résultat CustomerAccount

Get() public méthode

public Get ( string owner, string accountNumber ) : CustomerAccount
owner string
accountNumber string
Résultat CustomerAccount

GetBalance() public méthode

public GetBalance ( string accountCode ) : decimal
accountCode string
Résultat decimal

GetRate() public méthode

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
Résultat Rate

GetRtccCustomer() public méthode

public GetRtccCustomer ( string owner, string accountNumber ) : SIPSorcery.SIP.App.RtccCustomerAccount
owner string
accountNumber string
Résultat SIPSorcery.SIP.App.RtccCustomerAccount

GetRtccRate() public méthode

public GetRtccRate ( string owner, string rateCode, string destination, int ratePlan ) : SIPSorcery.SIP.App.RtccRate
owner string
rateCode string
destination string
ratePlan int
Résultat SIPSorcery.SIP.App.RtccRate

IsAccountCodeInUse() public méthode

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.
Résultat bool

IsAccountNameInUse() public méthode

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.
Résultat bool

IsAccountNumberInUse() public méthode

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.
Résultat bool

ReserveCredit() public méthode

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
Résultat bool

ReserveInitialCredit() public méthode

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.
Résultat decimal

ReturnUnusedCredit() public méthode

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
Résultat decimal

SetCDRIsHangingUp() public méthode

public SetCDRIsHangingUp ( string rtccID ) : void
rtccID string
Résultat void

Update() public méthode

Updates an existing customer account.
public Update ( CustomerAccount customerAccount ) : void
customerAccount CustomerAccount The customer account to update.
Résultat void

UpdateRealTimeCallControlCDRID() public méthode

public UpdateRealTimeCallControlCDRID ( string oldCDRID, SIPCDR newCDR ) : void
oldCDRID string
newCDR SIPSorcery.SIP.SIPCDR
Résultat void