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

Method channelCreate

server/channel.go:36–58  ·  view source on GitHub ↗
(ctx context.Context, reply string, req *proxy.Request)

Source from the content-addressed store, hash-verified

34}
35
36func (s *Server) channelCreate(ctx context.Context, reply string, req *proxy.Request) {
37 create := req.ChannelCreate.ChannelCreateRequest
38
39 if create.ChannelID == "" {
40 create.ChannelID = rid.New(rid.Channel)
41 }
42
43 // bind dialog
44 if req.Key.Dialog != "" {
45 s.Dialog.Bind(req.Key.Dialog, "channel", create.ChannelID)
46 s.Dialog.Bind(req.Key.Dialog, "channel", create.OtherChannelID)
47 }
48
49 h, err := s.ari.Channel().Create(req.Key, create)
50 if err != nil {
51 s.sendError(reply, err)
52 return
53 }
54
55 s.publish(reply, &proxy.Response{
56 Key: h.Key(),
57 })
58}
59
60func (s *Server) channelData(ctx context.Context, reply string, req *proxy.Request) {
61 d, err := s.ari.Channel().Data(req.Key)

Callers

nothing calls this directly

Calls 6

sendErrorMethod · 0.95
publishMethod · 0.95
NewMethod · 0.80
ChannelMethod · 0.80
BindMethod · 0.65
CreateMethod · 0.45

Tested by

no test coverage detected