Skip to content

will2therich/capacitor-sip-linphone

Repository files navigation

capacitor-sip-linphone

Gives SIP functionality to a capacitor app

Install

npm install capacitor-sip-linphone
npx cap sync

API

Defines the public API for the SipLinphone plugin.

initialize()

initialize() => Promise<void>

Initializes the Linphone core. This must be called before any other method.


register(...)

register(options: RegisterOptions) => Promise<void>

Registers the user agent with the SIP server.

Param Type Description
options RegisterOptions - The registration options.

getRegistrationStatus()

getRegistrationStatus() => Promise<void>

Checks the registration status.


unregister()

unregister() => Promise<void>

Unregisters the user agent from the SIP server.


makeCall(...)

makeCall(options: CallOptions) => Promise<void>

Makes an outgoing call.

Param Type Description
options CallOptions - The call options.

hangUp()

hangUp() => Promise<void>

Hangs up the current call.


acceptCall()

acceptCall() => Promise<void>

Accepts an incoming call.


declineCall()

declineCall() => Promise<void>

Declines an incoming call.


setMute(...)

setMute(options: MuteOption) => Promise<void>

Allows toggling of the microphone.

Param Type Description
options MuteOption - options

setSpeaker(...)

setSpeaker(options: SpeakerOption) => Promise<void>

Allows toggling of the speaker.

Param Type Description
options SpeakerOption - the mute data

addListener('callStateChanged', ...)

addListener(eventName: 'callStateChanged', callback: (data: { state: string; }) => void) => Promise<PluginListenerHandle>

Listens for changes in the call state. gives SIP events, incoming & outgoing call updates

Param Type Description
eventName 'callStateChanged' - The name of the event to listen for ('callStateChanged').
callback (data: { state: string; }) => void - The function to execute when the event occurs.

Returns: Promise<PluginListenerHandle>


Interfaces

RegisterOptions

An interface defining the options for registering with a SIP server.

Prop Type Description
username string The SIP username.
password string The SIP user's password.
domain string The SIP domain/server address.

CallOptions

An interface for call options.

Prop Type Description
address string The SIP address to call (e.g., "sip:user@domain.com").

MuteOption

Prop Type
mute boolean

SpeakerOption

Prop Type
speaker boolean

PluginListenerHandle

Prop Type
remove () => Promise<void>

About

No description, website, or topics provided.

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published