question

tony-abott8364 avatar image
tony-abott8364 asked igor-bebin answered

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

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.

webhooksringout
1 |3000

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

1 Answer

igor-bebin avatar image
igor-bebin answered
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,
1 |3000

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