From 3d72d0a712e58447a0f4d5331563a3580f1152f9 Mon Sep 17 00:00:00 2001 From: negbie Date: Sun, 30 May 2021 18:04:41 +0200 Subject: [PATCH] Improve config --- config.go | 11 ++++------- go.mod | 2 +- go.sum | 4 ++-- webhook.go | 8 ++++---- 4 files changed, 11 insertions(+), 14 deletions(-) diff --git a/config.go b/config.go index a767c2e..3a617ea 100644 --- a/config.go +++ b/config.go @@ -92,22 +92,19 @@ call_hold_other_calls no # Audio audio_path sounds audio_player aubridge,nil -#audio_player alsa,default -#audio_source alsa,default -#audio_alert alsa,default audio_source aufile,sounds/monorobo.wav -#audio_source ausine,440 +#audio_alert ausine,440 ausrc_srate 48000 -#auplay_srate 48000 +auplay_srate 48000 #ausrc_channels 0 #auplay_channels 0 -#audio_txmode poll # poll, thread +audio_txmode thread # poll, thread audio_level no ausrc_format s16 # s16, float, .. auplay_format s16 # s16, float, .. auenc_format s16 # s16, float, .. audec_format s16 # s16, float, .. -audio_buffer 20-160 # ms +audio_buffer 20-400 # ms # Video #video_source v4l2,/dev/video0 diff --git a/go.mod b/go.mod index 0ac4e75..0c6ce6e 100644 --- a/go.mod +++ b/go.mod @@ -4,5 +4,5 @@ go 1.16 require ( github.com/coocood/freecache v1.1.1 - github.com/negbie/go-baresip v0.0.5 + github.com/negbie/go-baresip v0.0.7 ) diff --git a/go.sum b/go.sum index 7183353..d7fef67 100644 --- a/go.sum +++ b/go.sum @@ -6,7 +6,7 @@ github.com/coocood/freecache v1.1.1 h1:uukNF7QKCZEdZ9gAV7WQzvh0SbjwdMF6m3x3rxEka github.com/coocood/freecache v1.1.1/go.mod h1:OKrEjkGVoxZhyWAJoeFi5BMLUJm2Tit0kpGkIr7NGYY= github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/negbie/go-baresip v0.0.5 h1:qLjG2e4M8gj154mgbLFpcs008JgvcRh+9xLYG+wYxQo= -github.com/negbie/go-baresip v0.0.5/go.mod h1:nTKUR3ZEyEHAhTVL/6PLm+mB7SLsVl/xZkwkAeL9LR4= +github.com/negbie/go-baresip v0.0.7 h1:KqJOmrsnQ27LA++FFLgGXVCRg4KI35NV0TxFj4i0mAM= +github.com/negbie/go-baresip v0.0.7/go.mod h1:nTKUR3ZEyEHAhTVL/6PLm+mB7SLsVl/xZkwkAeL9LR4= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72 h1:qLC7fQah7D6K1B0ujays3HV9gkFtllcxhzImRR7ArPQ= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= diff --git a/webhook.go b/webhook.go index 8e1666c..1f42747 100644 --- a/webhook.go +++ b/webhook.go @@ -8,14 +8,14 @@ import ( "time" ) -const warnEmo = " :warning: " -const fireEmo = " :fire: " +const warnEmo = ":warning: " +const fireEmo = ":fire: " func page(webhookUrl string, level, msg string) error { if level == "warning" { - msg = warnEmo + msg + warnEmo + msg = warnEmo + msg } else if level == "error" { - msg = fireEmo + msg + fireEmo + msg = fireEmo + msg } text := "{\"text\":" + fmt.Sprintf("%q", msg) + ",\"username\":\"telefonist\"}"