Monday, December 14, 2009

PAP2 updates

It has been a while since I've posted about my PAP2 connected to our system. There were quite a few hard days (as posted) while I tried to get the thing to register and stay registered. After that post, it was working quite well, but every few days or so it would unpredictably 'go offline'. I would mess around with various settings and it would magically work again for a while - not the best scenario when you are trying to convince your wife that this is the cooler/cheaper alternative to Vonage! :(

I have isolated the problem to ports and ip address changes (DCHP?).

First, whenever it goes offline, to repair it, usually all I have to do is log into the PAP2 gui and change the ports from this:
line1 @ 5060
line 2 @ 5061

to this:
line 1 @5064
line 2 @ 5065

I have also noted that there seems to be a connection between when their are network changes at the location of the asterisk server. It finally dawned on me when I pulled the electrical cable out of the router to reset it at the location where the asterisk server is plugged in. Of course, everything went down, and went back up again, but after that my home PAP2 (connected remotely to this network) would not register anymore and required me to go in and manually do the aforementioned port changes.

My theory is that if I were to purchase a static IP address where the asterisk is located, that this would no longer happen. Would the price of the static IP make it worthwhile? I"m not sure. I haven't priced it. ...

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

Thursday, September 17, 2009

What to do when my PAP2 Web browser Interface keeps freezing

I was battling the user interface of my Linksys PAP2 web browser interface. Every time I would try to change a setting in the advaced area, it would freeze up and I'd have to force-close the browser and restart my job. I found that it helped to power-cycle the device after force-closing the browswer, but it wouldn't stop the problem from reoccuring. Finally, what i found that works great, is that you just disconnect your internet connection from the device. Likely you are behind a router, so just unplug the cable that goes from the router to the modem. Then, log into your device (it might be wise to power-cycle it again before opening your browser). Do all your settings, save your settings, and then power cycle your device again. Reconnect the internet and you should be good to go. This worked well for me.

Inbound calls failing on PAP2 with FreePBX

Also related to this topic, look for my post about "What to do when my PAP2 gui keeps freezing." here

FINAL EDIT 092709

My perseverance finally paid off. I almost went crazy but everything works now. The problem was two part:

1. For some reason when I changed the static IP of the PAP2 to .107, the gui changed over and I could now access the gui from that IP in the browser. HOWEVER...and very strangely, when I went into the 'system' settings I noticed the PAP2 static IP was still reading .100! How, I don't know, so I simply changed it to .107 one more time, saved, and power-cycled the device - and it started working.

2. I changed the nat settings to 'yes' and 'keep alive' in both lines.

3. I put all the SIP ports of both lines back to 5060

What a battle!

EDIT 091909

It turns out that everything I wrote below wasn't actually... that worth following but it may be of educational interest for anyone on our path. I would recommend reading it just to pick up a few troubleshooting ideas, maybe. The new update on this is this:

It seems as though the Nokia E71 was in conflict with the Linksys PAP2. The way I finally found this out (and an interesting and fast troubleshooting method, by the way) is I went to the 'active session' of my DI-524 router (D-link) and kept clicking it and watching the IP address activity. What I figured out by doing that was that, even though I had removed all the static IP address from my actual Nokia and changed it back to 'automatic' under the advanced access point settings, I was still seeing an IP address of .107 showing up in the active session list! That was my old Nokia static IP address. Why was it still showing up if it wasn't in the phone? Then it dawned on me that I had, under the home/DHCP section of the router, left the MAC address of the Nokia in the static DHCP client list. So, I guess what was happening was the router was registering the MAC address of my Nokia and force-feeding it an address of .107. Why my Nokia doesn't register with our PBX with that static IP manually in there is another question, but it seems that once I removed that and put the phone back to automatic (NOkia) and the PAP2 to 'static' but still with DHCP ability active, everything worked, including PSTN inbound calls to the PAP2.

We'll see if it lasts this way overnight!

---------------------

The archives of this are here:

After hacking a vonage box successfully (I'll post about that soonish) I had a random problem occur. I believe it's a good and quick learning experience to read through the process I went through, but you can skip to the '1 second solution' at the end if you'd like. There is an edit in the middle that was an interesting turn of events (if you think this stuff is interesting! ha)

I had set up two different extensions within the PAP2 device. All of the following were working perfectly:

-inbound calls from PSTN
-outbound calls to PSTN
-Extension-to-extension calls from within the same LAN (i.e. phone1 port to phone2 port call withing selfsame PAP2) (inbound and outbound)
-Extension-t0-extension calls from one LAN through a WAN and terminating at an extension at a different LAN (both directions) (inbound and outbound)

Then, without notice, I totally lost all functionality of phone2 of the PAP2, including all voicemail recordings we had done (the voicemail recording loss remains a mystery at the time of this posting). At the same time, though, it appeared that phone1 of the adaptor was ok.

The first thing I did was log into the PAP2 device. I assumed that the problem was because there were too many devices sharing the same 5060 port. So, I changed phone1 to 5062 and phone2 to 5063. They both registered and were able to call out. However, after a few hours, I figured out that all calls within that LAN were now only able to call out, but not receive calls from anywhere (LAN, WAN, PSTN, etc). All extensions within that LAN were now basically only able to to outbound calls.

So, I decided to go into my router and do a DMZ where I discovered that it seemed to work! So it was definitely a port problem in my LAN that was restricting inbound calls. But, I had all the ports open for this kind of application.

Randomly (and here comes the solution so far), I decided to set both phone1 and phone2 of the PAP2 to 5060. I was expecting a conflict but lo and behold - they both not only registered by were able to receive inbound calls from my separate Nokia E71 which was at a different extension in the same LAN.

I went back into my router and cleared out all the new ports I had opened during testing and it seemed to work just fine.

I now, however, have one remaining problem! It seems that the PAP2 device is working just fine in my LAN but now my Nokia E71 can register but cannot receive inbound calls from the PAP2 extensions! Grr. I hope to post a follow up to this with a solution soon.

EDIT:

It turns out that it was not much related to what I thought above either! After doing everything above, I still started encountering the same problems once I started making random calls to and fro internal extensions on my LAN. I remembered reading somewhere something about NAT and how it offers a helping hand when you are behind a router. However, in the Linksys PAP2 they call it 'NAT mapping' and I had never heard of the word 'mapping' attached to NAT so I was afraid to try it out. Finally, I just enabled it as a last resort and did a test to and from all the extensions and it worked...almost. And here is an interesting note for troubleshooting. I didn't want to wake up my family while I was ringing the extensions so I just engaged the extension to which I would be calling (picked up the phone) so that when I called it, if it was working, I would get the 'on the phone' message, instead of the 'unavailable' message. I assumed that if I got the 'on the phone' message that everything was working perfectly for receiving calls. All the extensions worked perfectly after enabling 'NAT mapping'. I was happy, but at the last second I decided to do one actual call to an extension to make it ring. It failed! It went straight to the 'unavailable' message. Discouraged I did a quick power-cycle of the PAP2 and boom. Everything worked again. It seems that now, I am fully back in action.

1 second solution:

in PAP2 interface enable "NAT MAPPING" for each line if you are behind a router.

What I learned (Summary):

1. After doing any major changes in the PAP2 settings, always power cycle when you are done to make sure everything is 'engaged'

2. Always try a DMZ on the device before going too far. At least then you can isolate the source (LAN, device, WAN, otherwise)

3. write down a list of your extensions and all the possible combinations that you will test like a spreadsheet like this:


.............................| setting change | result | setting change | result
ext1 > ext 2
ext 1 > ext 3

ext2 > ext 1
ext 2 > ext 3

ext3> ext1
ext3> ext 2

that way you are tracking your setting change and making sure you are testing both inbound and outbound calls




Wednesday, September 16, 2009

How to fix a 'An Error has occurred' message in FreePBX voicemail

I was messing around with ports in my hacked Vongage adaptor when something went wacky. After that, every time I picked up my extension, I got a message waiting indicator beep, but when I went to go in and check the message I got the 'An error has occurred' robot chick. I know she's just doing her job but it frustrated me. So, I decided to fix it before I went to bed. After a bunch of further messing with the ports, the solution turned out to be nice and simple. I love it when that happens. Here's how to fix it:

1. Log into your FreePBX
2. Go to your admin gui
3. go to the extension that's messing up
4. Disable the voicemail completely, submit, and then apply changes (reload)
5. Re-enable voicemail for that extension, submit, and then apply changes (reload)

Done. Your voicemail should be cranking out the sweet voice of your mother inviting you for dinner on Sunday....

Sunday, September 13, 2009

Uploading Audio Files - FreePBX finicky settings

In addition to my post here:

I re-read my post and tried to follow it, but I realized that I forgot to do a post about how picky FreePBX is about how you go about uploading your completed (and correctly formatted, of course!) file. By following these steps, you'll reduce significantly the amount of hair you have to pull out:

1. Go to your "System Recordings' area
2. Browse for the file you wish to upload
3. Enter a name for the file in the 'name this recording' field below
4. Go BACK up and click the 'upload' button
5. A window will pop up with a message from your server warning you to wait. Wait!
6. When you see 'Successfuly uploaded ....." message appear in the background, then you can close the dialogue box warning by clicking 'ok'
7. Save your settings

It is currently NOT intuitive so you have to follow these instructions. If you try to upload the file before putting something in the 'name this file' field, for some reason it fails.

REMINDER NOTE! Another big reason for a failed upload is incorrect formatting. See my post here about that here.

Saturday, September 5, 2009

Peopleline.net - Inbound Calls not working - the solution

After about 5 hours with Disposable Joe and no success, I decided to wake up early and tackle the issue again.

Background: I had recently ported my vonage number over to Peopleline.net, a Vancouver VOIP provider (so far so good, by the way!). Outbound calls were always working well with x-lite with a temporary number they gave and masked the vonage number with. Inbound calls, of course, I had to wait for until the porting was complete. Once the porting was complete, I started working on setting up the inbound calls for Freepbx in the Peopleline trunk we set up. Unfortunately it was not working at all. Here is the saga with the solution at the end:

type=friend
host=customdomain.ucantalk.net
qualify=yes
canreinvite=no
context=from-trunk

I decided to try this:

1. Erasing all settings for inbound because i found a post where you shouldn't enter it and their email said it to..kind of...but not clearly.
2. Adding nat=yes to the outbound area because I was thinking that maybe it's because the box is behind the router that the inbound isn't working....

result:

fail...but...oddly,... with nothing at all in the inbound settings, i'm still getting the same results in the asterisk -rvvvvv action. It's still showing the call coming into the box...so..the call is going into the box...so it must be a small tweak in the existing setttings. i will mess again with the registration string based on this suggestion I found somewhere:

this works as regirstration:

Lexicon:

XXX = three digit user number assigned by Peopleline
YYYYYYYYYY=your ported or Peopleline VOIP number
customdomain = a custom subdomain assigned to you by Peopleline when you buy service
secret=random password Peopleline gives you

XXX:secret@customdomain.ucantalk.net/XXX

but i wonder if the front or back needs to have the 303 numjber.... i"ll try this first:

----- YYYYYYYYYY:secret@customdomain.ucantalk.net/XXX

result = 'all circuits are busy' but it still was doing something in the box (this is after calling a ...oh..crap. that's why. I was calling the 303 number. ha....let me try a cell

result = success! So, strangly, I changed to the setting above with the YYY number at the front and I can successfully call KA's cell phone as an internet call through the box. now i know that first number works interchangeably with the phone number. Now I'll try a call from the cell to the YYY number and watch the command line:

result = busy signal and no CLI activity whatsoever :(

now i'll try changing the last XXX to the phone number and try the steps above again. So, with this:

YYYYYYYYYY:secret@customdomain.ucantalk.net/YYYYYYYYYY

call from 1447 to cell: success!

call from cell to YYYYYYYYYY: busy signal and no CLI activity whatsoever :(

now i'm keeping the above settings and just adding 'from-trunk' to the 'USER context' field in the trunk

result: busy signal and no CLI activity whatsoever :(

So, it would seem that it's the

Now I"m adding this back in:

type=friend
host=customdomain.ucantalk.net
qualify=yes
canreinvite=no

Result: nothing. Busy, no CLI

Now I'll change this:

YYYYYYYYYY:secret@customdomain.ucantalk.net/YYYYYYYYYY

back to this:

XXX:secret@customdomain.ucantalk.net/XXX

and everything is back to 'not working' normal. CLI activity like last night, now i"m getting the ULAW voice stuff read to me.

Registration string seems to be the key..... maybe a bunch more combinations. Maybe we don't need both sides at all.... maybe one side was a temporary XXX while the number was porting...? maybe it's messing things up now?

trying this (no XXX at the end)

XXX:secret@customdomain.ucantalk.net

Result: It works just as well as if I didn't have it there. I see the CLI stuff happening and ULAW was read to me audibly

I'll try a call from 1447>PSTN : no problem! weird! So that terminating XXX didn't seem to do anything at all...

I just realized I didn't try this:
XXX:secret@customdomain.ucantalk.net/YYYYYYYYYY

here goes:
1447>pstn= works!
pstn>YYYYYYYYYY= IT.....................WORKS!!!!!!

something is happening! it's ringing...but strangely not t 1447 which is logged on

IT WORKS!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

we are in action.

SOLUTION in 1 second:

Registration string should be like this:
XXX:secret@customdomain.ucantalk.net/YYYYYYYYYY

that was it. That was all.

Now to learn how to hack a PAP2 (vonage box)

Tuesday, September 1, 2009

Peopleline.net Free PBX Outbound Trunk Settings

After much web search and randomly trying different settings (that's what I do because I don't know what I'm doing), we couldn't get our box to call our locally using Peopleline service. However, it worked perfectly and with almost zero latency when using x-lite. At least we knew that it was a simple setting problem in the box. Peopleline clearly states that they do not support Asterisk (because they know how messy it can get, I guess!) but after an email to their support clearly stating that I would not be asking for further support from them if I messed up anything, they gave me something that they found in one of their searches (I'd love to know what search engine they use!). After applying these settings, it worked like a charm. I think one of the key settings was the slash and username after the registration key. Here they are (note: i don't have incoming settings yet because my number isn't ported):

XXX = your phone number or temporary three digit user name, depending on whether you are porting a number or not. I'm assuming the XXX will be the number they give you if not and finally your ported number once ported

YYYYYYYY = your secret password provided by peopleline

[general]
register => XXX:YYYYYYYY@yourcustomsubdomain.ucantalk.net/XXX

[peopleline] <--trunk name
type=friend
username=XXX
secret=YYYYYYYY
fromuser=501
host=yourcustomsubdomain.ucantalk.net
dtmfmode=rfc2833
fromdomain=yourcustomsubdomain.ucantalk.net
context=default
insecure=very


They also gave this information which I have not yet used:


The corresponding entry in extensions.conf would be:

exten => 501,1,Dial(SIP/extension)
exten => _0[1-9].,1,Dial(SIP/
peopleline/${EXTEN})
exten => _00[1-9].,1,Dial(SIP/peopleline/${EXTEN})

Thursday, August 13, 2009

The cake is a lie...

There is a neat user portal feature in FreePBX that allows users to login via the web using their extension:password. This URL is usually http://IPofPBX/recordings/

After logging in, our users were unable to access anything on the side menu; it would just boot them back to the login screen.

Permission issues again. SOLVED

nano -w /etc/php.ini

Found session.save_path = "/var/lib/php/session"

Checked permissions:
ls -l /var/lib/php/session

Apache?! (>_<)
Changed permissions:
chown asterisk /var/lib/php/session

Users can now access the cake via portal.

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

Monday, June 22, 2009

Nokia E71 - Suddenly can't register to FreePBX

So, everything was good. I was frolicking in a green, grassy field on a spring day doing little turny-dance moves with my Nokia E71 - because it was working perfectly with our home-brew FreePBX system. But then it stopped. Suddenly. Everything went dark and gloomy.

Here's what happened:

I registered just fine like usual on my home WIFI network.
I made a call to an extension using X-lite somewhere out in WAN-land
The call connected and the first few seconds were good. Then the call got choppy and disconnected. I was able to call back, but on the second call it dropped and from that point forward I was no longer able to register with our PBX.

To troubleshoot the issue, here is what I did:

1. Attempted simple web connection on E71 - success
2. Attempted to register to our PBX by using Fring's quick and easy SIP subscription and entering my extension information - success! <-- that one surprised me
3. Connect to extension and do a successful call using X-lite on a totally separate machine but in the same LAN. - success

So, I concluded that the router and home internet connection is not the problem (step #1 above) and that the PBX is not the problem (because Fring could connect). I also figured out that all the specific extension settings were ok by step #3. These are good steps to log for quick troubleshooting.

So the problem, then, MUST be related to my Nokia's built in SIP settings OR the actual WIFI connection.

I should note that my E71 was setup as a static IP in my router as well as in the Nokia's WIFI connection advanced settings (ask us if you don't know how to find those because they're really well hidden!)

As a first step, I completely erased all SIP setting profiles in my Nokia. I figured that I must have messed around with something and screwed them up. I re-entered them again the way that I knew they used to work according to this GREAT tutorial (http://www.geek.com/articles/mobile/feature-voip-with-nokia-e71-how-to-2008095/). - FAIL!

After much messing around with my router and DMZ, etc, and still not being able to do it, I decided to do something Disposable Joe once showed me in a coffee shop - completely erase the WIFI connection from the WLAN list. I just nuked it. Then, I re-scanned for available networks and re-added my WIFI connection. Of course, the default connection is dynamic (not static) but what was interesting was that my Nokia immediately registered to our PBX!

I did a test call and it was ok if I called out to another extension, but not if a call came in (they couldn't hear my voice). THankfully, I"m pretty sure this is just a port problem and once I set it up as static IP in my router again, it should work. Let's try!

Test 1a: E71 @ home > DJ @ Work = No problem.
Test 1b: DJ @ work > E71 @ home = just got my voicemail

Test 2a: E71 @ home > mom @ home = no problem
Test 2b: mom @ home > E71 @ home = she just got my voice mail

Confirmed problem is on my side, my router, my ports. Next test is to turn my phone back to a static IP to see if that magically fixes everything.

Step one, change E71's WIFI advanced settings to static and give it a unique IP tag
You'll need:
-to choose a unique static ip (I chose .107)
-to have your router's default IP address (dlinks are 192.168.0.1)
-to find your primary/secondary dns settings (found in your router somewhere)(in Dlinks under the 'status' tab)

Step two: set up your phone in your router as a Static IP device. I did this in my dlink under the DHCP button on the 'home' tab

Instant FAIL! Grrr

Ah HA! The classic problem (and all E71 users, please note)

In your SIP settings of your nokia, make sure it's 'always on' and not 'when needed'. I have no idea why, but this has caused us much headache before. Just memorize that it should be 'always on' and not the other. The other seems to be the default so if you wipe a profile/start a new one, I think it defaults to the one that doesn't work. As soon as I changed to 'always on' boom. It registered. Now to test as per above:

Test 1a: E71 @ home > DJ @ Work = success
Test 1b: DJ @ work > E71 @ home = fail!

Test 2a: E71 @ home > mom @ home = success!
Test 2b: mom @ home > E71 @ home = success!

So now I'm very confused. It seems to work with my mom but not DJ....

Hopefully I'll be able to follow up with some good news.

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

Wednesday, June 17, 2009

File Permissions - Why? Why?

It seems that our installation of FreePBX has been plagued with file permission problems. Thankfully, Disposable Joe is slightly more nerdy than I and seems to know not only how to access these things but fix them. I aspire to be likd DJ one day...

So, as discussed in other posts, we had file permission problems with:
-our voicemail
-some extensions <--or was that something else..i recall a .conf file

Now we have what appears to be an issue with file permissions for our Music on Hold. I am trying to upload a PBX-ready file (see my post about doing that if you are interested) but it keeps flippin' up a blank page and not doing anything. Usually this is a file permission issue, I think. Let's see what DJ can do! Bloggit, DJ! How about we make a 12" remix name for you like "DJ PBX"

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

Creating an IVR (voice menu) in FreePBX

Now that you have your professional recording created in Audacity (see my other post), now you need to make the backbone work so that when your sexy voice says 'press 1 to speak to sexy me' that it actually reaches you, not your mother.

I'm pretty sure (but don't quote me on this) that you MUST have a trunk and some inbound/outbound routes set up before doing the IVR. If I'm right, i save you many headaches. If I'm wrong you're no further behind. So just start this part near the end of your PBX (Princess Ballerina X-ray) project.

Go to your control panel and then click IVR. On the right click 'Add IVR'. Give it a name that you'll remember, like 'General Voice Menu'.

Go to the bottom of the IVR options and enter the numbers in the little boxes on the left that you want people to press. click the drop down to make sure that when they press that number that it goes to the right destinations. Of course you have to have extensions before you even start this process so if you haven't done this, put this post on hold and go and make some extensions.

Most importantly, make sure that your actual voice recording is linked under 'announcements'. So, click the drop down and choose your audio file that you already prepared to play for the callers as per my other post.

-save
-apply configuration changes
-continue with reload
(always do the above anytime you want your changes to be remembered. It's a good habit)

Now your IVR is set up. However, will it play your recording? And when? You have to think of the IVR as a 'pseudo-extension'. It must be the destination of a call, basically.

In our case (and probably the most common case) we want it to be the message/menu to appear when a regular phone caller (PSTN) calls in. So, they hear a message (the recording you made) and then get the menu. Here's how you do it:

go to 'inbound routes' on the left side of your control panel
click your DID (donkey incoming dad) number. It's your voip number and you must have already set it up before beginning this part, so, like above, if you don't have one and need one, go get yourself a DID number so PSTN callers can call you from their cell and landlines.

Got your number? Configured it? Disposable Joe may do a quick post on that but your DID number provider MUST be able to give you the configurations. If they can't change.

So, you've got your extensions set up.
You've got your trunk set up
You've got your inbound route set up
you've got your voice menu recorded and in the right format and uploaded to system recordings

So, you click the DID number that you have already set up (we're still in 'inbound routes' here, btw). Go down to the bottom and you should see, as long as you've set up your IVR as per above, this:

Set Destination
Terminate Call:
Extensions:
Voicemail:
IVR:

Put the radio dial to 'IVR' and then select the IVR you just created as per above

-submit
-save
-apply configuration changes
-continue with reload

MT@Vancouver

EDIT:
The IVR was techinically "working" , but when we called in, we could not hear the announcement message.

The reason was that the recordings in /var/lib/asterisk/sounds/custom/ or the directory "custom" did not have the right permissions (this is still a mystery).

I did an ls -l /var/lib/asterisk/sounds/custom to find the permissions set:

-rw-r----- 1 apache apache 441044 Jun 16 09:08 090525_current2.wav

Apache? Why apache? , anyway I changed the owership:group of the folder to asterisk and made it recursive:

chown -R asterisk:asterisk /var/lib/asterisk/sounds/custom

-rw-r----- 1 asterisk asterisk 441044 Jun 16 09:08 090525_current2.wav

Now the menu played when we called in...

DJ@Paris

Create Great-Sounding Recordings in FreePBX using Audacity

Hi DJ. This is MT. I'm glad to make my first Geek-Post on this useful blog. I bet at least one other geek will appreciate our notes.

After asking yourself the age-old question of "Why Mailbox" (see video) you must ask yourself "Why Audacity recordings?" The answer is simple: better quality control.

It is important to understand that using X-lite or another softphone or even IP phone hardware to record your messages, voice mails, announcements and other such recordings limits you not only to the maximum quality of your headset mic or phone, but also to one mono track. With a bit of extra work you can mix down multiple tracks and create very high quality recordings for your callers to hear when they call you. Also, it seems that FreePBX has some kind of built in way of supposedly controlling the volume of the recordings that the caller hears (ever heard a complaint that your messages were too loud or too quiet?) but we have found that whatever that control is, doesn't give us full control of volume. By using Audacity, you can adjust, in detail, every aspect of the audio file.

Before you begin, you'll need to take note of something important. This is where I wasted no less than probably 4 hours. If you go to the 'System Recordings' section of your control panel you'll be greeted by what looks like a helpful message:

Alternatively, upload a recording in any supported asterisk format. Note that if you're using .wav, (eg, recorded with Microsoft Recorder) the file must be PCM Encoded, 16 Bits, at 8000Hz:

So, I obviously just copied those settings in Audacity.

(Sidetrack): You'll need Audacity (open source audio software) to do this, so grab that here: http://audacity.sourceforge.net/ (/sidetrack)

So those settings above are missing something SUPER important. In fact, if you do not heed this, it simply won't work. It will seem like it's uploading. It might even seem like it uploaded, but your recording WILL fail. Here's the key. Your recording MUST BE MONO! So, once I figured that out (I had to deduce that, actually, by looking at the format requirements in the message!) I simply converted my Audacity project to mono from stereo and voila! It didn't work. Wha? Yeah. It still didn't work! So I wasted another two hours until I finally figured it out. Take SUPER special note of this gem. Not only does your Audacity project need to match the file requirements of the message, AND be a mono project, but it must also NOT CONTAIN ANY STEREO TRACKS! The problem I had is that a little music blip that I used was a stereo track and the file would not export correct to mono because of it. So, you must make sure that if you use any stereo tracks in your audio project that you make sure you manually set them to mono. Thankfully, it's really easy! You just go to your stereo track, click the little black arrow thing that points down and a menu appears where you can 'make mono track' (or something like that).

*090617 - correction: You must first click 'split stereo track' and then go back to the split tracks and do it again and click 'mono'.

Once you've made sure all your tracks are mono, and that your project is set to the correct format, you can export your project to one file which will become your message for your callers.

Before exporting, assure that your entire project is in the correct format. To do so, just go to 'edit/preferences/quality' and make sure it's like this (the last four I just kind of left as is):

-deafault sample rate: 8000Hz
-default sample format: 16bit
-real-time sample rate converter: fast-sinc interpolation <-- what is it?
-high-quality sample rate converter: high-quality sinc interpolation<-- what is it?
-real-time dither: none <-- what is it?
-high-quality dither: triangle <-- what is it?

Under the same window but under the 'file formats' tab, make sure the 'uncompressed export format' is set to 'WAV (Microsoft 16 bit PCM)'

You're ready to export!

To export, just go to 'file' and 'export as .wav'. To make sure your file is in the correct format, touch it with your mouse, right click, properties. In the 'general' tab you should see that it is a .wav file. In the summary tab, it MUST be like this:
-bit rate: 128kbs
-audio sample size: 16 bit
-channels: 1(mono)
-Audio sample rate: 8HZ
-Audio format: PCM

If it's not, go over this post again and adjust. Don't even try to use the file in your PBX box if it's not.

You've now determined that everything is good to go so now you need to get the audio file into your PBX. This is under 'system recordings' in your control panel. I would still recommend, at this point, just doing individual extension recordings using your hardware phone or softphone. Callers are used to this kind of quality and even expect it. I'm leery to even try a high quality extension recording unless the extension leads to a 'general department' and not an individual... but feel free to make a 12 inch remix techno recording for yourself. I think it's cool....

Anyways, if you can't figure out how to upload your recording to the system recordings, there's no hope for you anyways, so I won't bother explaining it.

Now that your recording is up there (let's assume it was an outgoing voice menu) now you need the actual voice menu so the thing works. that's called an IVR in PBX Land. You'll need to read my post called 'Setting up an IVR (Voice Menu) in FreePBX'

Until then. Stay geeky. Don't quit.

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