|
|
|
@@ -61,6 +61,9 @@ func NewSIPService(
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *SIPService) CreateSIPTrunk(ctx context.Context, req *livekit.CreateSIPTrunkRequest) (*livekit.SIPTrunkInfo, error) {
|
|
|
|
|
if err := EnsureSIPAdminPermission(ctx); err != nil {
|
|
|
|
|
return nil, twirpAuthError(err)
|
|
|
|
|
}
|
|
|
|
|
if s.store == nil {
|
|
|
|
|
return nil, ErrSIPNotConnected
|
|
|
|
|
}
|
|
|
|
@@ -101,6 +104,9 @@ func (s *SIPService) CreateSIPTrunk(ctx context.Context, req *livekit.CreateSIPT
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *SIPService) CreateSIPInboundTrunk(ctx context.Context, req *livekit.CreateSIPInboundTrunkRequest) (*livekit.SIPInboundTrunkInfo, error) {
|
|
|
|
|
if err := EnsureSIPAdminPermission(ctx); err != nil {
|
|
|
|
|
return nil, twirpAuthError(err)
|
|
|
|
|
}
|
|
|
|
|
if s.store == nil {
|
|
|
|
|
return nil, ErrSIPNotConnected
|
|
|
|
|
}
|
|
|
|
@@ -132,6 +138,9 @@ func (s *SIPService) CreateSIPInboundTrunk(ctx context.Context, req *livekit.Cre
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *SIPService) CreateSIPOutboundTrunk(ctx context.Context, req *livekit.CreateSIPOutboundTrunkRequest) (*livekit.SIPOutboundTrunkInfo, error) {
|
|
|
|
|
if err := EnsureSIPAdminPermission(ctx); err != nil {
|
|
|
|
|
return nil, twirpAuthError(err)
|
|
|
|
|
}
|
|
|
|
|
if s.store == nil {
|
|
|
|
|
return nil, ErrSIPNotConnected
|
|
|
|
|
}
|
|
|
|
@@ -151,6 +160,9 @@ func (s *SIPService) CreateSIPOutboundTrunk(ctx context.Context, req *livekit.Cr
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *SIPService) ListSIPTrunk(ctx context.Context, req *livekit.ListSIPTrunkRequest) (*livekit.ListSIPTrunkResponse, error) {
|
|
|
|
|
if err := EnsureSIPAdminPermission(ctx); err != nil {
|
|
|
|
|
return nil, twirpAuthError(err)
|
|
|
|
|
}
|
|
|
|
|
if s.store == nil {
|
|
|
|
|
return nil, ErrSIPNotConnected
|
|
|
|
|
}
|
|
|
|
@@ -164,6 +176,9 @@ func (s *SIPService) ListSIPTrunk(ctx context.Context, req *livekit.ListSIPTrunk
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *SIPService) ListSIPInboundTrunk(ctx context.Context, req *livekit.ListSIPInboundTrunkRequest) (*livekit.ListSIPInboundTrunkResponse, error) {
|
|
|
|
|
if err := EnsureSIPAdminPermission(ctx); err != nil {
|
|
|
|
|
return nil, twirpAuthError(err)
|
|
|
|
|
}
|
|
|
|
|
if s.store == nil {
|
|
|
|
|
return nil, ErrSIPNotConnected
|
|
|
|
|
}
|
|
|
|
@@ -177,6 +192,9 @@ func (s *SIPService) ListSIPInboundTrunk(ctx context.Context, req *livekit.ListS
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *SIPService) ListSIPOutboundTrunk(ctx context.Context, req *livekit.ListSIPOutboundTrunkRequest) (*livekit.ListSIPOutboundTrunkResponse, error) {
|
|
|
|
|
if err := EnsureSIPAdminPermission(ctx); err != nil {
|
|
|
|
|
return nil, twirpAuthError(err)
|
|
|
|
|
}
|
|
|
|
|
if s.store == nil {
|
|
|
|
|
return nil, ErrSIPNotConnected
|
|
|
|
|
}
|
|
|
|
@@ -190,6 +208,9 @@ func (s *SIPService) ListSIPOutboundTrunk(ctx context.Context, req *livekit.List
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *SIPService) DeleteSIPTrunk(ctx context.Context, req *livekit.DeleteSIPTrunkRequest) (*livekit.SIPTrunkInfo, error) {
|
|
|
|
|
if err := EnsureSIPAdminPermission(ctx); err != nil {
|
|
|
|
|
return nil, twirpAuthError(err)
|
|
|
|
|
}
|
|
|
|
|
if s.store == nil {
|
|
|
|
|
return nil, ErrSIPNotConnected
|
|
|
|
|
}
|
|
|
|
@@ -207,6 +228,9 @@ func (s *SIPService) DeleteSIPTrunk(ctx context.Context, req *livekit.DeleteSIPT
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *SIPService) CreateSIPDispatchRule(ctx context.Context, req *livekit.CreateSIPDispatchRuleRequest) (*livekit.SIPDispatchRuleInfo, error) {
|
|
|
|
|
if err := EnsureSIPAdminPermission(ctx); err != nil {
|
|
|
|
|
return nil, twirpAuthError(err)
|
|
|
|
|
}
|
|
|
|
|
if s.store == nil {
|
|
|
|
|
return nil, ErrSIPNotConnected
|
|
|
|
|
}
|
|
|
|
@@ -239,6 +263,9 @@ func (s *SIPService) CreateSIPDispatchRule(ctx context.Context, req *livekit.Cre
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *SIPService) ListSIPDispatchRule(ctx context.Context, req *livekit.ListSIPDispatchRuleRequest) (*livekit.ListSIPDispatchRuleResponse, error) {
|
|
|
|
|
if err := EnsureSIPAdminPermission(ctx); err != nil {
|
|
|
|
|
return nil, twirpAuthError(err)
|
|
|
|
|
}
|
|
|
|
|
if s.store == nil {
|
|
|
|
|
return nil, ErrSIPNotConnected
|
|
|
|
|
}
|
|
|
|
@@ -252,6 +279,9 @@ func (s *SIPService) ListSIPDispatchRule(ctx context.Context, req *livekit.ListS
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *SIPService) DeleteSIPDispatchRule(ctx context.Context, req *livekit.DeleteSIPDispatchRuleRequest) (*livekit.SIPDispatchRuleInfo, error) {
|
|
|
|
|
if err := EnsureSIPAdminPermission(ctx); err != nil {
|
|
|
|
|
return nil, twirpAuthError(err)
|
|
|
|
|
}
|
|
|
|
|
if s.store == nil {
|
|
|
|
|
return nil, ErrSIPNotConnected
|
|
|
|
|
}
|
|
|
|
@@ -269,6 +299,9 @@ func (s *SIPService) DeleteSIPDispatchRule(ctx context.Context, req *livekit.Del
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *SIPService) CreateSIPParticipantWithToken(ctx context.Context, req *livekit.CreateSIPParticipantRequest, wsUrl, token string) (*livekit.SIPParticipantInfo, error) {
|
|
|
|
|
if err := EnsureSIPCallPermission(ctx); err != nil {
|
|
|
|
|
return nil, twirpAuthError(err)
|
|
|
|
|
}
|
|
|
|
|
if s.store == nil {
|
|
|
|
|
return nil, ErrSIPNotConnected
|
|
|
|
|
}
|
|
|
|
|