golang调用aliyun的语音通话

golang调用阿里云的语音通话
官方目前只给出python和java的示例,而没有go的示例,这段代码是经过测试无误的。

client4, err := dyvmsapi.NewClientWithAccessKey("cn-hangzhou", "xxxxxxxx", "xxxxxxxxxxx")
		if err != nil {
     
			panic(err.Error())
		}
		request := dyvmsapi.CreateSingleCallByTtsRequest()
		request.AcceptFormat = "json"
		request.CalledShowNumber = "01086394658"
		request.CalledNumber = "134xxxxxxxx"
		request.TtsCode = "TTS_174276778"
		request.TtsParam = "{\"location\":\"xxxx\"}"
		response := dyvmsapi.CreateAddRtcAccountResponse()
		err2 := client4.DoAction(request,response)
		if err2 != nil{
     
			panic(err2.Error())
		}
		fmt.Println(response)

你可能感兴趣的:(开始,golang,阿里云)