Merge branch 'mannol1-master'

This commit is contained in:
irungentoo 2014-07-04 13:28:47 -04:00
commit 705fceb2e0
No known key found for this signature in database
GPG Key ID: 10349DC9BED89E98
2 changed files with 35 additions and 2 deletions

View File

@ -795,8 +795,6 @@ int toxav_get_peer_transmission_type ( ToxAv *av, int32_t call_index, int peer )
*/
int toxav_get_peer_id ( ToxAv *av, int32_t call_index, int peer )
{
assert(av->msi_session);
if ( peer < 0 || cii(call_index, av->msi_session) || !av->msi_session->calls[call_index]
|| av->msi_session->calls[call_index]->peer_count <= peer )
return ErrorInternal;
@ -804,6 +802,23 @@ int toxav_get_peer_id ( ToxAv *av, int32_t call_index, int peer )
return av->msi_session->calls[call_index]->peers[peer];
}
/**
* @brief Get id of peer participating in conversation
*
* @param av Handler
* @param peer peer index
* @return int
* @retval ToxAvError No peer id
*/
ToxAvCallState toxav_get_call_state(ToxAv *av, int32_t call_index)
{
if ( cii(call_index, av->msi_session) || !av->msi_session->calls[call_index] )
return av_CallNonExistant;
return av->msi_session->calls[call_index]->state;
}
/**
* @brief Is certain capability supported
*

View File

@ -74,6 +74,15 @@ typedef enum {
} ToxAvCallType;
typedef enum {
av_CallNonExistant = -1,
av_CallInviting, /* when sending call invite */
av_CallStarting, /* when getting call invite */
av_CallActive,
av_CallHold,
av_CallHanged_up
} ToxAvCallState;
/**
* @brief Error indicators.
*/
@ -342,6 +351,15 @@ int toxav_get_peer_transmission_type ( ToxAv *av, int32_t call_index, int peer )
*/
int toxav_get_peer_id ( ToxAv *av, int32_t call_index, int peer );
/**
* @brief Get current call state
*
* @param av Handler
* @param call_index What call
* @return int
* @retval ToxAvCallState State id
*/
ToxAvCallState toxav_get_call_state ( ToxAv *av, int32_t call_index );
/**
* @brief Is certain capability supported
*