Skip to main content

SIPCore

Defined in: sip-hass-card/src/sip-core.ts:75

Main class for SIP Core functionality. Handles SIP registration, call management, and audio device management.

Accessors​

AudioInputId​

Get Signature​

get AudioInputId(): null | string;

Defined in: sip-hass-card/src/sip-core.ts:264

Returns​

null | string

Set Signature​

set AudioInputId(deviceId): void;

Defined in: sip-hass-card/src/sip-core.ts:268

Parameters​
ParameterType
deviceIdnull | string
Returns​

void


AudioOutputId​

Get Signature​

get AudioOutputId(): null | string;

Defined in: sip-hass-card/src/sip-core.ts:251

Returns​

null | string

Set Signature​

set AudioOutputId(deviceId): void;

Defined in: sip-hass-card/src/sip-core.ts:255

Parameters​
ParameterType
deviceIdnull | string
Returns​

void


callDuration​

Get Signature​

get callDuration(): string;

Defined in: sip-hass-card/src/sip-core.ts:241

Returns call duration in format 0:00

Returns​

string


callState​

Get Signature​

get callState(): CALLSTATE;

Defined in: sip-hass-card/src/sip-core.ts:229

Returns​

CALLSTATE


hass​

Get Signature​

get hass(): any;

Defined in: sip-hass-card/src/sip-core.ts:127

The live hass object.

home-assistant receives a brand new hass object on every state update, but this singleton lives outside the element tree - it is instantiated by a frontend module, so Home Assistant never hands it a fresh one. The snapshot taken in the constructor therefore ages: its states keep the camera_proxy token that was current at page load (it rotates every 5 minutes, so the call popup ends up embedding a token that no longer validates and the camera image 403s), and its auth.data is only refreshed when something asks for it.

Look the live object up on each access instead of caching it. The setter is kept so that the property stays assignable for anything that already writes to it.

Returns​

any

Set Signature​

set hass(hass): void;

Defined in: sip-hass-card/src/sip-core.ts:132

Parameters​
ParameterType
hassany
Returns​

void


registered​

Get Signature​

get registered(): boolean;

Defined in: sip-hass-card/src/sip-core.ts:159

Returns​

boolean


remoteExtension​

Get Signature​

get remoteExtension(): null | string;

Defined in: sip-hass-card/src/sip-core.ts:150

Returns the remote extension. Returns null if not in a call

Returns​

null | string


remoteName​

Get Signature​

get remoteName(): null | string;

Defined in: sip-hass-card/src/sip-core.ts:155

Returns the remote display name if available, otherwise the extension. Returns null if not in a call

Returns​

null | string

Constructors​

Constructor​

new SIPCore(): SIPCore;

Defined in: sip-hass-card/src/sip-core.ts:136

Returns​

SIPCore

Methods​

answerCall()​

answerCall(): Promise<void>;

Defined in: sip-hass-card/src/sip-core.ts:456

Returns​

Promise<void>


createHassioSession()​

createHassioSession(): Promise<null | string>;

Defined in: sip-hass-card/src/sip-core.ts:668

Creates a new Supervisor ingress session and stores it in the ingress cookie. Returns null when no Supervisor is available.

Returns​

Promise<null | string>


endCall()​

endCall(): Promise<void>;

Defined in: sip-hass-card/src/sip-core.ts:465

Returns​

Promise<void>


ensureHassioSession()​

ensureHassioSession(): Promise<null | string>;

Defined in: sip-hass-card/src/sip-core.ts:690

Extends the current Supervisor ingress session, creating a new one when it expired. Returns null when no Supervisor is available.

Returns​

Promise<null | string>


getAudioDevices()​

getAudioDevices(audioKind): Promise<MediaDeviceInfo[]>;

Defined in: sip-hass-card/src/sip-core.ts:725

Returns a list of audio devices of the specified kind

Parameters​

ParameterType
audioKindAUDIO_DEVICE_KIND

Returns​

Promise<MediaDeviceInfo[]>


init()​

init(): Promise<void>;

Defined in: sip-hass-card/src/sip-core.ts:345

Returns​

Promise<void>


playIncomingRingtone()​

playIncomingRingtone(): void;

Defined in: sip-hass-card/src/sip-core.ts:420

Returns​

void


playOutgoingTone()​

playOutgoingTone(): void;

Defined in: sip-hass-card/src/sip-core.ts:438

Returns​

void


startCall()​

startCall(extension): Promise<void>;

Defined in: sip-hass-card/src/sip-core.ts:470

Parameters​

ParameterType
extensionstring

Returns​

Promise<void>


stopIncomingRingtone()​

stopIncomingRingtone(): void;

Defined in: sip-hass-card/src/sip-core.ts:429

Returns​

void


stopOutgoingTone()​

stopOutgoingTone(): void;

Defined in: sip-hass-card/src/sip-core.ts:447

Returns​

void


triggerUpdate()​

triggerUpdate(): void;

Defined in: sip-hass-card/src/sip-core.ts:475

Dispatches a sipcore-update event

Returns​

void

Properties​

PropertyTypeDescriptionDefined in
configSIPCoreConfig-sip-hass-card/src/sip-core.ts:90
incomingAudionull | HTMLAudioElement-sip-hass-card/src/sip-core.ts:106
outgoingAudionull | HTMLAudioElement-sip-hass-card/src/sip-core.ts:107
remoteAudioStreamnull | MediaStream-sip-hass-card/src/sip-core.ts:103
remoteVideoStreamnull | MediaStream-sip-hass-card/src/sip-core.ts:104
RTCSessionnull | RTCSessionThe current RTC session, if available See https://jssip.net/documentation/3.1.x/api/session/sip-hass-card/src/sip-core.ts:86
uaUAThe JSSIP User Agent instance See https://jssip.net/documentation/3.1.x/api/ua/sip-hass-card/src/sip-core.ts:80
userUser-sip-hass-card/src/sip-core.ts:89
versionstring-sip-hass-card/src/sip-core.ts:88