# oh-sipclient - SIP Client

SIP Client to start and answer SIP calls

The oh-sipclient component allows to call and answer SIP calls using the JsSIP (opens new window) library.

# Usage

# General

The color of the call icon depends on the state of the connection to the SIP server:

  • yellow: no connection yet, but oh-sipclient tries to establish the connection
  • green: successfully connected to the SIP server, ready to perform calls

When the call button is green, a tap on it either directly starts a call or opens a popup to choose from the phonebook property. As soon as you start an outgoing call, a hangup button will be displayed. The hangup button is coloured yellow, if the call has not been accepted yet. If the call has been accepted, the hangup button will become red.

When a call is coming in, a green accept and a red decline button are displayed. If the call is accepted, a red hangup button is accepted. The number or the name (looked up in the phonebook property) of the caller is displayed between these two buttons, but this called id can be hidden.

oh-sipclient also supports video calling, playing ringtone as well as ringback sounds and performing DTMF operations, e.g. for doorstations to open the door.

This configuration is standard widget configuration and stored on the openHAB server, it is therefore shared across all clients.

# Intercom Functionality

It is even possible to establish an intercom functionality between multiple MainUI clients, e.g. between several wall-mounted tablets across your house.

To use the intercom functionality, it is required that each client gets his own SIP account configured. This can be achieved by configuring the widget as usual, but setting SIP username & password in the Local SIP Account Settings:

  1. Open the UI page with the oh-sipclient on the individual client.
  2. Enter Edit mode.
  3. oh-sipclient will show a button names Local SIP Account Settings in the upper right corner.
  4. Insert your SIP account credentials, they are used instead of those stored on the openHAB server.
  5. Insert the SIP address/phone number of your SIP account, it is used to hide your local identity from the call dial.

# SIP Connection State Item

The advanced sipStateItem property allows to define a String Item to publish the current SIP connection state to the openHAB server.

There are the following basic states:

  • connected: The SIP client has connected to the SIP server and ready to make outgoing calls.
  • registered: The SIP client has registered at the SIP server and ready to receive calls.
  • disconnected: The SIP client has disconnected from the SIP server.

In addition, there are the following call states, which provide the caller ID of the remote party, e.g. **620@fritz.box after a colon:

  • incoming: An incoming call is received, e.g. incoming:**620@fritz.box.
  • incoming-accepted: An incoming call has been accepted and is now active, e.g. incoming-accepted:**620@fritz.box.
  • outgoing: An outgoing call is started.
  • outgoing-accepted: An outgoing call has been accepted and is now active.
  • ended: The call has been ended.
  • failed: The call has failed.

The sipStateItem is useful to track the SIP connection state on the openHAB server and work with it, e.g. in rules.

# Configuration

# General

# iconSize Icon Size INTEGER

Size of the icon(s) in px

# websocketUrl Websocket URL* TEXT

Full URL of the WebRTC SIP websocket, e.g. wss://siphost:8089/ws or relative path, e.g. /ws, for Android & iOS, you need wss (WebSocket secured)

# domain SIP Domain* TEXT

# username SIP Username TEXT

# password SIP Password TEXT

# enableTones Enable tones BOOLEAN

Enable ringback and ring tone. Not recommended for mobile browsers, might cause issues. Ring tone might only work after interaction with the webpage.

# phonebook Phonebook* TEXT

Single SIP Address (phone number) for a single call target or a comma-separated list of phoneNumber=name for multiple call targets. Used as well to display a name instead of the number for incoming calls.

# dtmfString DTMF String TEXT

Display a button to send a preset DTMF string while in calls for remote doors, gates, etc...

# hideCallerId Hide caller id BOOLEAN

Hides the username of the remote party for incoming calls.

# enableVideo Enable Video BOOLEAN

Enable video calling

# enableLocalVideo Enable Local Video View BOOLEAN

Display the local camera on video calls

# defaultVideoAspectRatio Default Aspect Ratio TEXT

Default video aspect ratio used to size the widget before video is loaded. Defaults to 4/3, 16/9 and 1 are common alternatives.

# disableRegister Disable REGISTER BOOLEAN

SIP registration can be disabled in case you only want to initiate calls, but not receive calls with the SIP widgets.

# autoAnswer Auto Answer TEXT

Automatically answer an incoming call from one of the comma delimited SIP addresses (userInfo@hostname, userInfo, ...) or use * for all incoming calls.

# autoDial Auto Dial TEXT

Automatically dial the SIP address when loaded

# sipStateItem SIP State Item TEXT item

String Item to publish the current SIP connection state to the openHAB server and make it accessible from rules etc.

# enableSIPDebug Enable SIP Debug BOOLEAN

Enable SIP debugging to the browser console (dev tools)

# Inherited Properties

The iconSize property is forwarded to the icon-size property and the CSS height attribute of the f7-button (opens new window).

The defaultVideoAspectRatio property is forwarded to the CSS aspect-ratio attribute of the video-container class.