livekit / server-sdk-go

Client and server SDK for Golang
Apache License 2.0
214 stars 96 forks source link

CreateSIPtrunk undefined #546

Closed AmbaCaramba closed 1 month ago

AmbaCaramba commented 1 month ago

After creating simple example for SERVER API list rooms, after go run im getting

github.com\livekit\server-sdk-go\v2@v2.2.1\sipclient.go:56:21: s.sipClient.CreateSIPTrunk undefined (type livekit.SIP has no field or method CreateSIPTrunk)

Isnt it related to recent PR - https://github.com/livekit/server-sdk-go/pull/543 ?

package main

import (
    "log"
    "os"

    "github.com/joho/godotenv"
        livekit "github.com/livekit/protocol/livekit"
    lksdk "github.com/livekit/server-sdk-go/v2"
)

func main() {

    if err := godotenv.Load("development.env"); err != nil {
        log.Fatalf("Error loading .env file")
    }
    apiKey := os.Getenv("LIVEKIT_API_KEY")
    apiSecret := os.Getenv("LIVEKIT_API_SECRET")

    host := ""
    roomClient := lksdk.NewRoomServiceClient(host, apiKey, apiSecret)
    rooms, _ := roomClient.ListRooms(context.Background(), &livekit.ListRoomsRequest{})
    log.Println(rooms)

}
davidzhao commented 1 month ago

looks like it's related.. but I'm unable to reproduce it. It's unclear how the removal of that function is impacting this, especially since that version has not been released yet.

davidzhao commented 1 month ago

ok, it's an compatibility issue between the last server-sdk-go release. Give v2.3.0 a try, it should resolve this issue

AmbaCaramba commented 1 month ago

ok, it's an compatibility issue between the last server-sdk-go release. Give v2.3.0 a try, it should resolve this issue

it worked, thx