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 e98c9c4b..82385b95 100644
--- a/toxav/toxav.c
+++ b/toxav/toxav.c
@@ -795,8 +795,6 @@ int toxav_get_peer_transmission_type ( ToxAv *av, int32_t call_index, int peer )
795 */ 795 */
796int toxav_get_peer_id ( ToxAv *av, int32_t call_index, int peer ) 796int toxav_get_peer_id ( ToxAv *av, int32_t call_index, int peer )
797{ 797{
798 assert(av->msi_session);
799
800 if ( peer < 0 || cii(call_index, av->msi_session) || !av->msi_session->calls[call_index] 798 if ( peer < 0 || cii(call_index, av->msi_session) || !av->msi_session->calls[call_index]
801 || av->msi_session->calls[call_index]->peer_count <= peer ) 799 || av->msi_session->calls[call_index]->peer_count <= peer )
802 return ErrorInternal; 800 return ErrorInternal;
@@ -805,6 +803,23 @@ int toxav_get_peer_id ( ToxAv *av, int32_t call_index, int peer )
805} 803}
806 804
807/** 805/**
806 * @brief Get id of peer participating in conversation
807 *
808 * @param av Handler
809 * @param peer peer index
810 * @return int
811 * @retval ToxAvError No peer id
812 */
813ToxAvCallState toxav_get_call_state(ToxAv *av, int32_t call_index)
814{
815 if ( cii(call_index, av->msi_session) || !av->msi_session->calls[call_index] )
816 return av_CallNonExistant;
817
818 return av->msi_session->calls[call_index]->state;
819
820}
821
822/**
808 * @brief Is certain capability supported 823 * @brief Is certain capability supported
809 * 824 *
810 * @param av Handler 825 * @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