import typing

import android.app
import android.content
import android.os
import java
import java.io
import java.lang

class SipAudioCall(java.lang.Object):
    def __init__(self, context: android.content.Context, localProfile: SipProfile, /) -> None: ...
    def answerCall(self, timeout: int | java.jint | java.lang.Integer, /) -> None: ...
    def attachCall(self, session: SipSession, sessionDescription: str | java.lang.String, /) -> None: ...
    def close(self) -> None: ...
    def continueCall(self, timeout: int | java.jint | java.lang.Integer, /) -> None: ...
    def endCall(self) -> None: ...
    def getLocalProfile(self) -> SipProfile: ...
    def getPeerProfile(self) -> SipProfile: ...
    def getState(self) -> int: ...
    def holdCall(self, timeout: int | java.jint | java.lang.Integer, /) -> None: ...
    def isInCall(self) -> bool: ...
    def isMuted(self) -> bool: ...
    def isOnHold(self) -> bool: ...
    def makeCall(self, peerProfile: SipProfile, sipSession: SipSession, timeout: int | java.jint | java.lang.Integer, /) -> None: ...
    @typing.overload
    def sendDtmf(self, code: int | java.jint | java.lang.Integer, /) -> None: ...
    @typing.overload
    def sendDtmf(self, code: int | java.jint | java.lang.Integer, result: android.os.Message, /) -> None: ...
    @typing.overload
    def setListener(self, listener: SipAudioCall.Listener, /) -> None: ...
    @typing.overload
    def setListener(self, listener: SipAudioCall.Listener, callbackImmediately: bool | java.jboolean | java.lang.Boolean, /) -> None: ...
    def setSpeakerMode(self, speakerMode: bool | java.jboolean | java.lang.Boolean, /) -> None: ...
    def startAudio(self) -> None: ...
    def toggleMute(self) -> None: ...

    class Listener(java.lang.Object):
        def __init__(self) -> None: ...
        def onCallBusy(self, call: SipAudioCall, /) -> None: ...
        def onCallEnded(self, call: SipAudioCall, /) -> None: ...
        def onCallEstablished(self, call: SipAudioCall, /) -> None: ...
        def onCallHeld(self, call: SipAudioCall, /) -> None: ...
        def onCalling(self, call: SipAudioCall, /) -> None: ...
        def onChanged(self, call: SipAudioCall, /) -> None: ...
        def onError(self, call: SipAudioCall, errorCode: int | java.jint | java.lang.Integer, errorMessage: str | java.lang.String, /) -> None: ...
        def onReadyToCall(self, call: SipAudioCall, /) -> None: ...
        def onRinging(self, call: SipAudioCall, caller: SipProfile, /) -> None: ...
        def onRingingBack(self, call: SipAudioCall, /) -> None: ...

class SipErrorCode(java.lang.Object):
    CLIENT_ERROR: typing.ClassVar[int] = ...
    CROSS_DOMAIN_AUTHENTICATION: typing.ClassVar[int] = ...
    DATA_CONNECTION_LOST: typing.ClassVar[int] = ...
    INVALID_CREDENTIALS: typing.ClassVar[int] = ...
    INVALID_REMOTE_URI: typing.ClassVar[int] = ...
    IN_PROGRESS: typing.ClassVar[int] = ...
    NO_ERROR: typing.ClassVar[int] = ...
    PEER_NOT_REACHABLE: typing.ClassVar[int] = ...
    SERVER_ERROR: typing.ClassVar[int] = ...
    SERVER_UNREACHABLE: typing.ClassVar[int] = ...
    SOCKET_ERROR: typing.ClassVar[int] = ...
    TIME_OUT: typing.ClassVar[int] = ...
    TRANSACTION_TERMINTED: typing.ClassVar[int] = ...
    @staticmethod
    def toString(errorCode: int | java.jint | java.lang.Integer, /) -> str: ...

class SipException(java.lang.Exception):
    @typing.overload
    def __init__(self) -> None: ...
    @typing.overload
    def __init__(self, message: str | java.lang.String, /) -> None: ...
    @typing.overload
    def __init__(self, message: str | java.lang.String, cause: java.lang.Throwable, /) -> None: ...

class SipManager(java.lang.Object):
    EXTRA_CALL_ID: typing.ClassVar[str] = ...
    EXTRA_OFFER_SD: typing.ClassVar[str] = ...
    INCOMING_CALL_RESULT_CODE: typing.ClassVar[int] = ...
    def close(self, localProfileUri: str | java.lang.String, /) -> None: ...
    def createSipSession(self, localProfile: SipProfile, listener: SipSession.Listener, /) -> SipSession: ...
    @staticmethod
    def getCallId(incomingCallIntent: android.content.Intent, /) -> str | None: ...
    @staticmethod
    def getOfferSessionDescription(incomingCallIntent: android.content.Intent, /) -> str | None: ...
    def getSessionFor(self, incomingCallIntent: android.content.Intent, /) -> SipSession: ...
    @staticmethod
    def isApiSupported(context: android.content.Context, /) -> bool: ...
    @staticmethod
    def isIncomingCallIntent(intent: android.content.Intent, /) -> bool: ...
    def isOpened(self, localProfileUri: str | java.lang.String, /) -> bool: ...
    def isRegistered(self, localProfileUri: str | java.lang.String, /) -> bool: ...
    @staticmethod
    def isSipWifiOnly(context: android.content.Context, /) -> bool: ...
    @staticmethod
    def isVoipSupported(context: android.content.Context, /) -> bool: ...
    @typing.overload
    def makeAudioCall(self, localProfile: SipProfile, peerProfile: SipProfile, listener: SipAudioCall.Listener, timeout: int | java.jint | java.lang.Integer, /) -> SipAudioCall: ...
    @typing.overload
    def makeAudioCall(self, localProfileUri: str | java.lang.String, peerProfileUri: str | java.lang.String, listener: SipAudioCall.Listener, timeout: int | java.jint | java.lang.Integer, /) -> SipAudioCall: ...
    @staticmethod
    def newInstance(context: android.content.Context, /) -> SipManager | None: ...
    @typing.overload
    def open(self, localProfile: SipProfile, /) -> None: ...
    @typing.overload
    def open(self, localProfile: SipProfile, incomingCallPendingIntent: android.app.PendingIntent, listener: SipRegistrationListener, /) -> None: ...
    def register(self, localProfile: SipProfile, expiryTime: int | java.jint | java.lang.Integer, listener: SipRegistrationListener, /) -> None: ...
    def setRegistrationListener(self, localProfileUri: str | java.lang.String, listener: SipRegistrationListener, /) -> None: ...
    def takeAudioCall(self, incomingCallIntent: android.content.Intent, listener: SipAudioCall.Listener, /) -> SipAudioCall: ...
    def unregister(self, localProfile: SipProfile, listener: SipRegistrationListener, /) -> None: ...

class SipProfile(android.os.Parcelable, java.io.Serializable, java.lang.Cloneable):
    CREATOR: typing.ClassVar[android.os.Parcelable.Creator[SipProfile]] = ...
    def describeContents(self) -> int: ...
    def getAuthUserName(self) -> str: ...
    def getAutoRegistration(self) -> bool: ...
    def getDisplayName(self) -> str: ...
    def getPassword(self) -> str: ...
    def getPort(self) -> int: ...
    def getProfileName(self) -> str: ...
    def getProtocol(self) -> str: ...
    def getProxyAddress(self) -> str: ...
    def getSendKeepAlive(self) -> bool: ...
    def getSipDomain(self) -> str: ...
    def getUriString(self) -> str: ...
    def getUserName(self) -> str: ...
    def setCallingUid(self, uid: int | java.jint | java.lang.Integer, /) -> None: ...
    def writeToParcel(self, out: android.os.Parcel, flags: int | java.jint | java.lang.Integer, /) -> None: ...

    class Builder(java.lang.Object):
        @typing.overload
        def __init__(self, profile: SipProfile, /) -> None: ...
        @typing.overload
        def __init__(self, uriString: str | java.lang.String, /) -> None: ...
        @typing.overload
        def __init__(self, username: str | java.lang.String, serverDomain: str | java.lang.String, /) -> None: ...
        def build(self) -> SipProfile: ...
        def setAuthUserName(self, name: str | java.lang.String, /) -> SipProfile.Builder: ...
        def setAutoRegistration(self, flag: bool | java.jboolean | java.lang.Boolean, /) -> SipProfile.Builder: ...
        def setDisplayName(self, displayName: str | java.lang.String, /) -> SipProfile.Builder: ...
        def setOutboundProxy(self, outboundProxy: str | java.lang.String, /) -> SipProfile.Builder: ...
        def setPassword(self, password: str | java.lang.String, /) -> SipProfile.Builder: ...
        def setPort(self, port: int | java.jint | java.lang.Integer, /) -> SipProfile.Builder: ...
        def setProfileName(self, name: str | java.lang.String, /) -> SipProfile.Builder: ...
        def setProtocol(self, protocol: str | java.lang.String, /) -> SipProfile.Builder: ...
        def setSendKeepAlive(self, flag: bool | java.jboolean | java.lang.Boolean, /) -> SipProfile.Builder: ...

class SipRegistrationListener(java.lang.Object):
    def onRegistering(self, arg1: str | java.lang.String, /) -> None: ...
    def onRegistrationDone(self, arg1: str | java.lang.String, arg2: int | java.jlong | java.lang.Long, /) -> None: ...
    def onRegistrationFailed(self, arg1: str | java.lang.String, arg2: int | java.jint | java.lang.Integer, arg3: str | java.lang.String, /) -> None: ...

class SipSession(java.lang.Object):
    def answerCall(self, sessionDescription: str | java.lang.String, timeout: int | java.jint | java.lang.Integer, /) -> None: ...
    def changeCall(self, sessionDescription: str | java.lang.String, timeout: int | java.jint | java.lang.Integer, /) -> None: ...
    def endCall(self) -> None: ...
    def getCallId(self) -> str: ...
    def getLocalIp(self) -> str: ...
    def getLocalProfile(self) -> SipProfile: ...
    def getPeerProfile(self) -> SipProfile: ...
    def getState(self) -> int: ...
    def isInCall(self) -> bool: ...
    def makeCall(self, callee: SipProfile, sessionDescription: str | java.lang.String, timeout: int | java.jint | java.lang.Integer, /) -> None: ...
    def register(self, duration: int | java.jint | java.lang.Integer, /) -> None: ...
    def setListener(self, listener: SipSession.Listener, /) -> None: ...
    def unregister(self) -> None: ...

    class State(java.lang.Object):
        DEREGISTERING: typing.ClassVar[int] = ...
        INCOMING_CALL: typing.ClassVar[int] = ...
        INCOMING_CALL_ANSWERING: typing.ClassVar[int] = ...
        IN_CALL: typing.ClassVar[int] = ...
        NOT_DEFINED: typing.ClassVar[int] = ...
        OUTGOING_CALL: typing.ClassVar[int] = ...
        OUTGOING_CALL_CANCELING: typing.ClassVar[int] = ...
        OUTGOING_CALL_RING_BACK: typing.ClassVar[int] = ...
        PINGING: typing.ClassVar[int] = ...
        READY_TO_CALL: typing.ClassVar[int] = ...
        REGISTERING: typing.ClassVar[int] = ...
        @staticmethod
        def toString(state: int | java.jint | java.lang.Integer, /) -> str: ...

    class Listener(java.lang.Object):
        def __init__(self) -> None: ...
        def onCallBusy(self, session: SipSession, /) -> None: ...
        def onCallChangeFailed(self, session: SipSession, errorCode: int | java.jint | java.lang.Integer, errorMessage: str | java.lang.String, /) -> None: ...
        def onCallEnded(self, session: SipSession, /) -> None: ...
        def onCallEstablished(self, session: SipSession, sessionDescription: str | java.lang.String, /) -> None: ...
        def onCalling(self, session: SipSession, /) -> None: ...
        def onError(self, session: SipSession, errorCode: int | java.jint | java.lang.Integer, errorMessage: str | java.lang.String, /) -> None: ...
        def onRegistering(self, session: SipSession, /) -> None: ...
        def onRegistrationDone(self, session: SipSession, duration: int | java.jint | java.lang.Integer, /) -> None: ...
        def onRegistrationFailed(self, session: SipSession, errorCode: int | java.jint | java.lang.Integer, errorMessage: str | java.lang.String, /) -> None: ...
        def onRegistrationTimeout(self, session: SipSession, /) -> None: ...
        def onRinging(self, session: SipSession, caller: SipProfile, sessionDescription: str | java.lang.String, /) -> None: ...
        def onRingingBack(self, session: SipSession, /) -> None: ...
