0

我实际上正在寻找的是给定中继的终止和发起 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-

我如何获得 a credentialSid,以及,什么是 a credentialSid

SID是安全标识符?

另请参阅: Twilio:无法为 SIP 终止重命名子域 null

4

1 回答 1

1

您可以通过 API 了解SIP 凭证

还有一个用 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()); 
  }
}

希望这可以帮助!

于 2016-07-28T22:30:06.093 回答