summaryrefslogtreecommitdiff
path: root/toxav
diff options
context:
space:
mode:
Diffstat (limited to 'toxav')
-rw-r--r--toxav/toxav.c19
-rw-r--r--toxav/toxav.h18
2 files changed, 35 insertions, 2 deletions
diff --git a/toxav/toxav.c b/toxav/toxav.c
index 743d7fcf..108c36eb 100644
--- a/toxav/toxav.c
+++ b/toxav/toxav.c
@@ -797,8 +797,6 @@ int toxav_get_peer_transmission_type ( ToxAv *av, int32_t call_index, int peer )
797 */ 797 */
798int toxav_get_peer_id ( ToxAv *av, int32_t call_index, int peer ) 798int toxav_get_peer_id ( ToxAv *av, int32_t call_index, int peer )
799{ 799{
800 assert(av->msi_session);
801
802 if ( peer < 0 || cii(call_index, av->msi_session) || !av->msi_session->calls[call_index] 800 if ( peer < 0 || cii(call_index, av->msi_session) || !av->msi_session->calls[call_index]
803 || av->msi_session->calls[call_index]->peer_count <= peer ) 801 || av->msi_session->calls[call_index]->peer_count <= peer )
804 return ErrorInternal; 802 return ErrorInternal;
@@ -807,6 +805,23 @@ int toxav_get_peer_id ( ToxAv *av, int32_t call_index, int peer )
807} 805}
808 806
809/** 807/**
808 * @brief Get id of peer participating in conversation
809 *
810 * @param av Handler
811 * @param peer peer index
812 * @return int
813 * @retval ToxAvError No peer id
814 */
815ToxAvCallState toxav_get_call_state(ToxAv* av, int32_t call_index)
816{
817 if ( cii(call_index, av->msi_session) || !av->msi_session->calls[call_index] )
818 return av_CallNonExistant;
819
820 return av->msi_session->calls[call_index]->state;
821
822}
823
824/**
810 * @brief Is certain capability supported 825 * @brief Is certain capability supported
811 * 826 *
812 * @param av Handler 827 * @param av Handler
diff --git a/toxav/toxav.h b/toxav/toxav.h
index a548ee90..2e71c4da 100644
--- a/toxav/toxav.h
+++ b/toxav/toxav.h
@@ -74,6 +74,15 @@ typedef enum {
74} ToxAvCallType; 74} ToxAvCallType;
75 75
76 76
77typedef enum {
78 av_CallNonExistant = -1,
79 av_CallInviting, /* when sending call invite */
80 av_CallStarting, /* when getting call invite */
81 av_CallActive,
82 av_CallHold,
83 av_CallHanged_up
84} ToxAvCallState;
85
77/** 86/**
78 * @brief Error indicators. 87 * @brief Error indicators.
79 */ 88 */
@@ -343,6 +352,15 @@ int toxav_get_peer_transmission_type ( ToxAv *av, int32_t call_index, int peer )
343int toxav_get_peer_id ( ToxAv *av, int32_t call_index, int peer ); 352int toxav_get_peer_id ( ToxAv *av, int32_t call_index, int peer );
344 353
345/** 354/**
355 * @brief Get current call state
356 *
357 * @param av Handler
358 * @param call_index What call
359 * @return int
360 * @retval ToxAvCallState State id
361 */
362ToxAvCallState toxav_get_call_state ( ToxAv *av, int32_t call_index );
363/**
346 * @brief Is certain capability supported 364 * @brief Is certain capability supported
347 * 365 *
348 * @param av Handler 366 * @param av Handler