Controlling the number of fax retries using API

  • 1
  • Question
  • Updated 2 years ago

Is it possible to control the number of retries when faxing using API?

Is it possible to control the amount of time between retries?

We are posting the jobs using: /restapi/v1.0/account/~/extension/~/message-store/

Photo of ONE

ONE

  • 100 Points 100 badge 2x thumb

Posted 2 years ago

  • 1
Photo of Anton Nikitin

Anton Nikitin, Official Rep

  • 2,934 Points 2k badge 2x thumb
Unfortunately not. This logic is the same for all accounts and cannot be configured by any means.
Photo of John Wang

John Wang, Official Rep

  • 5,664 Points 5k badge 2x thumb
If you are interested in increasing the number of retries, you can use our API to resend faxes. The same API call can also forward faxes.

You can see more information in our documentation here:

http://ringcentral-api-docs.readthedocs.io/en/latest/messages_faxes/#forwarding-and-resending-faxes
(Edited)
Photo of ONE

ONE

  • 100 Points 100 badge 2x thumb
It makes sense to resend a fax when the fax status of the previous attempt is Busy, but right now we have a terrible hard time trying to find from you how to obtain the extended fax status from the Call Log based on the Message ID. When using the Message ID (/restapi/v1.0/account/{accountId}/extension/{extensionId}/message-store/{messageId}), all we get is "SendingFailed" and this is all. Only the Call Log contains the details like "Busy", but it seems there is no link between a specific Message ID and its corresponding Call Log. Please advice.
Photo of Benjamin Dean

Benjamin Dean, Alum

  • 8,642 Points 5k badge 2x thumb
The call log response body contains a few properties which are helpful in this situation:
- id: The ID of the call log entry for the outbound fax (you can filter the call-log on dateFrom=creationTime, direction=Outbound, and type=Fax)
- messageStatus: One of: 'Queued'. 'Sent', 'SendingFailed', 'Received'
- lastModifiedTime: When the messageStatus was last changed
- creationTime: When the fax was created

When you say "Extended Fax Status", which properties are you seeking specifically?

What use case are you trying to solve please?
Photo of ONE

ONE

  • 100 Points 100 badge 2x thumb

We are facing the following problem: we are sending more faxes to the same fax number in a short amount of time (it could be 4 - 6 fax jobs in 30 sec - 1 min). RingCentral starts sending the first fax to that number which usually takes somewhere between 2 and 4 minutes to be received at its destination. But while the designee is receiving this fax, RingCentral is trying to send to the same number the rest of faxes from queue and, as expected, the line is busy receiving the first fax.

Because RingCentral is not performing its own queue management when dealing with the same number and because it is not allowing us to change the number of retries (as Anton mentioned) we want to try performing the queue management on our side. In order to do this, we should put on hold the rest of the fax jobs that will be sent to the same number until the first fax is successfully sent. But we also need to take into account the fact that also the first fax could fail for a lot of reasons like: line is busy for other reasons, line is not available, the number is wrong and so on. Because we didn't find how to obtain from the call log the detailed statuses (like Busy, No Answer, Wrong Number etc.) for a specific Message ID, we get only MessageStatus: 'Sending Failed' and faxErrorCode: 'Undefined' while the CallLog contains 'No Answer' or 'Busy'. And 'Sending Failed' + 'Undefined' is not helping us so our question is: how to obtain those 'No Answer' or 'Busy' from the CallLog based on a MessageID if the MessageStatus and faxErrorCode do not provide them?

Let's focus on the 'Busy' case as long as this is our main problem. How can we obtain this status?


(Edited)
Photo of Benjamin Dean

Benjamin Dean, Alum

  • 8,642 Points 5k badge 2x thumb
Since the flow is controlled from your application code, I would recommend queuing the faxes to the same number until such time as you receive a "Sent" (sending success) message from an initial attempt to a number.
Photo of ONE

ONE

  • 100 Points 100 badge 2x thumb

What kind of solution is this? ... So, do you propose to try sending to a number until we get "Sent"? Really? ...

- What if the number is wrong? Should I keep trying to send it?

- What if the other machine is not answering (which in most of the cases is because that number is not handled by a fax machine)? Should I keep trying to send it?

- What if the number is outside of US which are not allowed for some accounts? Should I keep trying to send it?

HOW can I control the queue on my side if I get only  'Undefined' for all the situations explained above? Are you really don't understand that I need those extended statuses like 'No Answer', 'No fax machine', 'Wrong Number', 'Busy' etc. in order to control properly the queue on our side (as long as RingCentral is not able to do such a thing) ? ...

Here is an example, maybe this way I can make myself clear:

I made a simulation sending to a number which is not a fax number and I got this (I anonymized some info with [...] ):

{
  "uri" : "https://platform.ringcentral.com/restapi/v1.0/account/2624607008/extension/2624607008/message-store/...;,
  "id" : 700550190009,
  "to" : [ {
    "phoneNumber" : "+1[...]",
    "location" : "[...]",
    "messageStatus" : "SendingFailed",
    "faxErrorCode" : "Undefined"
  } ],
  "type" : "Fax",
  "creationTime" : "2016-12-21T21:22:38.000Z",
  "readStatus" : "Read",
  "priority" : "Normal",
  "attachments" : [ {
    "id" : 700550190009,
    "uri" : "
https://media.ringcentral.com/restapi/v1.0/account/2624607008/extension/2624607008/message-store/700...;,
    "type" : "RenderedDocument",
    "contentType" : "application/pdf"
  } ],
  "direction" : "Outbound",
  "availability" : "Alive",
  "messageStatus" : "SendingFailed",
  "faxResolution" : "High",
  "faxPageCount" : 2,
  "lastModifiedTime" : "2016-12-21T21:37:29.158Z",
  "coverIndex" : 7
}

As you can see, all we get is:

    "messageStatus" : "SendingFailed",
    "faxErrorCode" : "Undefined"

while the CallLog contains "No Answer". Why I cannot obtain that "No Answer" based on the message ID 700550190009 ?  This faxErrorCode is useless because we get "Undefined" all the time.


(Edited)
Photo of Benjamin Dean

Benjamin Dean, Alum

  • 8,642 Points 5k badge 2x thumb
Have you attempted to look in the Call Log for the respective record of type 'fax'? When an outbound fax request is sent, you can then view the extension's activeCalls which is sending the fax. This can be done for one or more extensions and returns activeCalls data https://developers.ringcentral.com/api-docs/latest/index.html#!#RefGetExtensionActiveCalls. You could filter the activeCalls records where action==='Outgoing Fax'.

The associated result property for the activeCall should provide you with much greater detailed information about what actually happened during fax transmission:
'Unknown' | 'ResultInProgress' | 'Call accepted' | 'Rejected' | 'Received' | 'Receive Error' | 'Fax on Demand' | 'Partial Receive' | 'Blocked' | 'Call connected' | 'No Answer' | 'International Disabled' | 'Busy' | 'Send Error' | 'Sent' | 'No fax machine' | 'Restricted Number' | 'Wrong Number' | 'Stopped' | 'Hang up' | 'Poor Line Quality' | 'Partially Sent' | 'International Restriction' | 'Abandoned' | 'Declined' | 'Fax Receipt Error' | 'Fax Send Error'