Monday, July 13, 2009

Voice Messaging one person using VM Blast module

as per the tag of my last post here: http://whymailbox.blogspot.com/2009/07/vm-blast-self-made-tutorial.html

I thought I'd set up a VM Blast Group containing just one extension to see if I could message my business partner (DJ) if he was busy. I was also thinking that it would be a good way to leave a 'self note' or an 'audio note for self' quickly and easily. My Nokia E71 should, if this works properly, leave a notification that I have a voice mail waiting. That voice mail would be myself talking to myself but possibly useful (though not likely). Here goes!

1. Set up two VM Blast Groups - one called 'Joe Group' and the other 'Wayne group'. In Joe Group is just Joe's extension and the same for Wayne Group.

2. In each group I control-select the individual extension and choose a memorable three digit number. In my case I chose a number that is similar to each persons' extension in the system.

3. I chose a password for both (optional)

4. I test called my own assuming they will both work the same by just dialing the three digit number and pressing 'send'.

The system prompted me for password, then read back the three digit number which I confirmed. A beep (very sudden btw) sounded and I recorded my note-to-self followed by the pound key and then option 1 to accept the message. The nice robo-lady thanked me for my message and I hung up.

Notification so far has not come but I think it comes after a bit of a delay... I'll wait a few minutes to confirm that. Result = fail. No notification. However, the message was successfully waiting for me in the voicemail box.

5. Sending test message to Joe...this is kind of like a Twitter 'd' message. ha. No reason why he shouldn't get it. I'll write back here if there is any problem, otherwise, assume this system works.

Conclusion: Easy way to leave voice notes to self and direct message your inner-network friends.

VM Blast - Self-made tutorial

I was surprised to not find much on this module. The search began when I thought of other voicemail systems (standard PSTN landline ones) that allow you to send inner-system messages without actually calling. Interestingly, I haven't found a way yet to send just a single message to a single user's extension in the system, but i did discover the very cool 'vm blast' module which will likely become a great tool for our business. Basically, how it works is you can send a voice message to group of extensions in your system. I have not found the answer as to whether you can send it to PSTN numbers out there instead of extensions, so that will need to be researched as well...but for now, I have it working so that I can voice message a group of extensions by calling a simple 3 digit number. Nice. Here's what you have to do:

1. go to the Admin GUI and go to the module area and 'search for updates' and then find 'vm blast' in the list and process the installation of the module (fast and easy)

2. while still in the GUI, find 'Voicemail Blasting' under your 'internal options & configurations' section of the 'setup' area of your admin page

3. It will be (I think) sitting there waiting with a defaul 'VmBlast Group' and you just have to put in a password (if you want) and name it. I chose this first one as the 'default group' and saved it.

NOTE! This is a bit weird in here. I saw the list of all the extensions in our system in the list and I thought "oh. they are all showing in the field so they must all be selected." However, this is incorrect. The truth is that it has a kind of awkward way of choosing the extensions. You have to select each one and, while holding down the control key, select the ones you want. To my surprise, this actually worked. The first one I saved default 500) without any highlighted extensions immediately disconnects me after a few prompts. That must be because there aren't any selected extensions. Meanwhile, the second Vmblast Group I set up ('test group') works perfectly. It has a few selected extensions. So, I learned
a) you have to do the control button selection thing to choose extensions and
b) if you don't have any extensions selected, it doesn't work at all

Now, I'm curious if I can set up a bit of a work-around for messaging just one person in the system... I bet you could just choose a three digit number for that person that you'll remember, and then set them up as the only person in the VM Blast Group and be able to message them that way. I'm not sure when I'd actually use this feature... I think my idea was that I could message someone without disturbing them if the message wasn't time sensitive (like a kind of voice log note to someone)... I'll do another post on that now.

Thursday, July 9, 2009

Nokia E71 can't register to PBX from certain access points

I wanted to blog this situation I went through because I think it will include some good troubleshooting steps to follow for the future should such a situation occur. It also contains the final solution to this particular problem.

Problem: I could not connect to our PBX from within my home WIFI network.

Steps to confirm problem:

-Attempted connection at second WIFI location = success

-Attempted connection to PBX from third WIFI location = success

Important note: The problem WIFI zone was the only access point where the phone connected with a static IP. The static IP information was input into the E71 for that location only. It used to work just fine this way...

Troubleshooting steps performed:

-reboot problem WIFI zone's router = fail

-check static IP settings in router and phone to make sure they were matching (IP address, primary/secondary DNS, gateway IP, etc) = they matched

-totally delete all SIP profiles from E71 (tools/settings/connection/SIP) and then totally delete all Internet Telephone profiles (tools/settings/connection/Internet Tel) and re-enter data according to this bombshell blog post : http://www.geek.com/articles/mobile/feature-voip-with-nokia-e71-how-to-2008095/ = FAIL!

-Try using a different extension instead of mine by following the steps above but changing the extension = message 'cannot save because you can't have two profiles with the same user names in the same realm' (something like that).

NOTE: That last one was really weird. It was like the phone was remembering some bad settings that weren't even there...kind of like some bad password was 'stuck' in there somewhere (I'm a layman, so cut me some slack on the terminology). That's when I decided something was really wacky and everything associated with this extension and connection had to be deleted...but..I forgot about deleting the actual access point from the phone. Thanks to Disposable Joe (DJ) everything worked out great!

-Delete problem WIFI access point from tools/settings/access points

-Scan for a 'new WLAN' connection and 're-found' my home WIFI zone, entered password

-Attempted connection to PBX = SUCCESS!

Note: The weirdest part is that this was without any static IP information.

Conclusion: the problem was either the actual WIFI access point connection (my guess this is true) AND/OR the static IP information associated to that access point (I haven't re-entered it yet to test this so I can't confirm. Maybe later)

Tuesday, July 7, 2009

Groundhog Day Reminders

Voice reminders via telephone input were not working properly. Every time the 8-digit date was entered, it would playback today's date instead of the date entered. The same problem occurred for the time: we would hear the current time rather than the entered time.

I snooped around extensions_custom.conf , in which the dialplan was located. The key parts were:

[reminder2] and [reminder4]

After looking up each command that was called, I noticed this:
http://www.voip-info.org/wiki/view/Asterisk+cmd+AGI

Thanks to my upgrade to Asterisk 1.6, the AGI command now has a different separator for arguments! ie. None of the arugments were being read, which is why Trixy decided to repeat the same day and time every time!

The fix for Asterisk 1.6:

Change all "|" in AGI commands to "," . ie:

[reminder2]
exten => s,1,Set(TIMEOUT(digit)=7)
exten => s,2,Set(TIMEOUT(response)=10)
exten => s,3,Read(APPTDT,custom/reminder2,8)
exten => s,4,AGI(checkdate.php|${APPTDT})
...
exten => s,4,AGI(checkdate.php|${APPTDT}) should be exten => s,4,AGI(checkdate.php,${APPTDT})


[reminder4]
exten => s,1,Set(TIMEOUT(digit)=7)
exten => s,2,Set(TIMEOUT(response)=10)
exten => s,3,Read(APPTTIME,custom/reminder3,4)
exten => s,4,GotoIf($["foo${APPTTIME}" < "foo1200"]?reminder5,s,1) exten => s,5,AGI(checktime.php|${APPTDT}|${APPTTIME}|0|${APPTPHONE})
...
exten => s,12,AGI(checktime.php|${APPTDT}|${APPTTIME}|1200|${APPTPHONE})
exten => s,5,AGI(checktime.php|${APPTDT}|${APPTTIME}|0|${APPTPHONE})... should be exten => s,5,AGI(checktime.php,${APPTDT},${APPTTIME},0,${APPTPHONE}) and
exten => s,12,AGI(checktime.php,${APPTDT},${APPTTIME},1200,${APPTPHONE})

I also found it in this section, which actually sets the reminder. This explains why no reminders were being sent out regardless of the time inputed.
[reminder9a]
exten => s,1,NoOp(APPTDT: ${APPTDT})
exten => s,2,NoOp(APPTTIME: ${APPTTIME})
exten => s,3,NoOp(APPTPHONE: ${APPTPHONE})
exten => s,4,NoOp(RECURRING: ${APPTRECUR})
exten => s,5,NoOp(APPTMSG: /var/lib/asterisk/sounds/custom/${APPTTIME}.${APPTDT}.${APPTP$
exten => s,6,Playback(your-msg-has-been-saved)
exten => s,7,Playback(goodbye)
exten => s,8,Wait(2)
exten => s,9,Hangup
exten => h,1,System(/bin/mv -f /var/lib/asterisk/sounds/custom/${TMPMSG}.gsm /var/lib/as$
exten => h,2,DeadAGI(reminder.php|${APPTDT}|${APPTTIME}|${APPTPHONE}|${APPTRECUR})
exten => h,3,Hangup

exten => h,2,DeadAGI(reminder.php|${APPTDT}|${APPTTIME}|${APPTPHONE}|${APPTRECUR}) should be
exten => h,2,DeadAGI(reminder.php,${APPTDT},${APPTTIME},${APPTPHONE},${APPTRECUR})

Do an amportal restart

NOW you have a functional prank call system.

DJ@Today

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