如何使用Linphone获取当前呼叫状态

时间:2018-03-28 05:50:04

标签: ios swift linphone

我正在使用Linphone调用app。我想从下面的代码中获取当前的调用状态。我尝试了很多,但没有找到任何解决方案。请告诉我如何从全局callstatechanged关闭获取当前调用状态?

<div id="chart_div" style="overflow:auto;overflow-x:scroll;overflow-y:scroll; "></div>
    <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>

如何从此代码访问当前呼叫状态?

1 个答案:

答案 0 :(得分:0)

这可能会帮助您获得当前通话

func answerCall () {
    if let call = linphone_core_get_current_call(theLinphone.lc) {
        linphone_core_accept_call(theLinphone.lc, call)
       // HERE HOW YOU GET CALL STATE
        let call_state =  linphone_call_get_state(call) 
        // call State may  return
        /* 
typedef enum _LinphoneCallState{
    LinphoneCallIdle,                   /**<Initial call state */
    LinphoneCallIncomingReceived, /**<This is a new incoming call */
    LinphoneCallOutgoingInit, /**<An outgoing call is started */
    LinphoneCallOutgoingProgress, /**<An outgoing call is in progress */
    LinphoneCallOutgoingRinging, /**<An outgoing call is ringing at remote end */
    LinphoneCallOutgoingEarlyMedia, /**<An outgoing call is proposed early media */
    LinphoneCallConnected, /**<Connected, the call is answered */
    LinphoneCallStreamsRunning, /**<The media streams are established and running*/
    LinphoneCallPausing, /**<The call is pausing at the initiative of local end */
    LinphoneCallPaused, /**< The call is paused, remote end has accepted the pause */
    LinphoneCallResuming, /**<The call is being resumed by local end*/
    LinphoneCallRefered, /**<The call is being transfered to another party, resulting in a new outgoing call to follow immediately*/
    LinphoneCallError, /**<The call encountered an error*/
    LinphoneCallEnd, /**<The call ended normally*/
    LinphoneCallPausedByRemote, /**<The call is paused by remote end*/
    LinphoneCallUpdatedByRemote, /**<The call's parameters change is requested by remote end, used for example when video is added by remote */
    LinphoneCallIncomingEarlyMedia, /**<We are proposing early media to an incoming call */
    LinphoneCallUpdating, /**<A call update has been initiated by us */
    LinphoneCallReleased, /**< The call object is no more retained by the core */
    LinphoneCallEarlyUpdatedByRemote, /*<The call is updated by remote while not yet answered (early dialog SIP UPDATE received).*/
    LinphoneCallEarlyUpdating /*<We are updating the call while not yet answered (early dialog SIP UPDATE sent)*/
} LinphoneCallState;
         */

    }

}