MCPcopy Create free account
hub / github.com/CyCoreSystems/ari-proxy / appStart

Function appStart

_examples/play/main.go:42–61  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

40}
41
42func appStart(ctx context.Context) func(*ari.ChannelHandle, *ari.StasisStart) {
43 return func(h *ari.ChannelHandle, startEvent *ari.StasisStart) {
44 defer h.Hangup()
45
46 log.Info("running app", "channel", h.Key().ID)
47
48 if err := h.Answer(); err != nil {
49 log.Error("failed to answer call", "error", err)
50 // return
51 }
52
53 if err := play.Play(ctx, h, play.URI("sound:tt-monkeys")).Err(); err != nil {
54 log.Error("failed to play sound", "error", err)
55 return
56 }
57
58 log.Info("completed playback")
59 return
60 }
61}

Callers 1

mainFunction · 0.70

Calls 6

HangupMethod · 0.80
InfoMethod · 0.80
AnswerMethod · 0.80
ErrMethod · 0.80
ErrorMethod · 0.45
PlayMethod · 0.45

Tested by

no test coverage detected