Showing posts with label asterisk. Show all posts
Showing posts with label asterisk. Show all posts

Sunday, February 13, 2011

No Sound Mailbox

After a long hiatus, I tried reconnecting to the trixbox using the e71 through my router etc.  I set up all the ports and I could register all right, but whenever I dialed *97 or *98 or anything ... I got no sound.  Alamak; we're back to the beginning!


After looking through our logs I found something in this:


/etc/asterisk/sip_general_custom.conf

externip=75.123.124.253 

Recently our external IP changed, so I corrected the conf file and it's working again!  I still have no messages.

Sunday, September 27, 2009

FreePBX - IVR Options Not Working [fixed!]

Funny times again in FreePBX Land.

As excited as I am at how close I am to having my 'own Google voice' catch-all number, it seems I'm bumping into an issue with the IVR. I am able to record the IVR, reach the IVR when calling the inbound route, but when the IVR recording plays, I am unable to actually do anything. When the voice says 'Press 1' and I press 1, nothing happens. It's not picking up the DTMF tone or something. Or permissions are wacky. I've emailed Disposable Joe to see what he thinks about the scenario...

EDIT:

DTMF was the problem. In the PEER details of the Trunk in FreePBX:

Change dtmfmode=rfc2833 to dtmfmode=inband

Or add it if isn't there...

Why?
The device that you press the key on will generate the DTMF tones. - If the codec is not ulaw or alaw then the DTMF tones will be distorted by the audio compression and will not be recognised. If the phone is set for RFC2833 and asterisk is set for inband then you may not hear anything

That's why!

If you are calling from an external line then it's a different codec or somthing.

Another option is to use dtmfmode=auto, but that didn't seem to work either.

DJ

Friday, July 3, 2009

Important Reminder

Finally, it is successful. Voice reminders are able to be set right through the phone. I was missing an important part in the extensions_custom.conf:

nano -w /etc/asterisk/extensions_custom.conf

If your installation is fresh outa the box like mine, then you will have to ADD (entirely):

[from-internal-custom]
exten => 123,1,Answer
exten => 123,2,Wait(1)
exten => 123,3,Authenticate(12345678)
exten => 123,4,Goto(reminder,s,1)
The context [from-internal-custom] is important. It should not be [from-internal-trixbox] like somewhere mentioned...

Be sure to amportal restart

I also added the Misc Destinations module via FreePBX web gui. And added..
Dial: 123
Description: Telephone Reminders

I also noticed that we had a rogue extension installed called "TESTY" which was using ext 1234. I don't know how TESTY got into the box, but it may have been affecting things as well.

So, it works now... the voice menus are a dance && 1/2 but it works.

I should point out that these phone reminders are the same module as the ones that we make with the web gui, but they don't actually require the Cepstral thing since you record the reminder using your very own home-grown voice.

Congratulations, you now have a very complex prank calling system.

DJ@Reminderland

[EDIT]
Asterisk 1.6 ? Not quite done yet... see here

Remind me again... 1.6

So, like I was saying, we installed this reminder module:
http://bestof.nerdvittles.com/applications/reminders4/

It started working with pieces of tutorials everywhere. I had it working easily on Asterisk 1.4, but I was not satisfied with 1.4 and went to 1.6, which made things a bit more difficult.

1. The reminder.pbx script worked on Trixbox. ie

wget http://bestof.nerdvittles.com/applications/reminders4/reminders.pbx
chmod +x reminders.pbx
./reminders.pbx


Then you can go into the FreePBX web gui and enable the module in the Module Admin section. Ok, we're half done... NOT!

2. Reminders work, but they won't do anything without a text-to-voice protocol (Flite or Cepstral). I tried to install Flite and failed, so I went to Cepstral, which worked after multiple failures. (It was important to install asterisk-devel)

[EDIT] Apparently Flite doesn't work in Trixbox. I forgot the sauce but that pretty much explains why it didn't install AND life in general.

Cepstral install worked based on this:
http://www.trixbox.org/forums/trixbox-forums/open-discussion/mini-howto-install-cepstral-asterisk-weather-station-zip-nerdv

Log into your trixbox system via ssh as root and enter the following commands:

cd /root
wget http://downloads.cepstral.com/cepstral/i386-linux/Cepstral_Allison-8kHz_i386-linux_5.1.0.tar.gz
tar -zxvf Cepstral*
cd Cepstral_Allison-8kHz_i386-linux_4.2.1
./install.sh

After you've read the license, type yes to install the voice on your system, not -yes- as the instructions imply. Don't ask how I know. Accept the default locations for the installation. When the installation completes, issue the following command:

echo /opt/swift/lib > /etc/ld.so.conf.d/cepstral.conf
ldconfig

This places the Cepstral_Allison voice in /opt/swift/voices/
You can download other voices from Cepstral at http://www.cepstral.com/cgi-bin/downloads?type=1143746987

After installing multiple voices, retrieve a list of installed voices with:

ls /opt/swift/voices


The "Allison" package will have be updated by then so wget it here:
http://cepstral.com/cgi-bin/downloads?type=1143746987

4. So, for Asterisk 1.6, we have a special case for App_Swift:
http://nerdvittles.com/index.php?p=202

Asterisk 1.6 Install. If you're using the newer versions of PBX in a Flash with Asterisk 1.6, you will need Darren Session's 1.6-compatible version of app-swift:

cd /usr/src
wget http://pbxinaflash.net/source/app_swift/app_swift-1.6.2.tar.gz (see below)
tar -zxvf app_swift-1.6*
rm *.gz
cd app_swift-1.6.2
make
make install
cp swift.conf.sample /etc/asterisk/swift.conf
chown asterisk:asterisk /etc/asterisk/swift.conf

Finally, you need to add a link in your search path for Cepstral and modify /etc/asterisk/swift.conf to tell it which voice you want to use with Asterisk and then restart Asterisk. Assuming you installed Allison-8kHz, here are the commands.

ln -s /opt/swift/bin/swift /usr/bin/swift
sed -i 's|David-8kHz|Allison-8kHz|' /etc/asterisk/swift.conf
amportal restart


This is all good except that we are using Trixbox and for some reason the App_swift package in the instructions didn't work (maybe made for PBX in a Flash).
This 1.6.2 package did work:

http://www.darrensessions.com/downloads/

To be sure that everything is installed and working with Asterisk, issue this command:

asterisk -rx "core show application swift"


You should receive the following response:

-= Info about application 'Swift' =-

[Synopsis]
Speak text through Swift text-to-speech engine.

[Description]
Swift(text) Speaks the given text through the Swift TTS engine.
Returns -1 on hangup or 0 otherwise. User can exit by pressing any key.

If you don't see that, then something is wrong.

5. FOP Problem. I was getting strange errors right in the terminal when scheduling reminders. Apparently, Asterisk 1.6 does not work well with Fop. Period. LIES.

It works with op_panel 0.3 http://www.asternic.org/

Stop your asterisk/op_server.pl:
amportal stop

Get the package:
wget http://www.asternic.org/files/op_panel-0.30.tar.gz

Unpack the package:
tar -zxvf op_panel*.gz

Delete the Package:
rm op_panel*.gz

Go to the package contents:
cd op_panel*

Update current FOB with package contents:
cp op_server.pl /var/www/html/panel/

Go to the flash directory in the unpacked package:
cd flash
cp operator_panel.swf /var/www/html/panel/

Restart your asterisk dood:
amportal restart

Now we can schedule reminders via the web gui: "Tools"--> "Reminders"

I'm still working on getting the phone reminders to work.

To be continued...

DJ@Limbo

Thursday, July 2, 2009

Dare Devel

Recently, I installed a Reminder module to allow wakeup calls etc. The next step was to install the text-to-voice portion. I needed to first install asterisk-devel. No problem, right?

[root@localhost ~]# yum install asterisk-devel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.arcticnetwork.ca
* updates: ftp.telus.net
* addons: centos.arcticnetwork.ca
* extras: ftp.telus.net
asterisk-current | 1.1 kB 00:00
digium-current | 1.1 kB 00:00
base | 1.1 kB 00:00
updates | 951 B 00:00
addons | 951 B 00:00
extras | 1.1 kB 00:00
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package asterisk16-devel.i386 0:1.6.0.10-1_centos5 set to be updated
--> Processing Dependency: asterisk16-core = 1.6.0.10 for package: asterisk16-devel
--> Running transaction check
---> Package asterisk16-core.i386 0:1.6.0.10-1_centos5 set to be updated
--> Processing Conflict: asterisk14-core conflicts asterisk16-core
--> Processing Conflict: asterisk16-core conflicts asterisk14-core
--> Finished Dependency Resolution
asterisk16-core-1.6.0.10-1_centos5.i386 from asterisk-current has depsolving problems
--> asterisk16-core conflicts with asterisk14-core
asterisk14-core-1.4.25.1-1_centos5.i386 from installed has depsolving problems
--> asterisk14-core conflicts with asterisk16-core
Error: asterisk14-core conflicts with asterisk16-core
Error: asterisk16-core conflicts with asterisk14-core
Ok. Problem.

For some reason "Trixy" (The trixbox installation) was getting confused about which version she wanted to run: 14 or 16.

The following guide helped me a lot : http://forums.digium.com/viewtopic.php?t=68202

I've had a lot of people ask me about Asterisk 1.6 in AsteriskNOW. Packages for it do exist in the repository, but it's not obvious how to switch "properly". There are two sets of packages - "asterisk14" and "asterisk16". The default is "asterisk14".

The problem is that you can't normally tell yum to install and remove packages simultaneously, in order to avoid dependency issues. But, there is a solution! yum has a 'shell mode', where multiple commands can be processed in a single transaction.

From a command line, run:
# yum shell

This enters the shell mode of yum. Once in the shell, enter the following.
# remove asterisk14-core asterisk14
# install asterisk16 asterisk16-core
# ts solve
# ts run

At this point, the package list will be calculated, and you should be presented with the option to finish the transaction. If everything looks correct, hit 'Y' and let it complete. You can then 'exit' the shell mode. Congratulations! You've just successfully installed Asterisk 1.6.

Note: If you've installed them, you may see asterisk14-addons packages being removed. You can add the asterisk16-addons equivalents to the 'remove' and 'install' commands above, and they will also be upgraded.
That worked! My next yum install asterisk-devel also worked without any errors. It was a bit of a leap of faith, but at least we know now.

DJ

Thursday, June 18, 2009

"You have no right to access..."

So far, every sound file that we have uploaded (IVR or moh) has been assigned the user:group of apache:apache. I did some snooping around, and I read something about httpd.conf.

So, I opened up /etc/httpd/conf/httpd.conf and found the following:


# If you wish httpd to run as a different user or group, you must run
# httpd as root initially and it will switch.
#
# User/Group: The name (or #number) of the user/group to run httpd as.
# . On SCO (ODT 3) use "User nouser" and "Group nogroup".
# . On HPUX you may not be able to use shared memory as nobody, and the
# suggested workaround is to create a user www and use that user.
# NOTE that some kernels refuse to setgid(Group) or semctl(IPC_SET)
# when the value of (unsigned)Group is above 60000;
# don't use Group #-1 on these systems!
#
User apache
Group apache
I changed the

User apache
Group apache

to

User asterisk
Group asterisk

Then I did a reboot on the box. Now, when I uploaded the files they had the correct user:group! Yes! I'm not sure if there will be other consequences of changing the user:group in httpd.conf, but so far it is nice.

DJ@Paris

Moh-fo

Music on hold (moh) has been put on hold...

In FreePBX webgui you can upload a sound file for moh. It ask for a wav or an mp3, but apparently mp3s don't work out of the box on Trixbox. There is some kind of converter that is not installed by default, and so it doesn't work. We may update that some day, but for a quick solution, we'll use a wav file with the same properties as the IVR (8bit mono etc).

So, going through the webgui, I tried to upload the wav, and go the following error(s):

1. Orgingally it said that the upload limit size was 2M. So, I edited /etc/php.ini so that

max_upload_size = 10M instead of 2M.

2.
Error Processing: "sox: Can't open input file '/var/lib/asterisk/mohmp3/orig_studyno3.wav': No such file or directory" for studyno3.wav!
This is not a fatal error, your Music on Hold may still work.
...but probably not. For one thing the directory /var/lib/asterisk/mohmp3 didn't even exist, so I did:

mkdir /var/lib/asterisk/mohmp3

Then set the permission as before chown -R asterisk:asterisk /var/lib/asterisk/mohmp3

Then, we need to change the permissions on the folder so that the user:group (ie asterisk:asterisk) can read, write, and execute files (7) in mohmp3, and others can read and extecute (5):

chmod 775 /var/lib/asterisk/mohmp3

I uploaded the file again... success! Sort of:

Error Processing: "sox: Input and Output rates must be different to use resample effect" for studyno3.wav!
This is not a fatal error, your Music on Hold may still work.
Yes, it may, and probably does still work. That error can be more or less ignored. I think it basically is saying that my file was already in the same format to which it would have been converted... had the converter been installed.

Moh for your money.

DJ@Paris

EDIT:

As per MT's comment, the moh still didn't work. That is because all of the uploaded files seem to still have the apache:apache ownership. We must be uploading them incorrectly. I chown-ed them to asterisk:asterisk, so they should work now. I guess the IVR might need re-chown-ing everytime we upload as well.

DJ@Paris

Tuesday, June 16, 2009

Why no mailbox? 2

Problem:

I can access the voicemail, but I can't record a voicemail greeting; it cuts off as soon as it beeps.

What's happening:

The permissions are probably wrong on the folder in which the greeting is trying to be written. In other words, asterisk does not have permissions to write to the folder. If you look in the Asterisk CLI when you try to record a message, you will see:
x=0 ...

When it works, you will see:
x=1 ... after.

Probably the voicemail conext is wrong... That's why no mailbox.

Solution:

Make sure that your VM Conext in the Trixbox webgui says "default" and your ext mailbox is extention@default. The default folder has set permissions that are supposed to work.

In /etc/asterisk/voicemail.conf

Put your extensions under [default].. ie:

[default]
1234 => 9999,Bob,,,attach=no|saycid=no|envelope=no|delete=no
1235 => 9999,Rob,,,attach=no|saycid=no|envelope=no|delete=no


DJ@Paris

Why no mailbox?

For some reason, Trixbox doesn't come with a default voicemail context setup in the configuration file.

When I set up the extensions, the conext said "default" and the mailbox was "1234@".

I looked in the /etc/asterisk/voicemail.conf and it said
...
[default]

[]
[]
1234 => 9999,Bob,,,attach=no|saycid=no|envelope=no|delete=no
1235 => 9999,Rob,,,attach=no|saycid=no|envelope=no|delete=no

I don't know what those extra empty [ ] context were about so I deleted them and created my own:

[device]
1234 => 9999,Bob,,,attach=no|saycid=no|envelope=no|delete=no
1235 => 9999,Rob,,,attach=no|saycid=no|envelope=no|delete=no

So, then back in the Trixbox web gui, I changed the voicemail context to "device" and my mailbox "1234@device".

EDIT: Don't make your own context, and do not change the VM Context in the web gui (as per the warning!) Why? Because you can't record your VM greetings.

Keep it as:

[default]
1234 => 9999,Bob,,,attach=no|saycid=no|envelope=no|delete=no
1235 => 9999,Rob,,,attach=no|saycid=no|envelope=no|delete=no

And keep the VM Contest as "default" , the 1234@device shoud be 1234@default, so that you can access your mailbox on that context.

Success... sort of. I was able to connect to the voicemail box by dialing *97.

I entered the Asterisk CLI from the ssh with command: asterisk -r

I could see that I was entering the mailbox all right, but I could not hear anything...

After some research, I found out that it was a NAT issue.

Earlier in /etc/asterisk/sip_general_custom.conf I had added:

nat=yes
externip=72.32.23.235 <--- IP address of Internet connection
localhost=192.168.0.111 <-- local IP address of PBX box I left out a few things according to my research, so I changed it to read:
nat=yes
externip=72.32.23.235
externrefresh=300 <-- No idea what this is for
localhost=192.168.0.111/255.255.255.0 <-- local subnetmask I went into the asterisk CLI again and ran module reload to refresh the server and apply the conf changes.

I can now access my mailbox. Why? I don't know exactly.

DJ@Paris

Monday, June 15, 2009

X-istentialism

After adding extensions through the web gui, I was unable to register any devices. It seems that the nothing was making its way through the ports.

So, I added to /etc/asterisk/sip_general_custom.conf (called by sip.conf in Trixbox)

nat=yes
externip=72.32.23.235 <--- IP address of Internet connection
localhost=192.168.0.111 <-- local IP address of PBX box

I also did a reboot on the system. In any case, I was able to register after one or both of those things.

I used X-Lite as the SIP phone to test my extension.

X-Lite settings:

ACCOUNT tab

User Details
--------------
Display Name: Disposable Joe
User Name: 1234 <-- Extension created in the web gui
Password: ****** <-- The password (ie secret) for extension
Authorization Name: 1234 <--Enter the extension again
Domain: funpbxbox.dyndns.org <-- static dyndns.org address for the PBX

Domain Proxy
--------------
Check "Register with domain and receive incoming calls"

Send outbound via: domain <-- If you have a proxy, then use proxy, but we don't.

TOPOLOGY tab

Firewall Traversal
--------------
IP Address: Discover global address

STUN Server
--------------
Discover server
Uncheck "Enable ICE"

DJ@Paris

Portage

After a long and hard debate with our home routers, we found that the following port setup seemed to work best for us and our hardware.

PBX router (office) and home routers port forwarding to the static PBX IP address:

5000-5082 (TCP&UDP)*

8000-20000 (UDP)**

* This covers the standard Asterisk ports 5060 and 5061

** I edited our /etc/asterisk/rtp.conf so that

rtpstart=8000
rtpend=20000

I increased the range because someone told me to do that once. Maybe it helps.

DJ@Paris

Renaissance

Until now, we had a relatively perfectly working Asterisk PBX running on an old computer with Trixbox CE 2.6.2.2. I connected from Paris, while Mr. Taylor (MT) was in Vancouver, BC.

Suddenly the hard drive died and became read-only, and then eventually unreadable! After replacing the hard drive, we have installed Trixbox again, but it is in need of some re-configuring.

This time, we will log process and progress.

1. After installation, MT ran a system-config-network so that we could assign a static IP address to our PBX box from behind our router (D-LINK).

Static IP: 192.168.0.111 (example)
Subnet Mask: 255.255.255.0
Host: 192.168.0.1 (IP of the router)

For some reason the PBX was not reaching the network, and we found that some other devices were probably overlapping the static IP, so we gave the PBX a higher-numbered IP to avoid conflicts. This IP still shows up as something else on the DHCP table in the router settings even though the assigned static IP address 192.168.0.111 is accessible.

2. I ran a yum upgrade to upgrade the packages on the PBX.

3. By default the Web GUI is not accessible outside of the local network, so I will be using an ssh tunnel to reach the web gui for now, although THIS looks promising.

I also updated any modules via the web gui --> Module Admin --> Check for Updates.
I installed the IVR module for later (MT will take care of this).

4. We already had a dyndns.org static address set up for this. Forward your dyndns.org address to the IP address of your Internet connect for your PBX (ie. externip)

DJ@Paris