Asterisk 13, deutsches Sprachpaket — noch immer karpott ;-(

Es ist ja nicht so, daß das nicht vor drei Jahren schon kein neuer Fehler mehr war …

    -- Executing [8463@tst-out:30002] Answer("SIP/9971-1-line2-00000006", "") in new stack
       > 0x7f7ee0014b90 -- Probation passed - setting RTP source address to 192.168.5.12:17334
    -- Executing [8463@tst-out:30003] Set("SIP/9971-1-line2-00000006", "FUTURETIME=1485570663") in new stack
    -- Executing [8463@tst-out:30004] SayUnixTime("SIP/9971-1-line2-00000006", "1485570663,Zulu,HNS") in new stack
    -- <SIP/9971-1-line2-00000006> Playing 'digits/2.gsm' (language 'de')
       > 0x7f7ee0010b00 -- Probation passed - setting RTP source address to 192.168.5.12:19668
    -- <SIP/9971-1-line2-00000006> Playing 'digits/oclock.gsm' (language 'de')
[Jan 28 03:30:52] WARNING[9428][C-00000022]: say.c:4377 ast_say_date_with_format_de: Unknown character in datetime format HNS: N at pos 1
[Jan 28 03:30:52] WARNING[9428][C-00000022]: file.c:774 ast_openstream_full: File digits/and does not exist in any format
[Jan 28 03:30:52] WARNING[9428][C-00000022]: file.c:1247 ast_streamfile: Unable to open digits/and (format (h264|alaw)): No such file or directory
[Jan 28 03:30:52] WARNING[9428][C-00000022]: say.c:467 wait_file: Unable to play message digits/and
  == Spawn extension (tst-out, 8463, 30004) exited non-zero on 'SIP/9971-1-line2-00000006'
root@daft:/usr/share/asterisk/sounds/de/digits# ln -s ../and.gsm and.gsm

Besser, aber nur fast:

    -- Executing [8463@tst-out:30002] Answer("SIP/9971-1-line2-00000009", "") in new stack
       > 0x7f7ee0014b90 -- Probation passed - setting RTP source address to 192.168.5.12:17060
    -- Executing [8463@tst-out:30003] Set("SIP/9971-1-line2-00000009", "FUTURETIME=1485571640") in new stack
    -- Executing [8463@tst-out:30004] SayUnixTime("SIP/9971-1-line2-00000009", "1485571640,Zulu,HNS") in new stack
    -- <SIP/9971-1-line2-00000009> Playing 'digits/2.gsm' (language 'de')
       > 0x7f7ee0010b00 -- Probation passed - setting RTP source address to 192.168.5.12:18000
    -- <SIP/9971-1-line2-00000009> Playing 'digits/oclock.gsm' (language 'de')
[Jan 28 03:47:09] WARNING[9485][C-0000002d]: say.c:4377 ast_say_date_with_format_de: Unknown character in datetime format HNS: N at pos 1
    -- <SIP/9971-1-line2-00000009> Playing 'digits/and.gsm' (language 'de')
    -- <SIP/9971-1-line2-00000009> Playing 'digits/20.gsm' (language 'de')
[Jan 28 03:47:10] WARNING[9485][C-0000002d]: file.c:774 ast_openstream_full: File digits/seconds does not exist in any format
[Jan 28 03:47:10] WARNING[9485][C-0000002d]: file.c:1247 ast_streamfile: Unable to open digits/seconds (format (h264|alaw)): No such file or directory
[Jan 28 03:47:10] WARNING[9485][C-0000002d]: say.c:467 wait_file: Unable to play message digits/seconds
  == Spawn extension (tst-out, 8463, 30004) exited non-zero on 'SIP/9971-1-line2-00000009'

Gnampf!

root@daft:/usr/share/asterisk/sounds/de/digits# for i in vm-and.gsm minute.gsm minutes.gsm seconds.gsm ; do ln -s ../$i $i ; done
root@daft:/usr/share/asterisk/sounds/de/digits# for i in vm-and.gsm minute.gsm minutes.gsm seconds.gsm ; do ls -l ../$i $i ; done
-rw-r--r-- 1 root root 726 Nov  4  2005 ../vm-and.gsm
lrwxrwxrwx 1 root root  13 Jan 28 03:49 vm-and.gsm -> ../vm-and.gsm
ls: cannot access '../minute.gsm': No such file or directory
lrwxrwxrwx 1 root root 13 Jan 28 03:49 minute.gsm -> ../minute.gsm
-rw-r--r-- 1 root root 1221 Nov  4  2005 ../minutes.gsm
lrwxrwxrwx 1 root root   14 Jan 28 03:49 minutes.gsm -> ../minutes.gsm
-rw-r--r-- 1 root root 1056 Nov  4  2005 ../seconds.gsm
lrwxrwxrwx 1 root root   14 Jan 28 03:49 seconds.gsm -> ../seconds.gsm
root@daft:/usr/share/asterisk/sounds/de/digits# rm minute.gsm ; ln -s ../vm-minutes.gsm minute.gsm
root@daft:/usr/share/asterisk/sounds/de/digits# for i in vm-and.gsm minute.gsm minutes.gsm seconds.gsm ; do ls -l ../$i $i ; done
-rw-r--r-- 1 root root 726 Nov  4  2005 ../vm-and.gsm
lrwxrwxrwx 1 root root  13 Jan 28 03:49 vm-and.gsm -> ../vm-and.gsm
ls: cannot access '../minute.gsm': No such file or directory
lrwxrwxrwx 1 root root 17 Jan 28 03:52 minute.gsm -> ../vm-minutes.gsm
-rw-r--r-- 1 root root 1221 Nov  4  2005 ../minutes.gsm
lrwxrwxrwx 1 root root   14 Jan 28 03:49 minutes.gsm -> ../minutes.gsm
-rw-r--r-- 1 root root 1056 Nov  4  2005 ../seconds.gsm
lrwxrwxrwx 1 root root   14 Jan 28 03:49 seconds.gsm -> ../seconds.gsm

Und, da schau her:

    -- Executing [8463@tst-out:30002] Answer("SIP/9971-1-line2-0000000a", "") in new stack
       > 0x7f7ee0014b90 -- Probation passed - setting RTP source address to 192.168.5.12:16806
    -- Executing [8463@tst-out:30003] Set("SIP/9971-1-line2-0000000a", "FUTURETIME=1485572023") in new stack
    -- Executing [8463@tst-out:30004] SayUnixTime("SIP/9971-1-line2-0000000a", "1485572023,Zulu,HNS") in new stack
    -- <SIP/9971-1-line2-0000000a> Playing 'digits/2.gsm' (language 'de')
       > 0x7f7ee0010b00 -- Probation passed - setting RTP source address to 192.168.5.12:18944
    -- <SIP/9971-1-line2-0000000a> Playing 'digits/oclock.gsm' (language 'de')
[Jan 28 03:53:32] WARNING[9518][C-00000031]: say.c:4377 ast_say_date_with_format_de: Unknown character in datetime format HNS: N at pos 1
    -- <SIP/9971-1-line2-0000000a> Playing 'digits/and.gsm' (language 'de')
    -- <SIP/9971-1-line2-0000000a> Playing 'digits/3-and.gsm' (language 'de')
    -- <SIP/9971-1-line2-0000000a> Playing 'digits/40.gsm' (language 'de')
    -- <SIP/9971-1-line2-0000000a> Playing 'digits/seconds.gsm' (language 'de')
    -- Executing [8463@tst-out:30005] SayPhonetic("SIP/9971-1-line2-0000000a", "z") in new stack
    -- <SIP/9971-1-line2-0000000a> Playing 'phonetic/z_p.gsm' (language 'de')
    -- Executing [8463@tst-out:30006] SayUnixTime("SIP/9971-1-line2-0000000a", "1485572023,,HNS") in new stack
    -- <SIP/9971-1-line2-0000000a> Playing 'digits/3.gsm' (language 'de')
    -- <SIP/9971-1-line2-0000000a> Playing 'digits/oclock.gsm' (language 'de')
[Jan 28 03:53:37] WARNING[9518][C-00000031]: say.c:4377 ast_say_date_with_format_de: Unknown character in datetime format HNS: N at pos 1
    -- <SIP/9971-1-line2-0000000a> Playing 'digits/and.gsm' (language 'de')
    -- <SIP/9971-1-line2-0000000a> Playing 'digits/3-and.gsm' (language 'de')
    -- <SIP/9971-1-line2-0000000a> Playing 'digits/40.gsm' (language 'de')
    -- <SIP/9971-1-line2-0000000a> Playing 'digits/seconds.gsm' (language 'de')
    -- Executing [8463@tst-out:30007] Playback("SIP/9971-1-line2-0000000a", "spy-local") in new stack
    -- <SIP/9971-1-line2-0000000a> Playing 'spy-local.slin' (language 'de')
    -- Executing [8463@tst-out:30008] WaitUntil("SIP/9971-1-line2-0000000a", "1485572023") in new stack
    -- Executing [8463@tst-out:30009] Playback("SIP/9971-1-line2-0000000a", "beep") in new stack
    -- <SIP/9971-1-line2-0000000a> Playing 'beep.slin' (language 'de')
    -- Executing [8463@tst-out:30010] Return("SIP/9971-1-line2-0000000a", "") in new stack
    -- Executing [8463@tst-out:8] Hangup("SIP/9971-1-line2-0000000a", "") in new stack
  == Spawn extension (tst-out, 8463, 8) exited non-zero on 'SIP/9971-1-line2-0000000a'

Gut, »3 Uhr und 13 Sekunden« ist jetzt eine ziemlich flüssige Zeitangabe, das liegt aber am »HNS« — warum auch immer das in der Beispieldefinition für die »time«-Extension falsch steht (richtig ist »HMS«).

Aber es geht mir hier auch eher ums Prinzip: direkt nach der Installation tut das Sprachpaket für Deutsch auch in Version 13 nicht. Wie doof ist das denn?! Ich weiß nicht, warum weder der Debian-Maintainer noch »Upstream« diese Kleinigkeiten fixt — auffallen tut das eigentlich jedem, der deutsche Ansagen mit Asterisk machen möchte, wie das große G verrät.

Nicht besser ist es mit den Paketen von AsteriskSounds.org. Hier fehlen noch einige Ansagen mehr, die im GSM-Orginal vorliegen; ich habe daher »/usr/share/asterisk/sounds/de« in »de-old« umbenannt, die AsteriskSounds-Dateien nach »de-test« gepackt, einen Symlink gesetzt, daß »de« unter »de-test« zu finden ist und dann fehlende Dateien verlinkt:

root@daft:/usr/share/asterisk/sounds/de-old/digits# for i in `echo *.gsm`; do if [ \! -e /usr/share/asterisk/sounds/de-test/digits/`basename $i .gsm`.sln16 ]; then echo "Linking $i ..." ; (cd /usr/share/asterisk/sounds/de-test/digits ; ln -s /usr/share/asterisk/sounds/de-old/digits/$i $i) ; fi ; done 
Linking and.gsm ...
Linking cent.gsm ...
Linking comma.gsm ...
Linking dollar.gsm ...
Linking eine.gsm ...
Linking ein.gsm ...
Linking euro.gsm ...
Linking minute.gsm ...
Linking minutes.gsm ...
Linking point.gsm ...
Linking seconds.gsm ...
Linking Star.gsm ...
Linking vm-and.gsm ...

Analog vorher schon im Verzeichnis dadrüber. Ergebnis, nachdem ich auch die »time«-Extension auf Ansage der lokalen Zeit beschnitten habe:

    -- Executing [8463@tst-out:30002] Answer("SIP/9971-1-line2-0000001b", "") in new stack
       > 0x7f7ee00085d0 -- Probation passed - setting RTP source address to 192.168.5.12:18990
    -- Executing [8463@tst-out:30003] Set("SIP/9971-1-line2-0000001b", "FUTURETIME=1485607835") in new stack
    -- Executing [8463@tst-out:30004] SayUnixTime("SIP/9971-1-line2-0000001b", "1485607835,CET,HMS") in new stack
    -- <SIP/9971-1-line2-0000001b> Playing 'digits/13.slin16' (language 'de')
       > 0x7f7ee0023730 -- Probation passed - setting RTP source address to 192.168.5.12:17528
    -- <SIP/9971-1-line2-0000001b> Playing 'digits/oclock.slin16' (language 'de')
    -- <SIP/9971-1-line2-0000001b> Playing 'digits/50.slin16' (language 'de')
    -- <SIP/9971-1-line2-0000001b> Playing 'digits/minutes.gsm' (language 'de')
    -- <SIP/9971-1-line2-0000001b> Playing 'digits/and.gsm' (language 'de')
    -- <SIP/9971-1-line2-0000001b> Playing 'digits/5-and.slin16' (language 'de')
    -- <SIP/9971-1-line2-0000001b> Playing 'digits/30.slin16' (language 'de')
    -- <SIP/9971-1-line2-0000001b> Playing 'digits/seconds.gsm' (language 'de')
    -- Executing [8463@tst-out:30005] WaitUntil("SIP/9971-1-line2-0000001b", "1485607835") in new stack
    -- Executing [8463@tst-out:30006] Playback("SIP/9971-1-line2-0000001b", "beep") in new stack
    -- <SIP/9971-1-line2-0000001b> Playing 'beep.slin16' (language 'de')
    -- Executing [8463@tst-out:30007] Return("SIP/9971-1-line2-0000001b", "") in new stack
    -- Executing [8463@tst-out:9] Hangup("SIP/9971-1-line2-0000001b", "") in new stack
  == Spawn extension (tst-out, 8463, 9) exited non-zero on 'SIP/9971-1-line2-0000001b'

Die »Asterisk Sound«-Dateien klingen ganz gut, vor allem über G.722, da sie in deutlich beserer Qualität vorliegen; allerdings ist das auf den zweiten Blick ziemlich liebloser Mist, augenscheinlich von Google-Translate ins Deutsche radegebrochene Sätze, die per Text-to-Speech zu Sprachprompts wurden — als abschreckendes Beispiel mag die unter 03051302334666 anhörbare Ansage zum Asterisk-Demomodus dienen. Ich bin jedenfalls wieder bei den alten, leider nur in GSM-Qualität vorliegenden, Samples gelandet — Zeitansage temporär unter 03051302334119 ;-)