Archive for the ‘Uncategorized’ Category

Fix Asterisk Fatal Error Connecting to MySql

Posted: December 27, 2013 by gngtech in Uncategorized
Tags:

Our lives have become these complicated webs of dependencies, most of which is on electricity. So when the electrical grid starts acting up its like getting a punch right to the gut. You’re dazed, possibly confused a bit, and surely bent over in pain. Okay, so maybe this is a bit of a dramatic analogy, but my point is we need electricity to make all our gizmos work. Until someone can invent some way of running Asterisk without any juice it falls victim to the same whims.

Needless to say we had a power outage. It was one of those nasty brown outs where the electricity sort of works and is probably doing its damnedest to destroy your precious electronics. Once it was over our * server started up and the phones all could not connect. I hopped on to the server and found a fatal error page once again from the FreePBX web page. This time the error indicated it was from not being able to connect to MySQL. Fare enough, worse things have happened.

1) SSH to you * box.
2) Run “mysql”.
3) Observe the error about not being able to connect to mysql.sock.
4) Stop the mysql server.

Image
5) Rename the sock file.

Image
6) Start the mysql server.

Image
7) Start the asterisk server if it isn’t already running.

Image

Hopefully now when you visit the FreePBX web page it will be full of rainbows and unicorns. Oh, and your phones should now be working.

Advertisements

Repairing Asterisk MySql

Posted: November 15, 2013 by gngtech in Uncategorized

It’s 7 PM and your wife calls telling you the phones are acting up. Your mind starts racing going through everything you’ve dealt with in the past. Usually its easy to attribute the phones not working to something you recently messed with when you really shouldn’t have. But every once in a while it is something else entirely, maybe even something you had no control over. This so happened to us when our Trixbox server decided to corrupt one of its MySql tables, leading to all sorts of problems.

In our case visiting the Trixbox home page didn’t reveal something obvious. It was only when we tried navigating to any of our extensions to view the details that we really saw any indication of a problem. We were introduced to a poorly formatted page with SELECT statements and the ever ominous statement “Table ‘./asterisk/extensions’ is marked as crashed.” Crashed sounds like a really bad thing to happen to our extensions table. We weren’t going to let this get us down; we were going to fix this. If this happens to you, these steps may help:

1) SSH to your * box.

2) Run “mysql -u root -p”.

3) The default password for the * MySql is “passw0rd”, sorry folks that 0 is a zero.

SSH-MySql-CLI-Asterisk

4) Now pay attention to the error message because it tells you the database and table that is “crashed.” In our case it’s the asterisk database and extensions table.

5) Type “use asterisk;”. This command will switch the context of MySql to the asterisk database.

SSH-MySql-CLI-Asterisk-2

6) Type “repair table extensions;”. This command will perform the repair.

SSH-MySql-CLI-Asterisk-3

7) Type “select * from extensions;”. This will select from the table and verify the repair was effective.

8) Go try opening the extensions in the web interface.

You should be all set!

For more information on the REPAIR TABLE command take a gander over at the MySql documentation: http://dev.mysql.com/doc/refman/5.0/en/repair-table.html.

Thanks for reading.

Win a trip to space!

Posted: November 2, 2011 by grahamodaniel in Uncategorized

I was over on SqlServerCentral.com today and noticed a huge banner at the top for a contest.  The grand price: a trip to space provided by the company Space Adventures!  I haven’t entered the contest yet but figured I’d throw this on the blog in case anyone else happens to see it.

Here’s the link to the contest site: https://www.dbainspace.com/?utm_source=ssc&utm_medium=pageheader&utm_campaign=dbainspace.