Documentation ¶
Index ¶
- Constants
- func HeartBeat(refresh func() (*OAuth, error))
- type Authorizer
- type Did
- type EventResp
- type Extension
- type IVR
- type OAuth
- func (oauth *OAuth) AddEvent(extensionId uint32, callbackUrl string, method string, eventType string) (*EventResp, error)
- func (oauth *OAuth) DeleteEventAll(extensionId uint32) error
- func (oauth *OAuth) DeleteEventByID(extensionId uint32, eventId uint32) error
- func (oauth *OAuth) DownloadRecord(recordUUID string, path string) (string, error)
- func (oauth *OAuth) ExtensionList(ClientId uint32, setExtensionNumber ...bool) ([]Extension, error)
- func (oauth *OAuth) GetDidById(didId uint64) (*Did, error)
- func (oauth *OAuth) GetDidList() ([]Did, error)
- func (oauth *OAuth) GetEventByID(extensionId uint32, eventId uint32) (*EventResp, error)
- func (oauth *OAuth) GetEventList(extensionId uint32) ([]EventResp, error)
- func (oauth *OAuth) GetIVR(extensionId uint32) (*IVR, error)
- func (oauth *OAuth) GetQueue(extensionId uint32) (*Queue, error)
- func (oauth *OAuth) GetRecordList(extensionId uint32, startDate time.Time, endDate time.Time, order string) ([]RecordList, error)
- func (oauth *OAuth) GetRecordStorageUrl(recordUUID string) string
- func (oauth *OAuth) UpdateDidById(didId uint64, ExtensionId uint32) (*Did, error)
- func (oauth *OAuth) UpdateEventByID(extensionId uint32, callbackUrl string, method string, eventType string, ...) (*EventResp, error)
- func (oauth *OAuth) UpdateIVR(extensionId uint32, object ...interface{}) (*IVR, error)
- func (oauth *OAuth) UpdateQueue(extensionId uint32, object ...interface{}) (*IVR, error)
- type PasswordAuth
- type Queue
- type RecordList
- type Storage
- type Trusted
- type User
Constants ¶
View Source
const ( API_URL = "https://apiproxy.telphin.ru" API_VERSION = "/api/ver1.0" DATE_FORMAT = "2006-01-02 15:04:05" EXPIRES_OFFSET = 400 API = API_URL + API_VERSION )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Authorizer ¶
type Extension ¶
type Extension struct { Status string `json:"status"` Domain string `json:"domain"` CreateDate string `json:"create_date"` Name string `json:"name"` RFCid bool `json:"rfc_public_caller_id_number"` ExtensionGroupId uint32 `json:"extension_group_id"` PublicCallerId uint32 `json:"public_caller_id_number"` Label string `json:"label"` CallerId uint32 `json:"caller_id_name"` ClientId uint32 `json:"client_id"` FromCallerId bool `json:"from_public_caller_id_number"` ExtraParams string `json:"extra_params"` DialRuleLimit string `json:"dial_rule_limit"` DialRuleId string `json:"dial_rule_id"` AniRFC3325 bool `json:"ani_rfc3325"` Type string `json:"type"` ID uint32 `json:"id"` DidAsTransCallerId uint32 `json:"did_as_transfer_caller_id"` ExtensionNumber string }
type IVR ¶
type IVR struct { LifetimeExpAction string `json:"lifetime_exp_action"` EntryContext uint64 `json:"entry_context"` LifetimeExpTransferDst string `json:"lifetime_exp_transfer_dst"` VmEnabled bool `json:"vm_enabled"` VmGreeting uint64 `json:"vm_greeting"` Lifetime uint64 `json:"lifetime"` VmAttachFile bool `json:"vm_attach_file"` SleepTime uint64 `json:"sleep_time"` VmMailto string `json:"vm_mailto"` }
type OAuth ¶
type OAuth struct { AccessToken string `json:"access_token"` TokenType string `json:"token_type"` ExpiresIn uint32 `json:"expires_in"` Scope string `json:"scope"` User *User }
func NewAPI ¶
func NewAPI(a Authorizer) (*OAuth, error)
func (*OAuth) DeleteEventAll ¶
func (*OAuth) DeleteEventByID ¶
func (*OAuth) DownloadRecord ¶
func (*OAuth) ExtensionList ¶
func (*OAuth) GetDidList ¶
func (*OAuth) GetEventByID ¶
func (*OAuth) GetEventList ¶
func (*OAuth) GetRecordList ¶
func (*OAuth) GetRecordStorageUrl ¶
func (*OAuth) UpdateDidById ¶
func (*OAuth) UpdateEventByID ¶
type PasswordAuth ¶
type PasswordAuth struct { GrantType string `json:"grant_type"` ClientID string `json:"client_id"` ClientSecret string `json:"client_secret"` Username string `json:"username"` Password string `json:"password"` }
func (*PasswordAuth) Authorization ¶
func (p *PasswordAuth) Authorization() (*OAuth, error)
type Queue ¶
type Queue struct { Sound uint64 `json:"sound"` TierRulesApply bool `json:"tier_rules_apply"` ExitKey string `json:"exit_key"` TimeoutTransferDst string `json:"timeout_transfer_dst"` MaxWaitTime uint64 `json:"max_wait_time"` RecordEnabled bool `json:"record_enabled"` MaxWaitTimeWithNoAgent uint64 `json:"max_wait_time_with_no_agent"` Strategy string `json:"strategy"` TierRuleWaitMultiplyLevel bool `json:"tier_rule_wait_multiply_level"` ExtensionID uint64 `json:"extension_id"` AnnounceFrequency uint64 `json:"announce_frequency"` ExitTransferDst string `json:"exit_transfer_dst"` SoundType string `json:"sound_type"` TierRuleWaitSecond uint64 `json:"tier_rule_wait_second"` AnnounceSound uint64 `json:"announce_sound"` StartSound uint64 `json:"start_sound"` }
type RecordList ¶
type RecordList struct { ToUsername string `json:"to_username"` SourceNumber string `json:"source_number"` Result string `json:"result"` Duration uint32 `json:"duration"` ToDomain string `json:"to_domain"` DidNumber string `json:"did_number"` HangupTimeGMT string `json:"hangup_time_gmt"` RecordFileSize uint64 `json:"record_file_size"` FromUsername string `json:"from_username"` Application string `json:"application"` StartTimeGMT string `json:"start_time_gmt"` ExtNumberReg string `json:"ext_number_reg"` HangupCause string `json:"hangup_cause"` ExtensionGroupOwnerID uint64 `json:"extension_group_owner_id"` InitTimeGMT string `json:"init_time_gmt"` DestDomain string `json:"dest_domain"` RecordUUID string `json:"record_uuid"` FromDomain string `json:"from_domain"` SourceDomain string `json:"source_domain"` ExtensionType string `json:"extension_type"` DidDomain string `json:"did_domain"` FromScreenName string `json:"from_screen_name"` ExtensionName string `json:"extension_name"` Flow string `json:"flow"` DestNumber string `json:"dest_number"` ExtensionId uint32 `json:"extension_id"` CallUUID string `json:"call_uuid"` ClientOwnerID uint64 `json:"client_owner_id"` }
type Trusted ¶
type Trusted struct { GrantType string `json:"grant_type"` ClientID string `json:"client_id"` ClientSecret string `json:"client_secret"` }
func (*Trusted) Authorization ¶
type User ¶
type User struct { DealerID string `json:"dealer_id"` IsAdmin bool `json:"admin"` Access string `json:"access"` ExtensionId uint32 `json:"extension_id"` ClientId uint32 `json:"client_id"` ExtensionGroupID uint32 `json:"extension_group_id"` Timezone string `json:"timezone"` Login string `json:"login"` Id uint32 `json:"id"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.