New 3cx tapi server url
This commit is contained in:
@@ -22,7 +22,7 @@ module.exports = {
|
||||
'GM.setValue'
|
||||
],
|
||||
connect: [
|
||||
'cpatapi.cpsrvweb2016.cp-austria.at'
|
||||
'3cxtapi.cp-austria.at'
|
||||
],
|
||||
'run-at': 'document-end'
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ import * as chrono from 'chrono-node'
|
||||
import { TapiContact } from './tapi-contact'
|
||||
import { extractNumber } from './utils'
|
||||
import GM_fetch from '@trim21/gm-fetch'
|
||||
import { Config } from './config'
|
||||
|
||||
export class CallHistory {
|
||||
private callerIds: { [number: string]: TapiContact } = {}
|
||||
@@ -86,7 +87,7 @@ export class CallHistory {
|
||||
if (this.callerIds[number] !== undefined) {
|
||||
this.updateCallHistoryEntry(element, this.callerIds[number])
|
||||
} else {
|
||||
var response = await GM_fetch('http://cpatapi.cpsrvweb2016.cp-austria.at/callerid/' + encodeURIComponent(number))
|
||||
var response = await GM_fetch(Config.tapi_server_url + '/callerid/' + encodeURIComponent(number))
|
||||
var callerId: TapiContact = { tD_NAME: '' }
|
||||
if (response.status === 200) {
|
||||
callerId = await response.json() as TapiContact
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import GM_fetch from '@trim21/gm-fetch'
|
||||
import { TapiContact } from './tapi-contact'
|
||||
import { extractNumber } from './utils'
|
||||
import { Config } from './config'
|
||||
|
||||
export class CallNotification {
|
||||
public async showCallNotification (element: HTMLElement) {
|
||||
@@ -14,7 +15,7 @@ export class CallNotification {
|
||||
}
|
||||
|
||||
console.log('TAPI searching callerid for', number)
|
||||
var response = await GM_fetch('http://cpatapi.cpsrvweb2016.cp-austria.at/callerid/' + encodeURIComponent(number))
|
||||
var response = await GM_fetch(Config.tapi_server_url + '/callerid/' + encodeURIComponent(number))
|
||||
console.log('TAPI callerid response', response)
|
||||
var notification = {
|
||||
text: number
|
||||
|
||||
5
client/src/config.ts
Normal file
5
client/src/config.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
class _Config {
|
||||
public tapi_server_url: string = 'https://3cxtapi.cp-austria.at'
|
||||
}
|
||||
|
||||
export const Config = new _Config()
|
||||
@@ -3,6 +3,7 @@ import { TapiContact } from './tapi-contact'
|
||||
import { debounce } from './debounce'
|
||||
import { fireChangeEvents } from './utils'
|
||||
import GM_fetch from '@trim21/gm-fetch'
|
||||
import { Config } from './config'
|
||||
|
||||
export class Search {
|
||||
private currentSearchText = ''
|
||||
@@ -103,7 +104,7 @@ export class Search {
|
||||
return
|
||||
}
|
||||
console.log('Searching TAPI')
|
||||
var response = await GM_fetch('http://cpatapi.cpsrvweb2016.cp-austria.at/search?query=' + encodeURIComponent(searchText))
|
||||
var response = await GM_fetch(Config.tapi_server_url + '/search?query=' + encodeURIComponent(searchText))
|
||||
console.log('TAPI Search response', response)
|
||||
var contacts = await response.json() as TapiContact[]
|
||||
console.log('TAPI Contacts', contacts)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { Config } from './config';
|
||||
import './status.css';
|
||||
import { ZcStatus } from './zc-status';
|
||||
import GM_fetch from "@trim21/gm-fetch";
|
||||
@@ -26,7 +27,7 @@ export class Status {
|
||||
private async checkStatus() {
|
||||
if (this._enabled) {
|
||||
try {
|
||||
var response = await GM_fetch('http://cpatapi.cpsrvweb2016.cp-austria.at/availability/' + encodeURIComponent(this._user));
|
||||
var response = await GM_fetch(Config.tapi_server_url + '/availability/' + encodeURIComponent(this._user));
|
||||
if (response.status == 200) {
|
||||
var status = await response.json() as ZcStatus;
|
||||
if (this._currentStatus !== status.loggedIn) {
|
||||
|
||||
Reference in New Issue
Block a user