Gives SIP functionality to a capacitor app
npm install capacitor-sip-linphone
npx cap syncinitialize()register(...)getRegistrationStatus()unregister()makeCall(...)hangUp()acceptCall()declineCall()setMute(...)setSpeaker(...)addListener('callStateChanged', ...)- Interfaces
Defines the public API for the SipLinphone plugin.
initialize() => Promise<void>Initializes the Linphone core. This must be called before any other method.
register(options: RegisterOptions) => Promise<void>Registers the user agent with the SIP server.
| Param | Type | Description |
|---|---|---|
options |
RegisterOptions |
- The registration options. |
getRegistrationStatus() => Promise<void>Checks the registration status.
unregister() => Promise<void>Unregisters the user agent from the SIP server.
makeCall(options: CallOptions) => Promise<void>Makes an outgoing call.
| Param | Type | Description |
|---|---|---|
options |
CallOptions |
- The call options. |
hangUp() => Promise<void>Hangs up the current call.
acceptCall() => Promise<void>Accepts an incoming call.
declineCall() => Promise<void>Declines an incoming call.
setMute(options: MuteOption) => Promise<void>Allows toggling of the microphone.
| Param | Type | Description |
|---|---|---|
options |
MuteOption |
- options |
setSpeaker(options: SpeakerOption) => Promise<void>Allows toggling of the speaker.
| Param | Type | Description |
|---|---|---|
options |
SpeakerOption |
- the mute data |
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>
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. |
An interface for call options.
| Prop | Type | Description |
|---|---|---|
address |
string |
The SIP address to call (e.g., "sip:user@domain.com"). |
| Prop | Type |
|---|---|
mute |
boolean |
| Prop | Type |
|---|---|
speaker |
boolean |
| Prop | Type |
|---|---|
remove |
() => Promise<void> |