v1

package
v0.0.0-...-c940998 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 5, 2017 License: Apache-2.0 Imports: 15 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Id                  string `json:"id,omitempty" url:"id"`
	Account             string `json:"account,omitempty" url:"account"`
	Username            string `json:"username" url:"username"`
	Protocol            string `json:"protocol" url:"protocol"`
	Description         string `json:"description,omitempty" url:"description"`
	AuthType            string `json:"auth_type" url:"auth_type"`
	Password            string `json:"password,omitempty" url:"password"`
	IP                  string `json:"ip,omitempty" url:"ip"`
	DeviceType          string `json:"device_type" url:"device_type"`
	CalleridNumber      string `json:"callerid_number,omitempty" url:"callerid_number"`
	CanadaRouting       string `json:"canada_routing,omitempty" url:"canada_routing"`
	LockInternational   string `json:"lock_international" url:"lock_international"`
	InternationalRoute  string `json:"international_route" url:"international_route"`
	MusicOnHold         string `json:"music_on_hold" url:"music_on_hold"`
	AllowedCodecs       string `json:"allowed_codecs" url:"allowed_codecs"`
	DTMFMode            string `json:"dtmf_mode" url:"dtmf_mode"`
	NAT                 string `json:"nat" url:"nat"`
	InternalExtension   string `json:"internal_extension,omitempty" url:"internal_extension"`
	InternalVoicemail   string `json:"internal_voicemail,omitempty" url:"internal_voicemail"`
	InternalDialtime    string `json:"internal_dialtime,omitempty" url:"internal_dialtime"`
	ResellerClient      string `json:"reseller_client,omitempty" url:"reseller_client"`
	ResellerPackage     string `json:"reseller_package,omitempty" url:"reseller_package"`
	ResellerNextbilling string `json:"reseller_nextbilling,omitempty" url:"reseller_nextbilling"`
	ResellerChargesetup string `json:"reseller_chargesetup,omitempty" url:"reseller_chargesetup"`
}

type AccountsAPI

type AccountsAPI struct {
	// contains filtered or unexported fields
}

func (*AccountsAPI) CreateSubAccount

func (a *AccountsAPI) CreateSubAccount(subAccount *Account) error

func (*AccountsAPI) DelSubAccount

func (a *AccountsAPI) DelSubAccount(id string) error

func (*AccountsAPI) GetAllowedCodecs

func (a *AccountsAPI) GetAllowedCodecs(codec string) ([]Codec, error)

func (*AccountsAPI) GetAuthTypes

func (a *AccountsAPI) GetAuthTypes(authType int) ([]AuthType, error)

func (*AccountsAPI) GetDTMFModes

func (a *AccountsAPI) GetDTMFModes(DTMFMode string) ([]DTMFMode, error)

func (*AccountsAPI) GetDeviceTypes

func (a *AccountsAPI) GetDeviceTypes(deviceType int) ([]DeviceType, error)

func (*AccountsAPI) GetLockInternational

func (a *AccountsAPI) GetLockInternational(lockInternational string) ([]LockInternational, error)

0 is an actual value for a Lock International entity so the signature of this message is a string opposed to an int. This was done to avoid confusion with other functions that take 0 in order to return all values.

func (*AccountsAPI) GetMusicOnHold

func (a *AccountsAPI) GetMusicOnHold(musicOnHold string) ([]MusicOnHold, error)

func (*AccountsAPI) GetNAT

func (a *AccountsAPI) GetNAT(NAT string) ([]NAT, error)

func (*AccountsAPI) GetProtocols

func (a *AccountsAPI) GetProtocols(protocol int) ([]Protocol, error)

func (*AccountsAPI) GetRegistrationStatus

func (a *AccountsAPI) GetRegistrationStatus(account string) (bool, []RegistrationStatus, error)

func (*AccountsAPI) GetReportEstimatedHoldTime

func (a *AccountsAPI) GetReportEstimatedHoldTime(typ3 string) ([]EstimatedHoldTime, error)

func (*AccountsAPI) GetRoutes

func (a *AccountsAPI) GetRoutes(route int) ([]Route, error)

func (*AccountsAPI) GetSubAccounts

func (a *AccountsAPI) GetSubAccounts(account string) ([]Account, error)

func (*AccountsAPI) SetSubAccount

func (a *AccountsAPI) SetSubAccount(account *Account) error

type AddChargeReq

type AddChargeReq struct {
	Client      string `json:"client"`
	Charge      string `json:"charge"`
	Description string `json:"description"`
	Test        string `json:"test"`
}

type AddChargeResp

type AddChargeResp struct {
	BaseResp
}

type AddPaymentReq

type AddPaymentReq struct {
	Client      string `json:"client"`
	Payment     string `json:"payment"`
	Description string `json:"description"`
	Test        string `json:"test"`
}

type AuthType

type AuthType NumberValueDescription

type BackOrder

type BackOrder struct {
	Quantity   int    `json:"quantity"`
	State      string `json:"state,omitempty"`    //State is used for US functions.
	Province   string `json:"province,omitempty"` //Province is used for CA functions.
	Ratecenter string `json:"ratecenter"`
	Order
}

type Balance

type Balance struct {
	CurrentBalance json.Number `json:"current_balance"`
	SpentTotal     json.Number `json:"spent_total,omitempty"`
	CallsTotal     json.Number `json:"calls_total,omitempty"`
	TimeTotal      json.Number `json:"time_total,omitempty"` //TODO:Stan change to duration
	SpentToday     json.Number `json:"spent_today,omitempty"`
	CallsToday     int         `json:"calls_today,omitempty"`
	TimeToday      json.Number `json:"time_today,omitempty"`
}

type BalanceManagement

type BalanceManagement NumberValueDescription

type BaseResp

type BaseResp struct {
	Status string `json:"status"`
}

func (*BaseResp) GetStatus

func (b *BaseResp) GetStatus() string

type BaseRoute

type BaseRoute struct {
	Type  string
	Value string
}

func NewAccountRoute

func NewAccountRoute(value string) BaseRoute

Helper to create account route.

func NewCBRoute

func NewCBRoute() BaseRoute

Helper to create cb route.

func NewDisaRoute

func NewDisaRoute() BaseRoute

Helper to create disa route.

func NewFwdRoute

func NewFwdRoute(value string) BaseRoute

Helper to create fwd route.

func NewGrpRoute

func NewGrpRoute() BaseRoute

Helper to create grp route.

func NewIVRRoute

func NewIVRRoute() BaseRoute

Helper to create ivr route.

func NewNoneRoute

func NewNoneRoute() BaseRoute

Helper to create none route.

func NewQueueRoute

func NewQueueRoute() BaseRoute

Helper to create queue route.

func NewRecordingRoute

func NewRecordingRoute() BaseRoute

Helper to create recording route.

func NewSIPRoute

func NewSIPRoute() BaseRoute

Helper to create sip route.

func NewSysRoute

func NewSysRoute(value string) BaseRoute

Helper to create sys route.

func NewTCRoute

func NewTCRoute() BaseRoute

Helper to create tc route.

func NewVMRoute

func NewVMRoute(value string) BaseRoute

Helper to create vm route.

func (BaseRoute) MarshalText

func (b BaseRoute) MarshalText() ([]byte, error)

func (BaseRoute) String

func (b BaseRoute) String() string

func (*BaseRoute) UnmarshalText

func (b *BaseRoute) UnmarshalText(text []byte) error

type CDR

type CDR struct {
	Date        time.Time     `json:"date"`
	CallerId    string        `json:"callerid"`
	Destination string        `json:"destination"`
	Description string        `json:"description"`
	Account     string        `json:"account"`
	Disposition string        `json:"disposition"`
	Duration    time.Duration `json:"duration"`
	Seconds     int           `json:"seconds,string"`
	Rate        float64       `json:"rate,string,omitempty"`
	Total       float64       `json:"total,string"`
	UniqueId    string        `json:"uniqueid"`
}

func (*CDR) UnmarshalJSON

func (c *CDR) UnmarshalJSON(data []byte) error

type CDRAPI

type CDRAPI struct {
	// contains filtered or unexported fields
}

func (*CDRAPI) GetCDR

func (c *CDRAPI) GetCDR(dateFrom, dateTo time.Time, callStatus CallStatus, timezone *time.Location, callType, callBilling, account string) ([]CDR, error)

func (*CDRAPI) GetCallAccounts

func (c *CDRAPI) GetCallAccounts(clientId string) ([]CallAccount, error)

func (*CDRAPI) GetCallBilling

func (c *CDRAPI) GetCallBilling() ([]CallBilling, error)

func (*CDRAPI) GetCallTypes

func (c *CDRAPI) GetCallTypes(clientId string) ([]CallType, error)

func (*CDRAPI) GetRates

func (c *CDRAPI) GetRates(packag3, query string) ([]Rate, error)

func (*CDRAPI) GetResellerCDR

func (c *CDRAPI) GetResellerCDR(dateFrom, dateTo time.Time, client string, callStatus CallStatus, timezone *time.Location, callType, callBilling, account string) ([]CDR, error)

func (*CDRAPI) GetTerminationRates

func (c *CDRAPI) GetTerminationRates(route, query string) ([]TerminationRate, error)

type CallAccount

type CallAccount StringValueDescription

type CallBilling

type CallBilling StringValueDescription

type CallStatus

type CallStatus struct {
	Answered bool
	NoAnswer bool
	Busy     bool
	Failed   bool
}

type CallType

type CallType StringValueDescription

type Callback

type Callback struct {
	Callback        string `json:"callback"`
	Description     string `json:"description"`
	Number          string `json:"number"`
	DelayBefore     int    `json:"delay_before"`
	ResponseTimeout int    `json:"response_timeout"`
	DigitTimeout    int    `json:"digit_timeout"`
	CalleridNumber  string `json:"callerid_number"`
}

type CallerIDFilter

type CallerIDFilter struct {
	Filtering           string `json:"filtering"`
	Callerid            string `json:"callerid"`
	DID                 string `json:"did"`
	Routing             string `json:"routing"`
	FailoverUnreachable string `json:"failover_unreachable"`
	FailoverBusy        string `json:"failover_busy"`
	FailoverNoanswer    string `json:"failover_noanswer"`
	Note                string `json:"note"`
}

type CancelDIDResp

type CancelDIDResp struct {
	BaseResp
}

type Carrier

type Carrier NumberValueDescription

type Charge

type Charge struct {
	Id          string    `json:"id"`
	Date        time.Time `json:"date"`
	Amount      float64   `json:"amount"`
	Description string    `json:"description"`
}

func (*Charge) UnmarshalJSON

func (c *Charge) UnmarshalJSON(data []byte) error

type Client

type Client struct {
	Client            string `json:"client"`
	Email             string `json:"email"`
	Password          string `json:"password"`
	Company           string `json:"company,omitempty"`
	FirstName         string `json:"firstname"`
	LastName          string `json:"lastname"`
	Address           string `json:"address,omitempty"`
	City              string `json:"city,omitempty"`
	State             string `json:"state,omitempty"`
	Country           string `json:"country,omitempty"`
	Zip               string `json:"zip,omitempty"`
	PhoneNumber       string `json:"phone_number"`
	BalanceManagement string `json:"balance_management,omitempty"`
}

type ClientPackage

type ClientPackage StringValueDescription

type ClientThreshold

type ClientThreshold struct {
	Threshold string `json:"threshold"`
	Email     string `json:"email"`
}

type ClientsAPI

type ClientsAPI struct {
	// contains filtered or unexported fields
}

func (*ClientsAPI) AddCharge

func (c *ClientsAPI) AddCharge(client, description string, charge float64, test bool) error

func (*ClientsAPI) AddPayment

func (c *ClientsAPI) AddPayment(client, description string, payment float64, test bool) error

func (*ClientsAPI) GetBalanceManagement

func (c *ClientsAPI) GetBalanceManagement(balanceManagement string) ([]BalanceManagement, error)

func (*ClientsAPI) GetCharges

func (c *ClientsAPI) GetCharges(client string) ([]Charge, error)

func (*ClientsAPI) GetClientPackages

func (c *ClientsAPI) GetClientPackages(client string) ([]ClientPackage, error)

func (*ClientsAPI) GetClientThreshold

func (c *ClientsAPI) GetClientThreshold(client string) (*ClientThreshold, error)

func (*ClientsAPI) GetClients

func (c *ClientsAPI) GetClients(client string) ([]Client, error)

func (*ClientsAPI) GetDeposits

func (c *ClientsAPI) GetDeposits(client string) ([]Deposit, error)

func (*ClientsAPI) GetPackages

func (c *ClientsAPI) GetPackages(packag3 string) ([]Package, error)

func (*ClientsAPI) GetResellerBalance

func (c *ClientsAPI) GetResellerBalance(client string) (*Balance, error)

func (*ClientsAPI) SetClient

func (c *ClientsAPI) SetClient(client *Client) error

func (*ClientsAPI) SetClientThreshold

func (c *ClientsAPI) SetClientThreshold(client, threshold, email string) error

func (*ClientsAPI) SignupClient

func (c *ClientsAPI) SignupClient(client *Client, confirmEmail, confirmPassword string, activate bool) error

type Codec

type ConnectDIDResp

type ConnectDIDResp struct {
	BaseResp
}

type Country

type Country StringValueDescription

type CreateSubAccountResp

type CreateSubAccountResp struct {
	BaseResp
	Id      int    `json:"id"`
	Account string `json:"account"`
}

type DID

type DID struct {
	DID                 string `json:"did"`
	Ratecenter          string `json:"ratecenter"`
	Province            string `json:"province,omitempty"`             //only populated on Canadian API calls
	ProvinceDescription string `json:"province_description,omitempty"` //only populated on Canadian API calls
	State               string `json:"state,omitempty"`                //only populated on US API calls
	StateDescription    string `json:"state_description,omitempty"`    //only populated on US API calls
	PerMinuteMonthly    string `json:"perminute_monthly"`
	PerMinuteMinute     string `json:"perminute_minute"`
	PerMinuteSetup      string `json:"perminute_setup"`
	FlatMonthly         string `json:"flat_monthly"`
	FlatMinute          string `json:"flat_minute"`
	FlatSetup           string `json:"flat_setup"`
	SMS                 int    `json:"sms,omitempty"`
}

type DIDCountries

type DIDCountries NumberValueDescription

type DIDInfo

type DIDInfo struct {
	DID         string `json:"did"`
	Description string `json:"description"`
	Order
	E911            string    `json:"e911"`
	NextBilling     time.Time `json:"next_billing"`
	OrderDate       time.Time `json:"next_billing"`
	ResellerAccount string    `json:"reseller_account"`

	ResellerNextBilling string `json:"reseller_next_billing"`
	ResellerMonthly     string `json:"reseller_monthly"`
	ResellerMinute      string `json:"reseller_minute"`
	ResellerSetup       string `json:"reseller_setup"`

	SMSAvailable          int    `json:"sms_available"`
	SMSEnabled            string `json:"sms_enabled"`
	SMSEmail              string `json:"sms_email"`
	SMSEmailEnabled       string `json:"sms_email_enabled"`
	SMSForward            string `json:"sms_forward"`
	SMSForwardEnabled     string `json:"sms_forward_enabled"`
	SMSURLCallback        string `json:"sms_url_callback"`
	SMSURLCallbackEnabled string `json:"sms_url_callback_enabled"`
	SMSURLCallbackEntry   string `json:"sms_url_callback_retry"`
}

type DIDOrder

type DIDOrder struct {
	Did string `json:"did"`
	Order
	DIDOrderResellerConfig
}

type DIDOrderInternationalGeographic

type DIDOrderInternationalGeographic struct {
	LocationId string `json:"location_id"`
	Quantity   int    `json:"quantity"`
	Order
	DIDOrderResellerConfig
}

type DIDOrderResellerConfig

type DIDOrderResellerConfig struct {
	Account string `json:"account"`
	Monthly string `json:"monthly"`
	Setup   string `json:"setup"`
	Minute  string `json:"minute"`
}

type DIDSearchType

type DIDSearchType string
const (
	StartsDIDSearchType   DIDSearchType = "starts"
	ContainsDIDSearchType DIDSearchType = "contains"
	EndsDIDSearchType     DIDSearchType = "ends"
)

type DIDsAPI

type DIDsAPI struct {
	// contains filtered or unexported fields
}

func (*DIDsAPI) BackOrderDIDCan

func (d *DIDsAPI) BackOrderDIDCan(backOrder *BackOrder) error

TODO:Stan this isn't working. It returns "invalid_ratecenter" and I'm pretty sure the ratecenter is correct.

func (*DIDsAPI) BackOrderDIDUSA

func (d *DIDsAPI) BackOrderDIDUSA(backOrder *BackOrder) error

TODO:Stan this isn't working. It returns "invalid_ratecenter" and I'm pretty sure the ratecenter is correct.

func (*DIDsAPI) CancelDID

func (d *DIDsAPI) CancelDID(DID, comment string, portOut, test bool) error

func (*DIDsAPI) ConnectDID

func (d *DIDsAPI) ConnectDID(DID, account, monthly, setup, minute string, nextBilling time.Time, dontChargeSetup, dontChargeMonthly bool) error

func (*DIDsAPI) DelCallback

func (d *DIDsAPI) DelCallback(callback string) error

func (*DIDsAPI) DelCallerIDFiltering

func (d *DIDsAPI) DelCallerIDFiltering(filtering string) error

func (*DIDsAPI) DelClient

func (d *DIDsAPI) DelClient(client string) error

func (*DIDsAPI) DelDISA

func (d *DIDsAPI) DelDISA(disa string) error

func (*DIDsAPI) DelForwarding

func (d *DIDsAPI) DelForwarding(forwarding string) error

func (*DIDsAPI) DelIVR

func (d *DIDsAPI) DelIVR(ivr string) error

func (*DIDsAPI) DelPhonebook

func (d *DIDsAPI) DelPhonebook(phonebook string) error

func (*DIDsAPI) DelQueue

func (d *DIDsAPI) DelQueue(queue string) error

func (*DIDsAPI) DelRecording

func (d *DIDsAPI) DelRecording(recording string) error

func (*DIDsAPI) DelRingGroup

func (d *DIDsAPI) DelRingGroup(ringGroup string) error

func (*DIDsAPI) DelSIPURI

func (d *DIDsAPI) DelSIPURI(SIPURI string) error

func (*DIDsAPI) DelStaticMember

func (d *DIDsAPI) DelStaticMember(member, queue string) error

func (*DIDsAPI) DelTimeCondition

func (d *DIDsAPI) DelTimeCondition(timeCondition string) error

func (*DIDsAPI) DeleteSMS

func (d *DIDsAPI) DeleteSMS(id string) error

func (*DIDsAPI) GetCallbacks

func (d *DIDsAPI) GetCallbacks(callback string) ([]Callback, error)

func (*DIDsAPI) GetCallerIDFiltering

func (d *DIDsAPI) GetCallerIDFiltering(filtering string) ([]CallerIDFilter, error)

func (*DIDsAPI) GetCarriers

func (d *DIDsAPI) GetCarriers(carrier string) ([]Carrier, error)

func (*DIDsAPI) GetDIDCountries

func (d *DIDsAPI) GetDIDCountries(countryId, typ3 string) ([]DIDCountries, error)

func (*DIDsAPI) GetDIDsCan

func (d *DIDsAPI) GetDIDsCan(province, rateCenter string) ([]DID, error)

func (*DIDsAPI) GetDIDsInfo

func (d *DIDsAPI) GetDIDsInfo(client, DID string) ([]DIDInfo, error)

func (*DIDsAPI) GetDIDsInternationalGeographic

func (d *DIDsAPI) GetDIDsInternationalGeographic(countryId string) ([]InternationalLocations, error)

func (*DIDsAPI) GetDIDsInternationalNational

func (d *DIDsAPI) GetDIDsInternationalNational(countryId string) ([]InternationalLocations, error)

func (*DIDsAPI) GetDIDsInternationalTollFree

func (d *DIDsAPI) GetDIDsInternationalTollFree(countryId string) ([]InternationalLocations, error)

func (*DIDsAPI) GetDIDsUSA

func (d *DIDsAPI) GetDIDsUSA(state, rateCenter string) ([]DID, error)

func (*DIDsAPI) GetDISAs

func (d *DIDsAPI) GetDISAs(DISA string) ([]DISA, error)

func (*DIDsAPI) GetForwardings

func (d *DIDsAPI) GetForwardings(forwarding string) ([]Forwarding, error)

func (*DIDsAPI) GetIVRs

func (d *DIDsAPI) GetIVRs(IVR string) ([]IVR, error)

func (*DIDsAPI) GetInternationalTypes

func (d *DIDsAPI) GetInternationalTypes(typ3 string) ([]InternationalTypes, error)

func (*DIDsAPI) GetJoinWhenEmptyTypes

func (d *DIDsAPI) GetJoinWhenEmptyTypes(typ3 string) ([]JoinWhenEmptyType, error)

func (*DIDsAPI) GetPhonebook

func (d *DIDsAPI) GetPhonebook(phonebook, name string) ([]Phonebook, error)

func (*DIDsAPI) GetPortability

func (d *DIDsAPI) GetPortability(DID string) (bool, []Plan, error)

func (*DIDsAPI) GetProvinces

func (d *DIDsAPI) GetProvinces() ([]Province, error)

func (*DIDsAPI) GetQueues

func (d *DIDsAPI) GetQueues(queue string) ([]Queue, error)

func (*DIDsAPI) GetRateCentersCan

func (d *DIDsAPI) GetRateCentersCan(province string) ([]RateCenter, error)

func (*DIDsAPI) GetRateCentersUSA

func (d *DIDsAPI) GetRateCentersUSA(state string) ([]RateCenter, error)

func (*DIDsAPI) GetRecordingFile

func (d *DIDsAPI) GetRecordingFile() error

func (*DIDsAPI) GetRecordings

func (d *DIDsAPI) GetRecordings() error

func (*DIDsAPI) GetRingGroups

func (d *DIDsAPI) GetRingGroups() error

func (*DIDsAPI) GetRingStrategies

func (d *DIDsAPI) GetRingStrategies() error

func (*DIDsAPI) GetSIPURIs

func (d *DIDsAPI) GetSIPURIs() error

func (*DIDsAPI) GetSMS

func (d *DIDsAPI) GetSMS() error

func (*DIDsAPI) GetStates

func (d *DIDsAPI) GetStates() ([]State, error)

func (*DIDsAPI) GetStaticMembers

func (d *DIDsAPI) GetStaticMembers(queue, member string) ([]Member, error)

func (*DIDsAPI) GetTimeConditions

func (d *DIDsAPI) GetTimeConditions(timeCondition string) ([]TimeCondition, error)

func (*DIDsAPI) GetVoicemailAttachmentFormats

func (d *DIDsAPI) GetVoicemailAttachmentFormats(emailAttachmentFormat string) ([]VoicemailAttachmentFormat, error)

func (*DIDsAPI) GetVoicemailSetups

func (d *DIDsAPI) GetVoicemailSetups(voicemailSetup string) ([]VoicemailSetup, error)

func (*DIDsAPI) OrderDID

func (d *DIDsAPI) OrderDID(didOrder *DIDOrder) error

func (*DIDsAPI) OrderDIDInternationalGeographic

func (d *DIDsAPI) OrderDIDInternationalGeographic(didOrder *DIDOrderInternationalGeographic) error

func (*DIDsAPI) OrderDIDInternationalNational

func (d *DIDsAPI) OrderDIDInternationalNational() error

func (*DIDsAPI) OrderDIDInternationalTollFree

func (d *DIDsAPI) OrderDIDInternationalTollFree() error

func (*DIDsAPI) OrderDIDVirtual

func (d *DIDsAPI) OrderDIDVirtual() error

func (*DIDsAPI) OrderTollFree

func (d *DIDsAPI) OrderTollFree() error

func (*DIDsAPI) OrderVanity

func (d *DIDsAPI) OrderVanity() error

func (*DIDsAPI) SearchDIDsCan

func (d *DIDsAPI) SearchDIDsCan(province string, typ3 DIDSearchType, query string) ([]DID, error)

func (*DIDsAPI) SearchDIDsUSA

func (d *DIDsAPI) SearchDIDsUSA() error

func (*DIDsAPI) SearchTollFreeCanUS

func (d *DIDsAPI) SearchTollFreeCanUS() error

func (*DIDsAPI) SearchTollFreeUSA

func (d *DIDsAPI) SearchTollFreeUSA() error

func (*DIDsAPI) SearchVanity

func (d *DIDsAPI) SearchVanity() error

func (*DIDsAPI) SendSMS

func (d *DIDsAPI) SendSMS() error

func (*DIDsAPI) SetCallback

func (d *DIDsAPI) SetCallback() error

func (*DIDsAPI) SetCallerIDFiltering

func (d *DIDsAPI) SetCallerIDFiltering() error

func (*DIDsAPI) SetDIDBillingType

func (d *DIDsAPI) SetDIDBillingType() error

func (*DIDsAPI) SetDIDInfo

func (d *DIDsAPI) SetDIDInfo() error

func (*DIDsAPI) SetDIDPOP

func (d *DIDsAPI) SetDIDPOP() error

func (*DIDsAPI) SetDIDRouting

func (d *DIDsAPI) SetDIDRouting() error

func (*DIDsAPI) SetDIDVoicemail

func (d *DIDsAPI) SetDIDVoicemail() error

func (*DIDsAPI) SetDISA

func (d *DIDsAPI) SetDISA() error

func (*DIDsAPI) SetForwarding

func (d *DIDsAPI) SetForwarding() error

func (*DIDsAPI) SetIVR

func (d *DIDsAPI) SetIVR() error

func (*DIDsAPI) SetPhonebook

func (d *DIDsAPI) SetPhonebook() error

func (*DIDsAPI) SetQueue

func (d *DIDsAPI) SetQueue() error

func (*DIDsAPI) SetRecording

func (d *DIDsAPI) SetRecording() error

func (*DIDsAPI) SetRingGroup

func (d *DIDsAPI) SetRingGroup() error

func (*DIDsAPI) SetSIPURI

func (d *DIDsAPI) SetSIPURI() error

func (*DIDsAPI) SetSMS

func (d *DIDsAPI) SetSMS() error

func (*DIDsAPI) SetStaticMember

func (d *DIDsAPI) SetStaticMember() error

func (*DIDsAPI) SetTimeCondition

func (d *DIDsAPI) SetTimeCondition() error

func (*DIDsAPI) UnconnectDID

func (d *DIDsAPI) UnconnectDID() error

type DISA

type DISA struct {
	DISA             string `json:"disa"`
	Name             string `json:"name"`
	PIN              string `json:"pin"`
	DigitTimeout     string `json:"digit_timeout"`
	CalleridOverride string `json:"callerid_override"`
}

type DTMFMode

type DTMFMode StringValueDescription

type DelStaticMemberResp

type DelStaticMemberResp struct {
	BaseResp
}

type DelSubAccountReq

type DelSubAccountReq struct {
	Id string `json:"id"`
}

type DelSubAccountResp

type DelSubAccountResp struct {
	BaseResp
}

type Deposit

type Deposit Charge

type DeviceType

type DeviceType NumberValueDescription

type EstimatedHoldTime

type EstimatedHoldTime StringValueDescription

type FaxAPI

type FaxAPI struct {
	// contains filtered or unexported fields
}

Not implemented yet.

type Forwarding

type Forwarding struct {
	Forwarding       string `json:"forwarding"`
	PhoneNumber      string `json:"phone_number"`
	CalleridOverride string `json:"callerid_override"`
	Description      string `json:"description"`
	DTMFDigits       string `json:"dtmf_digits"`
	Pause            string `json:"pause"`
}

type GeneralAPI

type GeneralAPI struct {
	// contains filtered or unexported fields
}

func (*GeneralAPI) GetBalance

func (g *GeneralAPI) GetBalance(advanced bool) (*Balance, error)

func (*GeneralAPI) GetCountries

func (g *GeneralAPI) GetCountries(country string) ([]Country, error)

func (*GeneralAPI) GetIP

func (g *GeneralAPI) GetIP() (string, error)

func (*GeneralAPI) GetLanguages

func (g *GeneralAPI) GetLanguages(language string) ([]Language, error)

func (*GeneralAPI) GetServerInfo

func (g *GeneralAPI) GetServerInfo(serverPop string) ([]Server, error)

func (*GeneralAPI) GetTransactionHistory

func (g *GeneralAPI) GetTransactionHistory(dateFrom, dateTo time.Time) ([]Transaction, error)

type GetAllowedCodecsResp

type GetAllowedCodecsResp struct {
	BaseResp
	AllowedCodecs []Codec `json:"allowed_codecs"`
}

type GetAuthTypesResp

type GetAuthTypesResp struct {
	BaseResp
	AuthTypes []AuthType `json:"auth_types"`
}

type GetBalanceMangementResp

type GetBalanceMangementResp struct {
	BaseResp
	BalanceManagement []BalanceManagement `json:"balance_mangement"`
}

type GetBalanceResp

type GetBalanceResp struct {
	BaseResp
	Balance `json:"balance"`
}

type GetCDRResp

type GetCDRResp struct {
	BaseResp
	CDRs []CDR `json:"cdr"`
}

type GetCallAccountsResp

type GetCallAccountsResp struct {
	BaseResp
	CallAccounts []CallAccount `json:"accounts"`
}

type GetCallBillingResp

type GetCallBillingResp struct {
	BaseResp
	CallBilling []CallBilling `json:"call_billing"`
}

type GetCallTypeResp

type GetCallTypeResp struct {
	BaseResp
	CallTypes []CallType `json:"call_types"`
}

type GetCallbacksResp

type GetCallbacksResp struct {
	BaseResp
	Callbacks []Callback `json:"callbacks"`
}

type GetCallerIDFilteringResp

type GetCallerIDFilteringResp struct {
	BaseResp
	CallerIDFilters []CallerIDFilter `json:"filtering"`
}

type GetCarriersResp

type GetCarriersResp struct {
	BaseResp
	Carriers []Carrier `json:"carriers"`
}

type GetChargesResp

type GetChargesResp struct {
	BaseResp
	Charges []Charge `json:"charges"`
}

type GetClientPackagesResp

type GetClientPackagesResp struct {
	BaseResp
	ClientPackages []ClientPackage `json:"packages"`
}

type GetClientThresholdResp

type GetClientThresholdResp struct {
	BaseResp
	ThresholdInformation ClientThreshold `json:"threshold_information"`
}

type GetClientsResp

type GetClientsResp struct {
	BaseResp
	Clients []Client `json:"clients"`
}

type GetCountriesResp

type GetCountriesResp struct {
	BaseResp
	Countries []Country `json:"countries"`
}

type GetDIDCountriesResp

type GetDIDCountriesResp struct {
	BaseResp
	Countries []DIDCountries `json:"countries"`
}

type GetDIDsCanResp

type GetDIDsCanResp struct {
	BaseResp
	DIDs []DID `json:"dids"`
}

type GetDIDsInfoResp

type GetDIDsInfoResp struct {
	BaseResp
	DIDInfos []DIDInfo `json:"dids"`
}

type GetDIDsInternationalResp

type GetDIDsInternationalResp struct {
	BaseResp
	Locations []InternationalLocations `json:"locations"`
}

type GetDIDsUSAResp

type GetDIDsUSAResp struct {
	BaseResp
	DIDs []DID `json:"dids"`
}

type GetDISAsResp

type GetDISAsResp struct {
	BaseResp
	DISAs []DISA `json:"disa"`
}

type GetDTMFModesResp

type GetDTMFModesResp struct {
	BaseResp
	DTMFModes []DTMFMode `json:"dtmf_modes"`
}

type GetDepositsResp

type GetDepositsResp struct {
	BaseResp
	Deposits []Deposit `json:"deposits"`
}

type GetDeviceTypesResp

type GetDeviceTypesResp struct {
	BaseResp
	DeviceTypes []DeviceType `json:"device_types"`
}

type GetForwardingsResp

type GetForwardingsResp struct {
	BaseResp
	Forwardings []Forwarding `json:"forwardings"`
}

type GetIPResp

type GetIPResp struct {
	BaseResp
	IP string `json:"ip"`
}

type GetIVRsResp

type GetIVRsResp struct {
	BaseResp
	IVRs []IVR `json:"ivrs"`
}

type GetInternationalTypesResp

type GetInternationalTypesResp struct {
	BaseResp
	Types []InternationalTypes `json:"types"`
}

type GetJoinWhenEmptyTypesResp

type GetJoinWhenEmptyTypesResp struct {
	BaseResp
	JoinWhenEmptyTypes []JoinWhenEmptyType `json:"types"`
}

type GetLanguagesResp

type GetLanguagesResp struct {
	BaseResp
	Languages []Language `json:"languages"`
}

type GetLockInternationalResp

type GetLockInternationalResp struct {
	BaseResp
	LockInternational []LockInternational `json:"lock_international"`
}

type GetMusicOnHoldResp

type GetMusicOnHoldResp struct {
	BaseResp
	MusicOnHold []MusicOnHold `json:"music_on_hold"`
}

type GetNATResp

type GetNATResp struct {
	BaseResp
	NAT []NAT `json:"nat"`
}

type GetPackagesResp

type GetPackagesResp struct {
	BaseResp
	Packages []Package `json:"packages"`
}

type GetPhonebookResp

type GetPhonebookResp struct {
	BaseResp
	Phonebooks []Phonebook `json:"phonebooks"`
}

type GetPortabilityResp

type GetPortabilityResp struct {
	BaseResp
	Portable string `json:"portable"`
	Plans    []Plan `json:"plans"`
}

type GetProtocolResp

type GetProtocolResp struct {
	BaseResp
	Protocols []Protocol `json:"protocols"`
}

type GetProvincesResp

type GetProvincesResp struct {
	BaseResp
	Provinces []Province `json:"provinces"`
}

type GetQueuesResp

type GetQueuesResp struct {
	BaseResp
	Queues []Queue `json:"queues"`
}

type GetRateCentersResp

type GetRateCentersResp struct {
	BaseResp
	RateCenters []RateCenter `json:"ratecenters"`
}

type GetRatesResp

type GetRatesResp struct {
	BaseResp
	Rates []Rate `json:"rates"`
}

type GetRegistrationStatusResp

type GetRegistrationStatusResp struct {
	BaseResp
	Registered    string               `json:"registered"`
	Registrations []RegistrationStatus `json:"registrations"`
}

type GetReportEstimatedHoldTimeResp

type GetReportEstimatedHoldTimeResp struct {
	BaseResp
	Types []EstimatedHoldTime `json:"types"`
}

type GetResellerBalanceResp

type GetResellerBalanceResp struct {
	BaseResp
	Balance Balance `json:"balance"`
}

type GetRoutesResp

type GetRoutesResp struct {
	BaseResp
	Routes []Route `json:"routes"`
}

type GetServerInfoResp

type GetServerInfoResp struct {
	BaseResp
	Servers []Server `json:"servers"`
}

type GetStatesResp

type GetStatesResp struct {
	BaseResp
	States []State `json:"states"`
}

type GetStaticMembersResp

type GetStaticMembersResp struct {
	BaseResp
	Members []Member `json:"members"`
}

type GetSubAccountsResp

type GetSubAccountsResp struct {
	BaseResp
	Accounts []Account `json:"accounts"`
}

type GetTerminationRatesRep

type GetTerminationRatesRep struct {
	BaseResp
	Route NumberValueDescription `json:"route"`
	Rates []TerminationRate      `json:"rates"`
}

type GetTimeConditionsResp

type GetTimeConditionsResp struct {
	BaseResp
	TimeConditions []TimeCondition `json:"timeconditon"`
}

type GetTransactionHistoryResp

type GetTransactionHistoryResp struct {
	BaseResp
	Transactions []Transaction `json:"transactions"`
}

type GetVoicemailAttachmentFormats

type GetVoicemailAttachmentFormats struct {
	BaseResp
	VoicemailAttachmentFormats []VoicemailAttachmentFormat `json:"email_attachment_formats"`
}

type GetVoicemailSetups

type GetVoicemailSetups struct {
	BaseResp
	VoicemailSetups []VoicemailSetup `json:"voicemailsetups"`
}

type IVR

type IVR struct {
	IVR            string      `json:"ivr"`
	Name           string      `json:"name"`
	Recording      string      `json:"recording"`
	Timeout        string      `json:"timeout"`
	Language       string      `json:"language"`
	VoicemailSetup string      `json:"voicemailsetup"`
	Choices        []IVRChoice `json:"choices"`
}

func (*IVR) UnmarshalJSON

func (i *IVR) UnmarshalJSON(data []byte) error

type IVRChoice

type IVRChoice struct {
	DTMFTone string
	Route    BaseRoute
}

func (IVRChoice) MarshalText

func (i IVRChoice) MarshalText() ([]byte, error)

func (IVRChoice) String

func (i IVRChoice) String() string

func (*IVRChoice) UnmarshalText

func (i *IVRChoice) UnmarshalText(text []byte) error

type InternationalLocations

type InternationalLocations struct {
	LocationId   string `json:"location_id"`
	LocationName string `json:"location_name"`
	Country      string `json:"country"`
	AreaCode     string `json:"area_code"`
	Stock        string `json:"stock"`
	Monthly      string `json:"montly"`
	Setup        string `json:"setup"`
	Minute       string `json:"minute"`
	Channels     string `json:"channels,omitempty"` //only used for GetDIDsInternationalGeographic
}

type InternationalTypes

type InternationalTypes StringValueDescription

type JoinWhenEmptyType

type JoinWhenEmptyType StringValueDescription

type Language

type Language StringValueDescription

type LockInternational

type LockInternational NumberValueDescription

The Value type seems to switch between int and string for some reason, so it needs a custom struct for now. TODO:Re-evaluate

type Member

type Member struct {
	Member    string `json:"member"`
	QueueName string `json:"queue_name"`
	Name      string `json:"name"`
	Account   string `json:"account"`
	Priority  string `json:"priority"`
}

type MusicOnHold

type MusicOnHold StringValueDescription

type NAT

type NumberValueDescription

type NumberValueDescription struct {
	Value       json.Number `json:"value"`
	Description string      `json:"description"`
}

type Order

type Order struct {
	Routing             BaseRoute   `json:"routing"`
	FailoverBusy        BaseRoute   `json:"failover_busy,omitempty"`
	FailoverUnreachable BaseRoute   `json:"failover_unreachable,omitempty"`
	FailoverNoanswer    BaseRoute   `json:"failover_noanswer,omitempty"`
	Voicemail           string      `json:"voicemail,omitempty"`
	POP                 string      `json:"pop"`
	Dialtime            json.Number `json:"dialtime"`
	CNAM                json.Number `json:"cnam"` //1: true, 0: false.
	CalleridPrefix      string      `json:"callerid_prefix,omitempty"`
	Note                string      `json:"note,omitempty"`
	BillingType         json.Number `json:"billing_type"`
	Test                bool        `json:"test,omitempty"`
}

type Package

type Package struct {
	Package            string `json:"package"` //This is the package id.
	Name               string `json:"name"`
	MarkupFixed        string `json:"markup_fixed"`
	MarkupPercentage   string `json:"markup_percentage"`
	Pulse              string `json:"pulse"`
	InternationalRoute string `json:"international_route"`
	CanadaRoute        string `json:"canada_route"`
	MonthlyFee         string `json:"monthly_fee"`
	SetupFee           string `json:"setup_fee"`
	FreeMinutes        string `json:"free_minutes"`
}

type Phonebook

type Phonebook struct {
	Phonebook string `json:"phonebook"`
	SpeedDial string `json:"speed_dial"`
	Name      string `json:"name"`
	Number    string `json:"number"`
	Callerid  string `json:"callerid"`
	Note      string `json:"note"`
}

type Plan

type Plan struct {
	Title         string `json:"title"`
	PricePerMonth string `json:"pricePerMonth"` //Voip.MS API uses camelcase here instead of underscores for some reason.
	PricePerMin   string `json:"pricePerMin"`
}

type Protocol

type Protocol NumberValueDescription

type Province

type Province struct {
	Province    string `json:"province"`
	Description string `json:"description"`
}

type Queue

type Queue struct {
	Queue                                            string    `json:"queue"`
	QueueName                                        string    `json:"queue_name"`
	QueueNumber                                      string    `json:"queue_number"`
	QueueLanguage                                    string    `json:"queue_language"`
	QueuePassword                                    string    `json:"queue_password"`
	CalleridPrefix                                   string    `json:"callerid_prefix"`
	JoinAnnouncement                                 string    `json:"join_announcement"`
	PriorityWeight                                   string    `json:"priority_weight"`
	AgentAnnouncement                                string    `json:"agent_announcement"`
	ReportHoldTimeAgent                              string    `json:"report_hold_time_agent"`
	MemberDelay                                      string    `json:"member_delay"`
	MusicOnHold                                      string    `json:"music_on_hold"`
	MaximumWaitTime                                  string    `json:"maximum_wait_time"`
	MaximumCallers                                   string    `json:"maximum_callers"`
	JoinWhenEmpty                                    string    `json:"join_when_empty"`
	LeaveWhenEmpty                                   string    `json:"leave_when_empty"`
	RingStrategy                                     string    `json:"ring_strategy"`
	RingInuse                                        string    `json:"ring_inuse"`
	AgentRingTimeout                                 string    `json:"agent_ring_timeout"`
	RetryTimer                                       string    `json:"retry_timer"`
	WrapupTime                                       string    `json:"wrapup_time"`
	VoiceAnnouncement                                string    `json:"voice_announcement"`
	FrequencyAnnouncement                            string    `json:"frequency_announcement"`
	AnnouncePositionFrequency                        string    `json:"announce_position_frecuency"`
	AnnounceRoundSeconds                             string    `json:"announce_round_seconds"`
	IfAnnouncePositionEnabledReportEstimatedHoldTime string    `json:"if_announce_position_enabled_report_estimated_hold_time"`
	ThankyouForYourPatience                          string    `json:"thankyou_for_your_patience"`
	FailOverRoutingTimeout                           BaseRoute `json:"fail_over_routing_timeout"`
	FailOverRoutingFull                              BaseRoute `json:"fail_over_routing_full"`
	FailOverRoutingJoinEmpty                         BaseRoute `json:"fail_over_routing_join_empty"`
	FailOverRoutingLeaveEmpty                        BaseRoute `json:"fail_over_routing_leave_empty"`
	FailOverRoutingJoinUnavail                       BaseRoute `json:"fail_over_routing_join_unavail"`
	FailOverRoutingLeaveUnavail                      BaseRoute `json:"fail_over_routing_leave_unavail"`
}

type Rate

type Rate struct {
	Destination     string  `json:"destination"`
	Prefix          string  `json:"prefix"`
	ClientIncrement int     `json:"client_increment"`
	ClientRate      float64 `json:"client_rate"`
	RealIncrement   int     `json:"real_increment"`
	RealRate        float64 `json:"real_rate"`
}

type RateCenter

type RateCenter struct {
	RateCenter string `json:"ratecenter"`
	Available  bool   `json:"available"`
}

func (*RateCenter) UnmarshalJSON

func (c *RateCenter) UnmarshalJSON(data []byte) error

type RegistrationStatus

type RegistrationStatus struct {
	Server
	RegisterIP   string `json:"register_ip"`
	RegisterPort string `json:"register_port"`
	RegisterNext string `json:"register_next"`
}

type Route

type SearchDIDsCanResp

type SearchDIDsCanResp struct {
	BaseResp
	DIDs []DID `json:"dids"`
}

type Server

type Server struct {
	ServerName      string `json:"server_name"`
	ServerShortname string `json:"server_shortname"`
	ServerHostname  string `json:"server_hostname"`
	ServerIP        string `json:"server_ip"`
	ServerCountry   string `json:"server_country"`
	ServerPop       string `json:"server_pop"`
}

type SetClientReq

type SetClientReq Client

type SetClientThresholdReq

type SetClientThresholdReq struct {
	Client    string `json:"client"`
	Threshold string `json:"threshold"`
	Email     string `json:"email"`
}

TODO:Stan Req objects aren't needed out side of the package. Change.

type SetSubAccountResp

type SetSubAccountResp struct {
	BaseResp
}

type SignupClientReq

type SignupClientReq struct {
	Client
	ConfirmEmail    string `json:"confirm_email"`
	ConfirmPassword string `json:"confirm_password"`
	Activate        bool   `json:"activate"`
}

type State

type State struct {
	State       string `json:"state"`
	Description string `json:"description"`
}

type StatusResp

type StatusResp interface {
	GetStatus() string
}

type StringValueDescription

type StringValueDescription struct {
	Value       string `json:"value"`
	Description string `json:"description"`
}

type TerminationRate

type TerminationRate struct {
	Destination string  `json:"destination"`
	Prefix      string  `json:"prefix"`
	Increment   int     `json:"increment"`
	Rate        float64 `json:"rate"`
}

type TimeCondition

type TimeCondition struct {
	TimeCondition  string `json:"timecondition"`
	Name           string `json:"name"`
	RoutingMatch   string `json:"routingmatch"`
	RoutingNoMatch string `json:"routingnomatch"`
	StartHour      string `json:"starthour"`
	StartMinute    string `json:"startminute"`
	EndHour        string `json:"endhour"`
	EndMinute      string `json:"endminute"`
	WeekdayStart   string `json:"weekdaystart"`
	WeekdayEnd     string `json:"weekdayend"`
}

type Transaction

type Transaction struct {
	Date        string `json:"date"` //can't be time.Time as the API likes to return things like this: {"date":"2015-11-02 to 2016-11-01","uniqueid":"n\/a","type":"CNAM Queries","description":"CNAM Queries","ammount":"-0.2160"}
	UniqueId    string `json:"uniqueid"`
	Type        string `json:"type"`
	Description string `json:"description"`
	Amount      string `json:"amount"`
}

type VOIPClient

type VOIPClient struct {
	URL      string
	Username string
	Password string
	Debug    bool
}

func NewVOIPClient

func NewVOIPClient(url, username, password string, debug bool) *VOIPClient

func (*VOIPClient) Call

func (c *VOIPClient) Call(req *http.Request, respStruct interface{}) (*http.Response, error)

func (*VOIPClient) Get

func (c *VOIPClient) Get(method string, values url.Values, entity interface{}) error

func (*VOIPClient) NewAccountsAPI

func (c *VOIPClient) NewAccountsAPI() *AccountsAPI

func (*VOIPClient) NewCDRAPI

func (c *VOIPClient) NewCDRAPI() *CDRAPI

func (*VOIPClient) NewClientsAPI

func (c *VOIPClient) NewClientsAPI() *ClientsAPI

func (*VOIPClient) NewDIDsAPI

func (c *VOIPClient) NewDIDsAPI() *DIDsAPI

Only partially implemented. See dids.go.

func (*VOIPClient) NewFaxAPI

func (c *VOIPClient) NewFaxAPI() *FaxAPI

Not implemented yet.

func (*VOIPClient) NewGeneralAPI

func (c *VOIPClient) NewGeneralAPI() *GeneralAPI

func (*VOIPClient) NewVoicemailAPI

func (c *VOIPClient) NewVoicemailAPI() *VoicemailAPI

Not implemented yet.

func (*VOIPClient) Post

func (c *VOIPClient) Post(method string, entity interface{}, respStruct interface{}) error

func (*VOIPClient) WriteStruct

func (c *VOIPClient) WriteStruct(writer *multipart.Writer, iface interface{}) error

type VoicemailAPI

type VoicemailAPI struct {
	// contains filtered or unexported fields
}

Not implemented yet.

type VoicemailAttachmentFormat

type VoicemailAttachmentFormat StringValueDescription

type VoicemailSetup

type VoicemailSetup NumberValueDescription

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL