Import path: github.com/telequick/telequick-sdk/go/pkg. The package name is telequick.

Constructors and fields

type Client struct {{
    OnAudioFrame func(payload []byte)
    OnCallEvent  func(payload []byte)
    // … (unexported fields)
}}

func NewClient(endpoint string, credPath string) (*Client, error)
ArgumentNotes
endpointquic://host:port. ALPN h3.
credPathPath to your service-account JSON. Empty ⇒ reads TELEQUICK_CREDENTIALS.
NewClient returns an unconnected client. The first RPC opens the QUIC session lazily.

RPC methods

All RPC methods return error. Internal serialization, FFI calls, and QUIC writes happen synchronously.

(c *Client) Dial(...) error

func (c *Client) Dial(
    to, trunkId, callFrom string,
    maxDurationMs int,
    defaultApp int,
    defaultAppArgs string,
    aiWs string,
    aiQuic string,
    autoBargeIn bool,
    bargeInPatienceMs int,
    clientIdOverride string,
) error
clientIdOverride == "" uses the SDK-generated UUID (which is what events are subscribed under).

(c *Client) OriginateBulk(...) error

func (c *Client) OriginateBulk(
    csvUrl, trunkId, campaignId string,
    cps int,
    defaultApp int,
    defaultAppArgs, aiWs, aiQuic string,
    autoBargeIn bool,
    bargeInPatienceMs int,
) error
cps sets both calls_per_second and max_concurrent_calls to the same value.

Single-arg methods

func (c *Client) Terminate(callSid string)        error
func (c *Client) Barge(callSid string)            error
func (c *Client) AbortBulk(campaignId string)     error
func (c *Client) StreamEvents(clientId string)    error
func (c *Client) GetIncomingCalls(trunkId string) error
func (c *Client) GetBucketCalls(bucketId string)  error
func (c *Client) GetActiveBuckets()               error

Multi-arg methods

func (c *Client) SetInboundRouting(
    trunkId string, rule int,
    audioUrl, webhookUrl, aiWs, aiQuic string,
) error

func (c *Client) AnswerIncomingCall(
    callSid, aiWs, aiQuic string,
) error

func (c *Client) ExecuteBucketAction(
    bucketId string, action int,
) error

func (c *Client) ExecuteDialplan(
    callSid string, action int, appArgs string,
) error

Mid-call control verbs

The clutch CLI exposes transfer, mute, unmute, hold, unhold, send-dtmf — each calls ExecuteDialplan with a DialplanAction value (7-12). The Go SDK ships these as one direct method (ExecuteDialplan); call it with the right action integer:
const (
    ActionTRANSFER  = 7
    ActionMUTE      = 8
    ActionUNMUTE    = 9
    ActionHOLD      = 10
    ActionUNHOLD    = 11
    ActionSEND_DTMF = 12
)

c.ExecuteDialplan(callSid, ActionTRANSFER, "+15551234567")
c.ExecuteDialplan(callSid, ActionMUTE,     "")           // gateway-side TX silence
c.ExecuteDialplan(callSid, ActionMUTE,     "wire")       // also recvonly re-INVITE
c.ExecuteDialplan(callSid, ActionHOLD,     "")
c.ExecuteDialplan(callSid, ActionSEND_DTMF, "5:rfc2833:200")
Full enum: DialplanAction values.

Audio

func (c *Client) PushAudio(
    callSid string,
    payload []byte,
    codec string,
    sequenceNumber uint64,
    endOfStream bool,
) error

func (c *Client) SerializeAudioFrame(
    callSid string,
    payload []byte,
    codec string,
    sequenceNumber uint64,
    endOfStream bool,
) []byte

func (c *Client) DeserializeAudioFrame(payload []byte) (callSid string, pcm []byte)
func (c *Client) DeserializeCallEvent(payload []byte) (callSid string, status string)
SerializeAudioFrame returns a fully-framed wire packet ready to write to your own QUIC stream.

Method ID constants

import telequick "github.com/telequick/telequick-sdk/go/pkg"

telequick.MethodID_ORIGINATE
telequick.MethodID_AUDIO_FRAME
telequick.MethodID_STREAM_EVENTS
// …
See Method IDs.

Concurrency

Client is not safe for concurrent RPC method calls — guard it with a mutex if multiple goroutines need to issue RPCs. Audio pushes are routed to a single internal uni-stream, so serializing PushAudio calls per call_sid is required to keep sequence_number monotonic on the wire. OnAudioFrame and OnCallEvent are invoked from a goroutine the SDK spawns; treat them as if they ran on a hot path (don’t block, don’t allocate unnecessarily).