Ringout Flow notifications (WEBHOOKs) and Second leg start connected without connecting the first leg.

  • 1
  • Question
  • Updated 2 weeks ago
1. When we call RingOut API, it gets connected to second leg directly even when the 'PlayPrompt' is set to true and the first legged number is logged in through softPhone.

Here is how we are calling the API
$cparams["url"] = "https://platform.devtest.ringcentral.com/restapi/v1.0/account/~/extension/~/ring-out";
$cparams["header"] =array('Content-Type: application/json',"Authorization: Bearer ". $token_response['access_token']);
$cparams["params"]= array('from'=>array("phoneNumber"=>"5856009977"),'to'=>array("phoneNumber"=>"5855327141"));
$response = $this->curl_req($cparams);

This is how we are creating subscriptions (for WebHook's)
  $cparams["header"] =array('Content-Type: application/json',"Authorization: Bearer ". $token_response['access_token']);
  $cparams["params"]= array(
           'eventFilters'=>array("/restapi/v1.0/account/~/extension/~/presence?detailedTelephonyState=true&sipData=true","/restapi/v1.0/account/~/extension/~/presence/line/presence?detailedTelephonyState=true"),
           "deliveryMode" =>array(
              "transportType"=> "WebHook",
              "address"=> "https://xxxxxxxxxx.ceipal.com/RingCentral/getcalldetails")
           );
 $cparams["url"] = "https://platform.devtest.ringcentral.com/restapi/v1.0/subscription";
 $response = $this->curl_req($cparams);


And the subscription is getting failed for some reason. (can you please let us know the cause of this error. We are getting the same error since last 48hrs.)
(
    [errorCode] => SUB-505
    [message] => Subscriptions limit exceeded
    [errors] => Array
        (
            [0] => Array
                (
                    [errorCode] => SUB-505
                    [message] => Subscriptions limit exceeded
                )
        )
)


2. We would like to keep the track of Calls, SMS in our database; when the user sends sms or make a call from our application. 

While ringing we are getting the presence as below:
{
  "uuid": "4369787660677498215",
  "event": "/restapi/v1.0/account/231607004/extension/231607004/presence",
  "timestamp": "2018-06-05T14:16:42.724Z",
  "subscriptionId": "8780795d-6e90-4df4-ab64-5342feb1ae39",
  "ownerId": "231607004",
  "body": {
    "extensionId": 231607004,
    "telephonyStatus": "Ringing",
    "presenceStatus": "Available",
    "userStatus": "Available",
    "dndStatus": "TakeAllCalls",
    "message": "Custom Status",
    "allowSeeMyPresence": true,
    "ringOnMonitoredCall": false,
    "pickUpCallsOnHold": true
  }
}
Once call connected, below is the presence:
{
  "uuid": "5107542592166768788",
  "event": "/restapi/v1.0/account/231607004/extension/231607004/presence?detailedTelephonyState=true",
  "timestamp": "2018-06-04T13:01:40.174Z",
  "subscriptionId": "ec05ff64-9647-44a0-8bbf-ea09eed380f3",
  "ownerId": "231607004",
  "body": {
    "extensionId": 231607004,
    "telephonyStatus": "CallConnected",
    "activeCalls": [
      {
        "id": "68087d60833d47f098205a8d139d1137",
        "direction": "Outbound",
        "fromName": "Tony Abott",
        "from": "+15876009977",
        "to": "+15855327141",
        "telephonyStatus": "CallConnected",
        "sessionId": "19012301004",
        "startTime": "2018-06-04T13:00:55.296Z"
      }
    ],
    "sequence": 7511,
    "presenceStatus": "Busy",
    "userStatus": "Available",
    "dndStatus": "TakeAllCalls",
    "message": "Custom Status",
    "allowSeeMyPresence": true,
    "ringOnMonitoredCall": false,
    "pickUpCallsOnHold": true,
    "totalActiveCalls": 1
  }
}
  we don't find any common reference/unique_id in the above presence to keep track, please suggest us if there are any custom params that we can maintain.
Photo of Tony Abott

Tony Abott

  • 102 Points 100 badge 2x thumb

Posted 2 weeks ago

  • 1
Photo of Igor Bebin

Igor Bebin, Official Rep

  • 550 Points 500 badge 2x thumb
Hi Tony,

We have a subscription count limit. Now it's 20 active subscriptions per application and User. Please remove unused subscriptions, e.g. retrieve the list of subscriptions for current User and delete redundant. 

Regarding tracking question - Presence notifications will notify you about User's calls, each call has unique session id, so you can track it by sessionId, provided in activeCalls section. 

Please advise if you have any questions.

Thanks,