Amazon AWS EC2 Asterisk Issue saying extension ‘s’ rejected because extension not found in context
I encountered an issue with Asterisk 1.8.16 running on Amazon AWS EC2 instance using Ubuntu 12.04 LTS Server the other day and thought I will share my experience.
I was working on an Asterisk Project for a client which involved a version 2.0 of an existing application I created not too long ago. Since I already had the config files from the first project, I fired up a new Ubuntu instance and uploaded the config files to the new server instance. After re-configuring key files (extensions.conf , sip.conf , voicemail.conf , etc), I connected it to my SIP trunk and called the DID associated with this instance. No matter what I did, the calls would not go through and all I saw in the CLI was that calls to extension ‘s’ rejected because extension was not found in context I specified. Hmm.. weird.
With that error, I did what a typical Asterisk person would do… I checked the extensions.conf and sip.conf for any errors in the dial plan and contexts. I did this over and over again and still nothing. I spent hours trying to figure out what was going on with this EC2 instance and I still could not get it to work.
Now, since this was on a Ubuntu instance, I thought I would try it on a Amazon Linux AMI x64 instance. I fired one up and did a basic config and dialed the DID and it worked!! Now I was pretty sure this was a Ubuntu incompatibility but that really didn’t make sense either. The first server I created for this client was on a Ubuntu instance and it worked fine! Needless to say, I was very baffled and tired and frustrated.
In hopes of remedying this situation, I looked for a possible clue by googling the error and found a few references to the SIP trunk and domains and other possible issues. Well, I tried them all and nothing worked. I created many different AWS EC2 instances in hopes that it was a installation glitch and poured over the installation notes. NOTHING worked!
Desperate for anything, I deleted the extconfig.conf , extensions.lua , and extensions.ael . Afterwards, I restarted Asterisk, crossed my fingers, and dialed the DID again. SUCCESS!!!!!!!!
I am not sure exactly what happened and maybe another Asterisk person can shed some light for me: I believe the configuration files were somehow conflicting with the files I deleted. So when I deleted those three files and restarted Asterisk, it actually read the extensions.conf I uploaded instead of reading the other files or cached version. This was a very frustrating issue and something I never encountered since most of my projects are new and I start from scratch. The error I saw in the CLI would have never pointed me to these files so I wanted to share with anyone else that might have this problem.
Hope this helps someone avoid many frustrating hours.
About Express Interconnect: We are a Portland, Oregon based Small Business VoIP Phone Consultant specializing in implementing quality VoIP PBX system based on Asterisk IP PBX on Amazon AWS cloud. We can be reached at 503-820-3513 or via email at: support@ExpressInterconnect.com and can help with any questions you might have.
Share and Enjoy