This commit is contained in:
JerryXiao 2023-07-29 00:03:35 +08:00
parent 3f38ba1177
commit a6e0a783c0
Signed by: Jerry
GPG key ID: 22618F758B5BE2E5
5 changed files with 124 additions and 13 deletions

View file

@ -1,20 +1,20 @@
[speex] [speex]
; CBR encoding quality [0..10] ; CBR encoding quality [0..10]
; used only when vbr = false ; used only when vbr = false
quality => 3 quality => 10
; codec complexity [0..10] ; codec complexity [0..10]
; tradeoff between cpu/quality ; tradeoff between cpu/quality
complexity => 2 complexity => 5
; perceptual enhancement [true / false] ; perceptual enhancement [true / false]
; improves clarity of decoded speech ; improves clarity of decoded speech
enhancement => true enhancement => false
; voice activity detection [true / false] ; voice activity detection [true / false]
; reduces bitrate when no voice detected, used only for CBR ; reduces bitrate when no voice detected, used only for CBR
; (implicit in VBR/ABR) ; (implicit in VBR/ABR)
vad => true vad => false
; variable bit rate [true / false] ; variable bit rate [true / false]
; uses bit rate proportionate to voice complexity ; uses bit rate proportionate to voice complexity
@ -231,9 +231,17 @@ type=opus
max_playback_rate=48000 max_playback_rate=48000
max_bandwidth=full max_bandwidth=full
bitrate=64000 bitrate=64000
cbr=yes
packet_loss=10
signal=music
application=audio
[opus96] [opus96]
type=opus type=opus
max_playback_rate=48000 max_playback_rate=48000
max_bandwidth=full max_bandwidth=full
bitrate=96000 bitrate=96000
cbr=yes
packet_loss=10
signal=music
application=audio

View file

@ -45,3 +45,4 @@ dsp_drop_silence=yes
[bridge1] [bridge1]
type=bridge type=bridge
max_members=10 max_members=10
sound_only_person=/opt/asterisk/sounds/confbridge-only-participant

View file

@ -3,6 +3,50 @@ static=yes
writeprotect=no writeprotect=no
clearglobalvars=no clearglobalvars=no
[extdn42modems]
exten => busy,1,NoOp()
same => n,PlayBack(silence/1&im-sorry&all-circuits-busy-now)
same => n,Hangup()
exten => 00,200,NoOp()
same => n,GotoIf($["${DEVICE_STATE(PJSIP/modem0)}" = "BUSY"]?busy,1:)
same => n,Dial(PJSIP/modem0/sip:0@[fd07:d34:7969:2f::6]:5060)
same => n,Hangup()
exten => 01,200,NoOp()
same => n,GotoIf($["${DEVICE_STATE(PJSIP/modem1)}" = "BUSY"]?busy,1:)
same => n,Dial(PJSIP/modem1/sip:0@[fd07:d34:7969:2f::6]:5061)
same => n,Hangup()
exten => 02,200,NoOp()
same => n,GotoIf($["${DEVICE_STATE(PJSIP/modem2)}" = "BUSY"]?busy,1:)
same => n,Dial(PJSIP/modem2/sip:0@[fd07:d34:7969:2f::6]:5062)
same => n,Hangup()
exten => 03,200,NoOp()
same => n,GotoIf($["${DEVICE_STATE(PJSIP/modem3)}" = "BUSY"]?busy,1:)
same => n,Dial(PJSIP/modem3/sip:0@[fd07:d34:7969:2f::6]:5063)
same => n,Hangup()
exten => 04,200,NoOp()
same => n,GotoIf($["${DEVICE_STATE(PJSIP/modem4)}" = "BUSY"]?busy,1:)
same => n,Dial(PJSIP/modem4/sip:0@[fd07:d34:7969:2f::6]:5064)
same => n,Hangup()
exten => 05,200,NoOp()
same => n,GotoIf($["${DEVICE_STATE(PJSIP/modem5)}" = "BUSY"]?busy,1:)
same => n,Dial(PJSIP/modem5/sip:0@[fd07:d34:7969:2f::6]:5065)
same => n,Hangup()
exten => 06,200,NoOp()
same => n,GotoIf($["${DEVICE_STATE(PJSIP/modem6)}" = "BUSY"]?busy,1:)
same => n,Dial(PJSIP/modem6/sip:0@[fd07:d34:7969:2f::6]:5066)
same => n,Hangup()
exten => _X!,200,NoOp()
same => n,Playback(silence/1&im-sorry&check-number-dial-again&silence/1)
same => n,Hangup()
[extdn42whois] [extdn42whois]
exten => _X!,200,Set(CALLNUM=${EXTEN}) exten => _X!,200,Set(CALLNUM=${EXTEN})
same => n,Goto(s,1) same => n,Goto(s,1)
@ -58,15 +102,27 @@ exten => 3,100,NoOp()
same => n,Return() same => n,Return()
exten => 4,100,NoOp() exten => 4,100,NoOp()
same => n,Read(TMPNOM,/opt/asterisk/sounds/0005-unreeeal_superhero_3,1,,1,0.1) same => n,Dial(AudioSocket/10.127.8.195:3619/d17b8c7e-458e-4d4a-96a8-66b01dc082e2/c(slin),,g)
same => n,Return() same => n,Return()
exten => 5,100,NoOp() exten => 5,100,NoOp()
same => n,Read(TMPNOM,/opt/asterisk/sounds/0006-external,1,,1,0.1) same => n,Read(TMPNOM,/opt/asterisk/sounds/0005-unreeeal_superhero_3,1,,999,0.1)
same => n,Return() same => n,Return()
exten => 6,100,NoOp() exten => 6,100,NoOp()
same => n,Read(TMPNOM,/opt/asterisk/sounds/0009-macroform-cold_day,1,,1,0.1) same => n,Read(TMPNOM,/opt/asterisk/sounds/0006-external,1,,999,0.1)
same => n,Return()
exten => 7,100,NoOp()
same => n,Read(TMPNOM,/opt/asterisk/sounds/0009-macroform-cold_day,1,,999,0.1)
same => n,Return()
exten => 8,100,NoOp()
same => n,Read(TMPNOM,/opt/asterisk/sounds/0013-f9_lapix_ash,1,,999,0.1)
same => n,Return()
exten => 9,100,NoOp()
same => n,Read(TMPNOM,/opt/asterisk/sounds/0004-little_computer_boy,1,,999,0.1)
same => n,Return() same => n,Return()
exten => _X,100,NoOp() exten => _X,100,NoOp()
@ -93,10 +149,19 @@ exten => 0006/_42403618X!,5,Dial(PJSIP/REDACTED,300,m)
exten => 0007/_42403618X!,5,Dial(PJSIP/REDACTED,300,m) exten => 0007/_42403618X!,5,Dial(PJSIP/REDACTED,300,m)
exten => 0008/_42403618X!,5,Dial(PJSIP/REDACTED,300,m) exten => 0008/_42403618X!,5,Dial(PJSIP/REDACTED,300,m)
exten => 0009/424036180009,5,Goto(pstnrecv,${EXTEN},5) exten => 0009/424036180009,5,Goto(pstnrecv,${EXTEN},5)
exten => 0009/424036180006,5,Dial(PJSIP/REDACTED,60,r)
exten => 0009/424036180008,5,Dial(PJSIP/REDACTED,60,r)
exten => 0009/_42403618X!,5,Dial(PJSIP/REDACTED&PJSIP/REDACTED,60,r)
exten => 0010/_42403618X!,5,Dial(PJSIP/REDACTED&PJSIP/REDACTED,300,m)
exten => 0000,5,Goto(extmymenu,${EXTEN},200) exten => 0000,5,Goto(extmymenu,${EXTEN},200)
exten => 0 ,5,Goto(extmymenu,${EXTEN},200) exten => 0 ,5,Goto(extmymenu,${EXTEN},200)
exten => 00 ,5,Dial(AudioSocket/10.127.8.195:3619/d17b8c7e-458e-4d4a-96a8-66b01dc082e2/c(slin))
exten => 3618,5,Goto(extmymenu,${EXTEN},210) exten => 3618,5,Goto(extmymenu,${EXTEN},210)
exten => 4200/_42403618X!,5,ChanSpy()
exten => 4201/_42403618X!,5,ChanSpy(,q)
exten => 4242,5,Goto(extdn42whois,${EXTEN},200) exten => 4242,5,Goto(extdn42whois,${EXTEN},200)
exten => 4243/_42403618X!,5,Dial(PJSIP/modem/sip:424026019@voip.burble.dn42:5060)
exten => _3618XX,5,Goto(extdn42modems,${EXTEN:4},200)
exten => _X! ,5,Playback(silence/1&im-sorry&check-number-dial-again&silence/1) exten => _X! ,5,Playback(silence/1&im-sorry&check-number-dial-again&silence/1)
same => n,GotoIf($["${DIALSTATUS}" = "CHANUNAVAIL"]?chanunavail,1:) same => n,GotoIf($["${DIALSTATUS}" = "CHANUNAVAIL"]?chanunavail,1:)
@ -142,10 +207,15 @@ exten => _0XXXX. ,2,Goto(extpeers,424${EXTEN},5)
exten => _X! ,2,Goto(extpeers,42403618${EXTEN},5) exten => _X! ,2,Goto(extpeers,42403618${EXTEN},5)
[pstnphone] [pstnphone]
exten => 0,5,Goto(extmyself,00,5)
exten => 1,5,Goto(extmyself,0009,5)
exten => 2,5,Goto(extmyself,8613700000000,5)
exten => 3,5,Goto(extmyself,8613700000001,5)
exten => 4,5,Goto(extmyself,8613700000002,5)
exten => _4240X!,5,Goto(extmyself,${EXTEN},5) exten => _4240X!,5,Goto(extmyself,${EXTEN},5)
exten => _X!,5,Goto(extmyself,86${EXTEN},5) exten => _X!,5,Goto(extmyself,86${EXTEN},5)
[pstnrecv] [pstnrecv]
exten => _X!,5,Set(CALLERID(number)=REDACTED) exten => _X!,5,Set(CALLERID(number)=REDACTED)
same => n,Dial(PJSIP/REDACTED&PJSIP/REDACTED,300,r) same => n,Dial(PJSIP/REDACTED&PJSIP/REDACTED,60,r)
same => n,Hangup() same => n,Hangup()

View file

@ -18,7 +18,7 @@ bind=[::]:5060
type=endpoint type=endpoint
context=jerry context=jerry
;message_context=jerry-msg ;message_context=jerry-msg
allow=!all,opusloss,ulaw,alaw,speex allow=!all,opus64,opusloss,speex32,ulaw,alaw
direct_media=no ; proxy all calls direct_media=no ; proxy all calls
rtp_ipv6=yes rtp_ipv6=yes
rtp_symmetric=yes rtp_symmetric=yes
@ -31,7 +31,7 @@ rewrite_contact=yes
[peers-endpoint-template](!,endpoint-template) [peers-endpoint-template](!,endpoint-template)
context=jerry-peers context=jerry-peers
allow=!all,ulaw,alaw,opusloss allow=!all,opus64,speex32,ulaw,alaw
[auth-template](!) [auth-template](!)
type=auth type=auth
@ -180,7 +180,6 @@ match=172.20.29.73
[jrb0001](peers-endpoint-template) [jrb0001](peers-endpoint-template)
aors = jrb0001 aors = jrb0001
identify_by=ip identify_by=ip
allow=!all,opusloss,speex,ulaw,alaw
[jrb0001](aor-template) [jrb0001](aor-template)
contact=sip:[fd42:5d71:219:1008:216:3eff:fe9d:882f]:5060 contact=sip:[fd42:5d71:219:1008:216:3eff:fe9d:882f]:5060
[jrb0001] [jrb0001]
@ -197,3 +196,36 @@ contact=sip:172.20.14.37:5060
type=identify type=identify
endpoint=kioubit endpoint=kioubit
match=172.20.14.37 match=172.20.14.37
[modem](peers-endpoint-template)
allow=!all,alaw,ulaw
[modem0](peers-endpoint-template)
allow=!all,alaw,ulaw
device_state_busy_at=1
[modem1](peers-endpoint-template)
allow=!all,alaw,ulaw
device_state_busy_at=1
[modem2](peers-endpoint-template)
allow=!all,alaw,ulaw
device_state_busy_at=1
[modem3](peers-endpoint-template)
allow=!all,alaw,ulaw
device_state_busy_at=1
[modem4](peers-endpoint-template)
allow=!all,alaw,ulaw
device_state_busy_at=1
[modem5](peers-endpoint-template)
allow=!all,alaw,ulaw
device_state_busy_at=1
[modem6](peers-endpoint-template)
allow=!all,alaw,ulaw
device_state_busy_at=1
[anonymous](peers-endpoint-template)

View file

@ -36,7 +36,7 @@ def espeak(to_speak, outfile):
timeout=10 timeout=10
) )
p2 = subprocess.run(['ffmpeg', '-hide_banner', '-i', "-", p2 = subprocess.run(['ffmpeg', '-hide_banner', '-i', "-",
"-vn", "-ac", "1", "-ar", "8000", f"{outfile}"], "-vn", "-ac", "1", "-ar", "24000", "-f", "s16le", f"{outfile}"],
input=p1.stdout, input=p1.stdout,
capture_output=True, capture_output=True,
check=True, check=True,
@ -125,7 +125,7 @@ def main():
# argv[1]: as number # argv[1]: as number
# argv[2]: unique identifier # argv[2]: unique identifier
unid = argv[2] unid = argv[2]
outfile = OUTDIR / f"{unid}.wav" outfile = OUTDIR / f"{unid}.sln24"
errfile = OUTDIR / f"{unid}{ERRSOUND.suffix}" errfile = OUTDIR / f"{unid}{ERRSOUND.suffix}"
cleanup(outfile, errfile) cleanup(outfile, errfile)
try: try: