Differences between revisions 3 and 4
Revision 3 as of 2005-10-19 15:46:22
Size: 11148
Editor: Kurgan
Comment:
Revision 4 as of 2005-10-20 07:58:43
Size: 12411
Editor: Kurgan
Comment:
Deletions are marked like this. Additions are marked like this.
Line 210: Line 210:
Dopo 30 secondi che suona a vuoto, la chiamata al telefono 102 viene ridiretta alla voicemail nella mailbox numero 1 del context "default" (il context dentro il file voicemail.conf, non quello dentro extensions.conf) Dopo 30 secondi che suona a vuoto, la chiamata al telefono 102 viene ridiretta alla voicemail nella mailbox numero 1 del context "default" (il context dentro il file voicemail.conf, non quello dentro extensions.conf). Se il telefono e` occupato o non raggiungibile, la chiamata va in segreteria subito.
Line 215: Line 215:
}}}

Questa e` un macro che usa la segreteria in modo piu` sofisticato. In pratica, se suona libero (o se il telefono non e` raggiungibile) dopo un certo timeout passa alla segreteria aggiungendoci un messaggio che dice "l'utente non risponde", se e` occupato passa con un messaggio che dice "l'utente e` occupato". Questa e` buona se c'e` una voicemail per utente, forse un po` meno buona se c'e` una sola voicemail per tanti utenti, perche` il caso di occupato non dovrebbe mai verificarsi, posto che ci siano piu` interni che linee esterne.
{{{
[macro-DialInterno]
; # Chiama un interno e dopo un timeout di X secondi passa alla segreteria.
; # Se l'interno e` occupato, passa alla segreteria. Va bene per le chiamate
; # entranti da fuori, non e` molto utile se gli interni si chiamano fra di loro.
; # I parametri sono: Interno (o lista di interni),timeout,numero e context della voice mailbox.
; # per esempio: 101,30,1@default
exten => s,1,NoOp(Dialing target ${ARG1} with rollover to voicemail ${ARG3})
exten => s,2,Dial(${ARG1}|${ARG2}|tT)
exten => s,3,Voicemail(u${ARG3})
exten => s,4,Hangup()
exten => s,103,Voicemail(b${ARG3})
exten => s,104,Hangup

Sistema di segreteria telefonica centralizzata

Asterisk dispone di un sistema di segreteria centralizzata, che puo` gestire diverse caselle in diverse lingue. Al momento la gestione della lingua italiana non e` il massimo, sembra di parlare con quel personaggio de "Il nome della rosa" che parlava in diverse lingue mischiandole fra loro. Per fortuna la parte che sentono le persone che ci chiamano e` a posto, sono i menu` che non sono il massimo.

Installazione dei file degli annunci in italiano

Asterisk viene fornito con gli annunci in inglese, per fortuna un italiano si e` sbattuto per registrare gli annunci in italiano. Non so perche` alcuni pezzi siano in inglese, non ho indagato. Comunque, occorre scaricarsi il file degli annunci da qui: ftp://213.156.62.146/pub/linux/asterisk/sounds/it/ e copiarlo dentro le giuste directory come indicato nel PDF che si trova sul medesimo sito.

Configurazione delle mailbox

Il sistema integrato di segreteria ha un file di configurazione dedicato, che e` /etc/asterisk/voicemail.conf. Quella che segue e` una configurazione di base che sto cercando di mettere assieme per l'uso in Italia. Attualmente io uso una sola mailbox, la "1", perche` non voglio fare un sistema di caselle personalizzate ma una casella generica per tutti gli utenti, visto che siamo in due.

Gran parte delle voci del file sono commentate, pero` non le ho tolte per lasciarmi un riferimento dei vari comandi.

; Voicemail Configuration

[general]

; Default formats for writing Voicemail
;format=g723sf|wav49|wav
format=wav49|gsm|wav

; Maximum length of a voicemail message in seconds
;maxmessage=180

; Minimum length of a voicemail message in seconds
;minmessage=3

; Maximum length of greetings in seconds
;maxgreet=60

; How many miliseconds to skip forward/back when rew/ff in message playback
skipms=3000

; How many seconds of silence before we end the recording
maxsilence=10

; Silence threshold (what we consider silence, the lower, the more sensitive)
silencethreshold=128

; Max number of failed login attempts
maxlogins=3

; If you need to have an external program, i.e. /usr/bin/myapp
; called when a voicemail is left, delivered, or your voicemailbox
; is checked, uncomment this:
;externnotify=/usr/bin/myapp

; If you need to have an external program, i.e. /usr/bin/myapp
; called when a voicemail password is changed,
; uncomment this:
;externpass=/usr/bin/myapp

; For the directory, you can override the intro file if you want
;directoryintro=dir-intro

; The ADSI feature descriptor number to download to
;adsifdn=0000000F

; The ADSI security lock code
;adsisec=9BDBF7AC

; The ADSI voicemail application version number.
;adsiver=1


; ##############################################################
; Notifica dei messaggi a mezzo email
; ##############################################################

; Who the e-mail notification should appear to come from
; con o senza "@dominio" a discrezione.
serveremail=asterisk

; Should the email contain the voicemail as an attachment
attach=yes

; Skip the "[PBX]:" string from the message title
;pbxskip=yes

; Change the From: string
;fromstring=The Asterisk PBX

;Change the From: string for pager messages
;pagerfromstring=The Asterisk PBX

; Change the email body and/or subject, variables:
;     VM_NAME, VM_DUR, VM_MSGNUM, VM_MAILBOX, VM_CALLERID, VM_DATE
;
; Note: The emailbody config row can be up to 512 characters due to a limitation in
;       asterisk config files.
;emailsubject=[PBX]: New message ${VM_MSGNUM} in mailbox ${VM_MAILBOX}
; The following definition is very close to the default, but the default shows just
; the CIDNAME, if it is not null, else just the CIDNUM, or "an unknown caller" if they are both null.
;emailbody=Dear ${VM_NAME}:\n\n\tjust wanted to let you know you were just left a ${VM_DUR} long message (number ${VM_MSGNUM})\nin mailbox ${VM_MAILBOX} from ${VM_CALLERID}, on ${VM_DATE}, so you might\nwant to check it when you get a chance.  Thanks!\n\n\t\t\t\t--Asterisk\n

; You can override the default program to send e-mail if you wish, too
;
;mailcmd=/usr/sbin/sendmail -t

; The character set for voicemail email messages can be specified here
;charset=ISO-8859-1



; #####################################################
; configurazione di come vengono lette le date e le ore
; a seconda della timezone (o di quelli che volete voi)
; Questo serve quando si ascoltano i messaggi in segreteria
; #####################################################

; Users may be located in different timezones, or may have different
; message announcements for their introductory message when they enter
; the voicemail system. Set the message and the timezone each user
; hears here. Set the user into one of these zones with the tz= attribute
; in the options field of the mailbox. Of course, language substitution
; still applies here so you may have several directory trees that have
; alternate language choices.
;
; Look in /usr/share/zoneinfo/ for names of timezones.
; Look at the manual page for strftime for a quick tutorial on how the
; variable substitution is done on the values below.
;
; Supported values:
; 'filename'    filename of a soundfile (single ticks around the filename required)
; ${VAR}        variable substitution
; A or a        Day of week (Saturday, Sunday, ...)
; B or b or h   Month name (January, February, ...)
; d or e        numeric day of month (first, second, ..., thirty-first)
; Y             Year
; I or l        Hour, 12 hour clock
; H             Hour, 24 hour clock (single digit hours preceded by "oh")
; k             Hour, 24 hour clock (single digit hours NOT preceded by "oh")
; M             Minute
; P or p        AM or PM
; Q             "today", "yesterday" or ABdY (*note: not standard strftime value)
; q             "" (for today), "yesterday", weekday, or ABdY (*note: not standard strftime value)
; R             24 hour time, including minute

[zonemessages]
eastern=America/New_York|'vm-received' Q 'digits/at' IMp
central=America/Chicago|'vm-received' Q 'digits/at' IMp
central24=America/Chicago|'vm-received' q 'digits/at' H 'digits/hundred' M 'hours'
italia=Europe/Rome|'it/vm-received' Q 'it/digits/at' R

; ####################################################################
; Configurazione delle mailbox
; ####################################################################

; Each mailbox is listed in the form <mailbox>=<password>,<name>,<email>,<pager_email>,<options>
; if the e-mail is specified, a message will be sent when a message is
; received, to the given mailbox. If pager is specified, a message will be sent there as well.
; If the password is prefixed by '-' then it is considered to be unchangable
;
; Advanced options example is extension 4069
; NOTE: All options can be expressed globally in the general section, and overriden in the per-mailbox
; settings, unless listed otherwise.
;
tz=italia               ; Timezone from zonemessages above.  Irrelevant if envelope=no.
; attach=yes            ; Attach the voicemail to the notification email *NOT* the pager email
; saycid=yes            ; Say the caller id information before the message. If not described,
                        ;     or set to no, it will be in the envelope
; dialout=fromvm        ; Context to dial out from [option 4 from the advanced menu]
                        ;     if not listed, dialing out will not be permitted
; sendvoicemail=yes     ; Context to Send voicemail from [option 5 from the advanced menu]
                        ; if not listed, sending messages from inside voicemail will not be
                        ; permitted
; callback=fromvm       ; Context to call back from
                        ;     if not listed, calling the sender back will not be permitted
; review=yes            ; Allow sender to review/rerecord their message before saving it [OFF by default
; operator=yes          ; Allow sender to hit 0 before/after/during  leaving a voicemail to
                        ;     reach an operator  [OFF by default]
; envelope=no           ; Turn on/off envelope playback before message playback. [ON by default]
                        ;     This does NOT affect option 3,3 from the advanced options menu
; delete=yes            ; After notification, the voicemail is deleted from the server. [per-mailbox only]
                        ;     This is intended for use with users who wish to receive their voicemail ONLY by email.
; nextaftercmd=yes      ; Skips to the next message after hitting 7 or 9 to delete/save current message.
                        ;     [global option only at this time]

[default]
1 => 4242,Segreteria generale,root@localhost

;4200 => 9855,Mark Spencer,markster@linux-support.net,mypager@digium.com,attach=no|serveremail=myaddy@digium.com|tz=central
;4300 => 3456,Ben Rigas,ben@american-computer.net
;4310 => -5432,Sales,sales@marko.net
;4069 => 6522,Matt Brooks,matt@marko.net,,|tz=central|attach=yes|saycid=yes|dialout=fromvm|callback=fromvm|review=yes|operator=yes|envelope=yes
;4073 => 1099,Bianca Paige,bianca@biancapaige.com,,delete=1
;4110 => 3443,Rob Flynn,rflynn@blueridge.net

;
; Mailboxes may be organized into multiple contexts for
; voicemail virtualhosting
;

;[other]
; Questo e` un esempio di un secondo context oltre a "default"
;The intro can be customized on a per-context basis
;directoryintro=dir-company2
; 1234 => 5678,Company2 User,root@localhost

Comandi della voicemail da inserire nel file extensions.conf

Per poter usare la voicemail occorre in qualche modo poterla chiamare. Nel file extensions.conf e` possibile inserire comandi per chiamare la voicemail, sia come padrone della mailbox che come la persona che deve lasciare il messaggio.

Ovviamente nel file extensions.conf si possono fare configurazioni complicatissime, ma questi sono un paio di esempi banali.

Dopo 30 secondi che suona a vuoto, la chiamata al telefono 102 viene ridiretta alla voicemail nella mailbox numero 1 del context "default" (il context dentro il file voicemail.conf, non quello dentro extensions.conf). Se il telefono e` occupato o non raggiungibile, la chiamata va in segreteria subito.

exten => 102,1,Dial(SIP/Int102|30|tT)
exten => 102,2,Voicemail(1@default)
exten => 102,3,Hangup

Questa e` un macro che usa la segreteria in modo piu` sofisticato. In pratica, se suona libero (o se il telefono non e` raggiungibile) dopo un certo timeout passa alla segreteria aggiungendoci un messaggio che dice "l'utente non risponde", se e` occupato passa con un messaggio che dice "l'utente e` occupato". Questa e` buona se c'e` una voicemail per utente, forse un po` meno buona se c'e` una sola voicemail per tanti utenti, perche` il caso di occupato non dovrebbe mai verificarsi, posto che ci siano piu` interni che linee esterne.

[macro-DialInterno]
; # Chiama un interno e dopo un timeout di X secondi passa alla segreteria.
; # Se l'interno e` occupato, passa alla segreteria. Va bene per le chiamate
; # entranti da fuori, non e` molto utile se gli interni si chiamano fra di loro.
; # I parametri sono: Interno (o lista di interni),timeout,numero e context della voice mailbox.
; # per esempio: 101,30,1@default
exten => s,1,NoOp(Dialing target ${ARG1} with rollover to voicemail ${ARG3})
exten => s,2,Dial(${ARG1}|${ARG2}|tT)
exten => s,3,Voicemail(u${ARG3})
exten => s,4,Hangup()
exten => s,103,Voicemail(b${ARG3})
exten => s,104,Hangup

Per chiamare la voicemail per ascoltare i messaggi, chiamare il numero "4" (dai telefoni interni). Non verra` chiesta alcuna password e si verra` connessi direttamente alla voicemail numero 1 nel context "default" (come sopra, il context e` in voicemail.conf)

; Siccome sono in locale, e ho una sola mailbox
; posso hardcodare il numero della mailbox e saltare
; l'autenticazione (s)
exten => 4,1,VoicemailMain(s1@default)
exten => 4,2,Hangup

Un riferimento ai comandi della voicemail si puo` trovare qui:

Asterisk/VoiceMail (last edited 2012-06-13 14:06:14 by Kurgan)