I am trying to call a number using "/restapi/v1.0/account/~/extension/~/ring-out" in php
I have the body set up like this
$body = array(
'from' => array(
'phoneNumber' => $fromNumber
),
'to' => array(
'phoneNumber' => $toNumber
),
'callerId' => array(
'phoneNumber' => $CallerIDPhoneNumber
),
'playPrompt' => false
);
If I make the call and have the $fromNumber and the $CallerIDPhoneNumber number as the same number it works fine but I want the $CallerIDPhoneNumber to always be the main office number regardless of where I am calling from. If I change the $CallerIDPhoneNumber to any other number than the $fromNumber number it does not work. any Ideas what I am doing wrong?
This works,
$fromNumber ="140xxx01";
$CallerIDPhoneNumber ="140xxx01";
the following occurs
1) call is place 2) the php page loads 3) caller Id on recieving call shows the following number: 140xxx01
and this also works
$fromNumber ="140xxx02";
$CallerIDPhoneNumber ="140xxx02";
1) call is place 2) the php page loads 3) caller Id on recieving call shows the following number: 140xxx02
but this does not
$fromNumber ="140xxx01";
$CallerIDPhoneNumber ="140xxx02";
no call is placed and an error occurs resulting in the php page crashing/not loading:
That is weird and I would say that it's not because of PHP code nor the ring-out API. If this happens on your production account, submit a dev support case so someone can have a look at your account. If this is your sandbox account, provide me with the account main company number.
There is nothing wrong with your code. You said it does not work if you change the caller id number. What happens when it does not work? An error? The caller (from number) does not see the correct caller id, or what?
You can make sure the caller id you are using is valid by calling this endpoint and check if the number has the CallerId feature before using it as a callerId.
$response = $platform->get('/account/~/extension/~/phone-number'); foreach ($response->json()->records as $record){ print_r ("This phone number ".$record->phoneNumber." has the following features: "."\n"); foreach ($record->features as $feature) print_r (" => ".$feature."\n"); }
A new Community is coming to RingCentral!
Posts are currently read-only as we transition into our new platform.We thank you for your patience
during this downtime.
Try Workflow Builder
Did you know you can easily automate tasks like responding to SMS, team messages, and more? Plus it's included with RingCentral Video and RingEX plans!Try RingCentral Workflow Builder