Files
protocol/rpc/sip.psrpc.go
Denys Smirnov 44e9dc34b4 Allow sending DTMF when creating SIP participant (#658)
* Allow sending DTMF when creating SIP participant.

* generated protobuf

* Add changeset.

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-03-14 22:39:25 +02:00

151 lines
5.8 KiB
Go

// Code generated by protoc-gen-psrpc v0.5.1, DO NOT EDIT.
// source: rpc/sip.proto
package rpc
import (
"context"
"github.com/livekit/psrpc"
"github.com/livekit/psrpc/pkg/client"
"github.com/livekit/psrpc/pkg/info"
"github.com/livekit/psrpc/pkg/rand"
"github.com/livekit/psrpc/pkg/server"
"github.com/livekit/psrpc/version"
)
var _ = version.PsrpcVersion_0_5
// ============================
// SIPInternal Client Interface
// ============================
type SIPInternalClient interface {
CreateSIPParticipant(ctx context.Context, topic string, req *InternalCreateSIPParticipantRequest, opts ...psrpc.RequestOption) (*InternalCreateSIPParticipantResponse, error)
}
// ================================
// SIPInternal ServerImpl Interface
// ================================
type SIPInternalServerImpl interface {
CreateSIPParticipant(context.Context, *InternalCreateSIPParticipantRequest) (*InternalCreateSIPParticipantResponse, error)
CreateSIPParticipantAffinity(context.Context, *InternalCreateSIPParticipantRequest) float32
}
// ============================
// SIPInternal Server Interface
// ============================
type SIPInternalServer interface {
RegisterCreateSIPParticipantTopic(topic string) error
DeregisterCreateSIPParticipantTopic(topic string)
// Close and wait for pending RPCs to complete
Shutdown()
// Close immediately, without waiting for pending RPCs
Kill()
}
// ==================
// SIPInternal Client
// ==================
type sIPInternalClient struct {
client *client.RPCClient
}
// NewSIPInternalClient creates a psrpc client that implements the SIPInternalClient interface.
func NewSIPInternalClient(bus psrpc.MessageBus, opts ...psrpc.ClientOption) (SIPInternalClient, error) {
sd := &info.ServiceDefinition{
Name: "SIPInternal",
ID: rand.NewClientID(),
}
sd.RegisterMethod("CreateSIPParticipant", true, false, true, false)
rpcClient, err := client.NewRPCClient(sd, bus, opts...)
if err != nil {
return nil, err
}
return &sIPInternalClient{
client: rpcClient,
}, nil
}
func (c *sIPInternalClient) CreateSIPParticipant(ctx context.Context, topic string, req *InternalCreateSIPParticipantRequest, opts ...psrpc.RequestOption) (*InternalCreateSIPParticipantResponse, error) {
return client.RequestSingle[*InternalCreateSIPParticipantResponse](ctx, c.client, "CreateSIPParticipant", []string{topic}, req, opts...)
}
// ==================
// SIPInternal Server
// ==================
type sIPInternalServer struct {
svc SIPInternalServerImpl
rpc *server.RPCServer
}
// NewSIPInternalServer builds a RPCServer that will route requests
// to the corresponding method in the provided svc implementation.
func NewSIPInternalServer(svc SIPInternalServerImpl, bus psrpc.MessageBus, opts ...psrpc.ServerOption) (SIPInternalServer, error) {
sd := &info.ServiceDefinition{
Name: "SIPInternal",
ID: rand.NewServerID(),
}
s := server.NewRPCServer(sd, bus, opts...)
sd.RegisterMethod("CreateSIPParticipant", true, false, true, false)
return &sIPInternalServer{
svc: svc,
rpc: s,
}, nil
}
func (s *sIPInternalServer) RegisterCreateSIPParticipantTopic(topic string) error {
return server.RegisterHandler(s.rpc, "CreateSIPParticipant", []string{topic}, s.svc.CreateSIPParticipant, s.svc.CreateSIPParticipantAffinity)
}
func (s *sIPInternalServer) DeregisterCreateSIPParticipantTopic(topic string) {
s.rpc.DeregisterHandler("CreateSIPParticipant", []string{topic})
}
func (s *sIPInternalServer) Shutdown() {
s.rpc.Close(false)
}
func (s *sIPInternalServer) Kill() {
s.rpc.Close(true)
}
var psrpcFileDescriptor8 = []byte{
// 374 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0x4f, 0x6f, 0xda, 0x30,
0x18, 0xc6, 0x65, 0xfe, 0x04, 0x78, 0x11, 0xd3, 0xe4, 0xb1, 0xcd, 0x62, 0x97, 0x89, 0x6d, 0x12,
0x9b, 0xa6, 0xa4, 0x7f, 0xbe, 0x40, 0xd5, 0x9e, 0x72, 0xa9, 0x10, 0xb4, 0x97, 0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