使用 Java 的 Twilio 发起和终止 SIP URI [英] Twilio origination and termination SIP URI's with Java

查看:58
本文介绍了使用 Java 的 Twilio 发起和终止 SIP URI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

What I'm actually looking for are the termination and origination SIP URI's for a given trunk.

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

The closest I found so far was:

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?

How do I get a credentialSid, and, what is a credentialSid?

SID 是安全标识符吗?

SID is Security IDentifier?

另见:Twilio:无法为 SIP 终止重命名子域 null

推荐答案

您可以了解关于 通过 API 的 SIP 凭据.

还有一个在 Java 中得到一个的例子:

And an example to get one in 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 的 Twilio 发起和终止 SIP URI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆