question

Scott Haley avatar image
Scott Haley asked vyshakhbabji answered

Ringout CallerId not working in Java SDK

When I try to set the outbound callerId property in the RequestBody and submit the request, nothing happens. The call does not even initiate the first leg of the call. If I remove it, everything works fine. Here is how I am calling it using the Java SDK.


MakeRingOutCallerIdInfo ringOutCallId = new MakeRingOutCallerIdInfo();

ringOutCallId.phoneNumber = callerId;

// Set call body

GetRingOutStatusResponse response = null;

// setup the parameters for the API call

MakeRingOutRequest requestBody = new MakeRingOutRequest();

requestBody.from(new MakeRingOutCallerInfoRequestFrom().phoneNumber(from = from.substring(0,2).contains("+1") ? from : "+1"+from));

requestBody.to(new MakeRingOutCallerInfoRequestTo().phoneNumber(to = to.substring(0,2).contains("+1") ? to : "+1"+to));

requestBody.callerId(new MakeRingOutCallerIdInfo().phoneNumber(callerId = callerId.substring(0,2).contains("+1") ? callerId : "+1"+callerId));

requestBody.playPrompt = false;

// Make the call to Ring Central

response = restClient.restapi().account().extension().ringout().post(requestBody);

ringout
1 |1500 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Phong Vu avatar image
Phong Vu answered

Where did you get the callerId from? Is that one of the callerIds belong to the authenticated user extension?

1 |1500 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Scott Haley avatar image
Scott Haley answered Phong Vu commented

I got it from the local site's number

1 comment
1 |1500 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Check the API response, it could be something like this if the callerId does not belong to the user

{
  "errorCode" : "RNG-102",
  "message" : "Caller ID should be one of company direct numbers",
  "errors" : [ {
    "errorCode" : "RNG-102",
    "message" : "Caller ID should be one of company direct numbers"
  } ]
}

You then need to read the user phone numbers and detect the number feature to see if it is callerId

screen-shot-2021-10-19-at-92027-am.png

0 Likes 0 ·
Scott Haley avatar image
Scott Haley answered Phong Vu commented

I am getting the following error:

{

"errorCode" : "TEL-107",

"message" : "Caller ID: [+1xxxxxxxxxx] is not allowed",

"errors" : [ {

"errorCode" : "TEL-107",

"message" : "Caller ID: [+1xxxxxxxxxx ] is not allowed",

"parameterValue" : "+1xxxxxxxxxx "

} ],

"parameterValue" : "+1xxxxxxxxxx "

}

1 comment
1 |1500 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Did you check if the feature of that phone number?

0 Likes 0 ·
vyshakhbabji avatar image
vyshakhbabji answered

You can check what callerIDs are allowed to be used for your logged in extension by using this api:
GEThttps://platform.devtest.ringcentral.com/restapi/v1.0/account/accountId/extension/extensionId/caller-id


You can choose one of the numbers from the response list as your callerID for ring-out api.

https://developers.ringcentral.com/api-reference/User-Settings/readExtensionCallerId



1 |1500 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys