Adding Extensions

Hi All,

I’ve read around the bug reports and the forum also and can’t find an answer to this one…

When I add/amend an extension in freePBX it just hangs. If I killall apache2 then restart apache2 the changes are there and I can apply configuration changes. I’ve been pointed towards voicemail conf as possibly causing this but I’ve tried the suggestions.

I’m running Debian lenny/ FreePBX 2.4.1.0 / Asterisk 1.4.21

My apache error logs don’t really give much away…

any help would be excellent!

Thanks,
Brian

How about posting the voicemail.conf and we’ll then take a look. Currently you’ve given us nothing to go on or look at besides your hunch.

Ok,

Sorry about that!

;
; Voicemail Configuration
;

;
; NOTE: Asterisk has to edit this file to change a user’s password. This does
; not currently work with the "#include " directive for Asterisk
; configuration files, nor when using realtime static configuration.
; Do not use them with this configuration file.
;

[general]
; Formats for writing Voicemail. Note that when using IMAP storage for
; voicemail, only the first format specified will be used.
;format=g723sf|wav49|wav
format=wav49|gsm|wav

;
; WARNING:
; If you change the list of formats that you record voicemail in
; when you have mailboxes that contain messages, you MUST absolutely
; manually go through those mailboxes and convert/delete/add the
; the message files so that they appear to have been stored using
; your new format list. If you don’t do this, very unpleasant
; things may happen to your users while they are retrieving and
; manipulating their voicemail.
;
; In other words: don’t change the format list on a production system
; unless you are VERY sure that you know what you are doing and are
; prepared for the consequences.
;
; Who the e-mail notification should appear to come from
[email protected]
; Should the email contain the voicemail as an attachment
attach=yes
; Maximum number of messages per folder. If not specified, a default value
; (100) is used. Maximum value for this option is 9999.
;maxmsg=100
; Maximum length of a voicemail message in seconds
;maxmessage=180
; Minimum length of a voicemail message in seconds for the message to be kept
; The default is no minimum.
;minmessage=3
; Maximum length of greetings in seconds
;maxgreet=60
; How many milliseconds 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
;
; User context is where entries from users.conf are registered. The
; default value is ‘default’
;
userscontext=default
;
; 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. It can also be set to ‘smdi’ to use
; smdi for external notification. If it is ‘smdi’, smdiport should
; be set to a valid port as specified in smdi.conf.

;externnotify=/usr/bin/myapp
;smdiport=/dev/ttyS0

; 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 character set for voicemail messages can be specified here
;charset=ISO-8859-1
; 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
; Skip the “[PBX]:” string from the message title
;pbxskip=yes
; Change the From: string
;fromstring=The Asterisk PBX
; Permit finding entries for forward/compose from the directory
;usedirectory=yes
; Voicemail can be stored in a database using the ODBC driver.
; The value of odbcstorage is the database connection configured
; in res_odbc.conf.
;odbcstorage=asterisk
; The default table for ODBC voicemail storage is voicemessages.
;odbctable=voicemessages
;
; Change the from, body and/or subject, variables:
; VM_NAME, VM_DUR, VM_MSGNUM, VM_MAILBOX, VM_CALLERID, VM_CIDNUM,
; VM_CIDNAME, VM_DATE
;
; Note: The emailbody config row can only be up to 512 characters due to a
; limitation in the Asterisk configuration subsystem.
;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, otherwise 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 also change the Pager From: string, the pager body and/or subject.
; The above defined variables also can be used here
;pagerfromstring=The Asterisk PBX
;pagersubject=New VM
;pagerbody=New ${VM_DUR} long msg in box ${VM_MAILBOX}\nfrom ${VM_CALLERID}, on ${VM_DATE}
;
; Set the date format on outgoing mails. Valid arguments can be found on the
; strftime(3) man page
;
; Default
emaildateformat=%A, %B %d, %Y at %r
; 24h date format
;emaildateformat=%A, %d %B %Y at %H:%M:%S
;
; You can override the default program to send e-mail if you wish, too
;
;mailcmd=/usr/sbin/sendmail -t
;
; 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, with 00 pronounced as “o’clock”
; N Minute, with 00 pronounced as “hundred” (US military time)
; 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
;
;
;
; Each mailbox is listed in the form =,,,<pager_email>,
; 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 unchangeable.
;
; Advanced options example is extension 4069
; NOTE: All options can be expressed globally in the general section, and
; overridden in the per-mailbox settings, unless listed otherwise.
;
; tz=central ; Timezone from zonemessages below. Irrelevant if envelope=no.
; attach=yes ; Attach the voicemail to the notification email NOT the pager email
; attachfmt=wav49 ; Which format to attach to the email. Normally this is the
; first format specified in the format parameter above, but this
; option lets you customize the format sent to particular mailboxes.
; Useful if Windows users want wav49, but Linux users want gsm.
; [per-mailbox only]
; saycid=yes ; Say the caller id information before the message. If not described,
; or set to no, it will be in the envelope
; cidinternalcontexts=intern ; Internal Context for Name Playback instead of
; extension digits when saying caller id.
; sayduration=no ; Turn on/off the duration information before the message. [ON by default]
; saydurationm=2 ; Specify the minimum duration to say. Default is 2 minutes
; dialout=fromvm ; Context to dial out from [option 4 from mailbox’s advanced menu].
; If not specified, option 4 will not be listed and dialing out
; from within VoiceMailMain() will not be permitted.
sendvoicemail=yes ; Allow the user to compose and send a voicemail while inside
; VoiceMailMain() [option 5 from mailbox’s advanced menu].
; If set to ‘no’, option 5 will not be listed.
; searchcontexts=yes ; Current default behavior is to search only the default context
; if one is not specified. The older behavior was to search all contexts.
; This option restores the old behavior [DEFAULT=no]
; callback=fromvm ; Context to call back from
; if not listed, calling the sender back will not be permitted
; exitcontext=fromvm ; Context to go to on user exit such as * or 0
; The default is the current context.
; 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. Note: “deletevoicemail” is provided as an
; equivalent option for Realtime configuration.
; volgain=0.0 ; Emails bearing the voicemail may arrive in a volume too
; quiet to be heard. This parameter allows you to specify how
; much gain to add to the message when sending a voicemail.
; NOTE: sox must be installed for this option to work.
; nextaftercmd=yes ; Skips to the next message after hitting 7 or 9 to delete/save current message.
; [global option only at this time]
; forcename=yes ; Forces a new user to record their name. A new user is
; determined by the password being the same as
; the mailbox number. The default is “no”.
; forcegreetings=no ; This is the same as forcename, except for recording
; greetings. The default is “no”.
; hidefromdir=yes ; Hide this mailbox from the directory produced by app_directory
; The default is “no”.
;tempgreetwarn=yes ; Remind the user that their temporary greeting is set

[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 N 'hours’
military=Zulu|‘vm-received’ q ‘digits/at’ H N ‘hours’ 'phonetic/z_p’
european=Europe/Copenhagen|‘vm-received’ a d b ‘digits/at’ HM

#include vm_general.inc
#include vm_email.inc
[default]

; Define maximum number of messages per folder for a particular context.
;maxmsg=50

1234 => 4242,Example Mailbox,root@localhost
;4200 => 9855,Mark Spencer,[email protected],[email protected],attach=no|[email protected]|tz=central|maxmsg=10
;4300 => 3456,Ben Rigas,[email protected]
;4310 => -5432,Sales,[email protected]
;4069 => 6522,Matt Brooks,[email protected],|tz=central|attach=yes|saycid=yes|dialout=fromvm|callback=fromvm|review=yes|operator=yes|envelope=yes|sayduration=yes|saydurationm=1
;4073 => 1099,Bianca Paige,[email protected],delete=1
;4110 => 3443,Rob Flynn,[email protected]
;4235 => 1234,Jim Holmes,[email protected],Tz=european

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

100 => 100,Karen,[email protected],attach=yes|saycid=yes|envelope=no|delete=no
101 => 101,Brian,[email protected],attach=yes|saycid=yes|envelope=no|delete=no
102 => 102,Paul,[email protected],attach=yes|saycid=yes|envelope=no|delete=no
103 => 103,Brian,[email protected],attach=yes|saycid=yes|envelope=yes|delete=no
104 => 104,Michael,[email protected],attach=yes|saycid=yes|envelope=yes|delete=no
[other]
;The intro can be customized on a per-context basis
;directoryintro=dir-company2
1234 => 5678,Company2 User,root@localhost

I don’t wanna have to start from scratch!

TIA.
Brian

yea you have two definitions of extension 1234 which could be a big problem.

Thanks for coming back to me!

I’ve removed 1234 and it still hangs. I’ve checked the voicemail.conf on a working system and it has the two 1234’s

Seems the voicemail.conf that ships with Asterisk has those two entries by default.

any other ideas?

Thanks Again,
Brian

Well neither line with the 1234 should be active. so both should start with a ; If you created a extension 1234 then it would get real interesting. This file also has two includes. Post both of those please so that we can check to be sure they are also correct. vm_general.inc and vm_email.inc

Hi There and thanks for looking at this for me!

vm_general.inc

; 1st listed format gets emailed
format=wav49|wav

attach=yes
pbxskip=yes ; Don’t put [PBX]: in the subject line
[email protected] ; Who the e-mail notification should appear to come from
fromstring=xxx.xx Asterisk PBX ;Real name of email sender
maxmessage=180 ; max length of vm message
minmessage=3 ; Minimum length of a voicemail message in seconds
maxsilence=5 ; Wait for 5 silent seconds and end the voicemail
silencethreshold=128 ; What do we consider to be silence
skipms=3000 ; How many miliseconds to skip forward/back when rew/ff in message playback
review=yes ; Allow sender to review/rerecord their message before saving it
operator=yes ; Allow caller to press 0
nextaftercmd=yes ; Automagically play next message when current message is deleted or saved

vm_email.inc

; Change the email body, variables: VM_NAME, VM_DUR, VM_MSGNUM, VM_MAILBOX, VM_CALLERID, VM_DATE

emailbody=${VM_NAME},\n\nThere is a new voicemail in mailbox ${VM_MAILBOX}:\n\n\tFrom:\t${VM_CALLERID}\n\tLength:\t${VM_DUR} seconds\n\tDate:\t${VM_DATE}\n\nDial 171 to access your voicemail by phone.\nVisit http://AMPWEBADDRESS/recordings/index.php to check your voicemail with a web browser.\n

The fromstring= should just be the human readable name, don’t have the e-mail address in it, it uses the servermail= as the e-mail address when building the from for the message.

Ok the problem (and I should have seen it sooner)…

You inserted the following into the voicemail.conf file:
[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 N 'hours’
military=Zulu|‘vm-received’ q ‘digits/at’ H N ‘hours’ 'phonetic/z_p’
european=Europe/Copenhagen|‘vm-received’ a d b ‘digits/at’ HM

This section needs to be placed AFTER the two includes not before. The includes need to be under the General context not the zonemessages context. Which is where they are when they are listed right after.

Hi and thanks again,

I edited voicemail.conf and put it in the correct context. Thanks for spotting it.

I amportal restart

I then just went to an extension and hit submit without changing anything and bang it’s hung again.

I’ve looked in apache2 error_log and the only errors are stylesheet related (Certainly not this)

I’ve saw other people with this issue and they generally just reload everything. I am loathe to do this as I would like to be able to fix this if it happens to me on a box again!

Appreciate very much your efforts.

Regards,
Brian

I changed amportal.conf

the following were false and I changed them to true.

XTNCONFLICTABORT, BADDESTABORT

setting either of these to true will result in retrieve_conf aborting during a reload if an extension

conflict is detected or a destination is detected. It is usually better to allow the reload to go

through and then correct the problem but these can be set if a more strict behavior is desired

both default to false if not set

XTNCONFLICTABORT=true
BADDESTABORT=true

as I thought this would make sense.

It indeed caused a reload to fail with:

Reload failed because retrieve_conf encountered an error: 20

exit: 20

Checking for PEAR DB…OK
Checking for PEAR Console::Getopt…OK
Checking for /etc/amportal.conf …OK
Bootstrapping /etc/amportal.conf …OK
Parsing /etc/amportal.conf …OK
Parsing /etc/asterisk/asterisk.conf …OK
Connecting to database…OK
Connecting to Asterisk manager interface…OK
Aborting reload because extension conflicts or bad destinations
1 error(s) occured, you should view the notification log on the dashboard or main screen to check for more details

The notification log just says:

retrieve_conf failed, config not applied
Reload failed because retrieve_conf encountered an error: 20
Added 3 minutes ago
(freepbx.RCONFFAIL)

is there anywhere this is more verbose?

Brian

Just wondering about my last post and if anyone can help me on it!?

Regards,
Brian