FAQ

FAQ

It can't be open source without a FAQ.

Feel free to add a child page to this book to answer any question you feel is Frequently Asked.


Changing the Asterisk manager password

Changing the Asterisk manager password

If you are using the default password, you will see the message:

Warning: You are running freePBX and asterisk with the
default manager pass. You should consider changing this to something
else.

Running with the default password is a bad idea, simply because
everyone else in the world knows it, and (if not properly firewalled,
etc etc) could potentially connect to your asterisk box and do bad
things(tm).

Warning: Don't get cute and try to use a password
with non-alphabetic or non-numeric characters - things may break in
strange ways if you try to use punctuation characters in passwords.
Unless you really know what you are doing, stick to numbers and
standard alphabetic characters.

Changing the password

To do this, you need to edit two files: /etc/asterisk/manager.conf and /etc/amportal.conf

manager.conf

This controls the asterisk 'manager' users that are allowed to connect to the asterisk manager interface.

For full information on the file, see http://www.voip-info.org/wiki/index.php?page=Asterisk+config+manager.conf

You can have as many users in here as you'd like (for example, an
operator panel might use one) and in fact, you should have different
users for each application.

freePBX requires a user that has a definition like the following:

[admin]
secret = secret123password
deny=0.0.0.0/0.0.0.0
permit=127.0.0.1/255.255.255.0
read = system,call,log,verbose,command,agent,user
write = system,call,log,verbose,command,agent,user

amportal.conf

There needs to be a corresponding entry in /etc/amportal.conf

AMPMGRUSER=admin
AMPMGRPASS=secret123password

Obviously you just need to use the same username (inside the square brackets) and password as above.


Changing the MySQL password

Changing the MySQL password

If you are using the default password, you will see the message:

Warning: You are running freePBX and mysql with the default password

Running with the default password is a bad idea, simply because
everyone else in the world knows it, and (if not properly firewalled,
etc etc) could potentially connect to your mysql server and do bad
things(tm).

Warning: Don't get cute and try to use a password
with non-alphabetic or non-numeric characters - things may break in
strange ways if you try to use punctuation characters in passwords.
Unless you really know what you are doing, stick to numbers and
standard alphabetic characters.

Changing the mysql password

There are multiple ways to change the password in mysql.

Using mysql admin

This requires that you know the existing password. From a shell, run:

mysqladmin -u asteriskuser -p password newpass

where asteriskuser is the username (asteriskuser is typically the default username in FreePBX), and newpass is your new password. You will be prompted for the old password interactively.

Using phpMyAdmin

Log into phpMyAdmin, and select Privileges from the main page. From there, select the user you want to edit, and click the edit icon next to their name.

Note on multiple username entries: Note that
sometimes there will be multiple user names with different hosts. MySQL
identifies users based on the hostname they're connecting from, and
allows different passwords for users when they connect from different
hosts. Often there is an entry with localhost and another with %.
% is a wildcard in MySQL, and means any host in this case. If you have
freePBX running on the same machine (which is most likely true) then
the localhost entry is a better match than %, so it
is the one that will be used. You can usually safely delete the % entry
if you're not using it. If you are using a different host, it's better
to use that specific host's name or IP than %. See MySQL documentation
for more information.

Scroll down to the "change password" section, and enter the new password.

Using SQL

Connect to the mysql interactive shell:

mysql -u username -p

Usually you will use root or another user with administrative privileges as the username.

Run the following SQL command:

SET PASSWORD FOR asteriskuser@localhost=PASSWORD('newpass');

asteriskuser should be the username of the freePBX user. localhost
should only be changed if your freePBX and MySQL servers are different
machines. Be sure to include quotes around the new password.

type quit to return to the OS shell.

Verifying the password

If you want to be sure that the password has been changed, run:

mysql -u asteriskuser -p

amportal.conf, cdr_mysql.conf, res_mysql.conf

Once the password works, you need to update three files:

  • /etc/amportal.conf:

AMPDBUSER=asteriskuser

AMPDBPASS=mypass

  • /etc/asterisk/cdr_mysql.conf:

password=mypass

user=asteriskuser

  • /etc/asterisk/res_mysql.conf:

dbuser = asteriskuser

dbpass = mypass

Where asteriskuser is the username (asteriskuser is the typical FreePBX default username) and mypass is the changed password.

(Thanks to gstueve for the comment regarding the latter two files.)


Your version of FreePBX is out of date

Your version of FreePBX is out of date

If you received this error whilst using the Connect to Online Module Repository
function, this means that your system is out of date. Upgrading to the
latest released version is always painless and transparent.

You can not upgrade by simply clicking on the 'Upgrade'
button on the Online Modules page - The only way to upgrade a Core
version is by downloading the released packages

If you're unsure on how to upgrade, follow the Updating instructions.
A normal upgrade takes less than 15 seconds (after doing the download)
and there is no interruption to service. Trixbox users MUST read the
'Important' section further down, or else asterisk won't start
properly. You have been warned!

Note that you can use the 'Online Support' module to connect to IRC
and talk to people there if you're unable to upgrade successfully.

If you like freePBX, and use it, why not make a donation? You can
use the button on the right, for any amount. It's all appreciated.
Also, if you need commercial support, you can use the buttons on the
left for prompt help!

Possible errors:

Trixbox Users (important!)
You need to delete the file /usr/lib/asterisk/modules/app_trunkisavail.so

[root@asterisk1 ~]# rm /usr/lib/asterisk/modules/app_trunkisavail.so

[root@asterisk1 ~]#

That module also breaks any non-trixbox upgrades, so it's a good idea to get rid of it anyway.

If you're still seeing the 'You need to upgrade' message:
Unfortunately, there is no way I could force the 2.1 machines to ignore their cached XML update file. You've got two options:

Wait an hour until it times out, and then you'll have the new
module list (It's ok - all your modules are still there, your machine
is still working)

or

From mysql run the command

[root@asterisk1 freepbx]# mysql asterisk

(You may need to put -uasteriskuser and -pamp109 on that line as well - check the file /etc/amportal.conf for ASTDBUSER and ASTDBPASS)

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 1856 to server version: 4.1.20

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> truncate module_xml;

Query OK, 0 rows affected (0.03 sec)

mysql> \q

Bye

[root@asterisk1 freepbx]#

After that, when you go to online modules, it'll download the correct, fresh, copy.


Asterisk With NVFaxDetect

Asterisk With NVFaxDetect
Originally Created by: kbmetz

1. Login to the FreePBX interface of the appropriate Asterisk box.
Click on the Setup tab along the top and then select the Inbound Routes
selection on the left navbar. Once this page opens, it will default to
Add Incoming Route.

2. Complete the Add Incoming Route window as follows:

DID Number: <Enter the DID number you created in Step 1>

Fax Extension: <Change this to "system">

Fax Email: <Enter FAX recipient's e-mail address here>

Fax Detection type: <Change to "NVFax">

Pause after answer: <Change to "20">

Set Destination: <Select "Core:" and then the recipient's voice extension number>

3. Click Submit and then click the Red Reload Bar along the top. Asterisk will restart.

4. SSH into the Asterisk box you're configuring. Type the following commands:

  • asterisk -r
    • CLI> set verbose 10
    • CLI> show application nvfaxdetect

YOU ARE FINISHED IF YOU SEE A CLI MESSAGE SAYING:

This application listens for fax tones (on IAX and SIP channels too)

for waitdur seconds of time. In addition, it can be interrupted by digits,

or non-silence. Audio is only monitored in the receive direction. If

digits interrupt, they must be the start of a valid extension unless the

option is included to ignore. If fax is detected, it will jump to the

'fax' extension. If a period of non-silence greater than 'mindur' ms,

yet less than 'maxdur' ms is followed by silence at least 'sildur' ms

then the app is aborted and processing jumps to the 'talk' extension.

If all undetected, control will continue at the next priority.

waitdur: Maximum number of seconds to wait (default=4)

options:

'n': Attempt on-hook if unanswered (default=no)

'x': DTMF digits terminate without extension (default=no)

'd': Ignore DTMF digit detection (default=no)

'f': Ignore fax detection (default=no)

't': Ignore talk detection (default=no)

sildur: Silence ms after mindur/maxdur before aborting (default=1000)

mindur: Minimum non-silence ms needed (default=100)

maxdur: Maximum non-silence ms allowed (default=0/forever)

Returns -1 on hangup, and 0 on successful completion with no exit conditions.

IF, INSTEAD, YOU RECEIVE A MESSAGE SAYING THAT NVFAXDETECT ISN'T INSTALLED, YOU MUST COMPLETE THE FOLLOWING STEPS:

  1. cd /usr/src
  2. wget http://www.soft-switch.org/downloads/spandsp/spandsp-0.0.2pre25/spandsp-0.0.2pre25.tar.gz
  3. tar zxf spandsp-0.0.2pre25.tar.gz
  4. cd spandsp-0.0.2
  5. ./configure --prefix=/usr && make && make install
  6. yum -y install ghostscript
  7. amportal stop (Hurry! Asterisk will be down until you complete!)
  8. cd /usr/src/asterisk/apps
  9. wget http://nerdvittles.com/aah2/app_nv_faxdetect.c
  10. wget http://www.soft-switch.org/downloads/spandsp/spandsp-0.0.2pre25/asterisk-1.2.x/app_rxfax.c
  11. wget http://www.soft-switch.org/downloads/spandsp/spandsp-0.0.2pre25/asterisk-1.2.x/app_txfax.c
  12. wget http://aussievoip.com/makefile.patch
  13. patch < makefile.patch
  14. cd ..
  15. make
  16. make install
  17. amportal start

NOW, SEE IF NVFAXDETECT IS INSTALLED:

  • asterisk -r
    • CLI> set verbose 10
    • CLI> show application nvfaxdetect

IF YOU NOW SEE THE APPLICATION INSTALLED, YOU SHOULD BE GOOD TO GO!


Cannot restore to previous version of FreePBX

Can't do a restore

You've upgraded to the latest freePBX version, but you can't do a
restore - it comes up wiht some wierd error about section not found?

There's some files left over that are interfering with freePBX. You need to clean them out. It's an easy fix:

rm -rf /var/www/html/admin

Then do an ./install_amp again. Then you can put your datafile back
in place, do a restore, and then, do an ./install_amp
--force-version=whateverversionyouwere running - if you are upgrading
from 2.8, use --force-version=2.0.1, 2.7 and 2.6 used 1.10.010


Common Problems

* Invalid Conference Number when using Page or Conferences
* 'You are running freePBX and asterisk with the default manager pass.' warning appears
* 'You are running freePBX and mysql with the default password' warning appears
* YOU MUST ACCESS THE CDR THROUGH THE ASTERISK MANAGEMENT PORTAL! when viewing Call Records
* 'You Need to Upgrade' when trying to use online modules.


Invalid Conference

Invalid Conference Number

This is caused by not having a zaptel timing source. Often, this
will happen when you've upgraded your kernel, but haven't recompiled
your zaptel to suit

.

Quick Fix

cd /usr/src/zaptel

make install

/etc/init.d/zaptel stop

/etc/init.d/zaptel start

Or modprobe ztdummy, which provides the timing souce if you don't have any hardware installed.

http://www.voip-info.org/wiki-Asterisk+timer+ztdummy

Important Note for RedHat? Enterprise Linux, CentOS 4.2 or similar.

There is a BUG in the latest kernel from RedHat?, that causes
zaptel to fail to compile. The way to fix this is to edit the file
/usr/src/kernels/2.6.9-3

4.EL-i686/include/linux/spinlock.h and change 'rw_lock_t' on line 407 to 'rwlock_t'.


Echo Info

I posted this to Whirlpool a while ago, about how Echo works, what
causes it, and how you can get around it. It's reprinted here for your
reading pleasure.

username_taken writes...

..hideous echo coming from the GXP-2000's.

Actually, the GXP's don't generate echo (well, they do, a bit. But
you don't notice it. See below). Echo is a perfectly normal part of the
telephone process. When you call someone (PSTN to PSTN) there is
_always_ echo. But, here's the tricky part. You don't notice it. When
the delay is less than 5msec, it merges with the
(I'm-using-a-two-wire-phone-)side­ tone (which is the sound of your own
voice in your earpiece) and basically vanishes from your awareness.

The reason why it's so incredibly visible in VoIP systems is that
there's an added delay (could be up to 100msec, 1/10th of a second, on
a slow machine with transcoding) put onto the audio stream. Without
echo cancellation, calling any phone that has two wires for the audio
signal, no matter how it's connected, will be pretty much useless.

This doesn't _have_ to happen at the remote end, by the way. If
you're using an X100P card in Australia, you will pretty much always
have totally awful echo, due to the impedance mismatch of the
Australian phone system (600 ohms) and the American (900 ohms). The
X100's have no functionality to change the impedance, so you're pretty
much stuck with it. You _can_ be lucky, and be extremely close to the
exchange, and have bugger all echo problems. But this is _really_
close. I don't know of anyone more than 500m away who's been able to
use an X100P and have a good audio path. (Although, if you have older
copper [thicker] to your place, you've got a better chance of having no
echo with an X100. There's a reason for this, but I don't know what it
is 8)

The TDM400's have programmable FXO and FXS ports, and then can
actually 'train' themselves to your phone line (see the incredibly
poorly documented fxotune in /usr/src/zaptel - I should write something
down about what it does and how it works one day). By setting
'opermode=AUSTRALIA' on the command line of the wctdm kernel module, it
sets the card to the correct impedance, ring voltage, and other various
arcane things which I haven't decoded yet)

Now, your home PSTN line has _already_ got an echo canceler on it,
but it only cuts in when you're calling someone far away - the other
side of the country, or internationally. You'll find that the places
you expect to have echo, that are far away, have none. This is normal.
This is Telstra doing it's job 8) You have to only care about the short
echos of your own sidetone and the short remote echo (Note, this
_isn't_ true for an ISDN link.You don't have a two wire system, so you
don't have a sidetone - no immediate short echo. Yay. But, you can
still have short and long echo's too, depending on where you're calling
and how their phone is connected. Also, you may or may not have
'someone' doing your long echo cancellation for you, too — eg,
depending on where you call, you _may_ have echo cancellation on
international calls, but you definitely won't on STD calls). This is
where the zaptel echo canceler comes in, and it does a fair-to-middlin'
job of this, when you're using the MG2 EC.

So, for those that are struggling to catch up - you're using a
standard POTS line (Plain Old Telephone Service, eg, a two-wire
standard telstra line). You pick up the phone, dial '1' and blow into
the mouthpiece. That's your sidetone, and is your first source of echo
- this is usually easily dealt with if your FXO port is configured
correctly (eg, not a X100P 8) However, you may also have remote end
echo. When you call Fred down the street, his two wire system is
generating echo too, but depending on how far 'down the street' is -
you live in cairns, and Fred might live in melbourne - they're all on
highway 1! 8) you may or may not get remote end echo. Realistically,
this is rarely a cause of echo problems on a PSTN line, it's usually
local echo that causes grief. Telstra are pretty good with their EC
stuff. (Fred could also be using a speakerphone which is causing far
end echo. It gets complex)

However, username_taken has a digital system. An ISDN circuit
(usually) has no echo cancellation on it, which means you have to
handle it yourself. This can be done (simply, very well, and
expensively) by buying a hardware echo canceler, which is full of DSP's
and various funky stuff, and plugging it in. All your echo problems go
away. Or, it can be done (reasonably simply, kinda OK, and for free)
with the zaptel echo canceler. There were some bad, nasty bugs with the
pre-1.2 trunk EC's, including them overflowing when the echo was too
loud (this is how people have mentioned they 'fixed' their echo by
turning down txgain - it just means that the EC isn't overflowing. If
the user shouts, they'll get their echo straight back again), and
various other silly, but difficult to find bugs.

Now, as I mentioned at the top, there's also a third source of
echo, but you don't notice it - the other party does. It's local echo.
This is caused, most of the time, by a telephone that doesn't have
acoustic shielding in the handset between the microphone and speaker.
The noise travels down the inside of the handpiece, is picked up by the
microphone, and the person at the _other end_ hears what they said,
faintly.

Now, finally, to the the point of this saga: that VoIP phone's
don't 'cause' echo. They just make it audible by introducing an extra
delay. The reason why people go 'Geez, those GXP-2000's cause terrible
echo' is because they have just got an X100P card, they've plugged in
into their PSTN line, and they have a bloody awful setup. They use
_anything_ and they'll have terrible echo. However, they hear that
people don't have echo so they go, 'well, it kinda works. I'll get a
TDM400 and a polycom' or something like that - by getting rid of their
untuned, $2 FXO card, they've fixed the cause of their echo. Spending
$500 on the phone was just so they had a funky phone on their desk 8)
(GXP's, by the way, DID used to case echo, by them having no echo
cancellation on their speakphones, which means that as soon as you
stuck your phone on hands free, the person at the other end hated you
with a passion. This has been fixed in the current versions)

Any more echo questions? I think I've covered most of the stuff you
'need to know' - there are other things like 'complex echos' (eg, the
'old' conferencing method was splitting the tx and rx out [causing
echo], sticking all the tx lines into an amplifier, and firing them
back out into the rx of everyone's line [again causing echo]), and how
you can disable ec on your home line to play with it (that tone that
faxes and modems beep at the start? That's a 'turn echo cancelation
off' signal to the exchange), and all sorts of other things.

PS: I just realised, I didn't emphasise the point of this post.
Edit the file /usr/src/zaptel/zconfig.h, and find the three lines that
say:

  1. define ECHO_CAN_KB1

/* This is the new latest and greatest */

/* #define ECHO_CAN_MG2 */

Change them around You want to have KB1 commented out, and MG2 enabled:

/* #define ECHO_CAN_KB1 */

/* This is the new latest and greatest */

  1. define ECHO_CAN_MG2

Type 'make install' and then stop asterisk, reload the modules, and
start asterisk again. You're now running the 'good' echo canceler! You
can check this by doing a 'dmesg' after you 'modprobe zaptel' - it
should say something like this on the last two lines:

Zapata Telephony Interface Registered on major 196

Zaptel Version: SVN-trunk-r969 Echo Canceler: MG2

--Rob

Asterisk x100p echotraining article at voip-info.org - also see this comment.

Solving Common Echo Problem article at VOIPSpeak.net


FAX

* Asterisk With NVFaxDetect
If you want to try to receive incoming faxes with Asterisk and FreePBX, here are the setup instructions
* Faxing with rxfax and txfax
* Installation of HylaFax with IAXmodem


I've Written a Module and Want to Submit It, How do I do That

New module submissions are a regularly occurring event and you will find many modules that have been submitted as tarballs in the Ticket system that are not available in the online system. Why is that?

The FreePBX project is designed as a Framework that can easily accommodate new modules and for that reason, new modules get written and submitted. This does not mean that we put every module that comes along into the project. As the project has matured and stabilized, we are putting a lot more thought into the architecting of the FreePBX as it continues to evolve and mature into a world class product. In order to do that, we need to carefully evaluate what officially enters the system since adopting a module has many implications. We try very hard once something becomes part of the project to take on the commitment of maintaining and supporting it and making sure that future upgrades of the project will continue to work with the Modules that are part of it. If you are thinking about writing a module that you would like to be part of the core project, you should talk with one of the active developers in advance.

This does not mean that the other modules are less valuable or inferior in any way, if we don't adopt them. In the past we have not had any mechanism to facilitate and house these modules, other than a tar ball stuck in a module submission ticket somewhere. We will be working on addressing this shortly, so that we can have an SVN repository location for such third party modules to provide easier access. We are also investigating the use of the command line module_admin program (you probably didn't know that existed did you?) to provide an online ability to install such third party modules. Some day we will get this into the GUI but there are other changes that need to happen in the GUI to accommodate this change.