question

Angelo Bevilacqua avatar image
Angelo Bevilacqua asked ·

Inbound faxes - partial receive / receive error

I am using the MessageStore api to detect/retrieve inbound faxes.

I noticed that sometimes the fax attachment is not complete and when I look in the call log I see entries with Partial Receive and/or Receive Error as a result.

I don't see anything in the message store which corresponds to the result in call log.

What can I do to make sure that the inbound fax retrieved from the MessageStore did not have an error?

I saw a post regarding something similar which mentioned to use the Call Log api but how can I find the corresponding entry in the call log based on what is returned from the MessageStore?


fax api
1 |1000 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 ·

The 2 endpoints, call-log and message-store have different purposes.

1. The call-log is for getting activities and status of voice and messaging including fax of extensions. It does not matter if a voice call or a fax was sent or received successfully, it always logs whatever happens to an extension.

2. The message-store is for getting SMS, voicemail, fax messages' metadata and the message itself. For inbound messages, the system saves the metadata and the message to the message store only after a message is received successfully. For outbound messages, the system saves the message metadata and the final status regardless of if the message was sent successfully or not. Message status can be one of these Queued, Sent, Delivered, DeliveryFailed, SendingFailed, Received.

I believe that the message Id of a message is identical between the call log and the message store content.

1 comment
1 |1000 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.

The id does not seem to be the same between the call log and message store.

This is kind of a showstopper for us - we need to be sure that the inbound fax is not partial as the inbound fax (in our use case) represents a signature from a physician.

Is there anything that can be done ?


0 Likes 0 ·
Phong Vu avatar image
Phong Vu answered ·

Call log response:

{"uri":".../call-log/...?view=Simple","id":"CpSiFh7qkee_DUA","sessionId":"12791151","startTime":"2019-12-09T19:20:36.456Z","duration":50,"type":"Fax","direction":"Inbound","action":"Incoming Fax","result":"Received","to":{"phoneNumber":"+1650513XXXX","extensionId":"1426275520"},"from":{"name":"CHICAGO      IL","phoneNumber":"+1312982XXXX","location":"Chicago, IL"},"message":{"uri":"https://platform.ringcentral.com/restapi/v1.0/account/~/extension/~/message-store/1099870668021","id":"1099870668021","type":"Fax"},...


Message store response:

{"uri":".../message-store?direction=Inbound&messageType=Fax&availability=Alive&dateFrom=2019-12-08T23:03:00.000Z&page=1&perPage=100","records":[{"uri":"https://platform.ringcentral.com/restapi/v1.0/account/~/extension/~/message-store/1099870668021","id":1099870668021, ...

You can see the ids are the same.

7 comments
1 |1000 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.

Hmm that's strange -I re-check and get back to you if needed.

0 Likes 0 ·

Yes, the message ids are the same. I am using the message id from the message store to find the matching call log entry and it works perfectly except for one case :

When receiving faxes to the main fax number - I don't get any results when using the user call log api (when using other extension fax numbers, which are Direct numbers, it works).

I tried using the company call log api and I do see entries for inbound faxes to the main fax number but in that api the result does not include the "message": {…} section so I am not able to match using the id from the message store.

How can I get this to work when using the main fax number ?

0 Likes 0 ·

The "message" is considered a private property of a user, and in this case, an inbound fax to the main company number is a private message of the extension associated with that number (normally the 101). To access those fax messages, don't use the company call log level (which just gives you access to metadata of an entire company), but you can call the call log at an extension level and that extension is e.g. the 101.

0 Likes 0 ·

I was only trying the company call log api to see if I could get the info I need.

The real issue is that when I use the user call log api for the main fax number extension - I don't see any inbound entries - I only see outbound entries. Do you know why this is happening?


0 Likes 0 ·
Show more comments
Show more comments
Angelo Bevilacqua avatar image
Angelo Bevilacqua answered ·

@Phong Vu can you please help me with issue ?

Thanks

8 comments
1 |1000 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.

I don't see any params so most probably you call the call-log API with the default dateFrom and dateTo and those expected inbound messages are older than 24 hours. (default time is 24 hours back from the current time).

Add this to your code and try again. Omit the dateTo will read till the current date and time.

var parameters = new ReadUserCallLogParameters();
parameters.dateFrom = "2019-12-01T00:00:00.000Z";
var callLogList = await rc.Restapi().Account().Extension().CallLog().List(parameters);
0 Likes 0 ·

I tried that to be sure - but still not seeing any inbound entries - only outbound entries.

In the call log in the portal I only see outbound entries as well.

This only happens with the main number/extension - the other numbers everything is ok.

0 Likes 0 ·

I am 100% sure there is some mistake from your code or the result you got. Can you call the call log and print out the result to show me what works and what does not work.

0 Likes 0 ·
Show more comments
Phong Vu avatar image
Phong Vu answered ·

Sorry for the mistake. Yes, "Detailed"

That's weird. If you can, install the RingCentral JS SDK and run this Node JS code. It works reliably for me.

var SDK = require('ringcentral')

RINGCENTRAL_CLIENTID = ''
RINGCENTRAL_CLIENTSECRET = ''
RINGCENTRAL_SERVER = 'https://platform.devtest.ringcentral.com

var rcsdk = new SDK({
      server: RINGCENTRAL_SERVER,
      appKey: RINGCENTRAL_CLIENTID,
      appSecret: RINGCENTRAL_CLIENTSECRET
  });
var platform = rcsdk.platform();
platform.login({
      username: "USERNAME",
      password: "PASSWORD",
      extension: "101"
      })
      .then(function(resp) {
        platform.get('/account/~/call-log', {
            dateFrom: "2019-12-18T03:00:00.000Z
            direction: ['Inbound'],
            view: "Detailed"
        })
        .then(function (resp)
          for (var record of resp.json().records){
            console.log(JSON.stringify(record)
          }
        });
      });
10 comments
1 |1000 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.

Hmm - I have no experience with Node JS.

But even when I use the "Try it Out" feature on the API documentation site - I get the same results so I don't see how this would be SDK related.



0 Likes 0 ·

It's ok, don't bother to try the Node JS code. I tested with the .Net SDK and found some issues with the response.

Thanks for your patience! I will check with the SDK team and get it fixed soon.

0 Likes 0 ·

Ok. Thank-you. Please let me know when I can try again.

0 Likes 0 ·
Show more comments

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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