bdsaas

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2024 License: MIT Imports: 9 Imported by: 0

README

bdsaas

client := bdsaas.NewClient("XXXXXXXXXX")

ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()

seats, err := client.GetSeats(ctx)

sessionId, err := client.Call(ctx, "13812345678", "13912345678", "127.0.0.1", "TEST")

records, err := client.Query(ctx, sessionId)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CallRecord

type CallRecord struct {
	CallerNum      string `json:"callerNum"`
	RecordFileID   string `json:"recordFileId"`
	DisconnectTime int64  `json:"disconnectTime"`
	TimeConsume    int    `json:"timeConsume"`
	SessionID      string `json:"sessionId"`
	CallType       string `json:"callType"`
	RealName       string `json:"realName"`
	CompanyID      int    `json:"companyId"`
	ProfileID      int    `json:"profileId"`
	ConnectTime    int64  `json:"connectTime"`
	CreatedTime    int64  `json:"createdTime"`
	CalleeNum      string `json:"calleeNum"`
	Status         string `json:"status"`
	Ext1           string `json:"ext1"`
}

CallRecord represents a call record.

type Client

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

Client is a client for the bdsaas API.

func NewClient

func NewClient(appKey string) *Client

NewClient creates a new client with the given app key.

func (Client) Call

func (c Client) Call(ctx context.Context, from, to string, options ...string) (sessionId string, err error)

Call initiates a call from seat phone number to client phone number, with optional client IP address and notes, returns the session ID of the call.

func (Client) DownloadRecording added in v0.0.2

func (c Client) DownloadRecording(ctx context.Context, sessionId string) (recording []byte, err error)

DownloadRecording downloads the recording of a call by session ID.

func (Client) GetSeats

func (c Client) GetSeats(ctx context.Context) (seats []string, err error)

GetSeats returns a list of phone numbers.

func (Client) Query

func (c Client) Query(ctx context.Context, sessionIds ...string) (callRecords []CallRecord, err error)

Query returns call records by session IDs.

Jump to

Keyboard shortcuts

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