gpt4 book ai didi

java - 使用 Java 的 Twilio 发起和终止 SIP URI

转载 作者:行者123 更新时间:2023-12-01 09:39:16 25 4
gpt4 key购买 nike

我实际上正在寻找的是给定中继的终止和发起 SIP URI。

到目前为止我发现的最接近的是:

getCredential

public Credential getCredential(String credentialSid)

Gets the credentials from the credential list

Returns:
the credentials

https://twilio.github.io/twilio-java/com/twilio/sdk/resource/instance/sip/CredentialListInstance.html#getCredential-java.lang.String-

如何获取 credentialSid,以及什么是 credentialSid

SID 是安全标识符吗?

另请参阅:Twilio: cannot rename subdomain null for SIP termination

最佳答案

您可以了解SIP Credentials via the API

还有一个用 Java 获取的示例:

// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.sip.Credential;

public class Example {

// Find your Account Sid and Token at twilio.com/user/account
public static final String ACCOUNT_SID = "None";
public static final String AUTH_TOKEN = "your_auth_token";

public static void main(String[] args) throws TwilioRestException {
TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);

// Get an object from its sid. If you do not have a sid,
// check out the list resource examples on this page
Credential credential = client.getAccount().getCredentialList("CL32a3c49700934481addd5ce1659f04d2").getCredential("SC32a3c49700934481addd5ce1659f04d2");
System.out.println(credential.getUsername());
}
}

希望这有帮助!

关于java - 使用 Java 的 Twilio 发起和终止 SIP URI,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38590611/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com