BelledonneCommunications / linphone-iphone

Linphone is a free VoIP and video softphone based on the SIP protocol. Mirror of linphone-iphone (git://git.linphone.org/linphone-iphone.git)
http://linphone.org
GNU General Public License v3.0
588 stars 354 forks source link

Linphone Call State changed #563

Closed ibrahimdn closed 1 week ago

ibrahimdn commented 5 years ago

`let callStateChanged: LinphoneCoreCallStateChangedCb = { (lc: Optional, call: Optional, callSate: LinphoneCallState, message: Optional<UnsafePointer>) in

switch callSate{
case LinphoneCallStateIncomingReceived: /**<This is a new incoming call */
    NSLog("callStateChanged: LinphoneCallIncomingReceived")

    if answerCall{
        ms_usleep(3 * 1000 * 1000); // Wait 3 seconds to pickup
        linphone_core_accept_call(lc, call)

    }

case LinphoneCallStateStreamsRunning: /**<The media streams are established and running*/
    NSLog("callStateChanged: LinphoneCallStreamsRunning")

case LinphoneCallStateError: /**<The call encountered an error*/
    NSLog("callStateChanged: LinphoneCallError")

default:
    NSLog("Default call state")
}

}`

Ihi, I want to show you whether the user is talking on the phone.

hamzaozturk commented 4 years ago

You can check the current call. Just write the code below where you want to show whether the user is talking on the phone or not.

if let currentCall = linphone_core_get_current_call(lc) {
      // There is an ongoing call so you can access it.
} else {
     // There is no call
}