0.0.14 • Published 9 months ago

@bonvies/bontalk v0.0.14

Weekly downloads
-
License
-
Repository
-
Last release
9 months ago

BonTalk Doc

Features

  • A sip.js-based plugin
  • Developers can adjust the style and theme of BonTalk
  • BonTalk can be used as a phone call
  • BonTalk can be installed anywhere on your web platform

Installation

Package manager

use npm:

$ npm i @bonvies/bontalk

CDN

Usage

Register the extension and ready to call…

import BonTalk from '@bonvies/bontalk'

// create an usable sip phone instance
const bonTalk = new BonTalk({
  wsServer: "wss://bonuc.sbc.telesale.org:7443/ws",
  domains: ["bonuc.sbc.telesale.org"],
  username: "3005",
  password: "1234",
  displayName: "3005 John",
  panelConfig: {
    position: 'right',
    topOffset: 70,
    zIndex: 1000,
    responsive: [
      {
        breakpoint: 768,
        position: 'left',
        topOffset: 70,
        zIndex: 1000,
      },
      {
        breakpoint: 320,
        hidden: true
      }
    ]
  }
})

bonTalk.init()

// attach a event to a button
document.getElementById("toggleButton").addEventListener("click", () => {
  bonTalk.togglePanel()
})

Unregister and destroy the instance…

bonTalk.destroy()

Arguments

ArgumentData TypeDescription
wsServerstringa usable web socket server address
domainsstring place multiple PBX domains or IPs to prevent any PBX from working properly
usernamestringauthorization username of the extension
passwordstringauthorization password of the extension
displayNamestringdisplay name of the extension
panelConfigobjectpanel configuration, see Panel Configuration for more details
responsiveobject[]responsive configuration, see Responsive Configuration for more details

Panel Configuration

PropertyData TypeDescription
positionstringpanel position, can be left or right
topOffsetnumberpanel top offset
zIndexnumberpanel z-index

Responsive Configuration

PropertyData TypeDescription
breakpointnumberresponsive breakpoint
hiddenbooleanhidden the panel
positionstringpanel position, can be left or right
topOffsetnumberpanel top offset
zIndexnumberpanel z-index

Instance Methods

MethodDescription
.init()render the panel and auto-register the agent’s extension, should only call once on every instance.
.destroy()destroy the panel. should call before destroy the element.
.togglePanel()open or close the panel.
0.0.14

9 months ago

0.0.10

9 months ago

0.0.11

9 months ago

0.0.12

9 months ago

0.0.13

9 months ago

0.0.9

9 months ago

0.0.8

9 months ago

0.0.7

9 months ago

0.0.6

9 months ago

0.0.5

9 months ago

0.0.4

9 months ago

0.0.3

9 months ago

0.0.2

9 months ago

0.0.1

1 year ago