C-toxcore: How detect that friend is busy

Created on 25 Jun 2018  路  8Comments  路  Source: TokTok/c-toxcore

When developing my client, I ran into a problem for which I can not find a solution. So I ask the developers for help.
I develop a tox-client for a landline phone. When I make a call to a friend (call function toxav_call()), I need to know that my friend's lines are free. If at the time of my call - a friend is already talking to someone or he just lifted the handset, I somehow should know about it, in order that played a busy-signal and finish the call.
How can I understand that my friend's line is busy?

suggestion

Most helpful comment

This is a privacy concern. Right now, you can't tell whether your friend is having a call at the moment. That is a good thing. The client can auto-reject calls. It might make sense to send a reject reason (e.g. "busy") somehow. You can implement that as custom packet for now.

All 8 comments

I think there's no API for that, since Tox can handle multiple calls at once. You would have to implement this mechanism in your client at the moment.

Maybe it makes sense to integrate such an API in the core?

This is a privacy concern. Right now, you can't tell whether your friend is having a call at the moment. That is a good thing. The client can auto-reject calls. It might make sense to send a reject reason (e.g. "busy") somehow. You can implement that as custom packet for now.

I think it could be interesting to have at least an API for a reject "reason" e.g. "busy". The rest can be handled by the client.

This is a privacy concern.

I agree, it can be a vulnerability. However, I develop my client for ordinary people, so I do not give privacy the absolute priority. Therefore would be great to have an opportunity to receive reject-code. API-function is a great variant. For tox-clients who are very take care of security can always return zero.

You can implement that as custom packet for now.

@iphydf, do I understand correctly: You suggest that I implement an alternative call termination function using the function tox_friend_send_lossless_packet ()

As a solution variant: may be to add the new status to enum TOX_USER_STATUS?

/**
     * User is busy. Signals to other clients that this client does not
     * currently wish to communicate.
     */
TOX_USER_STATUS_BUSY

Hmm, I think this could be already interpreted as the thing you want to implement? Just let your client play a "busy" tone when trying to call a friend who is busy? And auto-drop calls when your own status is busy?

Yes, I saw this flag (TOX_USER_STATUS_BUSY), but I have some doubts: at the moment this flag carries an information function (as far as I understand it). A friend as if says that he is very busy and asks him not to disturb. But nevertheless, if there is an urgent need, I can still write to friend or call him. If I interpret the TOX_USER_STATUS_BUSY flag as a busy-state, it can happen that I can not reach my friend for a very long time. For example, the qtox friend set the TOX_USER_STATUS_BUSES flag, and then forgot to remove it.
So I thought that do not need to assign a second meaning to TOX_USER_STATUS_BUSES flag. And for state "busy because of call", enter a separate line item.

I made a mechanism of notifying about the reason for ending the call through the function tox_friend_send_lossless_packet (). This works quite well. The main thing that the interval between end of a call and the notice wouldn't be very long. But this will be visible only in the process of using.

Was this page helpful?
0 / 5 - 0 ratings