C# 클래스 SIPSorcery.Entities.CustomerAccountDataLayer

파일 보기 프로젝트 열기: sipsorcery/sipsorcery

공개 메소드들

메소드 설명
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