twilioclient

package
Version: v0.0.0-...-88c9da9 Latest Latest
Warning

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

Go to latest
Published: May 20, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Example
package main

import (
	"fmt"
	"log"
	"time"

	"github.com/kevinburke/twilio-go/twilioclient"
)

func main() {
	cap := twilioclient.NewCapability("AC123", "123")
	cap.AllowClientIncoming("client-name")
	tok, err := cap.GenerateToken(time.Hour)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(tok)
}
Output:

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Capability

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

func NewCapability

func NewCapability(sid, token string) *Capability

func (*Capability) AllowClientIncoming

func (c *Capability) AllowClientIncoming(clientName string)

AllowClientIncoming registers this client to accept incoming calls by the given `clientName`. If your app TwiML <Dial>s `clientName`, this client will receive the call.

func (*Capability) AllowClientOutgoing

func (c *Capability) AllowClientOutgoing(appSid string, appParams map[string]string)

AllowClientOutgoing allows this client to call your application with id `appSid` (See https://www.twilio.com/user/account/apps). When the call connects, Twilio will call your voiceUrl REST endpoint. The `appParams` argument will get passed through to your voiceUrl REST endpoint as GET or POST parameters.

func (*Capability) AllowEventStream

func (c *Capability) AllowEventStream(filters map[string]string)

func (*Capability) GenerateToken

func (c *Capability) GenerateToken(ttl time.Duration) (string, error)

Generate the twilio capability token. Deliver this token to your JS/iOS/Android Twilio client.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL